diff --git a/.hgtags-top-repo b/.hgtags-top-repo
index 519f598b86e2fb7cac0b0ac1246eaa091c923fea..fe5540a5d8e5a5432dbe307ccf110a4a01b6b91b 100644
--- a/.hgtags-top-repo
+++ b/.hgtags-top-repo
@@ -267,3 +267,4 @@ ee4fd72b2ec3d92497f37163352f294aa695c6fb jdk9-b20
 8e4bdab4c362aadde2d321f968cd503a2f779e2f jdk9-b22
 88567461a2cd9b7fb431fee6440005a694df1f47 jdk9-b23
 1d4a293fbec19dc2d5790bbb2c7dd0ed8f265484 jdk9-b24
+aefd8899a8d6615fb34ba99b2e38996a7145baa8 jdk9-b25
diff --git a/corba/.hgtags b/corba/.hgtags
index 25bbe5d05c0c245ec60fc0b8a9d17fffef67580e..80f384892307c66b86cf22255a9ccdde4474c7b0 100644
--- a/corba/.hgtags
+++ b/corba/.hgtags
@@ -267,3 +267,4 @@ eecc1b6adc7e193d00a0641eb0963add5a4c06e8 jdk9-b19
 ddc07abf4307855c0dc904cc5c96cc764023a930 jdk9-b22
 57735d66face054440a63ce99789eac5a5ee1dfd jdk9-b23
 8a44142bb7fc8118f70f91a1b97c12dfc50563ee jdk9-b24
+da08cca6b97f41b7081a3e176dcb400af6e4bb26 jdk9-b25
diff --git a/hotspot/.hgtags b/hotspot/.hgtags
index 63e06453ec99ddd12a4a31d6e83258b7b33e9365..a39d162f8d8b4eef3b7068ddd64abf202aeaf599 100644
--- a/hotspot/.hgtags
+++ b/hotspot/.hgtags
@@ -427,3 +427,4 @@ c1af79d122ec9f715fa29312b5e91763f3a4dfc4 jdk9-b20
 518d1fcc0799494f013e00e0a94a91b6f212d54f jdk9-b22
 dd472cdacc32e3afc7c5bfa7ef16ea0e0befb7fa jdk9-b23
 dde2d03b0ea46a27650839e3a1d212c7c1f7b4c8 jdk9-b24
+6de94e8693240cec8aae11f6b42f43433456a733 jdk9-b25
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Klass.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Klass.java
index c3f7b8cb88b61f2b66cda62f39dd38cf0c4354dd..3fe93b7fc6bc0fcc343a23671bfcb60397ef47ab 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Klass.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Klass.java
@@ -55,7 +55,10 @@ public class Klass extends Metadata implements ClassConstants {
     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 class Klass extends Metadata implements ClassConstants {
   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.
diff --git a/hotspot/make/jprt.properties b/hotspot/make/jprt.properties
index 22c7b05ad6d31d750dc0ce01bc085874c0a587b7..a6ff452c2ce91187b99b6e5a220657c7ca6a8bb8 100644
--- a/hotspot/make/jprt.properties
+++ b/hotspot/make/jprt.properties
@@ -126,7 +126,7 @@ jprt.my.solaris.sparcv9.test.targets= \
     ${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.test.targets= \
     ${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.test.targets = \
     ${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.test.targets = \
     ${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.test.targets = \
     ${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, \
diff --git a/hotspot/src/cpu/ppc/vm/frame_ppc.cpp b/hotspot/src/cpu/ppc/vm/frame_ppc.cpp
index ff177e6231ab64ca033e1b418327e123fd7497e4..496197e92901fa33bc4f5f8fa9653632e0efc8b1 100644
--- a/hotspot/src/cpu/ppc/vm/frame_ppc.cpp
+++ b/hotspot/src/cpu/ppc/vm/frame_ppc.cpp
@@ -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::patch_pc(Thread* thread, address pc) {
   }
 }
 
-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");
diff --git a/hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp b/hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp
index 6186906a86087bc4c4d490b52e4fa38962e78890..457b9cb59d9325dbc409de02cb61a1de36b770dd 100644
--- a/hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp
+++ b/hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp
@@ -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 @@ inline intptr_t** frame::interpreter_frame_locals_addr() const {
   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 frame::ijava_state* frame::get_ijava_state() const {
 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.
diff --git a/hotspot/src/cpu/ppc/vm/icache_ppc.cpp b/hotspot/src/cpu/ppc/vm/icache_ppc.cpp
index 20b11455bf6df833d5ba3538fb155d1ed99f88f0..641841b9463fce1f03b62a1f618b8661bc794c99 100644
--- a/hotspot/src/cpu/ppc/vm/icache_ppc.cpp
+++ b/hotspot/src/cpu/ppc/vm/icache_ppc.cpp
@@ -68,7 +68,6 @@ int ICache::ppc64_flush_icache(address start, int lines, int magic) {
 }
 
 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;
 
diff --git a/hotspot/src/cpu/ppc/vm/interpreterRT_ppc.hpp b/hotspot/src/cpu/ppc/vm/interpreterRT_ppc.hpp
index 144ef50bfa81fee57a30992dff499bc011fc0cfa..da98715a10217ecb1c87567f8314f1e58c9201a2 100644
--- a/hotspot/src/cpu/ppc/vm/interpreterRT_ppc.hpp
+++ b/hotspot/src/cpu/ppc/vm/interpreterRT_ppc.hpp
@@ -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
diff --git a/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp b/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp
index a35b1ebb7a1c499a2c4d120c54ae9d28718b64af..96814188f0396ba07bead7b700f30dbdc2029313 100644
--- a/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp
+++ b/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp
@@ -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"
diff --git a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp
index ce10145ed905b7fa5cc183352c9fbfd4ebe4c29b..4366af19626ebf262c0ffb906aa83e06e13d3c81 100644
--- a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp
+++ b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp
@@ -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"
diff --git a/hotspot/src/cpu/ppc/vm/ppc.ad b/hotspot/src/cpu/ppc/vm/ppc.ad
index 9087959fe1eea418ce0bec13340e045f13970b00..18870359ad92ba77d86b50a09fd8062060a96c9f 100644
--- a/hotspot/src/cpu/ppc/vm/ppc.ad
+++ b/hotspot/src/cpu/ppc/vm/ppc.ad
@@ -267,7 +267,7 @@ register %{
 // 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 @@ enum RC { rc_bad, rc_int, rc_float, rc_stack };
 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;
 
diff --git a/hotspot/src/cpu/ppc/vm/register_ppc.hpp b/hotspot/src/cpu/ppc/vm/register_ppc.hpp
index 107c5bab8b8c254db971071298262fac53289300..9dc765ab4a2ed37af067d210277fc5d31738d4d2 100644
--- a/hotspot/src/cpu/ppc/vm/register_ppc.hpp
+++ b/hotspot/src/cpu/ppc/vm/register_ppc.hpp
@@ -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 @@ class RegisterImpl: public AbstractRegisterImpl {
   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 @@ class ConditionRegisterImpl: public AbstractRegisterImpl {
   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 @@ class FloatRegisterImpl: public AbstractRegisterImpl {
 
   // 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 @@ class SpecialRegisterImpl: public AbstractRegisterImpl {
 
   // 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; }
diff --git a/hotspot/src/cpu/ppc/vm/runtime_ppc.cpp b/hotspot/src/cpu/ppc/vm/runtime_ppc.cpp
index 0e5898381c222f4bd6b683f04a0f2b31e6e327de..404df9387777dc71b4f22ad40acefc3d15c43f77 100644
--- a/hotspot/src/cpu/ppc/vm/runtime_ppc.cpp
+++ b/hotspot/src/cpu/ppc/vm/runtime_ppc.cpp
@@ -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->
diff --git a/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp b/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp
index 15a5812e8816ded419142ef63b8308f395900b79..68dda7d3e2bd50f5bbfeede1560e68f083a760cc 100644
--- a/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp
+++ b/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp
@@ -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
 
diff --git a/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp b/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp
index d452b27038cfe39f8cc4511e705e295f42464f80..290a4be01b0aa7cad680fef5e74044bb90b24a76 100644
--- a/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp
+++ b/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp
@@ -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 @@ class StubGenerator: public StubCodeGenerator {
     __ 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 @@ class StubGenerator: public StubCodeGenerator {
     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 @@ class StubGenerator: public StubCodeGenerator {
   //
   // 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;
 
diff --git a/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp b/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp
index 8a9fae04770d4121bfec67111b02203f291b8202..b787fecc7d5dfe55bfd76a8e9dafbda6abb70dc5 100644
--- a/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp
+++ b/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp
@@ -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"
diff --git a/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp b/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp
index 367e8fef7d7e3977fabda82be1a5be4626e3ba34..0b375da582ef765bbd95b9faa6c21c660d026427 100644
--- a/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp
+++ b/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp
@@ -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"
diff --git a/hotspot/src/cpu/ppc/vm/vmreg_ppc.hpp b/hotspot/src/cpu/ppc/vm/vmreg_ppc.hpp
index 92c4d088de8b2494befe3b6b6684d8eb7e7a323f..4fe7bdb62e1767b98d06d762259f10b06f24439a 100644
--- a/hotspot/src/cpu/ppc/vm/vmreg_ppc.hpp
+++ b/hotspot/src/cpu/ppc/vm/vmreg_ppc.hpp
@@ -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;
+}
 
-  bool is_FloatRegister();
-  FloatRegister as_FloatRegister();
+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");
+  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
diff --git a/hotspot/src/cpu/ppc/vm/vmreg_ppc.inline.hpp b/hotspot/src/cpu/ppc/vm/vmreg_ppc.inline.hpp
index d097c5bc5cb8f568e8dc2318cd829b85b5a2d84b..16e5e5d8fd77dea98cb5950504354a755d21fb2f 100644
--- a/hotspot/src/cpu/ppc/vm/vmreg_ppc.inline.hpp
+++ b/hotspot/src/cpu/ppc/vm/vmreg_ppc.inline.hpp
@@ -44,28 +44,5 @@ inline VMReg SpecialRegisterImpl::as_VMReg() {
   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
diff --git a/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp
index 1eeca870804700f33965021331b5aaa6863257de..9f9fc75bd1bb7c9842a4f9d1f4c1b9523361fdb3 100644
--- a/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp
@@ -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"
diff --git a/hotspot/src/cpu/sparc/vm/frame_sparc.cpp b/hotspot/src/cpu/sparc/vm/frame_sparc.cpp
index 17b4d9e05acaa31ff34ca8651372dc328ca94263..2b3bd2dc10819153b7dc4128b070e94bec2164b3 100644
--- a/hotspot/src/cpu/sparc/vm/frame_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/frame_sparc.cpp
@@ -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 @@ bool frame::interpreter_frame_equals_unpacked_fp(intptr_t* fp) {
   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 @@ bool frame::is_interpreted_frame_valid(JavaThread* thread) const {
     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;
   }
 
diff --git a/hotspot/src/cpu/sparc/vm/frame_sparc.hpp b/hotspot/src/cpu/sparc/vm/frame_sparc.hpp
index 51a014872d556bab7f9989f1735a543c7da79ae0..5c0c7492509f0f7c96dab1fd7ce14a8e66c34679 100644
--- a/hotspot/src/cpu/sparc/vm/frame_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/frame_sparc.hpp
@@ -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
diff --git a/hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp b/hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp
index 8aa0105bf0dc140b8cfbc3d26dc5070fe0f8ccae..72346c6ded6adba06c45287453e0ac99ad18fee8 100644
--- a/hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp
+++ b/hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp
@@ -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 @@ inline intptr_t** frame::interpreter_frame_locals_addr() const {
   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 @@ inline intptr_t** frame::interpreter_frame_locals_addr() const {
   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());
 }
diff --git a/hotspot/src/cpu/sparc/vm/interpreterRT_sparc.cpp b/hotspot/src/cpu/sparc/vm/interpreterRT_sparc.cpp
index 41bdd88f7f5cedab4452088d6650d6f3be1d7d2d..8cbe422a4afb61d29417adfc42b9c8edb0009713 100644
--- a/hotspot/src/cpu/sparc/vm/interpreterRT_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/interpreterRT_sparc.cpp
@@ -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"
diff --git a/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp b/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp
index 132c5292a064e59e9a6ca9c29da3741feb8e0b0e..debdaeae7a485cf589e759885cd474cb579bdd4d 100644
--- a/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp
@@ -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"
diff --git a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp
index e43d77665aca3c1dad7d91c84c613bfa083ada1b..79ca56aecd372210b4805893ba69efcc8d227814 100644
--- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp
@@ -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"
diff --git a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp
index f03dc8e5e720a12f5eb78f7129c269791b58f48d..5fc0dd0632c3f29ac1dfde03f003adfec78fa19a 100644
--- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp
@@ -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 @@ REGISTER_DECLARATION(Register, ImethodDataPtr   , I2); // Pointer to the current
 //       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.
diff --git a/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp b/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp
index af2e4e1e96cac60773238ec54ba48e4d90fc48c5..4cd5b2a93c39e25025727c03c5e1f7954631da7b 100644
--- a/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp
@@ -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"
 
diff --git a/hotspot/src/cpu/sparc/vm/register_sparc.hpp b/hotspot/src/cpu/sparc/vm/register_sparc.hpp
index 7d0096ccf594001934e031da2ea147f55b522e08..22cb0283825034208405bea1d2e4d4a4cb15868d 100644
--- a/hotspot/src/cpu/sparc/vm/register_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/register_sparc.hpp
@@ -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 @@ class RegisterImpl: public AbstractRegisterImpl {
   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 @@ class FloatRegisterImpl: public AbstractRegisterImpl {
   };
 
   // construction
-  VMReg as_VMReg( );
+  inline VMReg as_VMReg( );
 
   // accessors
   int encoding() const                                { assert(is_valid(), "invalid register"); return value(); }
diff --git a/hotspot/src/cpu/sparc/vm/sparc.ad b/hotspot/src/cpu/sparc/vm/sparc.ad
index ca1d7137db5cc2b52e8dcc4131602e6c2774cef4..c261900003b8843433916628278a20a9aada4c7a 100644
--- a/hotspot/src/cpu/sparc/vm/sparc.ad
+++ b/hotspot/src/cpu/sparc/vm/sparc.ad
@@ -9728,7 +9728,7 @@ instruct cmpN_reg_branch_short(cmpOp cmp, iRegN op1, iRegN op2, label labl, flag
 
   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");
diff --git a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp
index c281e3bc0057c01a6b1af7513c9ec41b6b45992e..1f8503161ccd9222f0e64cfd186a593293e8bee4 100644
--- a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp
@@ -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 @@ void TemplateInterpreterGenerator::generate_throw_exception() {
   __ verify_thread();
   // expression stack is undefined here
   // O0: exception, i.e. Oexception
-  // Lbcp: exception bcx
+  // Lbcp: exception bcp
   __ verify_oop(Oexception);
 
 
diff --git a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp
index d4eb74f32045e7f6a3eec5f2e64982ce14596aef..f85864df87876784f4d7f00586e15dcc68364eeb 100644
--- a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp
@@ -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"
diff --git a/hotspot/src/cpu/sparc/vm/vmreg_sparc.hpp b/hotspot/src/cpu/sparc/vm/vmreg_sparc.hpp
index ce8cb4c3d3a7d9997206f5f633589db75b2cc7a6..29f38a8d8ca90a32b72d3605d70921107feb5810 100644
--- a/hotspot/src/cpu/sparc/vm/vmreg_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/vmreg_sparc.hpp
@@ -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() {
 
-  bool is_FloatRegister();
-  FloatRegister as_FloatRegister();
+  assert( is_Register() && is_even(value()), "even-aligned GPR name" );
+  // Yuk
+  return ::as_Register(value()>>1);
+}
+
+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
diff --git a/hotspot/src/cpu/sparc/vm/vmreg_sparc.inline.hpp b/hotspot/src/cpu/sparc/vm/vmreg_sparc.inline.hpp
index 993216fc12d249cd0b97885dd242915aaadd88ba..936d39db68b9aa2ab63dbb0310ef37eb7d8ae4b1 100644
--- a/hotspot/src/cpu/sparc/vm/vmreg_sparc.inline.hpp
+++ b/hotspot/src/cpu/sparc/vm/vmreg_sparc.inline.hpp
@@ -33,35 +33,5 @@ inline VMReg RegisterImpl::as_VMReg() {
 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
diff --git a/hotspot/src/cpu/x86/vm/frame_x86.cpp b/hotspot/src/cpu/x86/vm/frame_x86.cpp
index 1b16153e255b82e7845551e9cb54d7b25bacb433..ad15c8644530e3ce17609e708276a3202ad90bf9 100644
--- a/hotspot/src/cpu/x86/vm/frame_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/frame_x86.cpp
@@ -537,10 +537,6 @@ bool frame::interpreter_frame_equals_unpacked_fp(intptr_t* fp) {
   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 @@ bool frame::is_interpreted_frame_valid(JavaThread* thread) const {
     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 @@ void frame::describe_pd(FrameValues& values, int frame_no) {
     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
   }
diff --git a/hotspot/src/cpu/x86/vm/frame_x86.hpp b/hotspot/src/cpu/x86/vm/frame_x86.hpp
index 8c6a72c2e978bca13a935991a35a17ca32663807..890e1d1aa05b9ddef7117e76d09d001449f258c4 100644
--- a/hotspot/src/cpu/x86/vm/frame_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/frame_x86.hpp
@@ -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,
diff --git a/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp b/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp
index 9b875b83499c3703a76457ffa24286408bb57edb..a3f44363a171c5d7f53f31617ebf93e36a20aded 100644
--- a/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp
+++ b/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp
@@ -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 @@ inline intptr_t** frame::interpreter_frame_locals_addr() const {
   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 @@ inline Method** frame::interpreter_frame_method_addr() const {
   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 @@ inline intptr_t* frame::interpreter_frame_last_sp() const {
   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);
 }
 
 
diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp b/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp
index 42a826d7710e95fefd9e67c818ae1f85cf0fd374..34d0d8061d0827eeba17eb4c06fac72bff4d6bad 100644
--- a/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp
@@ -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 @@ void InterpreterMacroAssembler::profile_arguments_type(Register mdp, Register ca
         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()));
diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp b/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp
index d9ba3389967ca0dd4788236a5bcc17361e9ac1a8..181ee15251b21a4223674bd995780a3139d25537 100644
--- a/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp
+++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp
@@ -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 @@ void InterpreterMacroAssembler::unlock_object(Register lock_reg) {
 // 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 @@ void InterpreterMacroAssembler::set_method_data_pointer_for_bcp() {
   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 @@ void InterpreterMacroAssembler::update_mdp_by_offset(Register mdp_in, int offset
   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 @@ void InterpreterMacroAssembler::update_mdp_by_offset(Register mdp_in, Register r
   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);
 }
 
 
diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86_32.hpp b/hotspot/src/cpu/x86/vm/interp_masm_x86_32.hpp
index 88f01fc585232c42f162bf5b6bcfbbd1cdabe0c2..e4d61364de4f962233e14b6d5d9b4a8c201f2caa 100644
--- a/hotspot/src/cpu/x86/vm/interp_masm_x86_32.hpp
+++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_32.hpp
@@ -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
diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp b/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp
index c5969601333699f4d86ad5fff9a9da3243218e7d..23e3b9730418bb272fd60dfdfb802b270136c52f 100644
--- a/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp
+++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp
@@ -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::unlock_object(Register lock_reg) {
 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 @@ void InterpreterMacroAssembler::set_method_data_pointer_for_bcp() {
   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 @@ void InterpreterMacroAssembler::update_mdp_by_offset(Register mdp_in,
   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 @@ void InterpreterMacroAssembler::update_mdp_by_offset(Register mdp_in,
   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 @@ 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);
 }
 
 
diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86_64.hpp b/hotspot/src/cpu/x86/vm/interp_masm_x86_64.hpp
index 9186009fa9a9378a5afb955d83bec6eeac8dc720..a1cd4466bb9850db913c5ff938a31963396c522f 100644
--- a/hotspot/src/cpu/x86/vm/interp_masm_x86_64.hpp
+++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_64.hpp
@@ -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() {
diff --git a/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp b/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp
index 3c66bf4fb451e42fd3b982bfe1affcb7adf9b549..abe354360ff916c8021346ed686e4a3427217f2c 100644
--- a/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp
+++ b/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp
@@ -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"
diff --git a/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp b/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp
index e9c1ef782d8b188dd68b287afe845670090a28aa..65ffc6d2e97ef99125e190ea5358b2ad54d8afff 100644
--- a/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp
+++ b/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp
@@ -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"
diff --git a/hotspot/src/cpu/x86/vm/register_x86.hpp b/hotspot/src/cpu/x86/vm/register_x86.hpp
index 680dd900a487689ef024946d5f1d3123fa9f86b3..b5e6989d5d9400b56eb8cb3c258718461ef181d7 100644
--- a/hotspot/src/cpu/x86/vm/register_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/register_x86.hpp
@@ -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 @@ class RegisterImpl: public AbstractRegisterImpl {
   // 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 @@ class FloatRegisterImpl: public AbstractRegisterImpl {
   // 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 @@ class XMMRegisterImpl: public AbstractRegisterImpl {
   // 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); }
diff --git a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp
index 1e49ce1c6a4bb9d5d599968461bbb4d5fc1c5ba3..e705dfbe0ce5fdc72a0a696f49dfae015ddfff31 100644
--- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp
+++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp
@@ -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;
 
 //------------------------------------------------------------------------------------------------------------------------
diff --git a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp
index 12b0d0568f9fe4cb66634741304edccc08e0a226..9c81d6787a1d685a6abfb62130a0eb086ceda97d 100644
--- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp
+++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp
@@ -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;
 
 //-----------------------------------------------------------------------------
diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp b/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp
index 7fc8d33c42ff42a749dadfb9f9b09d77d2bfa7ca..da56c1449cd7d7dcfd901d6054b7d8a6d65b8f43 100644
--- a/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp
+++ b/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp
@@ -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"
diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp b/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp
index 60f62077e55f61239253ab81744322f3f2cbbbbe..00d2d58cdfbce15e2bd27268abf2d7d7ca22b358 100644
--- a/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp
+++ b/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp
@@ -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"
diff --git a/hotspot/src/cpu/x86/vm/vmreg_x86.hpp b/hotspot/src/cpu/x86/vm/vmreg_x86.hpp
index 38d47dccfc3df35f31679967cab9fb23f8bd000e..f31e1c5c9fd8544832df8c03d23c76fcd72ec66a 100644
--- a/hotspot/src/cpu/x86/vm/vmreg_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/vmreg_x86.hpp
@@ -25,13 +25,49 @@
 #ifndef CPU_X86_VM_VMREG_X86_HPP
 #define CPU_X86_VM_VMREG_X86_HPP
 
-  bool is_Register();
-  Register as_Register();
 
-  bool is_FloatRegister();
-  FloatRegister as_FloatRegister();
 
-  bool is_XMMRegister();
-  XMMRegister as_XMMRegister();
+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() {
+
+  assert( is_Register(), "must be");
+  // Yuk
+#ifdef AMD64
+  return ::as_Register(value() >> 1);
+#else
+  return ::as_Register(value());
+#endif // AMD64
+}
+
+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
diff --git a/hotspot/src/cpu/x86/vm/vmreg_x86.inline.hpp b/hotspot/src/cpu/x86/vm/vmreg_x86.inline.hpp
index 0608d3edbff6f64a39e97e28f34afdf76b032f83..bc94e4839af5451b0ca18c25d8148ba529e05252 100644
--- a/hotspot/src/cpu/x86/vm/vmreg_x86.inline.hpp
+++ b/hotspot/src/cpu/x86/vm/vmreg_x86.inline.hpp
@@ -42,48 +42,4 @@ inline VMReg XMMRegisterImpl::as_VMReg() {
   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
diff --git a/hotspot/src/cpu/x86/vm/x86.ad b/hotspot/src/cpu/x86/vm/x86.ad
index b575a98a8166fbabaa3968b03ceb094131e65739..42cc708a610f890016b50436ae767176949a58fd 100644
--- a/hotspot/src/cpu/x86/vm/x86.ad
+++ b/hotspot/src/cpu/x86/vm/x86.ad
@@ -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 @@ source_hpp %{
 // To keep related declarations/definitions/uses close together,
 // we switch between source %{ }% and source_hpp %{ }% freely as needed.
 
+class NativeJump;
+
 class CallStubImpl {
  
   //--------------------------------------------------------------
diff --git a/hotspot/src/cpu/zero/vm/frame_zero.cpp b/hotspot/src/cpu/zero/vm/frame_zero.cpp
index 4be75fdc3b35827eb29a2471ee0781dd411d261e..a1be88d81c89856b82fa22a066a32eea77707be3 100644
--- a/hotspot/src/cpu/zero/vm/frame_zero.cpp
+++ b/hotspot/src/cpu/zero/vm/frame_zero.cpp
@@ -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 @@ bool frame::safe_for_sender(JavaThread *thread) {
   return false;
 }
 
-void frame::pd_gc_epilog() {
-}
-
 bool frame::is_interpreted_frame_valid(JavaThread *thread) const {
   ShouldNotCallThis();
   return false;
diff --git a/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp b/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp
index 8c968599864790e437f30243f51468bbf52c7aed..64e7f5fdf1f0f4301356ef423fb63279cbfbc990 100644
--- a/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp
+++ b/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp
@@ -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 @@ inline intptr_t** frame::interpreter_frame_locals_addr() const {
   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 @@ inline Method** frame::interpreter_frame_method_addr() const {
   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);
 }
 
diff --git a/hotspot/src/os/aix/vm/os_aix.cpp b/hotspot/src/os/aix/vm/os_aix.cpp
index d08888816397f517c3190b76b57d2ccc832c1a58..70ca91a62ceb1ba08a7ba4ccc3795b5358ef6226 100644
--- a/hotspot/src/os/aix/vm/os_aix.cpp
+++ b/hotspot/src/os/aix/vm/os_aix.cpp
@@ -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 @@ void os::die() {
   ::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
 
diff --git a/hotspot/src/os/aix/vm/os_aix.inline.hpp b/hotspot/src/os/aix/vm/os_aix.inline.hpp
index 85d8bd878104e6279d25850f9f0ff4941827b869..b6a20fedd14639f280f2d3391a2093547963d4e3 100644
--- a/hotspot/src/os/aix/vm/os_aix.inline.hpp
+++ b/hotspot/src/os/aix/vm/os_aix.inline.hpp
@@ -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);
 }
diff --git a/hotspot/src/os/bsd/dtrace/generateJvmOffsets.cpp b/hotspot/src/os/bsd/dtrace/generateJvmOffsets.cpp
index 21d979f3efb60e872dd67ef391bc53777815ca92..4912e8e36a582a23372fc3b7f114e4f8f7dd7b0e 100644
--- a/hotspot/src/os/bsd/dtrace/generateJvmOffsets.cpp
+++ b/hotspot/src/os/bsd/dtrace/generateJvmOffsets.cpp
@@ -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 @@ int generateJvmOffsets(GEN_variant gen_variant) {
   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);
diff --git a/hotspot/src/os/bsd/dtrace/libjvm_db.c b/hotspot/src/os/bsd/dtrace/libjvm_db.c
index c51441e59ffbb1249f1a1361bd68144ce88e8993..cf133b4589a3958c774aaa659364e0f6a60ea315 100644
--- a/hotspot/src/os/bsd/dtrace/libjvm_db.c
+++ b/hotspot/src/os/bsd/dtrace/libjvm_db.c
@@ -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 @@ struct jvm_agent {
   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 @@ static int parse_vmstructs(jvm_agent_t* J) {
   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 @@ name_for_nmethod(jvm_agent_t* J,
   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 @@ name_for_imethod(jvm_agent_t* J,
   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 @@ name_for_codecache(jvm_agent_t* J, uint64_t fp, uint64_t pc, char * result,
     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 @@ int Jlookup_by_regs(jvm_agent_t* J, const prgregset_t regs, char *name,
   /* 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 @@ int Jlookup_by_regs(jvm_agent_t* J, const prgregset_t regs, char *name,
      * 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 @@ int Jlookup_by_regs(jvm_agent_t* J, const prgregset_t regs, char *name,
     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 @@ int Jlookup_by_regs(jvm_agent_t* J, const prgregset_t regs, char *name,
    */
 #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 @@ int Jlookup_by_regs(jvm_agent_t* J, const prgregset_t regs, char *name,
   }
 #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) {
diff --git a/hotspot/src/os/solaris/dtrace/generateJvmOffsets.cpp b/hotspot/src/os/solaris/dtrace/generateJvmOffsets.cpp
index 3fb13e5e97ca54c0c835053486cace2235c3edbf..c5e8b3461e84578709f60a57819f255d5f001a29 100644
--- a/hotspot/src/os/solaris/dtrace/generateJvmOffsets.cpp
+++ b/hotspot/src/os/solaris/dtrace/generateJvmOffsets.cpp
@@ -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 @@ int generateJvmOffsets(GEN_variant gen_variant) {
   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);
diff --git a/hotspot/src/os/solaris/dtrace/libjvm_db.c b/hotspot/src/os/solaris/dtrace/libjvm_db.c
index b15c187da76befa8d4ebe3bdff9451b05b0ea52f..40dada151eb36b3424da02624e5c72107f9d5891 100644
--- a/hotspot/src/os/solaris/dtrace/libjvm_db.c
+++ b/hotspot/src/os/solaris/dtrace/libjvm_db.c
@@ -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 @@ struct jvm_agent {
   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 @@ static int parse_vmstructs(jvm_agent_t* J) {
   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 @@ name_for_nmethod(jvm_agent_t* J,
   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 @@ name_for_imethod(jvm_agent_t* J,
   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 @@ name_for_codecache(jvm_agent_t* J, uint64_t fp, uint64_t pc, char * result,
     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 @@ int Jlookup_by_regs(jvm_agent_t* J, const prgregset_t regs, char *name,
   /* 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 @@ int Jlookup_by_regs(jvm_agent_t* J, const prgregset_t regs, char *name,
      * 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 @@ int Jlookup_by_regs(jvm_agent_t* J, const prgregset_t regs, char *name,
     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 @@ int Jlookup_by_regs(jvm_agent_t* J, const prgregset_t regs, char *name,
    */
 #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 @@ int Jlookup_by_regs(jvm_agent_t* J, const prgregset_t regs, char *name,
   }
 #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) {
diff --git a/hotspot/src/os/solaris/vm/os_solaris.cpp b/hotspot/src/os/solaris/vm/os_solaris.cpp
index 29d8154ece21da57f18e5cfb3d9d2c8528e3e4cb..21cb27a3c0e594f4873167e05d1121acca280269 100644
--- a/hotspot/src/os/solaris/vm/os_solaris.cpp
+++ b/hotspot/src/os/solaris/vm/os_solaris.cpp
@@ -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"
diff --git a/hotspot/src/os/windows/vm/os_windows.cpp b/hotspot/src/os/windows/vm/os_windows.cpp
index c8a15526f7ed8350467095119dfe43aef844c78f..d312b975abcedc7253a73a9d9e36283830113f82 100644
--- a/hotspot/src/os/windows/vm/os_windows.cpp
+++ b/hotspot/src/os/windows/vm/os_windows.cpp
@@ -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"
diff --git a/hotspot/src/os_cpu/aix_ppc/vm/atomic_aix_ppc.inline.hpp b/hotspot/src/os_cpu/aix_ppc/vm/atomic_aix_ppc.inline.hpp
index 744bb7c38d4e2c796f1850b8f48dc0b006c9a411..046912a2c24deba1b405252a0f90a770ca2b35cf 100644
--- a/hotspot/src/os_cpu/aix_ppc/vm/atomic_aix_ppc.inline.hpp
+++ b/hotspot/src/os_cpu/aix_ppc/vm/atomic_aix_ppc.inline.hpp
@@ -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"
diff --git a/hotspot/src/os_cpu/aix_ppc/vm/orderAccess_aix_ppc.inline.hpp b/hotspot/src/os_cpu/aix_ppc/vm/orderAccess_aix_ppc.inline.hpp
index 93e5ed159cd37fc24d6d58d9616b3137e34ac7fc..36ca820a6bde2bed21db012b9e01375904a42a48 100644
--- a/hotspot/src/os_cpu/aix_ppc/vm/orderAccess_aix_ppc.inline.hpp
+++ b/hotspot/src/os_cpu/aix_ppc/vm/orderAccess_aix_ppc.inline.hpp
@@ -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.
 
diff --git a/hotspot/src/os_cpu/bsd_x86/vm/atomic_bsd_x86.inline.hpp b/hotspot/src/os_cpu/bsd_x86/vm/atomic_bsd_x86.inline.hpp
index ab7fab3dd13a6bd8964e3a38cb37c6841f758201..0a9feddfec4e6cc90c1192625b61c18dd692a8c0 100644
--- a/hotspot/src/os_cpu/bsd_x86/vm/atomic_bsd_x86.inline.hpp
+++ b/hotspot/src/os_cpu/bsd_x86/vm/atomic_bsd_x86.inline.hpp
@@ -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
 
diff --git a/hotspot/src/os_cpu/bsd_x86/vm/orderAccess_bsd_x86.inline.hpp b/hotspot/src/os_cpu/bsd_x86/vm/orderAccess_bsd_x86.inline.hpp
index c7459d5a514185e25082877d6cd2e32f85d05de4..834efd2bbf7e091241d8051c52b9549d05185cee 100644
--- a/hotspot/src/os_cpu/bsd_x86/vm/orderAccess_bsd_x86.inline.hpp
+++ b/hotspot/src/os_cpu/bsd_x86/vm/orderAccess_bsd_x86.inline.hpp
@@ -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.
 
diff --git a/hotspot/src/os_cpu/bsd_zero/vm/atomic_bsd_zero.inline.hpp b/hotspot/src/os_cpu/bsd_zero/vm/atomic_bsd_zero.inline.hpp
index 4ed2934463b8c6573575e6e225cb8c7dbc00c052..60969caa9622c0bbb1624edc355c44cfb6d48df3 100644
--- a/hotspot/src/os_cpu/bsd_zero/vm/atomic_bsd_zero.inline.hpp
+++ b/hotspot/src/os_cpu/bsd_zero/vm/atomic_bsd_zero.inline.hpp
@@ -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
 
diff --git a/hotspot/src/os_cpu/bsd_zero/vm/orderAccess_bsd_zero.inline.hpp b/hotspot/src/os_cpu/bsd_zero/vm/orderAccess_bsd_zero.inline.hpp
index 7f8e78bbff8d385dddc87604d05cbfd92560cef1..ecc4c752777430016611e352491723b67b1db8f9 100644
--- a/hotspot/src/os_cpu/bsd_zero/vm/orderAccess_bsd_zero.inline.hpp
+++ b/hotspot/src/os_cpu/bsd_zero/vm/orderAccess_bsd_zero.inline.hpp
@@ -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
 
diff --git a/hotspot/src/os_cpu/linux_ppc/vm/atomic_linux_ppc.inline.hpp b/hotspot/src/os_cpu/linux_ppc/vm/atomic_linux_ppc.inline.hpp
index c8fcf1f64d285f43507b8f2c5d0fdb5828d46e80..39ed85ea36105442df249359f08e7ca8e3a64ccc 100644
--- a/hotspot/src/os_cpu/linux_ppc/vm/atomic_linux_ppc.inline.hpp
+++ b/hotspot/src/os_cpu/linux_ppc/vm/atomic_linux_ppc.inline.hpp
@@ -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"
diff --git a/hotspot/src/os_cpu/linux_ppc/vm/orderAccess_linux_ppc.inline.hpp b/hotspot/src/os_cpu/linux_ppc/vm/orderAccess_linux_ppc.inline.hpp
index dcc2375f878c55e7ee777199763e75ed5abf688a..dff21c6bf6a94d335192d243825788543df9ff91 100644
--- a/hotspot/src/os_cpu/linux_ppc/vm/orderAccess_linux_ppc.inline.hpp
+++ b/hotspot/src/os_cpu/linux_ppc/vm/orderAccess_linux_ppc.inline.hpp
@@ -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"
diff --git a/hotspot/src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp b/hotspot/src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp
index 331eed7a67fc83f747621d54f5101a66775773f2..29b51d70f7f7b23d7279ebbeca1f7eb6d27125e6 100644
--- a/hotspot/src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp
+++ b/hotspot/src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp
@@ -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
 
diff --git a/hotspot/src/os_cpu/linux_sparc/vm/orderAccess_linux_sparc.inline.hpp b/hotspot/src/os_cpu/linux_sparc/vm/orderAccess_linux_sparc.inline.hpp
index 6833c1f4e61704dbdab0f472f67429f4052808a0..f5215f187e8741627012bf9b4dc67238cf987277 100644
--- a/hotspot/src/os_cpu/linux_sparc/vm/orderAccess_linux_sparc.inline.hpp
+++ b/hotspot/src/os_cpu/linux_sparc/vm/orderAccess_linux_sparc.inline.hpp
@@ -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.
 
diff --git a/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp b/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp
index 6e364f4087a60bdd211e48463fb05b6f1e5ad77a..14194e449471d057d87781cdb5d25202cd98ac46 100644
--- a/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp
+++ b/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp
@@ -118,7 +118,7 @@ ExtendedPC os::fetch_frame_from_context(void* ucVoid,
       *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 @@ ExtendedPC os::fetch_frame_from_context(void* ucVoid,
 
 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));
diff --git a/hotspot/src/os_cpu/linux_x86/vm/atomic_linux_x86.inline.hpp b/hotspot/src/os_cpu/linux_x86/vm/atomic_linux_x86.inline.hpp
index 2d0d51973444ff5c65c7ae4ae3371517d8de2f40..679dd614523b6073e63a5b7b2382531b00da9ede 100644
--- a/hotspot/src/os_cpu/linux_x86/vm/atomic_linux_x86.inline.hpp
+++ b/hotspot/src/os_cpu/linux_x86/vm/atomic_linux_x86.inline.hpp
@@ -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
 
diff --git a/hotspot/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp b/hotspot/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp
index 10240a0b1c2cecdecc451be685db64d38eb66ebb..a71a53cfa8cf4a6d4a540964e3a39a56ad9ea8c8 100644
--- a/hotspot/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp
+++ b/hotspot/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp
@@ -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.
 
diff --git a/hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp b/hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp
index 33ce50dc73f9bd7115f7ef3d77d87e2da4a748bc..d9df41034d4c79adb517355314110778b4ed2140 100644
--- a/hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp
+++ b/hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp
@@ -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
 
diff --git a/hotspot/src/os_cpu/linux_zero/vm/orderAccess_linux_zero.inline.hpp b/hotspot/src/os_cpu/linux_zero/vm/orderAccess_linux_zero.inline.hpp
index 773fd643ab77db7f54c54bd5dc3c1580bddfc5aa..e15041e76a794b4c43d6b4ad65e23db55b4e1ce8 100644
--- a/hotspot/src/os_cpu/linux_zero/vm/orderAccess_linux_zero.inline.hpp
+++ b/hotspot/src/os_cpu/linux_zero/vm/orderAccess_linux_zero.inline.hpp
@@ -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
 
diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.inline.hpp b/hotspot/src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.inline.hpp
index 7d17fdf39cdb7a04d6c2817af2c809e746c7d957..83a07ce3fe514a5e1809ae6318ff01ece02439b7 100644
--- a/hotspot/src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.inline.hpp
+++ b/hotspot/src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.inline.hpp
@@ -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
 
diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/orderAccess_solaris_sparc.inline.hpp b/hotspot/src/os_cpu/solaris_sparc/vm/orderAccess_solaris_sparc.inline.hpp
index 7e633fd95cbbe82bef0d18eb3c2cfe812df76b20..f9321f2bac258659020f51f9460f3ed35766b624 100644
--- a/hotspot/src/os_cpu/solaris_sparc/vm/orderAccess_solaris_sparc.inline.hpp
+++ b/hotspot/src/os_cpu/solaris_sparc/vm/orderAccess_solaris_sparc.inline.hpp
@@ -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.
 
diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp b/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp
index ed7b25382801121810d1c7d4faafd29f33761238..f22bdcb923e5b12d41523cafc56b8c9fe33b7d41 100644
--- a/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp
+++ b/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp
@@ -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"
diff --git a/hotspot/src/os_cpu/solaris_x86/vm/atomic_solaris_x86.inline.hpp b/hotspot/src/os_cpu/solaris_x86/vm/atomic_solaris_x86.inline.hpp
index 27c0d396b723cb5b091d6eef77a1e7babd3c8ee9..e00d5be1ff0b3bf11221866335340410b723b1c8 100644
--- a/hotspot/src/os_cpu/solaris_x86/vm/atomic_solaris_x86.inline.hpp
+++ b/hotspot/src/os_cpu/solaris_x86/vm/atomic_solaris_x86.inline.hpp
@@ -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; }
diff --git a/hotspot/src/os_cpu/solaris_x86/vm/orderAccess_solaris_x86.inline.hpp b/hotspot/src/os_cpu/solaris_x86/vm/orderAccess_solaris_x86.inline.hpp
index e7238c27549cae51a7ac9c153e0c9b255f05d9ff..e211c060552c21e800ce89df267e202c50a56f87 100644
--- a/hotspot/src/os_cpu/solaris_x86/vm/orderAccess_solaris_x86.inline.hpp
+++ b/hotspot/src/os_cpu/solaris_x86/vm/orderAccess_solaris_x86.inline.hpp
@@ -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.
 
diff --git a/hotspot/src/os_cpu/windows_x86/vm/atomic_windows_x86.inline.hpp b/hotspot/src/os_cpu/windows_x86/vm/atomic_windows_x86.inline.hpp
index 7ba00f7aaebd60716cde4f79dcb55cc5af40e020..072b61f07d30348e21120c241405409645df8747 100644
--- a/hotspot/src/os_cpu/windows_x86/vm/atomic_windows_x86.inline.hpp
+++ b/hotspot/src/os_cpu/windows_x86/vm/atomic_windows_x86.inline.hpp
@@ -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
diff --git a/hotspot/src/os_cpu/windows_x86/vm/orderAccess_windows_x86.inline.hpp b/hotspot/src/os_cpu/windows_x86/vm/orderAccess_windows_x86.inline.hpp
index ea0ed143e989bb03405e540cec24bbe1c289408c..37e5126e06630b51cf89f59016819e1008cdc22d 100644
--- a/hotspot/src/os_cpu/windows_x86/vm/orderAccess_windows_x86.inline.hpp
+++ b/hotspot/src/os_cpu/windows_x86/vm/orderAccess_windows_x86.inline.hpp
@@ -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.
 
diff --git a/hotspot/src/share/vm/adlc/main.cpp b/hotspot/src/share/vm/adlc/main.cpp
index 614f0d43f10924140a75fd1991d37f44eddb826b..6c4553f4b8fde4382bbe65bdd6f04cdc495d1de2 100644
--- a/hotspot/src/share/vm/adlc/main.cpp
+++ b/hotspot/src/share/vm/adlc/main.cpp
@@ -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 @@ int main(int argc, char *argv[])
   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 @@ int main(int argc, char *argv[])
   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");
diff --git a/hotspot/src/share/vm/asm/assembler.hpp b/hotspot/src/share/vm/asm/assembler.hpp
index ec8ec5eb435f9e38b0e60b78ee7f4930167d24c6..3b9c012e02f2e09c65c11c137debf6ed0a7cf131 100644
--- a/hotspot/src/share/vm/asm/assembler.hpp
+++ b/hotspot/src/share/vm/asm/assembler.hpp
@@ -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;
diff --git a/hotspot/src/share/vm/asm/codeBuffer.cpp b/hotspot/src/share/vm/asm/codeBuffer.cpp
index 60d405b35f46c287f8adffcbafb0c97d7cb6aff4..9c4bc206158086d05211642b7fc062257c76c3f3 100644
--- a/hotspot/src/share/vm/asm/codeBuffer.cpp
+++ b/hotspot/src/share/vm/asm/codeBuffer.cpp
@@ -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"
 
diff --git a/hotspot/src/share/vm/c1/c1_CodeStubs.hpp b/hotspot/src/share/vm/c1/c1_CodeStubs.hpp
index 2d0c31e2afe427b4e76c5665f079124e4045d214..e3a4f4d5680583af2b8fe43e1586a1b74b6d5889 100644
--- a/hotspot/src/share/vm/c1/c1_CodeStubs.hpp
+++ b/hotspot/src/share/vm/c1/c1_CodeStubs.hpp
@@ -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"
 
diff --git a/hotspot/src/share/vm/c1/c1_Defs.hpp b/hotspot/src/share/vm/c1/c1_Defs.hpp
index bebb3b0bebe2dfcfde9b76a55195909d5e838e12..7504bbf7ce72efe285b906a2b53976dd4c00fc17 100644
--- a/hotspot/src/share/vm/c1/c1_Defs.hpp
+++ b/hotspot/src/share/vm/c1/c1_Defs.hpp
@@ -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,
diff --git a/hotspot/src/share/vm/c1/c1_FrameMap.cpp b/hotspot/src/share/vm/c1/c1_FrameMap.cpp
index f9e46f30132abeaaea8cefba26462bc934110cc3..a164d8ccb0086a849ce31a1616a320cbc58f5d0f 100644
--- a/hotspot/src/share/vm/c1/c1_FrameMap.cpp
+++ b/hotspot/src/share/vm/c1/c1_FrameMap.cpp
@@ -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
-
-
 
 //-----------------------------------------------------
 
diff --git a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp
index 838e08d799c36ffd05e6f5fca196f3b8eff337eb..351e410aa157bb268ede74a7374e666b1897ead2 100644
--- a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp
+++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp
@@ -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 {
diff --git a/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp b/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp
index 5697e9046aa223ffc4c725d4fe0183653fe8b2af..48b560840e38aa910026fcdc5edd3b35f4e1a66a 100644
--- a/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp
+++ b/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp
@@ -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
diff --git a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp
index bf0b6f2f1eaa025666cf83bc3db44c1730c30ba6..57b76803b426bf1dab1f234d1651ae08ca37900a 100644
--- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp
+++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp
@@ -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
diff --git a/hotspot/src/share/vm/c1/c1_LinearScan.cpp b/hotspot/src/share/vm/c1/c1_LinearScan.cpp
index 91bef59ef17c7e8022157b60c173ec4335a30200..afed1de995fd44f738bd7b3d591c5c72c9f70115 100644
--- a/hotspot/src/share/vm/c1/c1_LinearScan.cpp
+++ b/hotspot/src/share/vm/c1/c1_LinearScan.cpp
@@ -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
 
diff --git a/hotspot/src/share/vm/c1/c1_Runtime1.cpp b/hotspot/src/share/vm/c1/c1_Runtime1.cpp
index 00696f155424e002b90c83a6d773d263eae91332..b8dd1bbfb83d993874b5cbaf7f7fed0747ea2241 100644
--- a/hotspot/src/share/vm/c1/c1_Runtime1.cpp
+++ b/hotspot/src/share/vm/c1/c1_Runtime1.cpp
@@ -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"
 
diff --git a/hotspot/src/share/vm/ci/ciField.cpp b/hotspot/src/share/vm/ci/ciField.cpp
index cd04c9ff135904017b441e84e402a3f9d9c51d20..7eb2119444e2110c620cb2f255733564a7f76dc8 100644
--- a/hotspot/src/share/vm/ci/ciField.cpp
+++ b/hotspot/src/share/vm/ci/ciField.cpp
@@ -138,6 +138,17 @@ ciField::ciField(ciInstanceKlass* klass, int index): _known_to_link_with_put(NUL
     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);
 }
diff --git a/hotspot/src/share/vm/classfile/bytecodeAssembler.cpp b/hotspot/src/share/vm/classfile/bytecodeAssembler.cpp
index cbf3baf7945935a79ae2830e3765ec209b2a427c..0d8cfc7878a03758f1ab6e60f996c58ea5c2539c 100644
--- a/hotspot/src/share/vm/classfile/bytecodeAssembler.cpp
+++ b/hotspot/src/share/vm/classfile/bytecodeAssembler.cpp
@@ -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;
diff --git a/hotspot/src/share/vm/classfile/classFileStream.hpp b/hotspot/src/share/vm/classfile/classFileStream.hpp
index 691ed808fec81277d4bce7e2a658a7824d42c539..de392e7fa13c6e29f72def29ffe246e079312371 100644
--- a/hotspot/src/share/vm/classfile/classFileStream.hpp
+++ b/hotspot/src/share/vm/classfile/classFileStream.hpp
@@ -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
 //
diff --git a/hotspot/src/share/vm/classfile/javaClasses.cpp b/hotspot/src/share/vm/classfile/javaClasses.cpp
index cd313d277574b6aaad1e455f9e65ab7aa3e09b01..cfd3a68356ca0a3b60cd11b6012c706ab0d202c2 100644
--- a/hotspot/src/share/vm/classfile/javaClasses.cpp
+++ b/hotspot/src/share/vm/classfile/javaClasses.cpp
@@ -1639,9 +1639,9 @@ void java_lang_Throwable::fill_in_stack_trace(Handle throwable, methodHandle met
       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();
diff --git a/hotspot/src/share/vm/classfile/stackMapTable.hpp b/hotspot/src/share/vm/classfile/stackMapTable.hpp
index ee8b33f6219540100bc053fd703b5a18449d1d92..385aef3a7e6b519cf7667a1e7f8eaca1a7a618b4 100644
--- a/hotspot/src/share/vm/classfile/stackMapTable.hpp
+++ b/hotspot/src/share/vm/classfile/stackMapTable.hpp
@@ -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;
 
diff --git a/hotspot/src/share/vm/classfile/verifier.cpp b/hotspot/src/share/vm/classfile/verifier.cpp
index c0183cfe1cc2cee4bcd721c245969df06d8bc58b..6fc9ed239afb9d07bbfade5cb3ba0f43d117f8e0 100644
--- a/hotspot/src/share/vm/classfile/verifier.cpp
+++ b/hotspot/src/share/vm/classfile/verifier.cpp
@@ -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 @@ void ErrorContext::location_details(outputStream* ss, const Method* method) cons
   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);
diff --git a/hotspot/src/share/vm/code/codeBlob.cpp b/hotspot/src/share/vm/code/codeBlob.cpp
index f9e78bfb9e2d869409b2d316b917c8e01eec21dc..710ca948ddcf5111c3552feaa4990fcb4ffb1060 100644
--- a/hotspot/src/share/vm/code/codeBlob.cpp
+++ b/hotspot/src/share/vm/code/codeBlob.cpp
@@ -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
diff --git a/hotspot/src/share/vm/code/compiledIC.hpp b/hotspot/src/share/vm/code/compiledIC.hpp
index f2207cc2ec1a255ac44b6e10f7ad9c2533a51b56..d1e9b9a2bcefaf2aaa6782a3c3a3276a421357ac 100644
--- a/hotspot/src/share/vm/code/compiledIC.hpp
+++ b/hotspot/src/share/vm/code/compiledIC.hpp
@@ -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.
diff --git a/jdk/src/share/classes/sun/audio/AudioSecurityExceptionAction.java b/hotspot/src/share/vm/code/nativeInst.hpp
similarity index 62%
rename from jdk/src/share/classes/sun/audio/AudioSecurityExceptionAction.java
rename to hotspot/src/share/vm/code/nativeInst.hpp
index ed174c0f3a1168d1c92206232940d052fe515327..6e4ece7d01a5d81fc5b60c9c02fa0ca98640d21b 100644
--- a/jdk/src/share/classes/sun/audio/AudioSecurityExceptionAction.java
+++ b/hotspot/src/share/vm/code/nativeInst.hpp
@@ -1,12 +1,10 @@
 /*
- * Copyright (c) 1999, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * published by the Free Software Foundation.
  *
  * This code is distributed in the hope that it will be useful, but WITHOUT
  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@@ -21,10 +19,26 @@
  * Please 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;
+#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
 
-public interface AudioSecurityExceptionAction {
-    Object run() throws Exception;
-}
+#endif // SHARE_VM_CODE_NATIVEINST_HPP
diff --git a/hotspot/src/share/vm/code/nmethod.hpp b/hotspot/src/share/vm/code/nmethod.hpp
index 5ea2ca8891d27298cb980f5856991c95905a2e50..10fe4d8e5758be57fabf1a62ee830440164481f9 100644
--- a/hotspot/src/share/vm/code/nmethod.hpp
+++ b/hotspot/src/share/vm/code/nmethod.hpp
@@ -69,7 +69,12 @@ class PcDescCache VALUE_OBJ_CLASS_SPEC {
   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);
diff --git a/hotspot/src/share/vm/code/vmreg.hpp b/hotspot/src/share/vm/code/vmreg.hpp
index 1ef07ec199c37411a9de7b9d02ac55adbfcbae74..0b2edd19fd97f2a9f94765ac75e68dde2d95b39f 100644
--- a/hotspot/src/share/vm/code/vmreg.hpp
+++ b/hotspot/src/share/vm/code/vmreg.hpp
@@ -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 @@ public:
   // 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;
diff --git a/hotspot/src/share/vm/code/vmreg.inline.hpp b/hotspot/src/share/vm/code/vmreg.inline.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..6204f9df39fc935bb58b45f3be80fe5a4f202005
--- /dev/null
+++ b/hotspot/src/share/vm/code/vmreg.inline.hpp
@@ -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
diff --git a/hotspot/src/share/vm/compiler/compileLog.cpp b/hotspot/src/share/vm/compiler/compileLog.cpp
index f2c04b6e4ff5773a62f5b1ce7afe42ec46f5f0f2..340251f326585eee8927e6a2cf4286c239b8fe9e 100644
--- a/hotspot/src/share/vm/compiler/compileLog.cpp
+++ b/hotspot/src/share/vm/compiler/compileLog.cpp
@@ -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"
diff --git a/hotspot/src/share/vm/compiler/oopMap.cpp b/hotspot/src/share/vm/compiler/oopMap.cpp
index 5e1801584c2756fbe1c47d295bc4b2a7619d6f3f..556966bc9bfd6fc470f3e55f603df671841149bc 100644
--- a/hotspot/src/share/vm/compiler/oopMap.cpp
+++ b/hotspot/src/share/vm/compiler/oopMap.cpp
@@ -36,6 +36,9 @@
 #ifdef COMPILER1
 #include "c1/c1_Defs.hpp"
 #endif
+#ifdef COMPILER2
+#include "opto/optoreg.hpp"
+#endif
 
 // OopMapStream
 
diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp
index 640265fbf563918aff23d179f91b068684c633ed..2164628a77f95a5087a1246014504d938b248294 100644
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp
@@ -1904,12 +1904,12 @@ CompactibleFreeListSpace::splitChunkAndReturnRemainder(FreeChunk* chunk,
   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 @@ CompactibleFreeListSpace::splitChunkAndReturnRemainder(FreeChunk* chunk,
   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;
diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp
index 74c079d8ccf6e9080f8415edadcc095d4dbff303..3b9c0aa1906defcfaa55c1900eb91e28a806589f 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp
@@ -891,6 +891,10 @@ void ConcurrentMark::clearNextBitmap() {
   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 @@ void ConcurrentMark::print_stats() {
 
 // 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
diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp
index d0b67b39f9789216c8f5fc9e3069ddcad3582a89..a564855277b7b728195cb6da5fcdd34bd2b108e3 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp
@@ -736,6 +736,9 @@ public:
   // 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
diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp
index f8392143db84da6e7c533a45db50dabe8dc693f2..1f9f066177985ba8099c86723410cfa2614583ff 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp
@@ -277,9 +277,13 @@ void ConcurrentMarkThread::run() {
 
       // 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");
       }
     }
 
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
index aca5699351bf8f680eeac58f70201655a80aadbd..db56c33b91a89a7a179e84874f077fc311b482b3 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
@@ -2950,11 +2950,18 @@ void G1CollectedHeap::collection_set_iterate_from(HeapRegion* r,
   }
 }
 
-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);
 }
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp
index 30a3d7ebcb826b5f925617a9d40e7bb8378952ed..9f51eafa1edee18e8e16289b3ef7cd1fba95ebb5 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp
@@ -1158,19 +1158,19 @@ public:
   }
 
   // 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 @@ public:
   // 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.
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp
index 1c805c634b343f61f979170e07b6b7612f35bbb6..eba482046fd9c5f9c0eaf1dfd815d42fd4c52c20 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp
@@ -1047,7 +1047,7 @@ void G1CollectorPolicy::record_collection_pause_end(double pause_time_ms, Evacua
 
   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;
   }
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp
index 6a2627d10fcdd038c039dbdfeed98333c1e43db3..dbd9e523ba64530991a1f1f71b6088aecc0689b4 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp
@@ -76,7 +76,6 @@ void G1MarkSweep::invoke_at_safepoint(ReferenceProcessor* rp,
   // 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 @@ void G1MarkSweep::invoke_at_safepoint(ReferenceProcessor* rp,
   //  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 @@ class G1PrepareCompactClosure: public HeapRegionClosure {
   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 @@ class G1PrepareCompactClosure: public HeapRegionClosure {
     _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 @@ public:
         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 @@ void G1MarkSweep::mark_sweep_phase2() {
   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();
 }
diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp
index cecf891306a3b97e294078328b1fe10705c9bc10..524f2f315fb1514936cc2cf3aef044913bb6996b 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp
@@ -381,18 +381,7 @@ HeapRegion::HeapRegion(uint hrs_index,
 }
 
 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,
diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegionSet.hpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegionSet.hpp
index 222fc694f4cd2c96caec9c9d305f6e02a35f30e9..8502763ccf1a212a017a03ffa8efcd6c57e5ae2f 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionSet.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionSet.hpp
@@ -119,7 +119,7 @@ protected:
 public:
   const char* name() { return _name; }
 
-  uint length() { return _count.length(); }
+  uint length() const { return _count.length(); }
 
   bool is_empty() { return _count.length() == 0; }
 
diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp
index 647ed85ecdb2dc7530f68f8030758b42e3932712..a0b2cb960481d4d225ff0bc7c82d749ceab9f8f0 100644
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp
@@ -180,7 +180,6 @@ bool PSMarkSweep::invoke_no_policy(bool clear_all_softrefs) {
     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 @@ bool PSMarkSweep::invoke_no_policy(bool clear_all_softrefs) {
     MetaspaceAux::verify_metrics();
 
     BiasedLocking::restore_marks();
-    Threads::gc_epilogue();
     CodeCache::gc_epilogue();
     JvmtiExport::gc_epilogue();
 
diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp
index 7246a61b634956cf4c924dd28fb3d3a7218af94a..1a2fd30c6cebb5f51bfc329670e21bfbec2c225e 100644
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp
@@ -1066,7 +1066,6 @@ void PSParallelCompact::post_compact()
   ClassLoaderDataGraph::purge();
   MetaspaceAux::verify_metrics();
 
-  Threads::gc_epilogue();
   CodeCache::gc_epilogue();
   JvmtiExport::gc_epilogue();
 
@@ -2068,7 +2067,6 @@ bool PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) {
     size_policy->major_collection_begin();
 
     CodeCache::gc_prologue();
-    Threads::gc_prologue();
 
     COMPILER2_PRESENT(DerivedPointerTable::clear());
 
diff --git a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp
index d5d1b150134191cfed0356f7383d9d2219307aa7..783066e0adbcb354718fe95e3c16bae1af5ae0c7 100644
--- a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp
+++ b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp
@@ -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;
diff --git a/hotspot/src/share/vm/interpreter/bytecode.hpp b/hotspot/src/share/vm/interpreter/bytecode.hpp
index 10b5a567b2406a42266932e78a3a50e86c18d554..0708816ff519b33f9ec74e844228ccf5c634265c 100644
--- a/hotspot/src/share/vm/interpreter/bytecode.hpp
+++ b/hotspot/src/share/vm/interpreter/bytecode.hpp
@@ -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;
 
diff --git a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp
index b2a1c49683f729311eaff7b35f294d1ce787b68b..49fc1703d509e3242b311aae47af6da7ed4119ad 100644
--- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp
+++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp
@@ -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;
diff --git a/hotspot/src/share/vm/interpreter/bytecodeStream.hpp b/hotspot/src/share/vm/interpreter/bytecodeStream.hpp
index cf5500a7e33cf0732e62b87b10d0664a71f6bdeb..1f657b98bc2d6e81fc82d13a0fcba9b14c55e31d 100644
--- a/hotspot/src/share/vm/interpreter/bytecodeStream.hpp
+++ b/hotspot/src/share/vm/interpreter/bytecodeStream.hpp
@@ -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*.
diff --git a/hotspot/src/share/vm/interpreter/bytecodes.cpp b/hotspot/src/share/vm/interpreter/bytecodes.cpp
index 5c26a4a751fd6183e3c7a0abd8ccd53bb8e5e50a..7fcd65439844c10455b47038f66f3eabe982a1c8 100644
--- a/hotspot/src/share/vm/interpreter/bytecodes.cpp
+++ b/hotspot/src/share/vm/interpreter/bytecodes.cpp
@@ -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))
diff --git a/jdk/src/share/classes/sun/audio/AudioDataStream.java b/hotspot/src/share/vm/interpreter/interp_masm.hpp
similarity index 57%
rename from jdk/src/share/classes/sun/audio/AudioDataStream.java
rename to hotspot/src/share/vm/interpreter/interp_masm.hpp
index dcc21a882339d7ac1880e97b86eaab9bf0a6b5c9..6e647835448ca56fb6c343358ea1ee5c5344a98d 100644
--- a/jdk/src/share/classes/sun/audio/AudioDataStream.java
+++ b/hotspot/src/share/vm/interpreter/interp_masm.hpp
@@ -1,12 +1,10 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * published by the Free Software Foundation.
  *
  * This code is distributed in the hope that it will be useful, but WITHOUT
  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@@ -21,34 +19,31 @@
  * Please 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;
+#ifndef SHARE_VM_INTERPRETER_INTERP_MASM_HPP
+#define SHARE_VM_INTERPRETER_INTERP_MASM_HPP
 
-    /**
-     * Constructor
-     */
-    public AudioDataStream(final AudioData data) {
+#include "asm/macroAssembler.hpp"
 
-        super(data.buffer);
-        this.ad = data;
-    }
+#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
 
-    final AudioData getAudioData() {
-        return ad;
-    }
-}
+#endif // SHARE_VM_INTERPRETER_INTERP_MASM_HPP
diff --git a/hotspot/src/share/vm/interpreter/interpreter.cpp b/hotspot/src/share/vm/interpreter/interpreter.cpp
index 7ce4bdbb3ec39fc97628ffdd50845d482f2be7e2..4807cd083981e998d1c9aabb7cdb5a50283c9874 100644
--- a/hotspot/src/share/vm/interpreter/interpreter.cpp
+++ b/hotspot/src/share/vm/interpreter/interpreter.cpp
@@ -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 @@ void InterpreterCodelet::print_on(outputStream* st) const {
   }
 }
 
+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;
diff --git a/hotspot/src/share/vm/interpreter/interpreter.hpp b/hotspot/src/share/vm/interpreter/interpreter.hpp
index cc26b378d73f7a870864265b3991abfde6029908..2a81daf205d003eeb5b4a03d2cd6a0791bce52d9 100644
--- a/hotspot/src/share/vm/interpreter/interpreter.hpp
+++ b/hotspot/src/share/vm/interpreter/interpreter.hpp
@@ -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 @@ class CodeletMark: ResourceMark {
     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 CodeletMark: ResourceMark {
 
 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
diff --git a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp
index 5f1894033de4bad6d8c7337fa926b72f493e77a5..23d4bddca1b5a6c64fd17aa802fa8785ba048618 100644
--- a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp
+++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp
@@ -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
diff --git a/hotspot/src/share/vm/interpreter/templateInterpreter.cpp b/hotspot/src/share/vm/interpreter/templateInterpreter.cpp
index 66eb63eafb63256c9b0e5301d429360c735062cd..9f28e20f9b734e6da13c5d1169b2354458422427 100644
--- a/hotspot/src/share/vm/interpreter/templateInterpreter.cpp
+++ b/hotspot/src/share/vm/interpreter/templateInterpreter.cpp
@@ -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
diff --git a/hotspot/src/share/vm/interpreter/templateInterpreter.hpp b/hotspot/src/share/vm/interpreter/templateInterpreter.hpp
index 48e0e217091c9c27ac8b1ce4da3cd0e3b2014f9e..c72fafdbada2f19e2b83a5cc02b4072715837cfc 100644
--- a/hotspot/src/share/vm/interpreter/templateInterpreter.hpp
+++ b/hotspot/src/share/vm/interpreter/templateInterpreter.hpp
@@ -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)
diff --git a/hotspot/src/share/vm/interpreter/templateTable.cpp b/hotspot/src/share/vm/interpreter/templateTable.cpp
index 05b8a069691c80581f9111a9930806904d20a660..8449321d9f3d5256f37407b99fcc912d3eba4542 100644
--- a/hotspot/src/share/vm/interpreter/templateTable.cpp
+++ b/hotspot/src/share/vm/interpreter/templateTable.cpp
@@ -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"
 
diff --git a/hotspot/src/share/vm/interpreter/templateTable.hpp b/hotspot/src/share/vm/interpreter/templateTable.hpp
index c6ea51537a27e0f2977aeb45c1ea54dd13ba8b98..e6d334005e1a7ecffc6ee6cbcacf17b52e510466 100644
--- a/hotspot/src/share/vm/interpreter/templateTable.hpp
+++ b/hotspot/src/share/vm/interpreter/templateTable.hpp
@@ -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.
diff --git a/hotspot/src/share/vm/memory/filemap.cpp b/hotspot/src/share/vm/memory/filemap.cpp
index 47527f21e9f0b5cbab0f76ff02f5646306b45a28..2f5c0165893dc909710369db6ea7ea4749df9aa4 100644
--- a/hotspot/src/share/vm/memory/filemap.cpp
+++ b/hotspot/src/share/vm/memory/filemap.cpp
@@ -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"
 
diff --git a/hotspot/src/share/vm/memory/genCollectedHeap.cpp b/hotspot/src/share/vm/memory/genCollectedHeap.cpp
index bbca44a36f617b8a3e3aee1eb6955366f7a5d634..4b5deb03c050f4f520012947d097c2e66a7e894e 100644
--- a/hotspot/src/share/vm/memory/genCollectedHeap.cpp
+++ b/hotspot/src/share/vm/memory/genCollectedHeap.cpp
@@ -1088,7 +1088,7 @@ void GenCollectedHeap::prepare_for_compaction() {
   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);
diff --git a/hotspot/src/share/vm/memory/genMarkSweep.cpp b/hotspot/src/share/vm/memory/genMarkSweep.cpp
index 5faab645408c696b3bba8b69985f2baba54170b0..823b0a196bf86c9f96f45caf67162b0aaed73832 100644
--- a/hotspot/src/share/vm/memory/genMarkSweep.cpp
+++ b/hotspot/src/share/vm/memory/genMarkSweep.cpp
@@ -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 @@ void GenMarkSweep::invoke_at_safepoint(int level, ReferenceProcessor* rp, bool c
   // 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 @@ void GenMarkSweep::invoke_at_safepoint(int level, ReferenceProcessor* rp, bool c
     rs->invalidate_or_clear(old_gen);
   }
 
-  Threads::gc_epilogue();
   CodeCache::gc_epilogue();
   JvmtiExport::gc_epilogue();
 
diff --git a/hotspot/src/share/vm/memory/space.hpp b/hotspot/src/share/vm/memory/space.hpp
index 4c2974dcdab83953f449b1a9dab7b3fca0f6b940..0653884e043a3049559f7c06da3d099fd0f27fae 100644
--- a/hotspot/src/share/vm/memory/space.hpp
+++ b/hotspot/src/share/vm/memory/space.hpp
@@ -330,9 +330,9 @@ public:
   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) {}
 };
 
 
diff --git a/hotspot/src/share/vm/memory/threadLocalAllocBuffer.hpp b/hotspot/src/share/vm/memory/threadLocalAllocBuffer.hpp
index e0dc61a73f6236fce3345a7fbcd28102a79f7474..a54de2bf0a37069655a514298d7b4213ecb1e345 100644
--- a/hotspot/src/share/vm/memory/threadLocalAllocBuffer.hpp
+++ b/hotspot/src/share/vm/memory/threadLocalAllocBuffer.hpp
@@ -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;
 
diff --git a/hotspot/src/share/vm/oops/constantPool.hpp b/hotspot/src/share/vm/oops/constantPool.hpp
index 5c5ea1c76e237d65bc8c90b3f08a686ebac49932..5e26ec5e6229408edb89948056ec2ae2f29cf464 100644
--- a/hotspot/src/share/vm/oops/constantPool.hpp
+++ b/hotspot/src/share/vm/oops/constantPool.hpp
@@ -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.
diff --git a/hotspot/src/share/vm/oops/method.cpp b/hotspot/src/share/vm/oops/method.cpp
index 83ac9591aa289e292ca0286b122b7a3fe282577b..54fa43a7212527809a5b3fc069a6f6b286282d17 100644
--- a/hotspot/src/share/vm/oops/method.cpp
+++ b/hotspot/src/share/vm/oops/method.cpp
@@ -240,6 +240,9 @@ void Method::mask_for(int bci, InterpreterOopMap* mask) {
 
 
 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 @@ int Method::bci_from(address bcp) const {
 }
 
 
-// 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");
diff --git a/hotspot/src/share/vm/oops/method.hpp b/hotspot/src/share/vm/oops/method.hpp
index a2c36db39f4b6c30e22e7a2ccb5b51244ab1a632..23752b4f8f529b4d8310b7d051a2bb6d3064d758 100644
--- a/hotspot/src/share/vm/oops/method.hpp
+++ b/hotspot/src/share/vm/oops/method.hpp
@@ -649,7 +649,8 @@ class Method : public Metadata {
   // 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.
diff --git a/hotspot/src/share/vm/oops/methodData.hpp b/hotspot/src/share/vm/oops/methodData.hpp
index 1c88ac55ffa683c448aa9f4c603163d1439a099d..ad290402d9027810b57250c46b9a6b62cff63e54 100644
--- a/hotspot/src/share/vm/oops/methodData.hpp
+++ b/hotspot/src/share/vm/oops/methodData.hpp
@@ -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 @@ public:
     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) {
diff --git a/hotspot/src/share/vm/oops/oop.inline.hpp b/hotspot/src/share/vm/oops/oop.inline.hpp
index 0dc0db8e946c1a99d49f5473ec3374aa9493cb4d..08839267e010c00ca98998a3a8239f886309db18 100644
--- a/hotspot/src/share/vm/oops/oop.inline.hpp
+++ b/hotspot/src/share/vm/oops/oop.inline.hpp
@@ -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
diff --git a/hotspot/src/share/vm/opto/ad.hpp b/hotspot/src/share/vm/opto/ad.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..29308f8b10c6c85146c702936f0b8471e948ea69
--- /dev/null
+++ b/hotspot/src/share/vm/opto/ad.hpp
@@ -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
diff --git a/hotspot/src/share/vm/opto/buildOopMap.cpp b/hotspot/src/share/vm/opto/buildOopMap.cpp
index 9f2dd674e2f53870a6f49cd54c9eae73bc9c32cd..1fa98978f26b27c871a85a65ac35cbd66cc94ac5 100644
--- a/hotspot/src/share/vm/opto/buildOopMap.cpp
+++ b/hotspot/src/share/vm/opto/buildOopMap.cpp
@@ -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.
 //
diff --git a/hotspot/src/share/vm/opto/c2compiler.cpp b/hotspot/src/share/vm/opto/c2compiler.cpp
index dced2e00f34c886a512d4677dd98eb026be9c06b..795b0ec1fe521a39173b9057eb4e874675c78290 100644
--- a/hotspot/src/share/vm/opto/c2compiler.cpp
+++ b/hotspot/src/share/vm/opto/c2compiler.cpp
@@ -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[];
diff --git a/hotspot/src/share/vm/opto/compile.cpp b/hotspot/src/share/vm/opto/compile.cpp
index bd122ddb139a9bc49f10e991a9c2ead1a488403e..585f93152414d1babb99b7b9ba56d99843812bca 100644
--- a/hotspot/src/share/vm/opto/compile.cpp
+++ b/hotspot/src/share/vm/opto/compile.cpp
@@ -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 -----------------------
diff --git a/hotspot/src/share/vm/opto/gcm.cpp b/hotspot/src/share/vm/opto/gcm.cpp
index 4aa770d5af522709df6c7c4d2b5e67cf2cd43d50..0486bf6885bc8a7f651fe72003d8ed96b3ea7e5e 100644
--- a/hotspot/src/share/vm/opto/gcm.cpp
+++ b/hotspot/src/share/vm/opto/gcm.cpp
@@ -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
 
diff --git a/hotspot/src/share/vm/opto/lcm.cpp b/hotspot/src/share/vm/opto/lcm.cpp
index 10daf5694f90aba2b936a899b9366a1beb1bf9a1..a601752d4cd315e5d5d705e66db60ce055da17da 100644
--- a/hotspot/src/share/vm/opto/lcm.cpp
+++ b/hotspot/src/share/vm/opto/lcm.cpp
@@ -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
 
diff --git a/hotspot/src/share/vm/opto/library_call.cpp b/hotspot/src/share/vm/opto/library_call.cpp
index e0a09d27ff1996ab4e179a165e4f9cb5cc7c7106..8e01709fcdadbe74859daab74e05019e4066b605 100644
--- a/hotspot/src/share/vm/opto/library_call.cpp
+++ b/hotspot/src/share/vm/opto/library_call.cpp
@@ -23,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "asm/macroAssembler.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "classfile/vmSymbols.hpp"
 #include "compiler/compileBroker.hpp"
diff --git a/hotspot/src/share/vm/opto/locknode.hpp b/hotspot/src/share/vm/opto/locknode.hpp
index 8bd6f35afd8037886c4da6188fe3a8cc39d7cb80..515a40c466328aa3fed41c77803afa97f9a17190 100644
--- a/hotspot/src/share/vm/opto/locknode.hpp
+++ b/hotspot/src/share/vm/opto/locknode.hpp
@@ -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 {
diff --git a/hotspot/src/share/vm/opto/matcher.cpp b/hotspot/src/share/vm/opto/matcher.cpp
index a8321b07753a20bc31db3408730a7b37d4a2131c..cce4a73947336149e1af1714d26711577e80e140 100644
--- a/hotspot/src/share/vm/opto/matcher.cpp
+++ b/hotspot/src/share/vm/opto/matcher.cpp
@@ -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;
 
diff --git a/hotspot/src/share/vm/opto/optoreg.hpp b/hotspot/src/share/vm/opto/optoreg.hpp
index 0d45c7a50ab2774a7e45980bf2ca610d9d482f37..cc383393946c20f428cc1234ca333b71d56b4ca6 100644
--- a/hotspot/src/share/vm/opto/optoreg.hpp
+++ b/hotspot/src/share/vm/opto/optoreg.hpp
@@ -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
diff --git a/hotspot/src/share/vm/opto/output.cpp b/hotspot/src/share/vm/opto/output.cpp
index c8e6b9736c29b517941bd0305ee043d85503fd40..15bf30b393a1b7e09442d71e007e35c1e5b225c8 100644
--- a/hotspot/src/share/vm/opto/output.cpp
+++ b/hotspot/src/share/vm/opto/output.cpp
@@ -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"
diff --git a/hotspot/src/share/vm/opto/output.hpp b/hotspot/src/share/vm/opto/output.hpp
index 298de0fec679ac3aa340a0adcfe287d0f674678d..ab3c1a3045719d117554905e0dc686b5a319ab32 100644
--- a/hotspot/src/share/vm/opto/output.hpp
+++ b/hotspot/src/share/vm/opto/output.hpp
@@ -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;
diff --git a/hotspot/src/share/vm/opto/phaseX.cpp b/hotspot/src/share/vm/opto/phaseX.cpp
index 5b2771e83efbf4955f11cb888e2a48be19645d2e..b4470dcef53ab1a8f4e92070e9e545e998e8735a 100644
--- a/hotspot/src/share/vm/opto/phaseX.cpp
+++ b/hotspot/src/share/vm/opto/phaseX.cpp
@@ -1089,7 +1089,7 @@ Node *PhaseIterGVN::transform_old(Node* n) {
 #endif
 
   while (i != NULL) {
-#ifndef PRODUCT
+#ifdef ASSERT
     if (loop_count >= K) {
       dump_infinite_loop_info(i);
     }
diff --git a/hotspot/src/share/vm/opto/regmask.cpp b/hotspot/src/share/vm/opto/regmask.cpp
index a30678dadf298367a623eace6fc9974feebdd744..06a245a12f0ad3efc4440a023d15453d150fe9d6 100644
--- a/hotspot/src/share/vm/opto/regmask.cpp
+++ b/hotspot/src/share/vm/opto/regmask.cpp
@@ -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 */
 
diff --git a/hotspot/src/share/vm/opto/regmask.hpp b/hotspot/src/share/vm/opto/regmask.hpp
index ff0d0b96dc238c7ea90627ab57b35e5c2e3cff38..15f687ac38ef334372c0957da8cff7f79fba6617 100644
--- a/hotspot/src/share/vm/opto/regmask.hpp
+++ b/hotspot/src/share/vm/opto/regmask.hpp
@@ -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:
 //
diff --git a/hotspot/src/share/vm/opto/runtime.cpp b/hotspot/src/share/vm/opto/runtime.cpp
index dba4f047b5a86ad5a73ee34b89042fe6c60d42a6..2a2fb131dfd2fc11efb3f9214c5700e14d887f1b 100644
--- a/hotspot/src/share/vm/opto/runtime.cpp
+++ b/hotspot/src/share/vm/opto/runtime.cpp
@@ -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:
diff --git a/hotspot/src/share/vm/opto/runtime.hpp b/hotspot/src/share/vm/opto/runtime.hpp
index b8ad0105dfcc47e7b2a4dff48d8b7d9b0494668d..b5e8bc34d98768541ab6093afa2a8cfe5d3270a4 100644
--- a/hotspot/src/share/vm/opto/runtime.hpp
+++ b/hotspot/src/share/vm/opto/runtime.hpp
@@ -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"
diff --git a/hotspot/src/share/vm/precompiled/precompiled.hpp b/hotspot/src/share/vm/precompiled/precompiled.hpp
index e8d014430dfceaf69dbddcec80d5c0206c65d1a3..be70cfffd6efb133c494ef919a95845ebdc2d640 100644
--- a/hotspot/src/share/vm/precompiled/precompiled.hpp
+++ b/hotspot/src/share/vm/precompiled/precompiled.hpp
@@ -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"
diff --git a/hotspot/src/share/vm/prims/forte.cpp b/hotspot/src/share/vm/prims/forte.cpp
index f6af607c4eee1aba310a449c6c6cf44dd0b83a00..eee24dfc999a63c02632d52d4f5aebe93bc4a848 100644
--- a/hotspot/src/share/vm/prims/forte.cpp
+++ b/hotspot/src/share/vm/prims/forte.cpp
@@ -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 @@ static bool is_decipherable_interpreted_frame(JavaThread* thread,
     *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;
diff --git a/hotspot/src/share/vm/prims/jniCheck.cpp b/hotspot/src/share/vm/prims/jniCheck.cpp
index 4ffa3d491d08e306805cbfd1996dec0555a7a8c7..1de4f02101759627f026ba2abd26c00a8f83e0ca 100644
--- a/hotspot/src/share/vm/prims/jniCheck.cpp
+++ b/hotspot/src/share/vm/prims/jniCheck.cpp
@@ -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
diff --git a/hotspot/src/share/vm/prims/jvm.cpp b/hotspot/src/share/vm/prims/jvm.cpp
index 4f292216473a6efe7060b722e2a02b7ef38288d0..1970d715ebcc3e389998db22b47ea983a7aeffdc 100644
--- a/hotspot/src/share/vm/prims/jvm.cpp
+++ b/hotspot/src/share/vm/prims/jvm.cpp
@@ -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"
diff --git a/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp b/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp
index 92ff86fcd6d69ef076f3d4403a8257083097e6f3..c6633bf34a95f1838b9e55f7b8d1346de015cb7c 100644
--- a/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp
+++ b/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp
@@ -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()
diff --git a/hotspot/src/share/vm/prims/jvmtiTagMap.cpp b/hotspot/src/share/vm/prims/jvmtiTagMap.cpp
index eca5cc1eb1fd987b7f32c17b6f9cab43b416093a..89680d13ea65f587fd00bd7b92a7a9c5a1295512 100644
--- a/hotspot/src/share/vm/prims/jvmtiTagMap.cpp
+++ b/hotspot/src/share/vm/prims/jvmtiTagMap.cpp
@@ -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"
diff --git a/hotspot/src/share/vm/prims/unsafe.cpp b/hotspot/src/share/vm/prims/unsafe.cpp
index 955e34d503479c806954c5a79b6e794a18ce783a..c0e4f30d2a20d21c1c7eb9bcf2359b00346e7d6b 100644
--- a/hotspot/src/share/vm/prims/unsafe.cpp
+++ b/hotspot/src/share/vm/prims/unsafe.cpp
@@ -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"
diff --git a/hotspot/src/share/vm/prims/whitebox.cpp b/hotspot/src/share/vm/prims/whitebox.cpp
index 694ecbd685d773e36c645116afc8d36a7e408dae..e6805b12e5be8a9c4c1aa5a818ec6a93443deaab 100644
--- a/hotspot/src/share/vm/prims/whitebox.cpp
+++ b/hotspot/src/share/vm/prims/whitebox.cpp
@@ -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"
diff --git a/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp b/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp
index 1b97c18b7f79b741974c422dc3c53adbc2e5f396..5c765ec21b89e403937bb73c6563698a3871b17b 100644
--- a/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp
+++ b/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp
@@ -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"
 
diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp
index 7accd0c0b1817dff1f6a094a8b4409d3670185f7..3f0bff025ec13af375239bf282b3cd7a696b8587 100644
--- a/hotspot/src/share/vm/runtime/arguments.cpp
+++ b/hotspot/src/share/vm/runtime/arguments.cpp
@@ -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 @@ void Arguments::set_conservative_max_heap_alignment() {
     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() {
diff --git a/hotspot/src/share/vm/runtime/deoptimization.cpp b/hotspot/src/share/vm/runtime/deoptimization.cpp
index b15664f4b523b019a7590c4ac538f38b13670a7f..a7ad943cf7c7a3c1b13925ce0cf4e438cfb250f8 100644
--- a/hotspot/src/share/vm/runtime/deoptimization.cpp
+++ b/hotspot/src/share/vm/runtime/deoptimization.cpp
@@ -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
 
diff --git a/hotspot/src/share/vm/runtime/dtraceJSDT.cpp b/hotspot/src/share/vm/runtime/dtraceJSDT.cpp
index 1a5f4fe52866ee16e00e7b4dcb572653e8048cf7..51ae25d0c34ded704894a24d0fc11f7e8befbd5f 100644
--- a/hotspot/src/share/vm/runtime/dtraceJSDT.cpp
+++ b/hotspot/src/share/vm/runtime/dtraceJSDT.cpp
@@ -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"
diff --git a/hotspot/src/share/vm/runtime/dtraceJSDT.hpp b/hotspot/src/share/vm/runtime/dtraceJSDT.hpp
index 67b766ae944a948a3b595b62542fd7a27b6d3044..7e7592a5406b143d18d1f146c0c25807692e7d66 100644
--- a/hotspot/src/share/vm/runtime/dtraceJSDT.hpp
+++ b/hotspot/src/share/vm/runtime/dtraceJSDT.hpp
@@ -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;
diff --git a/hotspot/src/share/vm/runtime/fprofiler.cpp b/hotspot/src/share/vm/runtime/fprofiler.cpp
index 58cb6e89daa511efaa9e29d50290aeda71cc3a6b..aec76268824ea2389b56300539a5752732cc3e2a 100644
--- a/hotspot/src/share/vm/runtime/fprofiler.cpp
+++ b/hotspot/src/share/vm/runtime/fprofiler.cpp
@@ -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"
diff --git a/hotspot/src/share/vm/runtime/frame.cpp b/hotspot/src/share/vm/runtime/frame.cpp
index 0e6d22eb01f1bd49b7d0e3ca21ad4599ecfdac60..d076896f0aa421636ca60e625d21b5e8ea3a058e 100644
--- a/hotspot/src/share/vm/runtime/frame.cpp
+++ b/hotspot/src/share/vm/runtime/frame.cpp
@@ -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 @@ void frame::interpreter_frame_set_method(Method* method) {
   *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::metadata_do(void f(Metadata*)) {
   }
 }
 
-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) {
diff --git a/hotspot/src/share/vm/runtime/frame.hpp b/hotspot/src/share/vm/runtime/frame.hpp
index f715f68b52d3a56c7d96c4a7a937e4039340f4ed..9cdb256eea5633cae1fb0b2a62f5f09019dabd77 100644
--- a/hotspot/src/share/vm/runtime/frame.hpp
+++ b/hotspot/src/share/vm/runtime/frame.hpp
@@ -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 @@ class frame VALUE_OBJ_CLASS_SPEC {
 
  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 @@ class frame VALUE_OBJ_CLASS_SPEC {
 
   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 @@ class frame VALUE_OBJ_CLASS_SPEC {
   // 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 @@ class frame VALUE_OBJ_CLASS_SPEC {
   // 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");
 
diff --git a/hotspot/src/share/vm/runtime/frame.inline.hpp b/hotspot/src/share/vm/runtime/frame.inline.hpp
index ce725956dee4da1a18046c79135db02d4dce913d..c17c4f4ac6044a87e1a537591d8bf7d487a4e0de 100644
--- a/hotspot/src/share/vm/runtime/frame.inline.hpp
+++ b/hotspot/src/share/vm/runtime/frame.inline.hpp
@@ -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());
 }
diff --git a/hotspot/src/share/vm/runtime/java.cpp b/hotspot/src/share/vm/runtime/java.cpp
index 3a075117afe1030d33771af41f3140559623008d..cfecf0a5d578ee94b0296de7248a157b46fc4d71 100644
--- a/hotspot/src/share/vm/runtime/java.cpp
+++ b/hotspot/src/share/vm/runtime/java.cpp
@@ -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"
diff --git a/hotspot/src/share/vm/runtime/os.cpp b/hotspot/src/share/vm/runtime/os.cpp
index 86bf1d6ba4d7256181419e2d5b53f774222de030..d24c688bf13743fc22f4d9d9e3ebca3a34cc49dc 100644
--- a/hotspot/src/share/vm/runtime/os.cpp
+++ b/hotspot/src/share/vm/runtime/os.cpp
@@ -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"
diff --git a/hotspot/src/share/vm/runtime/registerMap.hpp b/hotspot/src/share/vm/runtime/registerMap.hpp
index b0f536fb95cd5912d3dcd16a4f9646e0326be03c..e27b745ff7c4236db17abd22350affe96f39a382 100644
--- a/hotspot/src/share/vm/runtime/registerMap.hpp
+++ b/hotspot/src/share/vm/runtime/registerMap.hpp
@@ -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;
 
diff --git a/hotspot/src/share/vm/runtime/relocator.hpp b/hotspot/src/share/vm/runtime/relocator.hpp
index bbc0600f7396c751efe3e152016f3ba1d670edc1..6ea9ab4c8197b8456651211bdee4d324697f814d 100644
--- a/hotspot/src/share/vm/runtime/relocator.hpp
+++ b/hotspot/src/share/vm/runtime/relocator.hpp
@@ -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
diff --git a/hotspot/src/share/vm/runtime/rframe.cpp b/hotspot/src/share/vm/runtime/rframe.cpp
index c52d16ff3d5b30f6c9d3d70895655a2231acba00..f3ef5504b37d7e8a008b0877687fb0e471c66841 100644
--- a/hotspot/src/share/vm/runtime/rframe.cpp
+++ b/hotspot/src/share/vm/runtime/rframe.cpp
@@ -23,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "code/codeCache.hpp"
 #include "interpreter/interpreter.hpp"
 #include "oops/oop.inline.hpp"
 #include "oops/symbol.hpp"
diff --git a/hotspot/src/share/vm/runtime/safepoint.cpp b/hotspot/src/share/vm/runtime/safepoint.cpp
index 8d5ed4cb233a570ae39fb54c889442da93059d34..4b16f6b04a865bbc6306e51bb654d68a4f6938b7 100644
--- a/hotspot/src/share/vm/runtime/safepoint.cpp
+++ b/hotspot/src/share/vm/runtime/safepoint.cpp
@@ -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"
diff --git a/hotspot/src/share/vm/runtime/sharedRuntime.cpp b/hotspot/src/share/vm/runtime/sharedRuntime.cpp
index 917f6d257b402711ccd97110c7ceeb7490e34618..8ccee76cdb6dd2330c09c11a77a150364640c849 100644
--- a/hotspot/src/share/vm/runtime/sharedRuntime.cpp
+++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp
@@ -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
diff --git a/hotspot/src/share/vm/runtime/stackValueCollection.cpp b/hotspot/src/share/vm/runtime/stackValueCollection.cpp
index 3794f64d78c5c62898c431767538b3f1eda6ea16..fdf448b37184618e758a03cfbb363f3aeada1654 100644
--- a/hotspot/src/share/vm/runtime/stackValueCollection.cpp
+++ b/hotspot/src/share/vm/runtime/stackValueCollection.cpp
@@ -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
 
diff --git a/hotspot/src/share/vm/runtime/statSampler.cpp b/hotspot/src/share/vm/runtime/statSampler.cpp
index 082cc4ec45e921d1cc1aa77f4fdf2fda2a8951b7..55fda6fb3f9fa5ad68c4fd012a8166e6f7de8d34 100644
--- a/hotspot/src/share/vm/runtime/statSampler.cpp
+++ b/hotspot/src/share/vm/runtime/statSampler.cpp
@@ -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
diff --git a/hotspot/src/share/vm/runtime/stubRoutines.hpp b/hotspot/src/share/vm/runtime/stubRoutines.hpp
index 78381168fc4023ce7a23fe07a91d72305acc0005..46d93a5291616a90b3214368eaf82d38b0e377bf 100644
--- a/hotspot/src/share/vm/runtime/stubRoutines.hpp
+++ b/hotspot/src/share/vm/runtime/stubRoutines.hpp
@@ -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
diff --git a/hotspot/src/share/vm/runtime/thread.cpp b/hotspot/src/share/vm/runtime/thread.cpp
index 984c75225808d1edb43876f49863c92a69024790..08785805729415530e042bcf6a6a2e834a8edf4e 100644
--- a/hotspot/src/share/vm/runtime/thread.cpp
+++ b/hotspot/src/share/vm/runtime/thread.cpp
@@ -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 @@ void JavaThread::deoptimized_wrt_marked_nmethods() {
 }
 
 
-// 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::metadata_do(void f(Metadata*)) {
   }
 }
 
-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();
diff --git a/hotspot/src/share/vm/runtime/thread.hpp b/hotspot/src/share/vm/runtime/thread.hpp
index 715e50a552f560c44dbba9dabd59d8e465bc34fc..7df1c0f3cbc45f386d75884d2dd9446d6db82d31 100644
--- a/hotspot/src/share/vm/runtime/thread.hpp
+++ b/hotspot/src/share/vm/runtime/thread.hpp
@@ -1416,10 +1416,6 @@ class JavaThread: public Thread {
   // 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 @@ class Threads: AllStatic {
   // 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
diff --git a/hotspot/src/share/vm/runtime/vframe.hpp b/hotspot/src/share/vm/runtime/vframe.hpp
index 70f31b14c51559cfaeaa02f8e39e4362b517182a..17ead61b7823c4ec43aa275e14dce2af13fe8631 100644
--- a/hotspot/src/share/vm/runtime/vframe.hpp
+++ b/hotspot/src/share/vm/runtime/vframe.hpp
@@ -511,8 +511,8 @@ inline bool vframeStreamCommon::fill_from_frame() {
 
 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();
diff --git a/hotspot/src/share/vm/runtime/vframeArray.cpp b/hotspot/src/share/vm/runtime/vframeArray.cpp
index 72e2e8717cbdc0e8b14223d01ed38cdae0ed64b8..6a3652c0ea1738491e04a060815cac98c73a5fb9 100644
--- a/hotspot/src/share/vm/runtime/vframeArray.cpp
+++ b/hotspot/src/share/vm/runtime/vframeArray.cpp
@@ -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 @@ void vframeArrayElement::unpack_on_stack(int caller_actual_parameters,
     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) {
diff --git a/hotspot/src/share/vm/runtime/vmStructs.cpp b/hotspot/src/share/vm/runtime/vmStructs.cpp
index 33fe915e7fef7da9b22fb3184a06359827b2a6b6..3ff417058433e297fd040e6973c2b705990bf5ac 100644
--- a/hotspot/src/share/vm/runtime/vmStructs.cpp
+++ b/hotspot/src/share/vm/runtime/vmStructs.cpp
@@ -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, ...),
diff --git a/hotspot/src/share/vm/runtime/vm_operations.cpp b/hotspot/src/share/vm/runtime/vm_operations.cpp
index 6f27fe3fecc9523408c3d221eab418ebfdd0a5d9..2e913c5015ff6838bc1f316eb72a2637e32502e8 100644
--- a/hotspot/src/share/vm/runtime/vm_operations.cpp
+++ b/hotspot/src/share/vm/runtime/vm_operations.cpp
@@ -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"
diff --git a/hotspot/src/share/vm/runtime/vm_version.cpp b/hotspot/src/share/vm/runtime/vm_version.cpp
index bbebb4157be615f86bd80ca7d9d98a52b2fb048f..c20e9a548ccce615079ee4252ade37553022dd1e 100644
--- a/hotspot/src/share/vm/runtime/vm_version.cpp
+++ b/hotspot/src/share/vm/runtime/vm_version.cpp
@@ -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();
diff --git a/hotspot/src/share/vm/runtime/vm_version.hpp b/hotspot/src/share/vm/runtime/vm_version.hpp
index fcd7b229348aa6590a8e943821247824345c6f63..a4fd05a31e7d149d29a82ab840fbf3e18c181105 100644
--- a/hotspot/src/share/vm/runtime/vm_version.hpp
+++ b/hotspot/src/share/vm/runtime/vm_version.hpp
@@ -128,4 +128,20 @@ class Abstract_VM_Version: AllStatic {
   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
diff --git a/hotspot/src/share/vm/services/diagnosticCommand.hpp b/hotspot/src/share/vm/services/diagnosticCommand.hpp
index 7a6d340280981f137ef194e2a8495b6ef14789ab..73e8673dddbe4bc08fa4c5d5404cc606c58a1150 100644
--- a/hotspot/src/share/vm/services/diagnosticCommand.hpp
+++ b/hotspot/src/share/vm/services/diagnosticCommand.hpp
@@ -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 "runtime/arguments.hpp"
 #include "classfile/vmSymbols.hpp"
-#include "utilities/ostream.hpp"
-#include "runtime/vm_version.hpp"
-#include "runtime/vmThread.hpp"
+#include "runtime/arguments.hpp"
 #include "runtime/os.hpp"
+#include "runtime/vmThread.hpp"
 #include "services/diagnosticArgument.hpp"
 #include "services/diagnosticCommand.hpp"
-#include "services/diagnosticFramework.hpp"
 #include "services/diagnosticCommand_ext.hpp"
+#include "services/diagnosticFramework.hpp"
 #include "utilities/macros.hpp"
+#include "utilities/ostream.hpp"
 
 class HelpDCmd : public DCmdWithParser {
 protected:
diff --git a/hotspot/src/share/vm/services/diagnosticFramework.hpp b/hotspot/src/share/vm/services/diagnosticFramework.hpp
index ca60f53ebc8220b6adfdffdbf97dbdc5eed2cdcb..4c9fe98da9dfc32075f3f7c69e57b1585e3487ff 100644
--- a/hotspot/src/share/vm/services/diagnosticFramework.hpp
+++ b/hotspot/src/share/vm/services/diagnosticFramework.hpp
@@ -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"
 
diff --git a/jdk/src/macosx/bundle/JavaAppLauncher/src/JavaAppLauncher_Prefix.pch b/hotspot/src/share/vm/utilities/bytes.hpp
similarity index 64%
rename from jdk/src/macosx/bundle/JavaAppLauncher/src/JavaAppLauncher_Prefix.pch
rename to hotspot/src/share/vm/utilities/bytes.hpp
index c44e81dac57f7a32b45ca05be28756f05312ad40..7da269a4775cea283aa6cab33b776c24875e3c3e 100644
--- a/jdk/src/macosx/bundle/JavaAppLauncher/src/JavaAppLauncher_Prefix.pch
+++ b/hotspot/src/share/vm/utilities/bytes.hpp
@@ -1,12 +1,10 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * published by the Free Software Foundation.
  *
  * This code is distributed in the hope that it will be useful, but WITHOUT
  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@@ -21,12 +19,26 @@
  * Please 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
-//
+#ifndef SHARE_VM_UTILITIES_BYTES_HPP
+#define SHARE_VM_UTILITIES_BYTES_HPP
 
-#ifdef __OBJC__
-    #import <Cocoa/Cocoa.h>
+#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
diff --git a/hotspot/src/share/vm/utilities/debug.cpp b/hotspot/src/share/vm/utilities/debug.cpp
index 0fc7d6af3a16a9451100773654eca66ef57cdc65..58e84e23a16327ee7114de1310790b9be4f0db1c 100644
--- a/hotspot/src/share/vm/utilities/debug.cpp
+++ b/hotspot/src/share/vm/utilities/debug.cpp
@@ -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"
diff --git a/hotspot/src/share/vm/utilities/ostream.cpp b/hotspot/src/share/vm/utilities/ostream.cpp
index 4a807a0662dce86a40b53ab9fe5a0cd00fa400dd..59943c4b16157a6687b9f41911379e3d629248f7 100644
--- a/hotspot/src/share/vm/utilities/ostream.cpp
+++ b/hotspot/src/share/vm/utilities/ostream.cpp
@@ -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"
diff --git a/hotspot/src/share/vm/utilities/vmError.cpp b/hotspot/src/share/vm/utilities/vmError.cpp
index f6b55cc99f058102281397f3042a018c613daf95..2bff5f5c824c206fb7cc2561fb08010d90178ca8 100644
--- a/hotspot/src/share/vm/utilities/vmError.cpp
+++ b/hotspot/src/share/vm/utilities/vmError.cpp
@@ -23,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "code/codeCache.hpp"
 #include "compiler/compileBroker.hpp"
 #include "gc_interface/collectedHeap.hpp"
 #include "prims/whitebox.hpp"
diff --git a/hotspot/test/TEST.groups b/hotspot/test/TEST.groups
index 6a89ec446d387f572945244e928e400431e21c3a..b88243644c06c22dc98e43abebd1b8a4e4df663b 100644
--- a/hotspot/test/TEST.groups
+++ b/hotspot/test/TEST.groups
@@ -117,15 +117,6 @@ compact3 = \
 # 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 @@ needs_compact3 = \
   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 @@ compact2_minimal = \
 
 # 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 = \
diff --git a/hotspot/test/compiler/5091921/Test6890943.java b/hotspot/test/compiler/5091921/Test6890943.java
index 6dee78a593cbed7f89df3caf922e072347b16ee5..9752b1d0c2b96130202db7abcbbb3e20dd9f9dd3 100644
--- a/hotspot/test/compiler/5091921/Test6890943.java
+++ b/hotspot/test/compiler/5091921/Test6890943.java
@@ -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();
-  }
-
-  int r, c, f, t;
-  boolean[][] grid;
-
-  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);
+    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();
     }
-  }
-
-  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());
-      }
-
-      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;
+    int r, c, f, t;
+    boolean[][] grid;
 
-          if (fallRight <= f) addToM(calcWalkingRange(digDown+fallRight, end(q)), m.getValue());
+    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+");
+
+        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");
+            }
+        }
+    }
 
-        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);
-              }
+    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());
             }
-          }
-
-          //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 (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 (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);
+                            }
+                        }
+                    }
+
+                    //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);
+                            }
+                        }
+                    }
+                }
             }
-          }
         }
-      }
+
+        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);
+        }
+
+        if (result == Integer.MAX_VALUE) return -1;
+        return result;
     }
 
-    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 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));
     }
 
-    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 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;
     }
-    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;
-
-    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--;
+
+    private boolean stuck(int q) {
+        return start(q) == end(q);
     }
-    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 depth(int q) {
+        return q % 50;
     }
 
-    return left *50*50 + right*50 + depth;
-  }
+    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;
+
+        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;
+    }
 }
diff --git a/hotspot/test/compiler/5091921/Test6890943.sh b/hotspot/test/compiler/5091921/Test6890943.sh
deleted file mode 100644
index 755f56890f1da0669361413b79ba48542bb98bcc..0000000000000000000000000000000000000000
--- a/hotspot/test/compiler/5091921/Test6890943.sh
+++ /dev/null
@@ -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
diff --git a/hotspot/test/compiler/6589834/InlinedArrayCloneTestCase.java b/hotspot/test/compiler/6589834/InlinedArrayCloneTestCase.java
new file mode 100644
index 0000000000000000000000000000000000000000..aadc1056323558382f69342395f592a3893f782a
--- /dev/null
+++ b/hotspot/test/compiler/6589834/InlinedArrayCloneTestCase.java
@@ -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();
+            }
+        }
+    }
+}
diff --git a/hotspot/test/compiler/6589834/Test_ia32.java b/hotspot/test/compiler/6589834/Test_ia32.java
index f9c2f524b263cec18d12f21657dd1b0fda7f3b60..aed3198320d154d509cd4f733055ba7d43725a5d 100644
--- a/hotspot/test/compiler/6589834/Test_ia32.java
+++ b/hotspot/test/compiler/6589834/Test_ia32.java
@@ -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;
-
-public class Test_ia32 {
-
-    public static int NUM_THREADS = 100;
-
-    public static int CLONE_LENGTH = 1000;
+import java.lang.reflect.Method;
 
-    public static void main(String[] args) throws InterruptedException, ClassNotFoundException {
-
-        Reflector[] threads = new Reflector[NUM_THREADS];
-        for (int i = 0; i < threads.length; i++) {
-            threads[i] = new Reflector();
-            threads[i].start();
-        }
+import com.oracle.java.testlibrary.Asserts;
+import sun.hotspot.WhiteBox;
 
-        System.out.println("Give Reflector.run() some time to compile...");
-        Thread.sleep(5000);
+public class Test_ia32 {
+    private static final int NUM_THREADS
+            = Math.min(100, 2 * Runtime.getRuntime().availableProcessors());
+    private static final int CLONE_LENGTH = 1000;
 
-        System.out.println("Load RMISecurityException causing run() deoptimization");
-        ClassLoader.getSystemClassLoader().loadClass("java.rmi.RMISecurityException");
+    private static WhiteBox wb = WhiteBox.getWhiteBox();
 
-        for (Reflector thread : threads)
-            thread.requestStop();
+    private final LoadedClass[] ARRAY = new LoadedClass[Test_ia32.CLONE_LENGTH];
+    private volatile boolean doSpin = true;
+    private volatile boolean testFailed = false;
 
-        for (Reflector thread : threads)
-            try {
-                thread.join();
-            } catch (InterruptedException e) {
-                System.out.println(e);
-            }
+    public boolean continueExecution() {
+        return doSpin;
+    }
 
+    public void stopExecution() {
+        doSpin = false;
     }
 
-}
+    public boolean isTestFailed() {
+        return testFailed;
+    }
 
-class Reflector extends Thread {
+    public void setTestFailed() {
+        this.testFailed = true;
+        stopExecution();
+    }
 
-    volatile boolean _doSpin = true;
+    public LoadedClass[] getArray() {
+        return ARRAY;
+    }
 
-    Test_ia32[] _tests;
+    public void runTest() {
+        Thread[] threads = new Thread[Test_ia32.NUM_THREADS];
+        Method method;
 
-    Reflector() {
-        _tests = new Test_ia32[Test_ia32.CLONE_LENGTH];
-        for (int i = 0; i < _tests.length; i++) {
-            _tests[i] = new Test_ia32();
+        try {
+            method = InlinedArrayCloneTestCase.class.getDeclaredMethod(
+                    "invokeArrayClone", LoadedClass[].class);
+        } catch (NoSuchMethodException e) {
+            throw new Error("Tested method not found", e);
         }
-    }
 
-    static int g(int i1, int i2, Test_ia32[] arr, int i3, int i4) {
+        Asserts.assertTrue(wb.isMethodCompilable(method),
+                "Method " + method.getName() + " should be compilable.");
 
-        if (!(i1==1 && i2==2 && i3==3 && i4==4)) {
-            System.out.println("Bug!");
+        for (int i = 0; i < threads.length; i++) {
+            threads[i] = new Thread(new InlinedArrayCloneTestCase(this));
+            threads[i].start();
         }
 
-        return arr.length;
-    }
-
-    static int f(Test_ia32[] arr) {
-        return g(1, 2, arr.clone(), 3, 4);
-    }
+        /*
+         * Wait until InlinedArrayCloneTestCase::invokeArrayClone is compiled.
+         */
+        while (!wb.isMethodCompiled(method)) {
+            Thread.yield();
+        }
 
-    @Override
-    public void run() {
-        Constructor[] ctrs = null;
-        Class<Test_ia32> klass = Test_ia32.class;
+        /*
+         * Load NotLoadedClass to cause deoptimization of
+         * InlinedArrayCloneTestCase::invokeArrayClone due to invalidated
+         * dependency.
+         */
         try {
-            ctrs = klass.getConstructors();
-        } catch (SecurityException e) {
-            System.out.println(e);
+            Class.forName("NotLoadedClass");
+        } catch (ClassNotFoundException e) {
+            throw new Error("Unable to load class that invalidates "
+                    + "CHA-dependency for method " + method.getName(), e);
         }
 
-        try {
-            while (_doSpin) {
-                if (f(_tests) < 0)
-                    System.out.println("return value usage");
+        stopExecution();
+
+        for (Thread thread : threads) {
+            try {
+                thread.join();
+            } catch (InterruptedException e) {
+                throw new Error("Fail to join thread " + thread, e);
             }
-        } catch (NullPointerException e) {
-            e.printStackTrace();
         }
 
-        System.out.println(this + " - stopped.");
+        Asserts.assertFalse(isTestFailed(), "Test failed.");
     }
 
-    public void requestStop() {
-        System.out.println(this + " - stop requested.");
-        _doSpin = false;
+    public static void main(String[] args) {
+        new Test_ia32().runTest();
     }
+}
+
+class LoadedClass {
+}
 
+@SuppressWarnings("unused")
+class NotLoadedClass extends LoadedClass {
 }
diff --git a/hotspot/test/compiler/8004051/Test8004051.java b/hotspot/test/compiler/8004051/Test8004051.java
index 97073e96b1e8e26ad69a3ff982aa51d3747b8248..981effb2089d55b609dfc6ad79c1ccc5d548984e 100644
--- a/hotspot/test/compiler/8004051/Test8004051.java
+++ b/hotspot/test/compiler/8004051/Test8004051.java
@@ -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 {
diff --git a/hotspot/test/compiler/ciReplay/TestSA.sh b/hotspot/test/compiler/ciReplay/TestSA.sh
index 61d93652f2549391e7658771e438029d151a4625..56736c7807ec72d3b77e1bf4bda6ee83ee0ba926 100644
--- a/hotspot/test/compiler/ciReplay/TestSA.sh
+++ b/hotspot/test/compiler/ciReplay/TestSA.sh
@@ -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
diff --git a/hotspot/test/compiler/ciReplay/TestVM.sh b/hotspot/test/compiler/ciReplay/TestVM.sh
index c972c607947da332ddb551ca3fc3480562b44b3d..e58d63e16faaa44eecdbb20ec8694f01bfd7d904 100644
--- a/hotspot/test/compiler/ciReplay/TestVM.sh
+++ b/hotspot/test/compiler/ciReplay/TestVM.sh
@@ -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
diff --git a/hotspot/test/compiler/ciReplay/TestVM_no_comp_level.sh b/hotspot/test/compiler/ciReplay/TestVM_no_comp_level.sh
index 4d0ee773c44f274f32ebb36526392789dfaf2656..d961d42541dcebcc1bbc2212bad2893134b270b7 100644
--- a/hotspot/test/compiler/ciReplay/TestVM_no_comp_level.sh
+++ b/hotspot/test/compiler/ciReplay/TestVM_no_comp_level.sh
@@ -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
diff --git a/hotspot/test/compiler/ciReplay/common.sh b/hotspot/test/compiler/ciReplay/common.sh
index cf17febc4f71115d79fa1611d1356b85f3c2509f..b7c5b7b4292ca9163ca6ce57bab85c675850e57e 100644
--- a/hotspot/test/compiler/ciReplay/common.sh
+++ b/hotspot/test/compiler/ciReplay/common.sh
@@ -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 @@ generate_replay() {
             -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 @@ generate_replay() {
     # 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}'`
-        dir=`dirname $core_with_dir`
         core_with_pid=`echo $core_locations | awk '{print $2}'`
-        if [ -n ${core_with_pid} ]
+        dir=`dirname $core_with_dir`
+        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
 
diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/BmiIntrinsicBase.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/BmiIntrinsicBase.java
index 0425bafc4a0b6e5e816cb0162e01e1b07406b0fc..49efda1215b5b5306d1cf61952f836d624c5a67b 100644
--- a/hotspot/test/compiler/intrinsics/bmi/verifycode/BmiIntrinsicBase.java
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/BmiIntrinsicBase.java
@@ -146,6 +146,10 @@ public class BmiIntrinsicBase extends CompilerWhiteBoxTest {
         }
 
         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 @@ public class BmiIntrinsicBase extends CompilerWhiteBoxTest {
             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;
+        }
+    }
 }
diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestI.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestI.java
index 0ba76e69bc5b547ef514f6e4d78ed088e71428b0..62c8642833b77c9080ab088d1e67f85ac4828a79 100644
--- a/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestI.java
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestI.java
@@ -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 {
diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestL.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestL.java
index 5ecfb96d6377c568333a44a36582f70e4750b0c3..16caae2b0d91776f59a1c091bf7767cc14f2fa96 100644
--- a/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestL.java
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestL.java
@@ -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 @@ public class LZcntTestL extends LZcntTestI {
     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 {
diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestI.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestI.java
index ad2af2c615a16f587c48db04478f69457f34ca8e..2502641e8dadcb568469d79f5c0a3e2576b8364d 100644
--- a/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestI.java
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestI.java
@@ -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 {
diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestL.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestL.java
index 0a856dfa9e281fb8a4198eabc92aefbc07f2cb88..c08dbcc1fc91e0c0331aa937ba948a3894b376ed 100644
--- a/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestL.java
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestL.java
@@ -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 @@ public class TZcntTestL extends TZcntTestI {
     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 {
diff --git a/hotspot/test/compiler/tiered/NonTieredLevelsTest.java b/hotspot/test/compiler/tiered/NonTieredLevelsTest.java
index 08321b872661c4f41fb82b49d8d79e4eb6b38598..ab975e4bdb78cc4f288f5bfb32ece0126094b6a2 100644
--- a/hotspot/test/compiler/tiered/NonTieredLevelsTest.java
+++ b/hotspot/test/compiler/tiered/NonTieredLevelsTest.java
@@ -25,8 +25,8 @@ import java.util.function.IntPredicate;
 
 /**
  * @test NonTieredLevelsTest
- * @ignore 8046268
  * @library /testlibrary /testlibrary/whitebox /compiler/whitebox
+ * @ignore 8046268
  * @build NonTieredLevelsTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  * @run main/othervm -Xbootclasspath/a:. -XX:-TieredCompilation
diff --git a/hotspot/test/compiler/tiered/TieredLevelsTest.java b/hotspot/test/compiler/tiered/TieredLevelsTest.java
index 4b9a0a4a90689a99e235a8e1a35f749bce5e5301..d862f50e904d691007c8f5d1e32b9aa8e43b1372 100644
--- a/hotspot/test/compiler/tiered/TieredLevelsTest.java
+++ b/hotspot/test/compiler/tiered/TieredLevelsTest.java
@@ -23,8 +23,8 @@
 
 /**
  * @test TieredLevelsTest
- * @ignore 8046268
  * @library /testlibrary /testlibrary/whitebox /compiler/whitebox
+ * @ignore 8046268
  * @build TieredLevelsTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  * @run main/othervm -Xbootclasspath/a:. -XX:+TieredCompilation
diff --git a/hotspot/test/compiler/whitebox/ClearMethodStateTest.java b/hotspot/test/compiler/whitebox/ClearMethodStateTest.java
index 195221658cf44396c02a7f6459c979dc6958edd5..8adbf2075a9aeeb281ce9619128d1b0599e3f2ef 100644
--- a/hotspot/test/compiler/whitebox/ClearMethodStateTest.java
+++ b/hotspot/test/compiler/whitebox/ClearMethodStateTest.java
@@ -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 @@ import java.util.function.Function;
 
 /*
  * @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
diff --git a/hotspot/test/compiler/whitebox/CompilerWhiteBoxTest.java b/hotspot/test/compiler/whitebox/CompilerWhiteBoxTest.java
index 5f3539980616e5a4ba0f646ea04c62549b112b46..ea673d6b862768ebc5178ca07e6d4e4dc1d2983d 100644
--- a/hotspot/test/compiler/whitebox/CompilerWhiteBoxTest.java
+++ b/hotspot/test/compiler/whitebox/CompilerWhiteBoxTest.java
@@ -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 @@ public abstract class CompilerWhiteBoxTest {
      */
     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 @@ public abstract class CompilerWhiteBoxTest {
      * @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;
diff --git a/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java b/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java
index a5b9d794c66f5732209ad040a44b872354945469..1a297ae350e5ad81ac5b169a256a80985c23197b 100644
--- a/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java
+++ b/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java
@@ -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
diff --git a/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java b/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java
index e257a1e5e25c6d8a0ae3a8c755ca7d9b685b69cb..bee232d2cb028aa2c094341b969c3286902e1a6f 100644
--- a/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java
+++ b/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java
@@ -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
diff --git a/hotspot/test/compiler/whitebox/EnqueueMethodForCompilationTest.java b/hotspot/test/compiler/whitebox/EnqueueMethodForCompilationTest.java
index 4acebb2b1233b1e9d5a32680d6cbf13c9f389933..5c6c4f39690d4448b63e4b453ecd23932e1eac06 100644
--- a/hotspot/test/compiler/whitebox/EnqueueMethodForCompilationTest.java
+++ b/hotspot/test/compiler/whitebox/EnqueueMethodForCompilationTest.java
@@ -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
diff --git a/hotspot/test/compiler/whitebox/GetNMethodTest.java b/hotspot/test/compiler/whitebox/GetNMethodTest.java
index 9800f3a3eb3f888f8c9298a36e1938bd7980fd90..14bc76278ddd4a1956959d765e77bdb7e6fa3013 100644
--- a/hotspot/test/compiler/whitebox/GetNMethodTest.java
+++ b/hotspot/test/compiler/whitebox/GetNMethodTest.java
@@ -26,9 +26,9 @@ import sun.hotspot.code.NMethod;
 
 /*
  * @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
diff --git a/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java b/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java
index 604175c38eff597ccb12b80a5311a98f202542aa..651002d078e06c9d390761e7516adbaa814c03a4 100644
--- a/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java
+++ b/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java
@@ -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
diff --git a/hotspot/test/runtime/whitebox/WBStackSize.java b/hotspot/test/runtime/whitebox/WBStackSize.java
index 2a0216082d7169cd0e5f1fc219b0a0fa059c3bf6..ff1a4dcca25090c7531424390f231b7e7189fd7e 100644
--- a/hotspot/test/runtime/whitebox/WBStackSize.java
+++ b/hotspot/test/runtime/whitebox/WBStackSize.java
@@ -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 class WBStackSize {
     }
 
     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);
 
diff --git a/hotspot/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java b/hotspot/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java
index bc38438285eb7d77b98d8ccbc66db7477ddbccca..bb58361ffda3bc7bbf760aeaea8fcdde1b7336f8 100644
--- a/hotspot/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java
+++ b/hotspot/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java
@@ -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 class WhiteBox {
   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);
+  }
 }
diff --git a/hotspot/test/testlibrary_tests/whitebox/vm_flags/VmFlagTest.java b/hotspot/test/testlibrary_tests/whitebox/vm_flags/VmFlagTest.java
index 0818f21f1c083e8e6ab4d19815dbc3c4d28bae74..6c98889e6ae0deee770af56a4865427370f135be 100644
--- a/hotspot/test/testlibrary_tests/whitebox/vm_flags/VmFlagTest.java
+++ b/hotspot/test/testlibrary_tests/whitebox/vm_flags/VmFlagTest.java
@@ -91,16 +91,20 @@ public final class VmFlagTest<T> {
     }
 
     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);
diff --git a/jdk/.hgtags b/jdk/.hgtags
index 0718a4f34ab6c9e46b3b2e28c2499e90776e3b4f..d5928939618e1a5a24f465b33e129ae62fc04312 100644
--- a/jdk/.hgtags
+++ b/jdk/.hgtags
@@ -267,3 +267,4 @@ f87c5be90e01a7ffb47947108eb3e0b0b1920880 jdk9-b20
 85bcf0f99edc08873614afbe5a5563e13ce13c83 jdk9-b22
 9febf9dbc0a4b15323f2dbd29931cfbf086332b4 jdk9-b23
 875450e7ef8dde8f59db662ec1351ea30b8cb35d jdk9-b24
+a31efe49556a7c12f9ea2c9ee8b4fae8aa67723a jdk9-b25
diff --git a/jdk/make/CopyFiles.gmk b/jdk/make/CopyFiles.gmk
index acab25412565f0e92889d1827b76c2f75e0f3b7d..7666fcd2dd5c1f126d37ee67eca9b54a70884143 100644
--- a/jdk/make/CopyFiles.gmk
+++ b/jdk/make/CopyFiles.gmk
@@ -122,7 +122,7 @@ COPY_FILES += $(PSFONTPROPFILE_TARGET_FILES)
 
 ##########################################################################################
 #
-# 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 @@ else
   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
 
diff --git a/jdk/make/CopyIntoClasses.gmk b/jdk/make/CopyIntoClasses.gmk
index fdf2a173acac2688e3e5215fbb9e25515c887dab..a80c661ace904c5e18aadb187a52c13eafe23d97 100644
--- a/jdk/make/CopyIntoClasses.gmk
+++ b/jdk/make/CopyIntoClasses.gmk
@@ -163,6 +163,19 @@ $(foreach R, $(JAVAX_SOUND_RULES), $(eval $(call addto_meta-inf_services, $R)))
 
 ################################################################################
 
+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 \
diff --git a/jdk/make/Setup.gmk b/jdk/make/Setup.gmk
index 485c3b72b13a4d962a7160bf36e8fe8b5245b6b8..c4f204cf6af3566e49cb69d1ae5cbc9766732fc8 100644
--- a/jdk/make/Setup.gmk
+++ b/jdk/make/Setup.gmk
@@ -27,7 +27,7 @@ DISABLE_WARNINGS := -Xlint:all,-deprecation,-unchecked,-rawtypes,-cast,-serial,-
 
 # 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 
diff --git a/jdk/make/data/swingbeaninfo/SwingBeanInfo.template b/jdk/make/data/swingbeaninfo/SwingBeanInfo.template
index 1bfe54530e22235726b9546b9b5bb1a5ce15b5d6..9c1a133f67f0be9cdaea087f9e1c1db29e6c8697 100644
--- a/jdk/make/data/swingbeaninfo/SwingBeanInfo.template
+++ b/jdk/make/data/swingbeaninfo/SwingBeanInfo.template
@@ -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 @@ import sun.swing.BeanInfoUtils;
  */
 
 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
diff --git a/jdk/make/data/swingbeaninfo/javax/swing/SwingBeanInfoBase.java b/jdk/make/data/swingbeaninfo/javax/swing/SwingBeanInfoBase.java
index 08e55122f5fbccf856ee0c6f2a4083227ca0cc54..d6167b448e519b9246654276d51b1ce9a07daed3 100644
--- a/jdk/make/data/swingbeaninfo/javax/swing/SwingBeanInfoBase.java
+++ b/jdk/make/data/swingbeaninfo/javax/swing/SwingBeanInfoBase.java
@@ -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 @@ public class SwingBeanInfoBase extends SimpleBeanInfo
      * 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);
diff --git a/jdk/make/data/swingbeaninfo/sun/swing/BeanInfoUtils.java b/jdk/make/data/swingbeaninfo/sun/swing/BeanInfoUtils.java
index fbcc2995dd5367adaa29a38a7b4d8b1504dcee9c..037615ad63a71ad91bd4a4f5e2121a863f9fc552 100644
--- a/jdk/make/data/swingbeaninfo/sun/swing/BeanInfoUtils.java
+++ b/jdk/make/data/swingbeaninfo/sun/swing/BeanInfoUtils.java
@@ -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 @@ public class BeanInfoUtils
      * @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 @@ public class BeanInfoUtils
                 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 @@ public class BeanInfoUtils
                 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 @@ public class BeanInfoUtils
      * @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 @@ public class BeanInfoUtils
     }
 
     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 @@ public class BeanInfoUtils
 
         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) {
diff --git a/jdk/make/lib/PlatformLibraries.gmk b/jdk/make/lib/PlatformLibraries.gmk
index e3fc71c4bf97dd833833d8e8068c0eaa0cd0692e..3f0a408fab719d5c2274dfaab3ba55c05f8def16 100644
--- a/jdk/make/lib/PlatformLibraries.gmk
+++ b/jdk/make/lib/PlatformLibraries.gmk
@@ -90,8 +90,7 @@ ifeq ($(OPENJDK_TARGET_OS), macosx)
   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, \
diff --git a/jdk/make/mapfiles/libawt/mapfile-mawt-vers b/jdk/make/mapfiles/libawt/mapfile-mawt-vers
index b8ea1636c88c47ad95c01011f43f352dd8892741..06d3ff802e18ca71f2b41594ce8195eba4b8869e 100644
--- a/jdk/make/mapfiles/libawt/mapfile-mawt-vers
+++ b/jdk/make/mapfiles/libawt/mapfile-mawt-vers
@@ -204,6 +204,7 @@ SUNWprivate_1.1 {
                 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;
diff --git a/jdk/make/mapfiles/libawt_headless/mapfile-vers b/jdk/make/mapfiles/libawt_headless/mapfile-vers
index c12d07d80fab00bdd32a4b23e3c108bd54ef8782..df24e4505dbbfac76a2b46e2eb965202b8e57257 100644
--- a/jdk/make/mapfiles/libawt_headless/mapfile-vers
+++ b/jdk/make/mapfiles/libawt_headless/mapfile-vers
@@ -76,6 +76,7 @@ SUNWprivate_1.1 {
 		Java_sun_print_CUPSPrinter_canConnect;
 		Java_sun_print_CUPSPrinter_getMedia;
 		Java_sun_print_CUPSPrinter_getPageSizes;
+		Java_sun_print_CUPSPrinter_getResolutions;
 
 		# libfontmanager entry points
 		AWTIsHeadless;
diff --git a/jdk/make/mapfiles/libawt_xawt/mapfile-vers b/jdk/make/mapfiles/libawt_xawt/mapfile-vers
index 3ae8af3ddbfbf3ac49494d3128ef99c686a88714..4a891077b7607a47207910efee39a30899fcb20a 100644
--- a/jdk/make/mapfiles/libawt_xawt/mapfile-vers
+++ b/jdk/make/mapfiles/libawt_xawt/mapfile-vers
@@ -442,6 +442,7 @@ SUNWprivate_1.1 {
 	Java_sun_print_CUPSPrinter_canConnect;
 	Java_sun_print_CUPSPrinter_getMedia;
 	Java_sun_print_CUPSPrinter_getPageSizes;
+	Java_sun_print_CUPSPrinter_getResolutions;
 
         awt_GetDrawingSurface;
         awt_FreeDrawingSurface;
diff --git a/jdk/make/profile-includes.txt b/jdk/make/profile-includes.txt
index e252ace094a0b91ded18ce747f8ec96dcaaff26d..fe069c37034e841c7bbae4d09ab5a0e110ab3909 100644
--- a/jdk/make/profile-includes.txt
+++ b/jdk/make/profile-includes.txt
@@ -177,7 +177,6 @@ FULL_JRE_LIB_FILES := \
     ext/dnsns.jar \
     ext/nashorn.jar \
     ext/zipfs.jar \
-    flavormap.properties \
     fontconfig.RedHat.5.bfc \
     fontconfig.RedHat.5.properties.src \
     fontconfig.RedHat.6.bfc \
diff --git a/jdk/src/macosx/bundle/JavaAppLauncher/JavaAppLauncher.xcodeproj/project.pbxproj b/jdk/src/macosx/bundle/JavaAppLauncher/JavaAppLauncher.xcodeproj/project.pbxproj
deleted file mode 100644
index b51cbefbd9b3d41b634f6ab29d4b7669a7573979..0000000000000000000000000000000000000000
--- a/jdk/src/macosx/bundle/JavaAppLauncher/JavaAppLauncher.xcodeproj/project.pbxproj
+++ /dev/null
@@ -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 */;
-}
diff --git a/jdk/src/macosx/bundle/JavaAppLauncher/resources/English.lproj/InfoPlist.strings b/jdk/src/macosx/bundle/JavaAppLauncher/resources/English.lproj/InfoPlist.strings
deleted file mode 100644
index 477b28ff8f86a3158a71c4934fbd3a2456717d7a..0000000000000000000000000000000000000000
--- a/jdk/src/macosx/bundle/JavaAppLauncher/resources/English.lproj/InfoPlist.strings
+++ /dev/null
@@ -1,2 +0,0 @@
-/* Localized versions of Info.plist keys */
-
diff --git a/jdk/src/macosx/bundle/JavaAppLauncher/resources/JavaAppLauncher-Info.plist b/jdk/src/macosx/bundle/JavaAppLauncher/resources/JavaAppLauncher-Info.plist
deleted file mode 100644
index a3268bb9f89c5aaf1bb83bce4cda4ce3528bd23d..0000000000000000000000000000000000000000
--- a/jdk/src/macosx/bundle/JavaAppLauncher/resources/JavaAppLauncher-Info.plist
+++ /dev/null
@@ -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>
diff --git a/jdk/src/macosx/bundle/JavaAppLauncher/src/JVMArgs.h b/jdk/src/macosx/bundle/JavaAppLauncher/src/JVMArgs.h
deleted file mode 100644
index cceb88d6e7c83e273a7b964bc1d7261d2f6c3e22..0000000000000000000000000000000000000000
--- a/jdk/src/macosx/bundle/JavaAppLauncher/src/JVMArgs.h
+++ /dev/null
@@ -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
diff --git a/jdk/src/macosx/bundle/JavaAppLauncher/src/JVMArgs.m b/jdk/src/macosx/bundle/JavaAppLauncher/src/JVMArgs.m
deleted file mode 100644
index 1f4af0160808dcc6a5f9fbeab26078140010a034..0000000000000000000000000000000000000000
--- a/jdk/src/macosx/bundle/JavaAppLauncher/src/JVMArgs.m
+++ /dev/null
@@ -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
diff --git a/jdk/src/macosx/bundle/JavaAppLauncher/src/JavaAppLauncher.m b/jdk/src/macosx/bundle/JavaAppLauncher/src/JavaAppLauncher.m
deleted file mode 100644
index db44ab3fee714c56f0cbb4bdbb96f2695ce28cd3..0000000000000000000000000000000000000000
--- a/jdk/src/macosx/bundle/JavaAppLauncher/src/JavaAppLauncher.m
+++ /dev/null
@@ -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
diff --git a/jdk/src/macosx/bundle/JavaAppLauncher/src/main.m b/jdk/src/macosx/bundle/JavaAppLauncher/src/main.m
deleted file mode 100644
index 019e78a7d486c3bc7bdcc9c004e40a58ca10d506..0000000000000000000000000000000000000000
--- a/jdk/src/macosx/bundle/JavaAppLauncher/src/main.m
+++ /dev/null
@@ -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;
-}
diff --git a/jdk/src/macosx/classes/apple/launcher/JavaAppLauncher.java b/jdk/src/macosx/classes/apple/launcher/JavaAppLauncher.java
deleted file mode 100644
index c701b1be63e961e5a39198fe2124d34fd6ea5831..0000000000000000000000000000000000000000
--- a/jdk/src/macosx/classes/apple/launcher/JavaAppLauncher.java
+++ /dev/null
@@ -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);
-        }
-}
diff --git a/jdk/src/macosx/classes/apple/launcher/appLauncherErrors.properties b/jdk/src/macosx/classes/apple/launcher/appLauncherErrors.properties
deleted file mode 100644
index 9f880b7a075f23bb61a485183a4732cc5d7f510f..0000000000000000000000000000000000000000
--- a/jdk/src/macosx/classes/apple/launcher/appLauncherErrors.properties
+++ /dev/null
@@ -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}
diff --git a/jdk/src/macosx/classes/apple/security/KeychainStore.java b/jdk/src/macosx/classes/apple/security/KeychainStore.java
index 8df45d7bea746f3be2ff131469a0368865961b92..8d04ee976f6c11cc9216619b37b743924c7e2673 100644
--- a/jdk/src/macosx/classes/apple/security/KeychainStore.java
+++ b/jdk/src/macosx/classes/apple/security/KeychainStore.java
@@ -74,19 +74,19 @@ public final class KeychainStore extends KeyStoreSpi {
      * 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 @@ public final class KeychainStore extends KeyStoreSpi {
 
             // 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 @@ public final class KeychainStore extends KeyStoreSpi {
      *
      * @return enumeration of the alias names
      */
-    public Enumeration engineAliases() {
+    public Enumeration<String> engineAliases() {
         permissionCheck();
         return entries.keys();
     }
@@ -598,8 +598,8 @@ public final class KeychainStore extends KeyStoreSpi {
         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 @@ public final class KeychainStore extends KeyStoreSpi {
         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 @@ public final class KeychainStore extends KeyStoreSpi {
 
         // 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 @@ public final class KeychainStore extends KeyStoreSpi {
 
         // 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 @@ public final class KeychainStore extends KeyStoreSpi {
 
         // 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 @@ public final class KeychainStore extends KeyStoreSpi {
 
         // 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;
         }
diff --git a/jdk/src/macosx/classes/com/apple/eawt/_AppDockIconHandler.java b/jdk/src/macosx/classes/com/apple/eawt/_AppDockIconHandler.java
index e91efeaa009d6b9de716cf89416754d16bdccf34..76dea3a7ed3dda86e6b2c5d44188e253facb3318 100644
--- a/jdk/src/macosx/classes/com/apple/eawt/_AppDockIconHandler.java
+++ b/jdk/src/macosx/classes/com/apple/eawt/_AppDockIconHandler.java
@@ -95,7 +95,7 @@ class _AppDockIconHandler {
 
     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) {
diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaBorder.java b/jdk/src/macosx/classes/com/apple/laf/AquaBorder.java
index dfb6fddd5ce30b397b11d9467810a752134a8336..e9eda68094c2e72025bdf78456149f90ad7020e6 100644
--- a/jdk/src/macosx/classes/com/apple/laf/AquaBorder.java
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaBorder.java
@@ -75,7 +75,7 @@ public abstract class AquaBorder implements Border, UIResource {
     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) {
diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxButton.java b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxButton.java
index 2867245ee1ee73d83a3a95c19a7207b51f105184..c87bcb78c041e2d6c8503db8ab333803dccaf206 100644
--- a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxButton.java
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxButton.java
@@ -35,8 +35,8 @@ import apple.laf.JRSUIConstants.*;
 
 @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 @@ class AquaComboBoxButton extends JButton {
     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 @@ class AquaComboBoxButton extends JButton {
     }
 
     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);
diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxPopup.java b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxPopup.java
index dde9b1be337d17c2df162a3c118adc0e9ff25e61..0f466e188e6337f6aab68583cd98e98772b2d720 100644
--- a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxPopup.java
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxPopup.java
@@ -43,7 +43,7 @@ class AquaComboBoxPopup extends BasicComboPopup {
     protected Component bottomStrut;
     protected boolean isPopDown = false;
 
-    public AquaComboBoxPopup(final JComboBox cBox) {
+    public AquaComboBoxPopup(final JComboBox<Object> cBox) {
         super(cBox);
     }
 
@@ -93,7 +93,7 @@ class AquaComboBoxPopup extends BasicComboPopup {
         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 @@ class AquaComboBoxPopup extends BasicComboPopup {
 
     @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()) {
diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRenderer.java b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRenderer.java
index 6161eb6447c69e1590beaf92de1785264113dfaa..f4d4225efe0fafd1e6f7aa85b024fd45dbea784f 100644
--- a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRenderer.java
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRenderer.java
@@ -29,8 +29,8 @@ import javax.swing.*;
 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);
     }
 }
diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRendererInternal.java b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRendererInternal.java
index 2ed6dcfcf70117efff6448188e869d96b751b23b..cf1025f6a851804f4830946bd6ae6e5d431d0c54 100644
--- a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRendererInternal.java
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRendererInternal.java
@@ -31,8 +31,8 @@ import javax.swing.*;
 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 @@ class AquaComboBoxRendererInternal extends JLabel implements ListCellRenderer {
     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 @@ class AquaComboBoxRendererInternal extends JLabel implements ListCellRenderer {
     }
 
     // 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) {
diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxUI.java b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxUI.java
index 75c7babb58af8eb033b452b2eb1d6a5b031bc83e..80ca6ff5b49a356ec64fcecfc8a7deaa541cec65 100644
--- a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxUI.java
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxUI.java
@@ -102,13 +102,13 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
                 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 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
         // this space intentionally left blank
     }
 
-    protected ListCellRenderer createRenderer() {
+    protected ListCellRenderer<Object> createRenderer() {
         return new AquaComboBoxRenderer(comboBox);
     }
 
@@ -185,7 +185,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
 
             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 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
                 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 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
         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 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
     @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 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
     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 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
     }
 
     @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 class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
                     }
                 }
             ) {
-                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 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
             };
         }
     };
-    static ClientPropertyApplicator<JComboBox, AquaComboBoxUI> getApplicator() {
+    static ClientPropertyApplicator<JComboBox<?>, AquaComboBoxUI> getApplicator() {
         return APPLICATOR.get();
     }
 }
diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaFileChooserUI.java b/jdk/src/macosx/classes/com/apple/laf/AquaFileChooserUI.java
index 3fae5e20310b87fc31e0dc2ca6a5f81fefc711eb..ebb3b4b6433fa27f16a37c72e7d1ac58c4d9db69 100644
--- a/jdk/src/macosx/classes/com/apple/laf/AquaFileChooserUI.java
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaFileChooserUI.java
@@ -724,6 +724,7 @@ public class AquaFileChooserUI extends FileChooserUI {
             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 @@ public class AquaFileChooserUI extends FileChooserUI {
     }
 
     @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 @@ public class AquaFileChooserUI extends FileChooserUI {
      * 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 @@ public class AquaFileChooserUI extends FileChooserUI {
             return fDirectories.size();
         }
 
-        public Object getElementAt(final int index) {
+        public File getElementAt(final int index) {
             return fDirectories.elementAt(index);
         }
     }
@@ -1257,11 +1261,14 @@ public class AquaFileChooserUI extends FileChooserUI {
     // 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 class AquaFileChooserUI extends FileChooserUI {
         }
 
         public void actionPerformed(final ActionEvent e) {
-            getFileChooser().setFileFilter((FileFilter)filterComboBox.getSelectedItem());
+            getFileChooser().setFileFilter((FileFilter) filterComboBox.getSelectedItem());
         }
     }
 
@@ -1503,7 +1510,7 @@ public class AquaFileChooserUI extends FileChooserUI {
         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 @@ public class AquaFileChooserUI extends FileChooserUI {
         // 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 @@ public class AquaFileChooserUI extends FileChooserUI {
         }
     }
 
-    JComboBox directoryComboBox;
+    JComboBox<File> directoryComboBox;
     DirectoryComboBoxModel fDirectoryComboBoxModel;
     private final Action directoryComboBoxAction = new DirectoryComboBoxAction();
 
@@ -1797,7 +1804,7 @@ public class AquaFileChooserUI extends FileChooserUI {
     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);
diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaFocusHandler.java b/jdk/src/macosx/classes/com/apple/laf/AquaFocusHandler.java
index d5fec4e292c09898823773e08ae08765d8e6ddc7..1438d2c118c75953d28837ba54f17d7ce2a6fafd 100644
--- a/jdk/src/macosx/classes/com/apple/laf/AquaFocusHandler.java
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaFocusHandler.java
@@ -131,7 +131,7 @@ public class AquaFocusHandler implements FocusListener, PropertyChangeListener {
         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 @@ public class AquaFocusHandler implements FocusListener, PropertyChangeListener {
         }
     }
 
-    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));
     }
diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaListUI.java b/jdk/src/macosx/classes/com/apple/laf/AquaListUI.java
index 85d064689126ab7a59b2a252bc02aa9d8ca41cc9..24217af311c0a1a27a902f3b191870de77965500 100644
--- a/jdk/src/macosx/classes/com/apple/laf/AquaListUI.java
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaListUI.java
@@ -79,7 +79,7 @@ public class AquaListUI extends BasicListUI {
          * 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 @@ public class AquaListUI extends BasicListUI {
         }*/
     }
 
-    JList getComponent() {
+    JList<Object> getComponent() {
         return list;
     }
 
@@ -144,7 +144,7 @@ public class AquaListUI extends BasicListUI {
         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);
diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java b/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java
index dd65433283f6fa52357c520a266012868d99c467..8dd4fa60d2d2767c915f32de583fc97de84bc220 100644
--- a/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java
@@ -3820,7 +3820,7 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing
                 _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;
diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaTableHeaderUI.java b/jdk/src/macosx/classes/com/apple/laf/AquaTableHeaderUI.java
index 5d847e98ef2ba0aa4bd6bf43ed9aab3400ce8481..dbc8c8c86ad079baf0cb8305d119fd885189c5a1 100644
--- a/jdk/src/macosx/classes/com/apple/laf/AquaTableHeaderUI.java
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaTableHeaderUI.java
@@ -69,6 +69,7 @@ public class AquaTableHeaderUI extends BasicTableHeaderUI {
 
     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") {
diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaUtilControlSize.java b/jdk/src/macosx/classes/com/apple/laf/AquaUtilControlSize.java
index b64595f4245872bbba554c90bfc6a10ce9066061..17b372af8586fdb2fe311e535aaada806b425a67 100644
--- a/jdk/src/macosx/classes/com/apple/laf/AquaUtilControlSize.java
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaUtilControlSize.java
@@ -121,7 +121,7 @@ public class AquaUtilControlSize {
         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]);
diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaUtils.java b/jdk/src/macosx/classes/com/apple/laf/AquaUtils.java
index 078435b161b60580ce6ab16fc4b40c92938a0330..faa670345c7119ef4c8fad81829e4ada868a4fc2 100644
--- a/jdk/src/macosx/classes/com/apple/laf/AquaUtils.java
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaUtils.java
@@ -82,7 +82,8 @@ final class AquaUtils {
             @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 @@ final class AquaUtils {
                     @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) {
diff --git a/jdk/src/macosx/classes/com/apple/laf/ClientPropertyApplicator.java b/jdk/src/macosx/classes/com/apple/laf/ClientPropertyApplicator.java
index 665c9319cc1eaf557dcae383b07bbdb0886a63b0..908c63c2c3e4587b39d4a1b240a7c10292efae6f 100644
--- a/jdk/src/macosx/classes/com/apple/laf/ClientPropertyApplicator.java
+++ b/jdk/src/macosx/classes/com/apple/laf/ClientPropertyApplicator.java
@@ -33,6 +33,7 @@ import javax.swing.JComponent;
 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);
diff --git a/jdk/src/macosx/classes/com/apple/laf/ScreenMenuBar.java b/jdk/src/macosx/classes/com/apple/laf/ScreenMenuBar.java
index 1735b444ea5a909953b077b567c5551f6d6dd2d4..2d56499ebb30ecf254a59fc9f0b5a94d917462bd 100644
--- a/jdk/src/macosx/classes/com/apple/laf/ScreenMenuBar.java
+++ b/jdk/src/macosx/classes/com/apple/laf/ScreenMenuBar.java
@@ -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 @@ public class ScreenMenuBar extends MenuBar implements ContainerListener, ScreenM
             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 sun.lwawt.macosx.CMenuBar peer = (sun.lwawt.macosx.CMenuBar)getPeer();
-                if (peer == null) return m;
+            final Vector<Menu> menus = AWTAccessor.getMenuBarAccessor().getMenus(this);
+            menus.insertElementAt(m, index);
+            AWTAccessor.getMenuComponentAccessor().setParent(m, this);
 
-                        peer.setNextInsertionIndex(index);
-                        if (m.getPeer() == null) {
-                            m.addNotify();
-                        }
+            final CMenuBar peer = (CMenuBar)getPeer();
+            if (peer == null) return m;
 
-                        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;
         }
     }
diff --git a/jdk/src/macosx/lib/flavormap.properties b/jdk/src/macosx/classes/sun/awt/datatransfer/flavormap.properties
similarity index 86%
rename from jdk/src/macosx/lib/flavormap.properties
rename to jdk/src/macosx/classes/sun/awt/datatransfer/flavormap.properties
index 8f17d95fa2071c5f56ee3caa596a41b72e4f0f11..b50c523279e6afdfae5e74fc4f780ecd7537aef4 100644
--- a/jdk/src/macosx/lib/flavormap.properties
+++ b/jdk/src/macosx/classes/sun/awt/datatransfer/flavormap.properties
@@ -2,19 +2,12 @@
 # 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
+# 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>=<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
@@ -23,9 +16,9 @@
 # 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.
+# 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
@@ -79,5 +72,5 @@ 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
+URL=application/x-java-url;class=java.net.URL,\
+    text/uri-list;eoln="\r\n";terminators=1
diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java
index 67570c18a6f7b2e8002c5a3850270f96eee73fbc..c6c75bc82c6758351796be82e357daeb602f4683 100644
--- a/jdk/src/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java
@@ -88,7 +88,7 @@ public final class CDragSourceContextPeer extends SunDragSourceContextPeer {
         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 @@ public final class CDragSourceContextPeer extends SunDragSourceContextPeer {
         }
     }
 
-    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 @@ public final class CDragSourceContextPeer extends SunDragSourceContextPeer {
     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);
 
diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethod.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethod.java
index eef5284175b823d66f9e789051ed42dfe617e3f4..077b156d8063ea358df4eb8eb244d77457524184 100644
--- a/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethod.java
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethod.java
@@ -44,13 +44,14 @@ import sun.lwawt.*;
 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 class CInputMethod extends InputMethodAdapter {
     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 @@ public class CInputMethod extends InputMethodAdapter {
      * 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 @@ public class CInputMethod extends InputMethodAdapter {
     /**
         * @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 @@ public class CInputMethod extends InputMethodAdapter {
 
     // 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 @@ public class CInputMethod extends InputMethodAdapter {
     // 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();
diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethodDescriptor.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethodDescriptor.java
index d922d029b3320af478584083abf6e47fd05c8b22..3deba1e33f9b23fc2d3f8b60107545309c5e8c64 100644
--- a/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethodDescriptor.java
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethodDescriptor.java
@@ -57,7 +57,7 @@ public class CInputMethodDescriptor implements InputMethodDescriptor {
     }
 
     static Object[] getAvailableLocalesInternal() {
-        List workList = nativeGetAvailableLocales();
+        List<?> workList = nativeGetAvailableLocales();
 
         if (workList != null) {
             return workList.toArray();
@@ -119,5 +119,5 @@ public class CInputMethodDescriptor implements InputMethodDescriptor {
     }
 
     private static native void nativeInit();
-    private static native List nativeGetAvailableLocales();
+    private static native List<?> nativeGetAvailableLocales();
 }
diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
index 534cf0dd74413344e7a408c74ea751d337d1734a..5af2cdfe1d06ee210c7c40f0c1c231a2cb297c29 100644
--- a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
@@ -151,7 +151,7 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
         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()));
diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java b/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java
index edbebbacb67cc2881c3cd820b642b0c2c3845ffa..768086220c3b2e1a6c59d636e29805d3b0f49ca0 100644
--- a/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java
@@ -32,6 +32,7 @@ import java.awt.dnd.peer.DragSourceContextPeer;
 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 @@ public final class LWCToolkit extends LWToolkit {
             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 @@ public final class LWCToolkit extends LWToolkit {
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     public <T extends DragGestureRecognizer> T createDragGestureRecognizer(
             Class<T> abstractRecognizerClass, DragSource ds, Component c,
             int srcActions, DragGestureListener dgl) {
@@ -743,7 +745,7 @@ public final class LWCToolkit extends LWToolkit {
      * @since 1.3
      */
     @Override
-    public Map mapInputMethodHighlight(InputMethodHighlight highlight) {
+    public Map<TextAttribute, ?> mapInputMethodHighlight(InputMethodHighlight highlight) {
         return CInputMethod.mapInputMethodHighlight(highlight);
     }
 
@@ -906,6 +908,9 @@ public final class LWCToolkit extends LWToolkit {
     }
 
     private static boolean isValidPath(String path) {
-        return !path.isEmpty() && !path.endsWith("/") && !path.endsWith(".");
+        return path != null &&
+                !path.isEmpty() &&
+                !path.endsWith("/") &&
+                !path.endsWith(".");
     }
 }
diff --git a/jdk/src/macosx/native/apple/launcher/JavaAppLauncher.m b/jdk/src/macosx/native/apple/launcher/JavaAppLauncher.m
deleted file mode 100644
index 11f98dbdde7269823e2701dd16556c3d27b53105..0000000000000000000000000000000000000000
--- a/jdk/src/macosx/native/apple/launcher/JavaAppLauncher.m
+++ /dev/null
@@ -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);
-}
diff --git a/jdk/src/macosx/native/sun/awt/splashscreen/splashscreen_sys.m b/jdk/src/macosx/native/sun/awt/splashscreen/splashscreen_sys.m
index affb6577d64bd74e4963105c9ca2d05990dd1dea..25b00545a74e1e23e7d72497a6979ddc8da0ad60 100644
--- a/jdk/src/macosx/native/sun/awt/splashscreen/splashscreen_sys.m
+++ b/jdk/src/macosx/native/sun/awt/splashscreen/splashscreen_sys.m
@@ -45,6 +45,7 @@
 #include <dlfcn.h>
 
 #include <sizecalc.h>
+#import "ThreadUtilities.h"
 
 static NSScreen* SplashNSScreen()
 {
@@ -130,8 +131,12 @@ char* SplashGetScaledImageName(const char* jar, const char* file,
     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];
diff --git a/jdk/src/share/bin/java.c b/jdk/src/share/bin/java.c
index df1f832cef822735468622863962b448b9df0cfd..c71f4c26fab35297575b037ecaf02a8e69022fa4 100644
--- a/jdk/src/share/bin/java.c
+++ b/jdk/src/share/bin/java.c
@@ -98,6 +98,7 @@ static int numOptions, maxOptions;
  */
 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 @@ JLI_Launch(int argc, char ** argv,              /* main argc, argc */
                                jvmpath, sizeof(jvmpath),
                                jvmcfg,  sizeof(jvmcfg));
 
+    if (!IsJavaArgs()) {
+        SetJvmEnvironment(argc,argv);
+    }
+
     ifn.CreateJavaVM = 0;
     ifn.GetDefaultJavaVMInitArgs = 0;
 
@@ -640,6 +645,67 @@ CheckJvmType(int *pargc, char ***argv, jboolean speculative) {
     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) {
diff --git a/jdk/src/share/bin/jli_util.h b/jdk/src/share/bin/jli_util.h
index d3c9f0ff8f25e2d8cd5393420d763c9aff012b66..579972278b3b7fecc356a2d77529839ac30fef71 100644
--- a/jdk/src/share/bin/jli_util.h
+++ b/jdk/src/share/bin/jli_util.h
@@ -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 @@ int     JLI_GetStdArgc();
 #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
diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPMetadata.java b/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPMetadata.java
index 03d649907e2c049ecfdf3a6bbcd87d314e98432b..c22415b75757cffe2f66117d1139a0e12762216a 100644
--- a/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPMetadata.java
+++ b/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPMetadata.java
@@ -126,18 +126,18 @@ public class BMPMetadata extends IIOMetadata implements BMPConstants {
             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 @@ public class BMPMetadata extends IIOMetadata implements BMPConstants {
 
         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
diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadata.java b/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadata.java
index 51f1234d74d2a5a89d5bfbb80876bf1e1296cada..f25863955ecb2e82984a52640911edd2df2b80ce 100644
--- a/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadata.java
+++ b/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadata.java
@@ -2323,7 +2323,7 @@ public class JPEGMetadata extends IIOMetadata implements Cloneable {
                 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);
                     }
diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java b/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java
index 3b2a081d860501e9fc4f9cc7a493b8063baf93d3..d3f489b7ee2cd6e6ae8236c650f2c131144b35ab 100644
--- a/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java
+++ b/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java
@@ -639,7 +639,7 @@ public class PNGImageReader extends ImageReader {
         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);
diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGMetadata.java b/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGMetadata.java
index 11018ec401515520c4843c365a81615fdcbfd66f..f02dd4391f0af607532f824443a22233e423ad27 100644
--- a/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGMetadata.java
+++ b/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGMetadata.java
@@ -1254,8 +1254,11 @@ public class PNGMetadata extends IIOMetadata implements Cloneable {
             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 @@ public class PNGMetadata extends IIOMetadata implements Cloneable {
                     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);
diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/wbmp/WBMPMetadata.java b/jdk/src/share/classes/com/sun/imageio/plugins/wbmp/WBMPMetadata.java
index c28046f0b5836196b718c608bacd420828094047..28ad467eadd9a16296c4ad7a11de632fb5457f39 100644
--- a/jdk/src/share/classes/com/sun/imageio/plugins/wbmp/WBMPMetadata.java
+++ b/jdk/src/share/classes/com/sun/imageio/plugins/wbmp/WBMPMetadata.java
@@ -75,9 +75,9 @@ public class WBMPMetadata extends IIOMetadata {
         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;
     }
diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java
index b35e60d7ec69f401b72a31e1b7db1754b8a6959e..cfdd8672303769c8d9351ceec9d1e0f7b071edb2 100644
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java
@@ -812,12 +812,12 @@ public class GTKLookAndFeel extends SynthLookAndFeel {
 
             "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),
 
diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java
index 116fe475be32ae8b5ddca4c046a6e9fb12f60372..79ebfbc8cffdef033c08c0ce273d485f58aa1941 100644
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java
@@ -567,7 +567,7 @@ public class MotifLookAndFeel extends BasicLookAndFeel
             "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 @@ public class MotifLookAndFeel extends BasicLookAndFeel
                  "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 @@ public class MotifLookAndFeel extends BasicLookAndFeel
                  }),
 
             "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 @@ public class MotifLookAndFeel extends BasicLookAndFeel
             "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 @@ public class MotifLookAndFeel extends BasicLookAndFeel
             "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",
diff --git a/jdk/src/share/classes/com/sun/jndi/cosnaming/CNCtx.java b/jdk/src/share/classes/com/sun/jndi/cosnaming/CNCtx.java
index 800c0a536434030508d1215b1c48cb5d4eb7bb01..6a4d3dea7da3ad1c92f3012251d927c2892b0bd7 100644
--- a/jdk/src/share/classes/com/sun/jndi/cosnaming/CNCtx.java
+++ b/jdk/src/share/classes/com/sun/jndi/cosnaming/CNCtx.java
@@ -1145,7 +1145,7 @@ public class CNCtx implements javax.naming.Context {
 
         // 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() {
diff --git a/jdk/src/share/classes/com/sun/jndi/dns/DnsClient.java b/jdk/src/share/classes/com/sun/jndi/dns/DnsClient.java
index 18654c87808b4be8f46cc8b49e4cf2d1b6d79b68..db1f907182a5b7f61b7f36a4281e0ee17a9878fd 100644
--- a/jdk/src/share/classes/com/sun/jndi/dns/DnsClient.java
+++ b/jdk/src/share/classes/com/sun/jndi/dns/DnsClient.java
@@ -376,7 +376,7 @@ public class DnsClient {
 
 
     /**
-     * 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'.
diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java b/jdk/src/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java
index 241105bf1cebadac005b9087b833a65efadb713f..be3315674fa23a5ffbd714bf28c909e5e1263025 100644
--- a/jdk/src/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java
@@ -137,7 +137,7 @@ abstract class AbstractLdapNamingEnumeration<T extends NameClassPair>
         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) &&
diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/ClientId.java b/jdk/src/share/classes/com/sun/jndi/ldap/ClientId.java
index 5095823dc238144070a88d0921ed9ffc8a70b81d..aa535a2b9956ef527d764891b45e8265d20e7fdc 100644
--- a/jdk/src/share/classes/com/sun/jndi/ldap/ClientId.java
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/ClientId.java
@@ -196,7 +196,7 @@ class ClientId {
                 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) {
diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/EventQueue.java b/jdk/src/share/classes/com/sun/jndi/ldap/EventQueue.java
index db335f7acc9428ad4b557a27ca92c9b4f8f0ea76..85bc38076f5395d8ef311fcfc5996b2020388c0b 100644
--- a/jdk/src/share/classes/com/sun/jndi/ldap/EventQueue.java
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/EventQueue.java
@@ -75,7 +75,7 @@ final class EventQueue implements Runnable {
      * 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 @@ final class EventQueue implements Runnable {
                     // 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));
diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/EventSupport.java b/jdk/src/share/classes/com/sun/jndi/ldap/EventSupport.java
index a9d45a23c17386d64550ae36b692b0e551dd2e37..86006ff714b9509c458aa66a33784d3bf01b2d83 100644
--- a/jdk/src/share/classes/com/sun/jndi/ldap/EventSupport.java
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/EventSupport.java
@@ -83,7 +83,7 @@ import javax.naming.ldap.UnsolicitedNotification;
  *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.
diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/LdapAttribute.java b/jdk/src/share/classes/com/sun/jndi/ldap/LdapAttribute.java
index 50f6ac69f5f75aa05eb7111d1ce684d5977839d3..36c7dad461194bae139761316734f8a7c14e0da4 100644
--- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapAttribute.java
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapAttribute.java
@@ -34,7 +34,7 @@ import javax.naming.directory.*;
 /**
   * 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 @@ final class LdapAttribute extends BasicAttribute {
         // 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();
     }
 
diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtx.java b/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtx.java
index e5821adea6e259d10bbfdddc123d9b732d9fca21..c163dce796a854237fb038b3027c92a58fdd610a 100644
--- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtx.java
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtx.java
@@ -1651,7 +1651,7 @@ final public class LdapCtx extends ComponentDirContext
      *
      * 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 @@ final public class LdapCtx extends ComponentDirContext
      *    - 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 @@ final public class LdapCtx extends ComponentDirContext
             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 @@ final public class LdapCtx extends ComponentDirContext
     }
 
     /**
-     * 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) {
diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/LdapName.java b/jdk/src/share/classes/com/sun/jndi/ldap/LdapName.java
index d29e408cdec10d3027a4a8651a0de0dceee9ef8e..b3f76d9ab0b81aba8ba0afdeef01a80961d9fb3b 100644
--- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapName.java
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapName.java
@@ -346,8 +346,8 @@ public final class LdapName implements Name {
     }
 
     /**
-     * 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 @@ public final class LdapName implements Name {
         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 @@ public final class LdapName implements Name {
         }
 
         /*
-         * 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.
diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/LdapReferralContext.java b/jdk/src/share/classes/com/sun/jndi/ldap/LdapReferralContext.java
index 0a09e0fda690a3e3388bb3faf39f098821053401..b810187c649938ea66da89388f3910a9d0d272b2 100644
--- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapReferralContext.java
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapReferralContext.java
@@ -679,7 +679,7 @@ final class LdapReferralContext implements DirContext, LdapContext {
 
         } 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 @@ final class LdapReferralContext implements DirContext, LdapContext {
 
     /*
      * 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;
diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/LdapRequest.java b/jdk/src/share/classes/com/sun/jndi/ldap/LdapRequest.java
index 23347ac5dc89cfc74e07e15696b01eff6a9aa7ae..6e7e3e6544b54cc563575f3e87c6530c998fed0c 100644
--- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapRequest.java
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapRequest.java
@@ -62,7 +62,7 @@ final class LdapRequest {
         cancelled = true;
 
         // Unblock reader of pending request
-        // Should only ever have atmost one waiter
+        // Should only ever have at most one waiter
         notify();
     }
 
diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/LdapSchemaParser.java b/jdk/src/share/classes/com/sun/jndi/ldap/LdapSchemaParser.java
index 7fddd7799f51db29b779e434eb2bddc9b7ed8938..ae3d2bd4881b7dfea2c8ff84e5d12f00da23b051 100644
--- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapSchemaParser.java
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapSchemaParser.java
@@ -84,7 +84,7 @@ final class LdapSchemaParser {
     // 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 @@ final class LdapSchemaParser {
         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 @@ final class LdapSchemaParser {
         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 @@ final class LdapSchemaParser {
             count++;
         }
 
-        attr = attrs.get(AUXILARY_ID);
+        attr = attrs.get(AUXILIARY_ID);
         if (attr != null) {
             objectDesc.append(writeBoolean(attr));
             count++;
@@ -856,7 +856,7 @@ final class LdapSchemaParser {
                     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;
diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/LdapSearchEnumeration.java b/jdk/src/share/classes/com/sun/jndi/ldap/LdapSearchEnumeration.java
index 329b1d249af1d443cea4d1cc625cc9c058665a1b..4af58a8b0ddabc1c682e3c49acee6a2dcacc4720 100644
--- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapSearchEnumeration.java
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapSearchEnumeration.java
@@ -156,7 +156,7 @@ final class LdapSearchEnumeration
             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 @@ final class LdapSearchEnumeration
         // 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) {
diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/LdapURL.java b/jdk/src/share/classes/com/sun/jndi/ldap/LdapURL.java
index ada02f6f3bcc4281ceaa291e41e5bbe520641535..40b2b56cf42e26c1733f192e167026d4be96044a 100644
--- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapURL.java
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapURL.java
@@ -162,7 +162,7 @@ final public class LdapURL extends Uri {
     }
 
     /**
-     * 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);
diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/ServiceLocator.java b/jdk/src/share/classes/com/sun/jndi/ldap/ServiceLocator.java
index 05df1bbd6b72b8c2278297944507a70f378a0ffe..a7bf61d949456a0bf98c3d4879bf9ab7b5daec16 100644
--- a/jdk/src/share/classes/com/sun/jndi/ldap/ServiceLocator.java
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/ServiceLocator.java
@@ -62,7 +62,7 @@ class ServiceLocator {
      *
      * @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) {
diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper.java b/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper.java
index 0a696bd4ff2070fc997e9d9b19aeb460e7852614..17e7bc137790575d88f0c4fda558478a50199197 100644
--- a/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper.java
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper.java
@@ -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;
+
+public final class VersionHelper {
 
-abstract 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;
+
+    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);
+    }
 
-    VersionHelper() {} // Disallow anyone from creating one of these.
+    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);
 }
diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper12.java b/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper12.java
deleted file mode 100644
index 468273ede97d3ab85306aed91d3c920e161d27eb..0000000000000000000000000000000000000000
--- a/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper12.java
+++ /dev/null
@@ -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);
-                    }
-                }
-        );
-    }
-}
diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/pool/Connections.java b/jdk/src/share/classes/com/sun/jndi/ldap/pool/Connections.java
index 2df13459570572432f48122548216f57a2be74b3..0e3e1094d67609d48b3cec55da0c2d9a61ebb8be 100644
--- a/jdk/src/share/classes/com/sun/jndi/ldap/pool/Connections.java
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/pool/Connections.java
@@ -254,7 +254,7 @@ final class Connections implements PoolCallback {
     /**
      * 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
diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/pool/Pool.java b/jdk/src/share/classes/com/sun/jndi/ldap/pool/Pool.java
index f9786cad2137533f1c63e59caad4f50266259e7e..723f11a8783f5a6e15dfb3520ffadd4141b32402 100644
--- a/jdk/src/share/classes/com/sun/jndi/ldap/pool/Pool.java
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/pool/Pool.java
@@ -68,8 +68,8 @@ import javax.naming.NamingException;
  * 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
diff --git a/jdk/src/share/classes/com/sun/jndi/toolkit/corba/CorbaUtils.java b/jdk/src/share/classes/com/sun/jndi/toolkit/corba/CorbaUtils.java
index 8009b67aa2c977a002c190cfb02b9e6be3b302a9..3802f5f106ceff80d1384b5be9564ab040d9c0b7 100644
--- a/jdk/src/share/classes/com/sun/jndi/toolkit/corba/CorbaUtils.java
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/corba/CorbaUtils.java
@@ -165,6 +165,7 @@ public class CorbaUtils {
 
         // 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
diff --git a/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/AtomicContext.java b/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/AtomicContext.java
index f8f41d598f9c2ea49a066142e44ec412f2b1a557..606f38005cfa41a130620cabf582aa4896c7eb58 100644
--- a/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/AtomicContext.java
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/AtomicContext.java
@@ -96,7 +96,7 @@ public abstract class AtomicContext extends ComponentContext {
       * 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 @@ public abstract class AtomicContext extends ComponentContext {
                 resolve_to_nns_and_continue(name, cont);
                 return null;
             } else {
-                // use COmponentContext
+                // use ComponentContext
                 return super.c_getNameParser_nns(name, cont);
             }
         }
diff --git a/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/ComponentContext.java b/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/ComponentContext.java
index 351d6d7d0f738b978396054ef569cd5e0b85dc57..24e65fa104ad0b2a3287a8a0139f40f00b38194e 100644
--- a/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/ComponentContext.java
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/ComponentContext.java
@@ -137,7 +137,7 @@ public abstract class ComponentContext extends PartialCompositeContext {
       * 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.
diff --git a/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/Continuation.java b/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/Continuation.java
index 6c09f935f97eb929525382b299f5700e013a7745..44bc245bad4be9011f0b1ff9e5a0b144a1ac18c7 100644
--- a/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/Continuation.java
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/Continuation.java
@@ -172,7 +172,7 @@ public class Continuation extends ResolveResult {
      *
      * 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 @@ public class Continuation extends ResolveResult {
      *
      * 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.
diff --git a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/ContextEnumerator.java b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/ContextEnumerator.java
index cafd047b144f807c248e0bafbd7f1b5880ee5a89..176e3392b02b3dea95bf05d4bc70a2dd3c3db7db 100644
--- a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/ContextEnumerator.java
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/ContextEnumerator.java
@@ -182,14 +182,14 @@ public class ContextEnumerator implements NamingEnumeration<Binding> {
 
         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 @@ public class ContextEnumerator implements NamingEnumeration<Binding> {
         } 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();
diff --git a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/HierMemDirCtx.java b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/HierMemDirCtx.java
index e10ee2aec4156d72162daeea1ae97d19b5f2fafe..35895db239555eac399f10c5dd22725037e9ebe0 100644
--- a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/HierMemDirCtx.java
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/HierMemDirCtx.java
@@ -881,8 +881,8 @@ public class HierMemDirCtx implements DirContext {
     }
 }
 
-    // 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.
 
diff --git a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/LazySearchEnumerationImpl.java b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/LazySearchEnumerationImpl.java
index b6efbedfa4b242e1f730ded117aba65a95ebb440..8871e0f051ca966883445b3732a304d5928fab4b 100644
--- a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/LazySearchEnumerationImpl.java
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/LazySearchEnumerationImpl.java
@@ -152,7 +152,7 @@ final public class LazySearchEnumerationImpl
                         } 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);
diff --git a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/SearchFilter.java b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/SearchFilter.java
index cf23c3dd2e455c54a6da556978645551b3d4a5eb..695238309f325fcceecb1342b91b4c1b47ce3862 100644
--- a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/SearchFilter.java
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/SearchFilter.java
@@ -256,7 +256,7 @@ public class SearchFilter implements AttrFilter {
     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 @@ public class SearchFilter implements AttrFilter {
                     }
                     break;
                 default:
-                    if (debug) {System.out.println("AtomicFilter: unkown " +
+                    if (debug) {System.out.println("AtomicFilter: unknown " +
                                                    "matchType");}
                 }
             }
@@ -434,7 +434,7 @@ public class SearchFilter implements AttrFilter {
 
 
     /**
-      * 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) {
diff --git a/jdk/src/share/classes/com/sun/jndi/toolkit/url/GenericURLContext.java b/jdk/src/share/classes/com/sun/jndi/toolkit/url/GenericURLContext.java
index cb5255d0a7b9fb8d122c45adb86ee66b52add665..8493330135b64d832efc11f49a74e18fe3662225 100644
--- a/jdk/src/share/classes/com/sun/jndi/toolkit/url/GenericURLContext.java
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/url/GenericURLContext.java
@@ -168,7 +168,7 @@ abstract public class GenericURLContext implements Context {
             }
         }
 
-        // else 0 or 1 iniitial slashes; start is unchanged
+        // else 0 or 1 initial slashes; start is unchanged
         return url.substring(0, start);
     }
 
diff --git a/jdk/src/share/classes/com/sun/jndi/url/ldap/ldapURLContext.java b/jdk/src/share/classes/com/sun/jndi/url/ldap/ldapURLContext.java
index 6143363284a7874e1f677ba1c696ed8efbb89f71..af88b606e218c1979db12abb2d3a61c83ad3845a 100644
--- a/jdk/src/share/classes/com/sun/jndi/url/ldap/ldapURLContext.java
+++ b/jdk/src/share/classes/com/sun/jndi/url/ldap/ldapURLContext.java
@@ -562,7 +562,7 @@ final public class ldapURLContext
     }
 
     // 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 {
 
diff --git a/jdk/src/share/classes/com/sun/management/GcInfo.java b/jdk/src/share/classes/com/sun/management/GcInfo.java
index 0a7eda76a517913c422b15f232c335df5f33bf06..7257b6c6f626c89589d4c7ac55850a8e284ade3d 100644
--- a/jdk/src/share/classes/com/sun/management/GcInfo.java
+++ b/jdk/src/share/classes/com/sun/management/GcInfo.java
@@ -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 @@ public class GcInfo implements CompositeData, CompositeDataView {
         return cdata.toString();
     }
 
-    public Collection values() {
+    public Collection<?> values() {
         return cdata.values();
     }
 
diff --git a/jdk/src/share/classes/com/sun/naming/internal/ResourceManager.java b/jdk/src/share/classes/com/sun/naming/internal/ResourceManager.java
index a735b4342ee3349fd3cc08adaa72d9350c528e4b..09be7ca7cd124405cc5447d2cb3567173e5ab231 100644
--- a/jdk/src/share/classes/com/sun/naming/internal/ResourceManager.java
+++ b/jdk/src/share/classes/com/sun/naming/internal/ResourceManager.java
@@ -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 @@ package com.sun.naming.internal;
 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 @@ public final class ResourceManager {
     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 final class ResourceManager {
 
     // ---------- 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 @@ public final class ResourceManager {
      *          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 @@ public final class ResourceManager {
         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 @@ public final class ResourceManager {
     /**
       * 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 @@ public final class ResourceManager {
      * 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
diff --git a/jdk/src/share/classes/com/sun/naming/internal/VersionHelper.java b/jdk/src/share/classes/com/sun/naming/internal/VersionHelper.java
index 63590be93aa8d776e793efcd213dfb826b47e18a..2a9db220af0fe138cd10a46382821c00a53d3173 100644
--- a/jdk/src/share/classes/com/sun/naming/internal/VersionHelper.java
+++ b/jdk/src/share/classes/com/sun/naming/internal/VersionHelper.java
@@ -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 java.io.InputStream;
+import javax.naming.NamingEnumeration;
+import java.io.File;
+import java.io.FileInputStream;
 import java.io.IOException;
+import java.io.InputStream;
 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 @@ import javax.naming.NamingEnumeration;
  * @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 abstract class VersionHelper {
     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 {
 
-    abstract Class<?> loadClass(String className, ClassLoader cl)
-        throws ClassNotFoundException;
+        ClassLoader parent = getContextClassLoader();
+        ClassLoader cl =
+                URLClassLoader.newInstance(getUrlArray(codebase), parent);
 
-    public abstract Class<?> loadClass(String className, String codebase)
-        throws ClassNotFoundException, MalformedURLException;
+        return loadClass(className, cl);
+    }
+
+    /**
+     * 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 @@ public abstract class VersionHelper {
      * 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 @@ public abstract class VersionHelper {
      *
      * @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 @@ public abstract class VersionHelper {
      * 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() {
+
+        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);
+    }
 
-    static protected URL[] getUrlArray(String codebase)
-        throws MalformedURLException {
+    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 @@ public abstract class VersionHelper {
         }
         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() {
+        }
+    }
 }
diff --git a/jdk/src/share/classes/com/sun/naming/internal/VersionHelper12.java b/jdk/src/share/classes/com/sun/naming/internal/VersionHelper12.java
deleted file mode 100644
index bf4586e7ebcf474e8fd4cd21a8e2d868eda6197e..0000000000000000000000000000000000000000
--- a/jdk/src/share/classes/com/sun/naming/internal/VersionHelper12.java
+++ /dev/null
@@ -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() {
-        }
-    }
-}
diff --git a/jdk/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParser.java b/jdk/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParser.java
index 5f0c12086d63b7a86069c41de06c40f3470443d6..4005adc4262c0680cc9f438f87ee006bb3d65d6d 100644
--- a/jdk/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParser.java
+++ b/jdk/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParser.java
@@ -33,18 +33,18 @@ import java.util.ArrayList;
 
 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 @@ public class ExpressionParser implements ExpressionParserConstants {
   }
 
   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 @@ public class ExpressionParser implements ExpressionParserConstants {
     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 @@ public class ExpressionParser implements ExpressionParserConstants {
     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 @@ public class ExpressionParser implements ExpressionParserConstants {
   }
 
   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();
diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaClass.java b/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaClass.java
index e7a59b3a4d678c5f4fa145baf1c416e17dbac313..3ad56be2d2c53e3129439e8bc79a92d5b4771804 100644
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaClass.java
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaClass.java
@@ -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 @@ public class JavaClass extends JavaHeapObject {
         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));
diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaHeapObject.java b/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaHeapObject.java
index 508e0c0d4a39f1e7976242ba1ae7eb5b714d23e0..471a77b595be22cb4fbd553abcf31357afd0c3ed 100644
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaHeapObject.java
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaHeapObject.java
@@ -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 @@ public abstract class JavaHeapObject extends JavaThing {
      *
      * @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 @@ public abstract class JavaHeapObject extends JavaThing {
                 return referers != null && num < referers.length;
             }
 
-            public Object nextElement() {
+            public JavaThing nextElement() {
                 return referers[num++];
             }
         };
diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/model/ReachableExcludesImpl.java b/jdk/src/share/classes/com/sun/tools/hat/internal/model/ReachableExcludesImpl.java
index 46978cfaf906b98a044c0d92fd4199f9c8e854da..c20d54b7392424c7b35a5be0b7a8c4d71d72b01c 100644
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/ReachableExcludesImpl.java
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/ReachableExcludesImpl.java
@@ -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 @@ public class ReachableExcludesImpl implements ReachableExcludes {
 
     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
diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/model/ReachableObjects.java b/jdk/src/share/classes/com/sun/tools/hat/internal/model/ReachableObjects.java
index 831e82458738b052e0f37c31d1094c81cbfabe10..43f4c03aa91b22f8e1c441666dc1c10711b567ef 100644
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/ReachableObjects.java
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/ReachableObjects.java
@@ -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 @@ public class ReachableObjects {
         // 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 @@ public class ReachableObjects {
         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];
diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/model/Snapshot.java b/jdk/src/share/classes/com/sun/tools/hat/internal/model/Snapshot.java
index 9c00ce05e1845a771fb8304b3012b1406c6b70da..77613c08e413bfb8e3bcacfcdc3c891b1ca7d575 100644
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/Snapshot.java
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/Snapshot.java
@@ -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 @@ public class Snapshot {
                  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 @@ public class Snapshot {
     /**
      * 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 @@ public class Snapshot {
         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 @@ public class Snapshot {
                 finalizables.add(referent);
             }
         }
-        finalizablesCache = new SoftReference<Vector>(finalizables);
+        finalizablesCache = new SoftReference<Vector<?>>(finalizables);
         return finalizables.elements();
     }
 
@@ -455,7 +455,7 @@ public class Snapshot {
                 // 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)) {
diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/oql/OQLEngine.java b/jdk/src/share/classes/com/sun/tools/hat/internal/oql/OQLEngine.java
index c69335d979898e524d00f7a3fa240009726b7f46..c393b445ec6e2a974c781123d56dab3cb74b4b54 100644
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/oql/OQLEngine.java
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/oql/OQLEngine.java
@@ -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 @@ public class OQLEngine {
 
             // 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 @@ public class OQLEngine {
             }
 
             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 @@ public class OQLEngine {
 
             // 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 @@ public class OQLEngine {
             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[] {
diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/AllClassesQuery.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/AllClassesQuery.java
index d453d82c38cf987a39d59acb72ea6591cb63e61c..cd08b1bf0dae216b72a7aea02ae14f4f896070c9 100644
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/AllClassesQuery.java
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/AllClassesQuery.java
@@ -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 @@ class AllClassesQuery extends QueryHandler {
             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;
diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/ClassQuery.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/ClassQuery.java
index dde9640b4a7f79f3c05d4b87874285fb9cd3be61..824501381f7a414dfe487401c3338744d84a02ce 100644
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/ClassQuery.java
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/ClassQuery.java
@@ -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 @@ class ClassQuery extends QueryHandler {
         }
         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);
diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/FinalizerObjectsQuery.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/FinalizerObjectsQuery.java
index 91f7017ebf2a961c11e09d24bf5e7d067de2508a..a717c7aa38c23ed6e97ce89ab8343264e518e545 100644
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/FinalizerObjectsQuery.java
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/FinalizerObjectsQuery.java
@@ -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 @@ import java.util.*;
 
 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>");
diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/FinalizerSummaryQuery.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/FinalizerSummaryQuery.java
index 916cda738a42535d1b9d5df3273937018612f96d..c1aa35bce552713f8e8e8ae2caac36e4cb1c5f39 100644
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/FinalizerSummaryQuery.java
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/FinalizerSummaryQuery.java
@@ -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 @@ import java.util.*;
 
 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 @@ public class FinalizerSummaryQuery extends QueryHandler {
         private long count;
     }
 
-    private void printFinalizerSummary(Enumeration objs) {
+    private void printFinalizerSummary(Enumeration<?> objs) {
         int count = 0;
         Map<JavaClass, HistogramElement> map = new HashMap<JavaClass, HistogramElement>();
 
diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesCountQuery.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesCountQuery.java
index 1b466a49a4f3c2ab07ccf0eecf6675c24adacd50..311df7bbb26b29865cbe49320c68a9ed73aec488 100644
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesCountQuery.java
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesCountQuery.java
@@ -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 @@ class InstancesCountQuery extends QueryHandler {
             }
             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++;
                     }
diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesQuery.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesQuery.java
index ff1f60f7be5c70a3c1969f472634b345e6bc3eae..7532b0b2e62207380e2d9198386c9ae058768d82 100644
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesQuery.java
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesQuery.java
@@ -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 @@ class InstancesQuery extends QueryHandler {
             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);
diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/RefsByTypeQuery.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/RefsByTypeQuery.java
index 73755c2e523f3b7c1f29b1ddfae6add44ad8766b..15f7ae8b492f59e24ea26bd30a9c6def6d693b3b 100644
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/RefsByTypeQuery.java
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/RefsByTypeQuery.java
@@ -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 @@ public class RefsByTypeQuery extends QueryHandler {
         } 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);
diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/util/CompositeEnumeration.java b/jdk/src/share/classes/com/sun/tools/hat/internal/util/CompositeEnumeration.java
index 6663d8ff894c48c0e28dc896d89fa81ce5072c59..c20afb22339e6e165ab12f4e8543f44d2047dafb 100644
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/util/CompositeEnumeration.java
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/util/CompositeEnumeration.java
@@ -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 @@ package com.sun.tools.hat.internal.util;
 
 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 @@ public class CompositeEnumeration implements Enumeration {
         return e1.hasMoreElements() || e2.hasMoreElements();
     }
 
-    public Object nextElement() {
+    public JavaHeapObject nextElement() {
         if (e1.hasMoreElements()) {
             return e1.nextElement();
         }
diff --git a/jdk/src/share/classes/com/sun/tools/jdi/EventRequestManagerImpl.java b/jdk/src/share/classes/com/sun/tools/jdi/EventRequestManagerImpl.java
index 115721608256571a9a342ff489ff34dbaaf98767..93c10f0b00f55ec3bf2d3290f13dfe4f00eb7fa4 100644
--- a/jdk/src/share/classes/com/sun/tools/jdi/EventRequestManagerImpl.java
+++ b/jdk/src/share/classes/com/sun/tools/jdi/EventRequestManagerImpl.java
@@ -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 @@ import java.util.*;
 // 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
 {
diff --git a/jdk/src/share/classes/java/awt/Color.java b/jdk/src/share/classes/java/awt/Color.java
index e80e991aa15f7d50ee0dc4fa5a7baccd02b203ad..3a94d73ac74602a5fe3e8f6a31591d770d48b70f 100644
--- a/jdk/src/share/classes/java/awt/Color.java
+++ b/jdk/src/share/classes/java/awt/Color.java
@@ -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 @@ import java.awt.color.ColorSpace;
  * 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
diff --git a/jdk/src/share/classes/java/awt/Font.java b/jdk/src/share/classes/java/awt/Font.java
index 41d143522dcd846a4fa2190ccbfc86b8e88c7e15..d9faf3d3e8086fc4100da227f9d8c0c0f0ccf8bb 100644
--- a/jdk/src/share/classes/java/awt/Font.java
+++ b/jdk/src/share/classes/java/awt/Font.java
@@ -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 @@ public class Font implements java.io.Serializable
      * 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
diff --git a/jdk/src/share/classes/java/awt/Graphics.java b/jdk/src/share/classes/java/awt/Graphics.java
index 4f03e1c61dd88b5ffbc3bdb58a5b27bd4dbd19fc..3be860cab315efc9fffa5644773d3f568d6574eb 100644
--- a/jdk/src/share/classes/java/awt/Graphics.java
+++ b/jdk/src/share/classes/java/awt/Graphics.java
@@ -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 @@ public abstract class Graphics {
      * 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.
diff --git a/jdk/src/share/classes/java/awt/MenuComponent.java b/jdk/src/share/classes/java/awt/MenuComponent.java
index 4ea95bf5969268f5a6937542c4f9fba946fc971e..64b1db9bf06243ee9e2f857e5f4b4c4a2e516b97 100644
--- a/jdk/src/share/classes/java/awt/MenuComponent.java
+++ b/jdk/src/share/classes/java/awt/MenuComponent.java
@@ -132,16 +132,24 @@ public abstract class MenuComponent implements java.io.Serializable {
     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();
                 }
diff --git a/jdk/src/share/classes/java/awt/Polygon.java b/jdk/src/share/classes/java/awt/Polygon.java
index e714428c0d11e300f63e365b9834209951ce1d78..0d89e6045be4e59fc337e370e49d679d920ce362 100644
--- a/jdk/src/share/classes/java/awt/Polygon.java
+++ b/jdk/src/share/classes/java/awt/Polygon.java
@@ -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 @@ public class Polygon implements Shape, java.io.Serializable {
     /**
      * 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
diff --git a/jdk/src/share/classes/java/awt/Rectangle.java b/jdk/src/share/classes/java/awt/Rectangle.java
index d64deaf2f0e8044c0a5477f85f54ccb829898552..727fe8e7ba89a6bd4a5399099b64b0683aaa9807 100644
--- a/jdk/src/share/classes/java/awt/Rectangle.java
+++ b/jdk/src/share/classes/java/awt/Rectangle.java
@@ -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 @@ import java.beans.Transient;
  * <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 @@ public class Rectangle extends Rectangle2D
      * <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 @@ public class Rectangle extends Rectangle2D
 
     /**
      * 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 @@ public class Rectangle extends Rectangle2D
     /**
      * 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,
diff --git a/jdk/src/share/classes/java/awt/Toolkit.java b/jdk/src/share/classes/java/awt/Toolkit.java
index 65b494ba52dd0bf7db114e9c5d6b9943e406bcdb..2fc0910cc96bfab8a4e71dedf58676cc5922a5b4 100644
--- a/jdk/src/share/classes/java/awt/Toolkit.java
+++ b/jdk/src/share/classes/java/awt/Toolkit.java
@@ -1241,10 +1241,9 @@ public abstract class Toolkit {
      * 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>
diff --git a/jdk/src/share/classes/java/awt/color/ColorSpace.java b/jdk/src/share/classes/java/awt/color/ColorSpace.java
index ac21273d415ed390cfcb0e4e7bee10989855f716..08feedd844e74b021d4c02afe178275384b8abb8 100644
--- a/jdk/src/share/classes/java/awt/color/ColorSpace.java
+++ b/jdk/src/share/classes/java/awt/color/ColorSpace.java
@@ -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 @@ public abstract class ColorSpace implements java.io.Serializable {
      * 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 @@ public abstract class ColorSpace implements java.io.Serializable {
      * 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 @@ public abstract class ColorSpace implements java.io.Serializable {
      * 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 @@ public abstract class ColorSpace implements java.io.Serializable {
      * 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
diff --git a/jdk/src/share/classes/java/awt/color/ICC_ColorSpace.java b/jdk/src/share/classes/java/awt/color/ICC_ColorSpace.java
index ee2ed1a43a59fdd9aee4440ef9283954cb1e5a49..c64177658f1078597bb04497961df1994a21cf0b 100644
--- a/jdk/src/share/classes/java/awt/color/ICC_ColorSpace.java
+++ b/jdk/src/share/classes/java/awt/color/ICC_ColorSpace.java
@@ -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 @@ public class ICC_ColorSpace extends ColorSpace {
      * 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 @@ public class ICC_ColorSpace extends ColorSpace {
      * 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 @@ public class ICC_ColorSpace extends ColorSpace {
      * 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 @@ public class ICC_ColorSpace extends ColorSpace {
      * 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.
diff --git a/jdk/src/share/classes/java/awt/datatransfer/SystemFlavorMap.java b/jdk/src/share/classes/java/awt/datatransfer/SystemFlavorMap.java
index fd54c9414a0f64e8953269b13c4034ff59cce65a..e799020110a9477ebac880f7910303c612957667 100644
--- a/jdk/src/share/classes/java/awt/datatransfer/SystemFlavorMap.java
+++ b/jdk/src/share/classes/java/awt/datatransfer/SystemFlavorMap.java
@@ -27,6 +27,8 @@ package java.awt.datatransfer;
 
 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.URL;
 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.LinkedHashSet;
 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 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable {
     }
 
     /**
-     * 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");
-            }
+        InputStream is = SystemFlavorMap.class.getResourceAsStream("/sun/awt/datatransfer/flavormap.properties");
+        if (is == null) {
+            throw new InternalError("Default flavor mapping not found");
         }
 
-        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
-            }
-        }
-
-        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,80 +300,11 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable {
                     }
                 }
             }
+        } catch (IOException e) {
+            throw new InternalError("Error reading default flavor mapping", e);
         }
     }
 
-    /**
-     * 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++;
-        }
-        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();
-    }
-
     /**
      * Stores the listed object under the specified hash key in map. Unlike a
      * standard map, the listed object will not replace any object already at
diff --git a/jdk/src/share/classes/java/awt/font/TextAttribute.java b/jdk/src/share/classes/java/awt/font/TextAttribute.java
index 3a7714ba1ddb9194e57b7d77f3ccc706b868b6aa..280e1934693c9e86445ff76b238955d237abc193 100644
--- a/jdk/src/share/classes/java/awt/font/TextAttribute.java
+++ b/jdk/src/share/classes/java/awt/font/TextAttribute.java
@@ -96,7 +96,7 @@ import sun.misc.SharedSecrets;
  * </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">
diff --git a/jdk/src/share/classes/java/awt/geom/Arc2D.java b/jdk/src/share/classes/java/awt/geom/Arc2D.java
index 3d92306f6185481658982e48dd27cb7ecbd74582..be51e8a4bc36e1b36c4e3f78d0d2b9fd65f0cf5a 100644
--- a/jdk/src/share/classes/java/awt/geom/Arc2D.java
+++ b/jdk/src/share/classes/java/awt/geom/Arc2D.java
@@ -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 @@ import java.io.Serializable;
  * <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
diff --git a/jdk/src/share/classes/java/awt/image/AffineTransformOp.java b/jdk/src/share/classes/java/awt/image/AffineTransformOp.java
index 9e6a66eea5c8cc77f15011994063273144c6c5c6..d9216606b738b33e85fa456e867af7bd1fb5a18d 100644
--- a/jdk/src/share/classes/java/awt/image/AffineTransformOp.java
+++ b/jdk/src/share/classes/java/awt/image/AffineTransformOp.java
@@ -324,7 +324,7 @@ public class AffineTransformOp implements BufferedImageOp, RasterOp {
      * 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.
diff --git a/jdk/src/share/classes/java/awt/image/BufferedImageFilter.java b/jdk/src/share/classes/java/awt/image/BufferedImageFilter.java
index bac63a8f066cf8d41299962bff11543864802dbd..e848fd9c2068c62c336bd1cc2e1a84b989177786 100644
--- a/jdk/src/share/classes/java/awt/image/BufferedImageFilter.java
+++ b/jdk/src/share/classes/java/awt/image/BufferedImageFilter.java
@@ -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 @@ public class BufferedImageFilter extends ImageFilter implements Cloneable {
      * 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
diff --git a/jdk/src/share/classes/java/awt/image/ImageFilter.java b/jdk/src/share/classes/java/awt/image/ImageFilter.java
index 33198346e03cee0f16f402bffa11907f6a7b9c89..04077b6d6a5736435e921316d79033217751598c 100644
--- a/jdk/src/share/classes/java/awt/image/ImageFilter.java
+++ b/jdk/src/share/classes/java/awt/image/ImageFilter.java
@@ -225,7 +225,7 @@ public class ImageFilter implements ImageConsumer, Cloneable {
      *
      * <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.
      *
diff --git a/jdk/src/share/classes/java/awt/image/WritableRaster.java b/jdk/src/share/classes/java/awt/image/WritableRaster.java
index 6ad950288eeffe4371eb1eade412bbf007d7a796..65ff74aa4f9a4c3a085c845bcd3e3cc833a25ba2 100644
--- a/jdk/src/share/classes/java/awt/image/WritableRaster.java
+++ b/jdk/src/share/classes/java/awt/image/WritableRaster.java
@@ -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 @@ public class WritableRaster extends Raster {
      * 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.
diff --git a/jdk/src/share/classes/java/awt/image/renderable/ParameterBlock.java b/jdk/src/share/classes/java/awt/image/renderable/ParameterBlock.java
index e6b923dda0ef392ab81c23dc803405977710adcd..b08e13481ee402919804c80cdfab1be7dd2d2b97 100644
--- a/jdk/src/share/classes/java/awt/image/renderable/ParameterBlock.java
+++ b/jdk/src/share/classes/java/awt/image/renderable/ParameterBlock.java
@@ -370,7 +370,7 @@ public class ParameterBlock implements Cloneable, Serializable {
      *         the specified parameter.
      */
     public ParameterBlock add(int i) {
-        return add(new Integer(i));
+        return add(i);
     }
 
     /**
@@ -489,7 +489,7 @@ public class ParameterBlock implements Cloneable, Serializable {
      *        the specified parameter.
      */
     public ParameterBlock set(int i, int index) {
-        return set(new Integer(i), index);
+        return set(i, index);
     }
 
     /**
diff --git a/jdk/src/share/classes/java/awt/print/PrinterJob.java b/jdk/src/share/classes/java/awt/print/PrinterJob.java
index 0c80d1490d457eae26d83a00109d32651a2d0d82..41d39ce10ec99e3a03f16f81f7846951aee953da 100644
--- a/jdk/src/share/classes/java/awt/print/PrinterJob.java
+++ b/jdk/src/share/classes/java/awt/print/PrinterJob.java
@@ -546,7 +546,6 @@ public abstract class PrinterJob {
      * 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
diff --git a/jdk/src/share/classes/java/beans/EventHandler.java b/jdk/src/share/classes/java/beans/EventHandler.java
index dd41750f2f13ca01a5b685ce2ff5edde770008bb..be0f95d8ede2cd3ec213b26f56e3355669b92bcf 100644
--- a/jdk/src/share/classes/java/beans/EventHandler.java
+++ b/jdk/src/share/classes/java/beans/EventHandler.java
@@ -437,7 +437,7 @@ public class EventHandler implements InvocationHandler {
         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")) {
diff --git a/jdk/src/share/classes/java/beans/MetaData.java b/jdk/src/share/classes/java/beans/MetaData.java
index d0e7108179d55d64d92fbab8e2f62305d8885bc3..ee64475b8c43425937991b279fd9b8d824a96c33 100644
--- a/jdk/src/share/classes/java/beans/MetaData.java
+++ b/jdk/src/share/classes/java/beans/MetaData.java
@@ -123,13 +123,13 @@ static final class ArrayPersistenceDelegate extends PersistenceDelegate {
         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 @@ static class java_util_List_PersistenceDelegate extends DefaultPersistenceDelega
             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 @@ static final class java_awt_MenuShortcut_PersistenceDelegate extends Persistence
     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())});
     }
 }
 
diff --git a/jdk/src/share/classes/java/beans/NameGenerator.java b/jdk/src/share/classes/java/beans/NameGenerator.java
index 61dd93398537660daac7afdae4858bf1a3789bee..fc1db4d0fb73b9fb75ce33b9ea434a32b05868eb 100644
--- a/jdk/src/share/classes/java/beans/NameGenerator.java
+++ b/jdk/src/share/classes/java/beans/NameGenerator.java
@@ -107,7 +107,7 @@ class NameGenerator {
 
             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);
diff --git a/jdk/src/share/classes/java/lang/reflect/Modifier.java b/jdk/src/share/classes/java/lang/reflect/Modifier.java
index 7387bbeaa75a7b708f49c7a276ecbecced25eecb..f84a35166a95cfad5aaa0d31e682a1ea80140291 100644
--- a/jdk/src/share/classes/java/lang/reflect/Modifier.java
+++ b/jdk/src/share/classes/java/lang/reflect/Modifier.java
@@ -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 @@ public class Modifier {
      * 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 ((len = sb.length()) > 0)    /* trim trailing space */
-            return sb.toString().substring(0, len-1);
-        return "";
+        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");
+
+        return sj.toString();
     }
 
     /*
diff --git a/jdk/src/share/classes/java/time/chrono/JapaneseEra.java b/jdk/src/share/classes/java/time/chrono/JapaneseEra.java
index 0187565869fb8fa6f18f06f7b514ed8d3cbe43a1..0c9e3e81e1d640f71d7bc4694a3d8b4ae1866cea 100644
--- a/jdk/src/share/classes/java/time/chrono/JapaneseEra.java
+++ b/jdk/src/share/classes/java/time/chrono/JapaneseEra.java
@@ -127,7 +127,7 @@ public final class JapaneseEra
 
     // 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 @@ public final class JapaneseEra
         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 @@ public final class JapaneseEra
      * @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)];
diff --git a/jdk/src/share/classes/java/util/Collections.java b/jdk/src/share/classes/java/util/Collections.java
index f6a65c7b1069f7a8675ae824cb6d5e4884ab5db4..ce4ae7d1b973bee13a32d673d4b396b226f05ae3 100644
--- a/jdk/src/share/classes/java/util/Collections.java
+++ b/jdk/src/share/classes/java/util/Collections.java
@@ -2342,7 +2342,7 @@ public class Collections {
 
         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 @@ public class Collections {
          */
         @Override
         public void replaceAll(UnaryOperator<E> operator) {
+            Objects.requireNonNull(operator);
             list.replaceAll(e -> typeCheck(operator.apply(e)));
         }
 
diff --git a/jdk/src/share/classes/java/util/DoubleSummaryStatistics.java b/jdk/src/share/classes/java/util/DoubleSummaryStatistics.java
index 569c35899bc40bef04c4c11957856915786fa2e8..ab5f59d8a65e8e20ce6e4f7651f3484ea4d6bcf4 100644
--- a/jdk/src/share/classes/java/util/DoubleSummaryStatistics.java
+++ b/jdk/src/share/classes/java/util/DoubleSummaryStatistics.java
@@ -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 @@ public class DoubleSummaryStatistics implements DoubleConsumer {
      * 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 @@ public class DoubleSummaryStatistics implements DoubleConsumer {
      * 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 @@ public class DoubleSummaryStatistics implements DoubleConsumer {
      * 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.
diff --git a/jdk/src/share/classes/java/util/stream/DoubleStream.java b/jdk/src/share/classes/java/util/stream/DoubleStream.java
index cfc12ffde282eee71299ffff241e1b3566c683ad..08b4eeda3043e683581588ab62623995ac82c0f3 100644
--- a/jdk/src/share/classes/java/util/stream/DoubleStream.java
+++ b/jdk/src/share/classes/java/util/stream/DoubleStream.java
@@ -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 @@ public interface DoubleStream extends BaseStream<Double, DoubleStream> {
      * 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 @@ public interface DoubleStream extends BaseStream<Double, DoubleStream> {
      * 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 @@ public interface DoubleStream extends BaseStream<Double, DoubleStream> {
      * 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>.
diff --git a/jdk/src/share/classes/javax/imageio/package.html b/jdk/src/share/classes/javax/imageio/package.html
index f0927fa147b0f762c1088f0fc907604d9f5078ab..f8254b1128471b13333822986cc3bff2d78183dd 100644
--- a/jdk/src/share/classes/javax/imageio/package.html
+++ b/jdk/src/share/classes/javax/imageio/package.html
@@ -131,8 +131,8 @@ standard plug-ins.
 <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
diff --git a/jdk/src/share/classes/javax/imageio/spi/PartiallyOrderedSet.java b/jdk/src/share/classes/javax/imageio/spi/PartiallyOrderedSet.java
index f4d17c2b427146f2c7058873adef9dfa7c266b64..54fb8f46745c0f143762d9d81c2d2fd7f55c709b 100644
--- a/jdk/src/share/classes/javax/imageio/spi/PartiallyOrderedSet.java
+++ b/jdk/src/share/classes/javax/imageio/spi/PartiallyOrderedSet.java
@@ -170,7 +170,7 @@ class PartialOrderIterator<E> implements Iterator<E> {
         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 @@ class PartialOrderIterator<E> implements Iterator<E> {
         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) {
diff --git a/jdk/src/share/classes/javax/naming/Context.java b/jdk/src/share/classes/javax/naming/Context.java
index db2acbde8d36ee8ababc561a2ad16a846e8a27da..3f1b759b42453972651191e3fc7e4dd61c82e288 100644
--- a/jdk/src/share/classes/javax/naming/Context.java
+++ b/jdk/src/share/classes/javax/naming/Context.java
@@ -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 @@ import java.util.Hashtable;
  * <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 @@ import java.util.Hashtable;
  *
  * 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 @@ import java.util.Hashtable;
  * <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 @@ public interface Context {
      * 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 @@ public interface Context {
      * @see NoInitialContextException
      * @see #addToEnvironment(String, Object)
      * @see #removeFromEnvironment(String)
-     * @see #APPLET
      */
     String INITIAL_CONTEXT_FACTORY = "java.naming.factory.initial";
 
@@ -847,8 +844,8 @@ public interface Context {
      * 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 @@ public interface Context {
      * @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 @@ public interface Context {
      * 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 @@ public interface Context {
      * @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 @@ public interface Context {
      * 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 @@ public interface Context {
      * @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 @@ public interface Context {
      * 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 @@ public interface Context {
      *
      * @see #addToEnvironment(String, Object)
      * @see #removeFromEnvironment(String)
-     * @see #APPLET
      */
     String PROVIDER_URL = "java.naming.provider.url";
 
@@ -926,8 +918,8 @@ public interface Context {
      * 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 @@ public interface Context {
     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.
-     *
-     * <p> The value of this constant is "java.naming.applet".
-     *
-     * @see #addToEnvironment(String, Object)
-     * @see #removeFromEnvironment(String)
-     * @see InitialContext
+     * @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 ...
+     *
+     *     Context ctx = new InitialContext(env);
+     * }</pre>
      *
      * @since 1.3
      */
+    @Deprecated
     String APPLET = "java.naming.applet";
 };
diff --git a/jdk/src/share/classes/javax/naming/InitialContext.java b/jdk/src/share/classes/javax/naming/InitialContext.java
index 867af4ca598dbb83d6408132578e752b235be2be..8a9792dd3b4d619da0e21a136ae0ebd575a84d8e 100644
--- a/jdk/src/share/classes/javax/naming/InitialContext.java
+++ b/jdk/src/share/classes/javax/naming/InitialContext.java
@@ -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 @@ import com.sun.naming.internal.ResourceManager;
  * 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>
diff --git a/jdk/src/share/classes/javax/naming/directory/DirContext.java b/jdk/src/share/classes/javax/naming/directory/DirContext.java
index 903ccbea4212b35bac46a1a66badfcd29d3103b9..2b77486673a105cd57f4112858f4f85573d884b8 100644
--- a/jdk/src/share/classes/javax/naming/directory/DirContext.java
+++ b/jdk/src/share/classes/javax/naming/directory/DirContext.java
@@ -723,7 +723,7 @@ public interface DirContext extends Context {
      * 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.
diff --git a/jdk/src/share/classes/javax/naming/ldap/LdapContext.java b/jdk/src/share/classes/javax/naming/ldap/LdapContext.java
index 05db4a8648b99b6e6d74a82e980f2414000e9dcc..d70b865790e00a8c0dc2d5f54811fb9721630056 100644
--- a/jdk/src/share/classes/javax/naming/ldap/LdapContext.java
+++ b/jdk/src/share/classes/javax/naming/ldap/LdapContext.java
@@ -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 @@ public interface LdapContext extends DirContext {
      * 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".
      *
diff --git a/jdk/src/share/classes/javax/naming/ldap/Rdn.java b/jdk/src/share/classes/javax/naming/ldap/Rdn.java
index d688e11baf8c1f17b84147dc5c8f719507bf50de..dc001705bdd8982329f473f7ae1c4040086fc18a 100644
--- a/jdk/src/share/classes/javax/naming/ldap/Rdn.java
+++ b/jdk/src/share/classes/javax/naming/ldap/Rdn.java
@@ -421,7 +421,7 @@ public class Rdn implements Serializable, Comparable<Object> {
         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 @@ public class Rdn implements Serializable, Comparable<Object> {
     }
 
     /**
-     * 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.
diff --git a/jdk/src/share/classes/javax/naming/ldap/SortControl.java b/jdk/src/share/classes/javax/naming/ldap/SortControl.java
index b7420b987ec3b0b3be9b9602647e7fcbec20df55..aaeb7a17ad933848c9ae5b4191b7f51530d801a6 100644
--- a/jdk/src/share/classes/javax/naming/ldap/SortControl.java
+++ b/jdk/src/share/classes/javax/naming/ldap/SortControl.java
@@ -188,7 +188,7 @@ final public class SortControl extends BasicControl {
     /*
      * 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
diff --git a/jdk/src/share/classes/javax/naming/spi/NamingManager.java b/jdk/src/share/classes/javax/naming/spi/NamingManager.java
index c6a99ec4c3e7a5637917ab11eaef7fb754168165..6bb98ddc0ee3f7d5d7104b608c78bbf5a64d6dd5 100644
--- a/jdk/src/share/classes/javax/naming/spi/NamingManager.java
+++ b/jdk/src/share/classes/javax/naming/spi/NamingManager.java
@@ -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 @@ public class NamingManager {
      * (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 @@ public class NamingManager {
             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;
             }
diff --git a/jdk/src/share/classes/javax/print/Doc.java b/jdk/src/share/classes/javax/print/Doc.java
index d28a3e565ef39380b143ab9273ac2df739a60a34..873aac594a6ab5974a5a4ed774b889492b979962 100644
--- a/jdk/src/share/classes/javax/print/Doc.java
+++ b/jdk/src/share/classes/javax/print/Doc.java
@@ -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 @@ public interface Doc {
      * 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 @@ public interface Doc {
      * 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.
diff --git a/jdk/src/share/classes/javax/print/DocFlavor.java b/jdk/src/share/classes/javax/print/DocFlavor.java
index eac9d38954d6e3d18f1d480b7ee6db8fec1df9a7..cb00e00753b443ecd080f943c839228acdfb1eb3 100644
--- a/jdk/src/share/classes/javax/print/DocFlavor.java
+++ b/jdk/src/share/classes/javax/print/DocFlavor.java
@@ -381,7 +381,6 @@ import java.io.Serializable;
  * <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 @@ import java.io.Serializable;
  * 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 @@ public class DocFlavor implements Serializable, Cloneable {
      * 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 @@ public class DocFlavor implements Serializable, Cloneable {
      * 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 @@ public class DocFlavor implements Serializable, Cloneable {
      * 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 @@ public class DocFlavor implements Serializable, Cloneable {
      * 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 @@ public class DocFlavor implements Serializable, Cloneable {
      * 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 @@ public class DocFlavor implements Serializable, Cloneable {
      * 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 @@ public class DocFlavor implements Serializable, Cloneable {
      * 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 @@ public class DocFlavor implements Serializable, Cloneable {
      * Class DocFlavor.SERVICE_FORMATTED provides predefined static constant
      * DocFlavor objects for example doc flavors for service formatted print
      * data.
-     * <P>
      *
      * @author  Alan Kaminsky
      */
diff --git a/jdk/src/share/classes/javax/print/PrintService.java b/jdk/src/share/classes/javax/print/PrintService.java
index f52eb72a0d2a00cec5811a0f28bf05c3da681dde..a003e7308804415275c88fdb1b79b286eaeac6ae 100644
--- a/jdk/src/share/classes/javax/print/PrintService.java
+++ b/jdk/src/share/classes/javax/print/PrintService.java
@@ -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 @@ public interface PrintService {
      * 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
diff --git a/jdk/src/share/classes/javax/print/PrintServiceLookup.java b/jdk/src/share/classes/javax/print/PrintServiceLookup.java
index aece5d1205ae117b16739831062b1f6154346983..70695a995f8dff8d106c23a2d52c1755f428c596 100644
--- a/jdk/src/share/classes/javax/print/PrintServiceLookup.java
+++ b/jdk/src/share/classes/javax/print/PrintServiceLookup.java
@@ -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 @@ public abstract class PrintServiceLookup {
      * 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 @@ public abstract class PrintServiceLookup {
     * <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
diff --git a/jdk/src/share/classes/javax/print/ServiceUI.java b/jdk/src/share/classes/javax/print/ServiceUI.java
index 20b23611ed1672129d51314945601c56dcf4a3b5..c6ba370a064d3d49f1831a2ea3603e9ef392e756 100644
--- a/jdk/src/share/classes/javax/print/ServiceUI.java
+++ b/jdk/src/share/classes/javax/print/ServiceUI.java
@@ -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 @@ public class ServiceUI {
      *    }
      * }
      * }</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
diff --git a/jdk/src/share/classes/javax/print/ServiceUIFactory.java b/jdk/src/share/classes/javax/print/ServiceUIFactory.java
index d293a8cadc7614c9e80bef576d7fdd1792e18b12..06deb02e5e820399d8a4ea3896bd00c93fc4a89f 100644
--- a/jdk/src/share/classes/javax/print/ServiceUIFactory.java
+++ b/jdk/src/share/classes/javax/print/ServiceUIFactory.java
@@ -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 @@ public abstract class ServiceUIFactory {
     /**
      * 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.
diff --git a/jdk/src/share/classes/javax/print/SimpleDoc.java b/jdk/src/share/classes/javax/print/SimpleDoc.java
index 3cf0d7790866c0e8bf8b208fce6059d31ba7cfd8..f73d794f76bb0b165a442e83313d5d8565e50bb7 100644
--- a/jdk/src/share/classes/javax/print/SimpleDoc.java
+++ b/jdk/src/share/classes/javax/print/SimpleDoc.java
@@ -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 @@ public final class SimpleDoc implements Doc {
      * 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 @@ public final class SimpleDoc implements Doc {
      * 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
diff --git a/jdk/src/share/classes/javax/print/StreamPrintServiceFactory.java b/jdk/src/share/classes/javax/print/StreamPrintServiceFactory.java
index dfa91a70fcb6ad6d72169ec0b0dfbacb7f8da610..f1f7f28c41047f2cdfd45517a47020abe0d54781 100644
--- a/jdk/src/share/classes/javax/print/StreamPrintServiceFactory.java
+++ b/jdk/src/share/classes/javax/print/StreamPrintServiceFactory.java
@@ -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 @@ public abstract class StreamPrintServiceFactory {
      * 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 @@ public abstract class StreamPrintServiceFactory {
      * 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.
diff --git a/jdk/src/share/classes/javax/print/attribute/Attribute.java b/jdk/src/share/classes/javax/print/attribute/Attribute.java
index 5226f9cb80d3beb6b3b4e94d3b3f53ef1dd8b8be..a6c58e6f9330ed0be2f7f65b27175a099f8191ca 100644
--- a/jdk/src/share/classes/javax/print/attribute/Attribute.java
+++ b/jdk/src/share/classes/javax/print/attribute/Attribute.java
@@ -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 @@ import java.io.Serializable;
  * 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
diff --git a/jdk/src/share/classes/javax/print/attribute/DateTimeSyntax.java b/jdk/src/share/classes/javax/print/attribute/DateTimeSyntax.java
index d78c8f2004a3c37858d0016802a68152970ca642..72e583a034730119150942138fd91f7ebbe1310b 100644
--- a/jdk/src/share/classes/javax/print/attribute/DateTimeSyntax.java
+++ b/jdk/src/share/classes/javax/print/attribute/DateTimeSyntax.java
@@ -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 @@ import java.util.Date;
  * 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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/DocAttribute.java b/jdk/src/share/classes/javax/print/attribute/DocAttribute.java
index e99c09d6bcb460a90750a0abe0571695741b22f3..994208f0a9e2085a5bff0c1052bd86c4f35ce623 100644
--- a/jdk/src/share/classes/javax/print/attribute/DocAttribute.java
+++ b/jdk/src/share/classes/javax/print/attribute/DocAttribute.java
@@ -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 @@ package javax.print.attribute;
  * 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
diff --git a/jdk/src/share/classes/javax/print/attribute/DocAttributeSet.java b/jdk/src/share/classes/javax/print/attribute/DocAttributeSet.java
index b4482d2e455c30e373cdf3f828dfb7b9140f0864..bacc1074f2c31d7371d92d205fd73d218c8d4ab0 100644
--- a/jdk/src/share/classes/javax/print/attribute/DocAttributeSet.java
+++ b/jdk/src/share/classes/javax/print/attribute/DocAttributeSet.java
@@ -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 @@ package javax.print.attribute;
  * 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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/EnumSyntax.java b/jdk/src/share/classes/javax/print/attribute/EnumSyntax.java
index 85ee7d8b4023e6da12767261f553305088a8b800..f774066e592c4a785e02eee3f6393fa32fa012a0 100644
--- a/jdk/src/share/classes/javax/print/attribute/EnumSyntax.java
+++ b/jdk/src/share/classes/javax/print/attribute/EnumSyntax.java
@@ -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 @@ import java.io.Serializable;
  * 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
diff --git a/jdk/src/share/classes/javax/print/attribute/HashAttributeSet.java b/jdk/src/share/classes/javax/print/attribute/HashAttributeSet.java
index 7956794d304c7de39ae9b720d91d6516b0e72dc2..e4928a8196dfc6eb6250142bf51e8c407e6748ba 100644
--- a/jdk/src/share/classes/javax/print/attribute/HashAttributeSet.java
+++ b/jdk/src/share/classes/javax/print/attribute/HashAttributeSet.java
@@ -34,7 +34,6 @@ import java.util.HashMap;
 /**
  * Class HashAttributeSet provides an <code>AttributeSet</code>
  * implementation with characteristics of a hash map.
- * <P>
  *
  * @author  Alan Kaminsky
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/HashDocAttributeSet.java b/jdk/src/share/classes/javax/print/attribute/HashDocAttributeSet.java
index d4bc20e27d3368c694f5153834e0f596fba53cc0..0b915ba2ca9b4b6958841491f8fd2b93bd2cd34a 100644
--- a/jdk/src/share/classes/javax/print/attribute/HashDocAttributeSet.java
+++ b/jdk/src/share/classes/javax/print/attribute/HashDocAttributeSet.java
@@ -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 @@ import java.io.Serializable;
  * inherits its implementation from class {@link HashAttributeSet
  * HashAttributeSet} and enforces the semantic restrictions of interface {@link
  * DocAttributeSet DocAttributeSet}.
- * <P>
  *
  * @author  Alan Kaminsky
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/HashPrintJobAttributeSet.java b/jdk/src/share/classes/javax/print/attribute/HashPrintJobAttributeSet.java
index 980693694e68492c90a9327d6734b9de15100d63..f39c85883d5bef3a17347fff407514d746414927 100644
--- a/jdk/src/share/classes/javax/print/attribute/HashPrintJobAttributeSet.java
+++ b/jdk/src/share/classes/javax/print/attribute/HashPrintJobAttributeSet.java
@@ -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 @@ import java.io.Serializable;
  * which inherits its implementation from class {@link HashAttributeSet
  * HashAttributeSet} and enforces the semantic restrictions of interface
  * {@link PrintJobAttributeSet PrintJobAttributeSet}.
- * <P>
  *
  * @author  Alan Kaminsky
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/HashPrintRequestAttributeSet.java b/jdk/src/share/classes/javax/print/attribute/HashPrintRequestAttributeSet.java
index 53708f0259c6f569d17369b1078fe2fb8c778c37..fde4ebb69453d5c24d09e957764aa195dd4de3cc 100644
--- a/jdk/src/share/classes/javax/print/attribute/HashPrintRequestAttributeSet.java
+++ b/jdk/src/share/classes/javax/print/attribute/HashPrintRequestAttributeSet.java
@@ -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 @@ import java.io.Serializable;
  * class {@link HashAttributeSet HashAttributeSet} and enforces the
  * semantic restrictions of interface
  * {@link PrintRequestAttributeSet PrintRequestAttributeSet}.
- * <P>
  *
  * @author  Alan Kaminsky
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/HashPrintServiceAttributeSet.java b/jdk/src/share/classes/javax/print/attribute/HashPrintServiceAttributeSet.java
index 64e5b9e48f3d65f29831776ec2b46d4effbd0d0b..d98430d0d75b769b64470950e37adbea30954b34 100644
--- a/jdk/src/share/classes/javax/print/attribute/HashPrintServiceAttributeSet.java
+++ b/jdk/src/share/classes/javax/print/attribute/HashPrintServiceAttributeSet.java
@@ -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 @@ import java.io.Serializable;
  * which inherits its implementation from class {@link HashAttributeSet
  * HashAttributeSet} and enforces the semantic restrictions of interface
  * {@link PrintServiceAttributeSet PrintServiceAttributeSet}.
- * <P>
  *
  * @author  Alan Kaminsky
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/IntegerSyntax.java b/jdk/src/share/classes/javax/print/attribute/IntegerSyntax.java
index 7675a8327e7bb56f0f8cfe04d8e1e8626bff93f6..1fbd3b2556d7cf6d69ec075c2272650a4485a31c 100644
--- a/jdk/src/share/classes/javax/print/attribute/IntegerSyntax.java
+++ b/jdk/src/share/classes/javax/print/attribute/IntegerSyntax.java
@@ -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 @@ import java.io.Serializable;
  * 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
diff --git a/jdk/src/share/classes/javax/print/attribute/PrintJobAttribute.java b/jdk/src/share/classes/javax/print/attribute/PrintJobAttribute.java
index af8258090badb7b6ff63a6b672f040749e06024a..ad9a0d7217a58745fea0f124be3eef5296d9d1eb 100644
--- a/jdk/src/share/classes/javax/print/attribute/PrintJobAttribute.java
+++ b/jdk/src/share/classes/javax/print/attribute/PrintJobAttribute.java
@@ -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 @@ package javax.print.attribute;
  * 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
diff --git a/jdk/src/share/classes/javax/print/attribute/PrintJobAttributeSet.java b/jdk/src/share/classes/javax/print/attribute/PrintJobAttributeSet.java
index 5bce73513e93d5319b80d7a42c5319a1668f8714..4c920a1b48a64ebdadcc40348bc32b495c12009d 100644
--- a/jdk/src/share/classes/javax/print/attribute/PrintJobAttributeSet.java
+++ b/jdk/src/share/classes/javax/print/attribute/PrintJobAttributeSet.java
@@ -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 @@ package javax.print.attribute;
  * 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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/PrintRequestAttribute.java b/jdk/src/share/classes/javax/print/attribute/PrintRequestAttribute.java
index 78fe37ccb7605e686a49aa52a0212e534520c2e8..48249480e60fc74ce124499ef67792fc58a392fc 100644
--- a/jdk/src/share/classes/javax/print/attribute/PrintRequestAttribute.java
+++ b/jdk/src/share/classes/javax/print/attribute/PrintRequestAttribute.java
@@ -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 @@ package javax.print.attribute;
  * 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
diff --git a/jdk/src/share/classes/javax/print/attribute/PrintRequestAttributeSet.java b/jdk/src/share/classes/javax/print/attribute/PrintRequestAttributeSet.java
index eac683b194c191a1f74f1c9de18001c025dfd7e3..bde6c0cce8b09a78d5d69d3a65b7877520bbe57c 100644
--- a/jdk/src/share/classes/javax/print/attribute/PrintRequestAttributeSet.java
+++ b/jdk/src/share/classes/javax/print/attribute/PrintRequestAttributeSet.java
@@ -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 @@ package javax.print.attribute;
  * 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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/PrintServiceAttribute.java b/jdk/src/share/classes/javax/print/attribute/PrintServiceAttribute.java
index 8ac2b656d18803b414d57db5244697d5f9e82e44..f09b38870edbb0d126ee32d0aafc275819825612 100644
--- a/jdk/src/share/classes/javax/print/attribute/PrintServiceAttribute.java
+++ b/jdk/src/share/classes/javax/print/attribute/PrintServiceAttribute.java
@@ -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 @@ package javax.print.attribute;
  * 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
  *
diff --git a/jdk/src/share/classes/javax/print/attribute/PrintServiceAttributeSet.java b/jdk/src/share/classes/javax/print/attribute/PrintServiceAttributeSet.java
index badde7342184c1324bc55493f65d610b5179401c..3d3296ed40593853aaa78564c8230df632d718f8 100644
--- a/jdk/src/share/classes/javax/print/attribute/PrintServiceAttributeSet.java
+++ b/jdk/src/share/classes/javax/print/attribute/PrintServiceAttributeSet.java
@@ -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 @@ package javax.print.attribute;
  * 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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/ResolutionSyntax.java b/jdk/src/share/classes/javax/print/attribute/ResolutionSyntax.java
index 1089381d1c63d49f8bb312f88fc8d93e04ee8c5f..7e9c40835b5f8c837b875e1f2c806827a4effc36 100644
--- a/jdk/src/share/classes/javax/print/attribute/ResolutionSyntax.java
+++ b/jdk/src/share/classes/javax/print/attribute/ResolutionSyntax.java
@@ -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 @@ import java.io.Serializable;
  * 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
diff --git a/jdk/src/share/classes/javax/print/attribute/SetOfIntegerSyntax.java b/jdk/src/share/classes/javax/print/attribute/SetOfIntegerSyntax.java
index 0aed773fe6e0c4403192df8ff5e51ff9da10756a..8ba9303135ae4daa3a3c97940a2c63256c5b4fc5 100644
--- a/jdk/src/share/classes/javax/print/attribute/SetOfIntegerSyntax.java
+++ b/jdk/src/share/classes/javax/print/attribute/SetOfIntegerSyntax.java
@@ -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 @@ import java.util.Vector;
  * 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
diff --git a/jdk/src/share/classes/javax/print/attribute/Size2DSyntax.java b/jdk/src/share/classes/javax/print/attribute/Size2DSyntax.java
index 0f6a5dfe6c48658d06a95afddecf8878d0d44ccf..76832508c9416ec208dfbc62a622de6f1e64349e 100644
--- a/jdk/src/share/classes/javax/print/attribute/Size2DSyntax.java
+++ b/jdk/src/share/classes/javax/print/attribute/Size2DSyntax.java
@@ -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 @@ import java.io.Serializable;
  * 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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/SupportedValuesAttribute.java b/jdk/src/share/classes/javax/print/attribute/SupportedValuesAttribute.java
index 61e4bd57e621d9be0b8eee3f6f7bf07906ad5f55..ca8736b1315702d2aa9b5d4760a0f7cc59e5c306 100644
--- a/jdk/src/share/classes/javax/print/attribute/SupportedValuesAttribute.java
+++ b/jdk/src/share/classes/javax/print/attribute/SupportedValuesAttribute.java
@@ -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 @@ package javax.print.attribute;
  * 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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/TextSyntax.java b/jdk/src/share/classes/javax/print/attribute/TextSyntax.java
index 20e27fa314f5deca33ba8d5732ee6274068690b1..7b91de24d0ffb9d961071785b41908c4e6372739 100644
--- a/jdk/src/share/classes/javax/print/attribute/TextSyntax.java
+++ b/jdk/src/share/classes/javax/print/attribute/TextSyntax.java
@@ -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 @@ import java.util.Locale;
  * 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
diff --git a/jdk/src/share/classes/javax/print/attribute/URISyntax.java b/jdk/src/share/classes/javax/print/attribute/URISyntax.java
index 118b1c0cd8d36d602593b975d1d05ed6fdb7f635..770ba8a95921c5b716a05cd7a16b99d31e136346 100644
--- a/jdk/src/share/classes/javax/print/attribute/URISyntax.java
+++ b/jdk/src/share/classes/javax/print/attribute/URISyntax.java
@@ -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 @@ import java.net.URI;
  * 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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/package.html b/jdk/src/share/classes/javax/print/attribute/package.html
index fa9851655a873657ee0123102d9e9bae3c9998ae..aeedb0df2c27eb7ce8de16e9e01010b7a8d5ed00 100644
--- a/jdk/src/share/classes/javax/print/attribute/package.html
+++ b/jdk/src/share/classes/javax/print/attribute/package.html
@@ -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 @@ interpretation. Usage to the contrary is incorrect coding and may result
 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>
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/ColorSupported.java b/jdk/src/share/classes/javax/print/attribute/standard/ColorSupported.java
index 3ed094a871b979597b7f6cf642facecf79553c6f..53def76bff1cd206dcb53d61a8b4013b5d325dec 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/ColorSupported.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/ColorSupported.java
@@ -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 @@ import javax.print.attribute.PrintServiceAttribute;
  * <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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/Compression.java b/jdk/src/share/classes/javax/print/attribute/standard/Compression.java
index 8dbbfaf8aa173ce8d7ca3304449f6b21c48898c1..80b391ed3bdf250c4c47ab6edcc649478eac55de 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/Compression.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/Compression.java
@@ -40,7 +40,6 @@ import javax.print.attribute.DocAttribute;
  * <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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/CopiesSupported.java b/jdk/src/share/classes/javax/print/attribute/standard/CopiesSupported.java
index ebead89203fedf89f78e3b523e872284c7844d5b..4d24577ca7dc48d63b7eb7ba88e955cfdfe5ccc7 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/CopiesSupported.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/CopiesSupported.java
@@ -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 @@ import javax.print.attribute.SupportedValuesAttribute;
  * 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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/DateTimeAtCompleted.java b/jdk/src/share/classes/javax/print/attribute/standard/DateTimeAtCompleted.java
index ee675aca28f656241216e400a70660696e5e7a04..c51b2fd32abe651f6b8cedf87744e6fcdcd35b1d 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/DateTimeAtCompleted.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/DateTimeAtCompleted.java
@@ -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 @@ import javax.print.attribute.PrintJobAttribute;
  * "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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/DateTimeAtCreation.java b/jdk/src/share/classes/javax/print/attribute/standard/DateTimeAtCreation.java
index 2676ee9b3c88f8b353a091a5a6bf9fcc5946acd1..f4c98aaba7da205108109ae741fef9e28a4cfd73 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/DateTimeAtCreation.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/DateTimeAtCreation.java
@@ -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 @@ import javax.print.attribute.PrintJobAttribute;
  * "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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/DateTimeAtProcessing.java b/jdk/src/share/classes/javax/print/attribute/standard/DateTimeAtProcessing.java
index 6823d25ab6084d281ce7a7852fbd79820b583c01..821a8453a1a3bcf9f24297bbb717a7fe5a5fe7ab 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/DateTimeAtProcessing.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/DateTimeAtProcessing.java
@@ -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 @@ import javax.print.attribute.PrintJobAttribute;
  * "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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/Destination.java b/jdk/src/share/classes/javax/print/attribute/standard/Destination.java
index 546bd73814255ceae3a9b3d91162c6ca1bbe53cf..43e1ea9b150e69ac796536fd355ec950adfdaa5a 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/Destination.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/Destination.java
@@ -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 @@ import javax.print.attribute.PrintJobAttribute;
  * cause.
  * <P>
  * <B>IPP Compatibility:</B> Destination is not an IPP attribute.
- * <P>
  *
  * @author  Phil Race.
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/DialogTypeSelection.java b/jdk/src/share/classes/javax/print/attribute/standard/DialogTypeSelection.java
index 43cc15ee96a4f10f2ba46976bccf0b2c17951d97..5d1948e22fc3d29b32164d75eda9a64550f0d018 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/DialogTypeSelection.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/DialogTypeSelection.java
@@ -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 @@ import javax.print.attribute.PrintRequestAttribute;
  * or even printer specific options.
  * <P>
  * <B>IPP Compatibility:</B> This is not an IPP attribute.
- * <P>
- * @since 1.7
  *
+ * @since 1.7
  */
 public final class DialogTypeSelection extends EnumSyntax
         implements PrintRequestAttribute {
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/DocumentName.java b/jdk/src/share/classes/javax/print/attribute/standard/DocumentName.java
index 2e6157ae3580d818cb0e7c5c5401b2cd0c84a912..68b93bed43c67d79227935d8bd8d6ba1e192d71f 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/DocumentName.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/DocumentName.java
@@ -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 @@ import javax.print.attribute.DocAttribute;
  * <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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/JobHoldUntil.java b/jdk/src/share/classes/javax/print/attribute/standard/JobHoldUntil.java
index 0a849b5cb34ee58d81c4e5c532c8666f82efe9b9..4e3ee705bb73eaebcf641b702e8bb6f400b8d1a9 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/JobHoldUntil.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobHoldUntil.java
@@ -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 @@ import javax.print.attribute.PrintJobAttribute;
  * 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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/JobImpressions.java b/jdk/src/share/classes/javax/print/attribute/standard/JobImpressions.java
index 20e3401d268ca126acbefde8815738dda07cfac0..e0b267bae893fd2ee890af5ce3c7037e49abf457 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/JobImpressions.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobImpressions.java
@@ -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 @@ import javax.print.attribute.PrintJobAttribute;
  * <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
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/JobImpressionsCompleted.java b/jdk/src/share/classes/javax/print/attribute/standard/JobImpressionsCompleted.java
index c9516da26e07041777c95a25ebaf192ae6f6fd3e..2ac4f6049d103a8456dd4b5eb7b2076d76a47315 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/JobImpressionsCompleted.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobImpressionsCompleted.java
@@ -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 @@ import javax.print.attribute.PrintJobAttribute;
  * <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
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/JobImpressionsSupported.java b/jdk/src/share/classes/javax/print/attribute/standard/JobImpressionsSupported.java
index 61286e6321e89116fe5467bfe7e42843e676b8a9..b6804aae2c8b881861e256d56a08286c300dafce 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/JobImpressionsSupported.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobImpressionsSupported.java
@@ -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 @@ import javax.print.attribute.SupportedValuesAttribute;
  * 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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/JobKOctets.java b/jdk/src/share/classes/javax/print/attribute/standard/JobKOctets.java
index a40a02168ea7c68cbc1a10105d98d6435ea13875..383f5fe1e2e856c3b754f24e3aab5b07543adb2c 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/JobKOctets.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobKOctets.java
@@ -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 @@ import javax.print.attribute.PrintJobAttribute;
  * <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
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/JobKOctetsProcessed.java b/jdk/src/share/classes/javax/print/attribute/standard/JobKOctetsProcessed.java
index 2f622597cbcc97f27fa2a92eea5fa7786fc7590d..cecd80ddd1bd6ff6efdbe29e2e124d1180199244 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/JobKOctetsProcessed.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobKOctetsProcessed.java
@@ -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 @@ import javax.print.attribute.PrintJobAttribute;
  * <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
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/JobKOctetsSupported.java b/jdk/src/share/classes/javax/print/attribute/standard/JobKOctetsSupported.java
index f854aa654d7192abf3c9892faee8f1823e1505c5..9a7a8504e001bff6af7f14a56eadeee43930eb77 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/JobKOctetsSupported.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobKOctetsSupported.java
@@ -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 @@ import javax.print.attribute.SupportedValuesAttribute;
  * 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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/JobMediaSheets.java b/jdk/src/share/classes/javax/print/attribute/standard/JobMediaSheets.java
index e3b76b3e0eb7ed1451916d5e34f9d1135220774e..caeb31e996caeb9cb9ae68ae197819051d94820d 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/JobMediaSheets.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobMediaSheets.java
@@ -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 @@ import javax.print.attribute.PrintJobAttribute;
  * <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
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/JobMediaSheetsCompleted.java b/jdk/src/share/classes/javax/print/attribute/standard/JobMediaSheetsCompleted.java
index 3a1cb7c2a2829678c60c18c25e33d7149f64c91b..5b75cdbb89bde8eb40263a28333e2c5bfd2fb448 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/JobMediaSheetsCompleted.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobMediaSheetsCompleted.java
@@ -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 @@ import javax.print.attribute.PrintJobAttribute;
  * <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
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/JobMediaSheetsSupported.java b/jdk/src/share/classes/javax/print/attribute/standard/JobMediaSheetsSupported.java
index 08ca6ef8da67ebf39b1927ef3192ea52a07e42ea..47c7b04459a781ed7a31f82daeac9a65de41b4a6 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/JobMediaSheetsSupported.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobMediaSheetsSupported.java
@@ -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 @@ import javax.print.attribute.SupportedValuesAttribute;
  * 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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/JobMessageFromOperator.java b/jdk/src/share/classes/javax/print/attribute/standard/JobMessageFromOperator.java
index 7bf70af1f27fc8e649a787e91493b7c59b4e69b9..c1f4231009cea1b9a97ca953e7dbc67d9af1389e 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/JobMessageFromOperator.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobMessageFromOperator.java
@@ -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 @@ import javax.print.attribute.PrintJobAttribute;
  * <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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/JobName.java b/jdk/src/share/classes/javax/print/attribute/standard/JobName.java
index f01288a82df6695a74ebb9d2c78082a4f97bd119..bb563ceaf75a58984ce795c59dcce5a8042a3c90 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/JobName.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobName.java
@@ -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 @@ import javax.print.attribute.PrintJobAttribute;
  * <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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/JobOriginatingUserName.java b/jdk/src/share/classes/javax/print/attribute/standard/JobOriginatingUserName.java
index 20892467ebd6cb24d2719d372b93f6af9eb792c8..61e589c7f64010a7cf0e96d185ded3d5e557500e 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/JobOriginatingUserName.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobOriginatingUserName.java
@@ -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 @@ import javax.print.attribute.PrintJobAttribute;
  * <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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/JobPriority.java b/jdk/src/share/classes/javax/print/attribute/standard/JobPriority.java
index cd5cfc606d4dd905dcdbf52d0c94758f92d54003..b4a77ae5c51b65fe47a4ed57eba60ed93d1125bd 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/JobPriority.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobPriority.java
@@ -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 @@ import javax.print.attribute.PrintJobAttribute;
  * <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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/JobPrioritySupported.java b/jdk/src/share/classes/javax/print/attribute/standard/JobPrioritySupported.java
index 875c7a65a45fb53c5788a2e8a86d967696ac5995..80e7b6c54a5cc54617ec8675ac533240921ad3ac 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/JobPrioritySupported.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobPrioritySupported.java
@@ -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 @@ import javax.print.attribute.SupportedValuesAttribute;
  * <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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/JobSheets.java b/jdk/src/share/classes/javax/print/attribute/standard/JobSheets.java
index a98111353255d71505beeaca5be651cd47f10408..cec0f27901ac6121794d9d5219f8aef4ff41d94e 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/JobSheets.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobSheets.java
@@ -49,7 +49,6 @@ import javax.print.attribute.PrintJobAttribute;
  * <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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/JobState.java b/jdk/src/share/classes/javax/print/attribute/standard/JobState.java
index 1be9118e08de04e15f62e6f42d62855fcf996f1a..0ad1e5997ba276b9b9009f251c84525c05697b8e 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/JobState.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobState.java
@@ -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 @@ import javax.print.attribute.PrintJobAttribute;
  * <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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/JobStateReason.java b/jdk/src/share/classes/javax/print/attribute/standard/JobStateReason.java
index a3de1c5c9ff115023f8c0f5ffad1f2d455722271..3465eae620405bcd09dbeb41fdf3efb482fb5161 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/JobStateReason.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobStateReason.java
@@ -51,7 +51,6 @@ import javax.print.attribute.Attribute;
  * <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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/JobStateReasons.java b/jdk/src/share/classes/javax/print/attribute/standard/JobStateReasons.java
index 19ea46f23676cefeccbb8913694ec80c23ba986e..20f1da3297ce4d3cfee99fb7d7b54aabe4486362 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/JobStateReasons.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobStateReasons.java
@@ -62,7 +62,6 @@ import javax.print.attribute.PrintJobAttribute;
  * 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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/Media.java b/jdk/src/share/classes/javax/print/attribute/standard/Media.java
index 211d77a342d7f8eaef167df614d84790b6314787..59dd57b320b6642a66252587c402165e8ada2500 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/Media.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/Media.java
@@ -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 @@ import javax.print.attribute.PrintJobAttribute;
  * <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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/MediaSize.java b/jdk/src/share/classes/javax/print/attribute/standard/MediaSize.java
index af173a8d6ea6eeb62ea14f8746c976f4818163b2..e21d8b52c1e6f1c5eb7bed1eafef34011553b9f6 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/MediaSize.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/MediaSize.java
@@ -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 @@ import javax.print.attribute.Attribute;
  * 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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/NumberOfDocuments.java b/jdk/src/share/classes/javax/print/attribute/standard/NumberOfDocuments.java
index 6e4745ed11b15049e4351364364cdd1dc3004dc0..73e07e8d12485917b1071146289aa7c1e9ee5f1a 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/NumberOfDocuments.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/NumberOfDocuments.java
@@ -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 @@ import javax.print.attribute.PrintJobAttribute;
  * <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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/NumberOfInterveningJobs.java b/jdk/src/share/classes/javax/print/attribute/standard/NumberOfInterveningJobs.java
index 86005835a85707e02dec6fdd8b02b3f7f5f69e08..e73ef00be84952101d2f4c067bd8c2bdb7652f42 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/NumberOfInterveningJobs.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/NumberOfInterveningJobs.java
@@ -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 @@ import javax.print.attribute.PrintJobAttribute;
  * <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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/NumberUpSupported.java b/jdk/src/share/classes/javax/print/attribute/standard/NumberUpSupported.java
index 617367c89326c525c9b2ff63461c813b7a1f2646..a7f1b98bc1f0a18b83050610fe695b96cb77ab4e 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/NumberUpSupported.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/NumberUpSupported.java
@@ -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 @@ import javax.print.attribute.SupportedValuesAttribute;
  * 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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/OrientationRequested.java b/jdk/src/share/classes/javax/print/attribute/standard/OrientationRequested.java
index 1c468f0448c68c609bd32eb5e9f1b4e8e9970fc2..a026baac5db2f98e6666b18071a6b531c54cc637 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/OrientationRequested.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/OrientationRequested.java
@@ -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 @@ import javax.print.attribute.PrintJobAttribute;
  * <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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/OutputDeviceAssigned.java b/jdk/src/share/classes/javax/print/attribute/standard/OutputDeviceAssigned.java
index c2e091108c8ad2c6437621abdabc967dbf0787f8..5ebf19378fdc0daf7d05674aeca6c7af97857185 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/OutputDeviceAssigned.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/OutputDeviceAssigned.java
@@ -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 @@ import javax.print.attribute.PrintJobAttribute;
  * <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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/PDLOverrideSupported.java b/jdk/src/share/classes/javax/print/attribute/standard/PDLOverrideSupported.java
index 8f1ce4eda9a6f42995981a2e473799e8c47b3672..b7f75af6ead454bf6c97f725e18c721c60d9430f 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/PDLOverrideSupported.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PDLOverrideSupported.java
@@ -38,7 +38,6 @@ import javax.print.attribute.PrintServiceAttribute;
  * <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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/PagesPerMinute.java b/jdk/src/share/classes/javax/print/attribute/standard/PagesPerMinute.java
index cb615e2aed8d1b8a8b9ad1df53a59dacee0c5709..37d0ddbd5d7a04f7daf9e815b2a92ac98049282e 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/PagesPerMinute.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PagesPerMinute.java
@@ -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 @@ import javax.print.attribute.PrintServiceAttribute;
  * <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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/PagesPerMinuteColor.java b/jdk/src/share/classes/javax/print/attribute/standard/PagesPerMinuteColor.java
index 23aec09e9f6d4d790f640279d5c6646a5f8e899c..f139c5964ced2c558049900fbeaa91870c424cf1 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/PagesPerMinuteColor.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PagesPerMinuteColor.java
@@ -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 @@ import javax.print.attribute.PrintServiceAttribute;
  * <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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/PresentationDirection.java b/jdk/src/share/classes/javax/print/attribute/standard/PresentationDirection.java
index d5fbb0d924545a541cbaf783c0e934bfd27120eb..4b3ff06d073a73082e51c9fde1643b4344212c67 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/PresentationDirection.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PresentationDirection.java
@@ -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 @@ import javax.print.attribute.PrintRequestAttribute;
  * <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.
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/PrintQuality.java b/jdk/src/share/classes/javax/print/attribute/standard/PrintQuality.java
index 1ed3caf8254deb364ea7a0b7f8afcc865ab58548..6240965c68a048dd241eadb09bb220c84855a23a 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/PrintQuality.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrintQuality.java
@@ -38,7 +38,6 @@ import javax.print.attribute.PrintJobAttribute;
  * <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
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/PrinterInfo.java b/jdk/src/share/classes/javax/print/attribute/standard/PrinterInfo.java
index 9a19d32a84011c9517ade2f38e3e27ba19948f6c..57813ec20b777e68d5f43a2c354d15d14e07f39d 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/PrinterInfo.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterInfo.java
@@ -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 @@ import javax.print.attribute.PrintServiceAttribute;
  * <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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/PrinterIsAcceptingJobs.java b/jdk/src/share/classes/javax/print/attribute/standard/PrinterIsAcceptingJobs.java
index c22042c73c31d4b191dbae89501d17aa0d241a06..b04c4bab5ecbe5d2a17f504015cf71dee975d53c 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/PrinterIsAcceptingJobs.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterIsAcceptingJobs.java
@@ -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 @@ import javax.print.attribute.PrintServiceAttribute;
  * <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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/PrinterLocation.java b/jdk/src/share/classes/javax/print/attribute/standard/PrinterLocation.java
index b212cd7d0c6fdb354a901bf1e547bc9ec96fe5db..7675cb956d4f6deb14627ed8f77a4f6637338b46 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/PrinterLocation.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterLocation.java
@@ -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 @@ import javax.print.attribute.PrintServiceAttribute;
  * <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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/PrinterMakeAndModel.java b/jdk/src/share/classes/javax/print/attribute/standard/PrinterMakeAndModel.java
index efd11bd524475731acf7729dfdd65c0ae8068a0a..c0538fae8455a21f1935f792820c252d03685ab0 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/PrinterMakeAndModel.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterMakeAndModel.java
@@ -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 @@ import javax.print.attribute.PrintServiceAttribute;
  * <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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/PrinterMessageFromOperator.java b/jdk/src/share/classes/javax/print/attribute/standard/PrinterMessageFromOperator.java
index a427c06bee58156a2d5b14d1921d02042eb8e5cb..d46412d2f9c8bfc28f5edb1391a6116658169646 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/PrinterMessageFromOperator.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterMessageFromOperator.java
@@ -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 @@ import javax.print.attribute.PrintServiceAttribute;
  * <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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/PrinterMoreInfo.java b/jdk/src/share/classes/javax/print/attribute/standard/PrinterMoreInfo.java
index d34c9e95d19841e8a3350ff093b158c41dbfe020..c982907badf41f20706fadc59d645f3b802c6c79 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/PrinterMoreInfo.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterMoreInfo.java
@@ -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 @@ import javax.print.attribute.PrintServiceAttribute;
  * <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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/PrinterMoreInfoManufacturer.java b/jdk/src/share/classes/javax/print/attribute/standard/PrinterMoreInfoManufacturer.java
index 8cedd1517f8818b044dbc80033c2248a4fb6019e..10b4e9acacee812df7e7d689f3c2b24fa3422cfa 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/PrinterMoreInfoManufacturer.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterMoreInfoManufacturer.java
@@ -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 @@ import javax.print.attribute.PrintServiceAttribute;
  * <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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/PrinterName.java b/jdk/src/share/classes/javax/print/attribute/standard/PrinterName.java
index d081d3dee643a3eda977a7fb86a8a4bf7d58d11f..a8b2487ad177695922e70e3b17e4535a3339d0f1 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/PrinterName.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterName.java
@@ -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 @@ import javax.print.attribute.PrintServiceAttribute;
  * <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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/PrinterResolution.java b/jdk/src/share/classes/javax/print/attribute/standard/PrinterResolution.java
index 795ee5e860d255119f39012b4933676f1e14ee74..67d908103a2f885bce5ef22c234993fe932574c1 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/PrinterResolution.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterResolution.java
@@ -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 @@ import javax.print.attribute.PrintJobAttribute;
  * <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
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/PrinterState.java b/jdk/src/share/classes/javax/print/attribute/standard/PrinterState.java
index efe878f667174231e4ea09a97ece8b610135b675..961d82ec53dd9ead8b88424b9583f187c8b3e8ca 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/PrinterState.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterState.java
@@ -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 @@ import javax.print.attribute.PrintServiceAttribute;
  * <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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/PrinterStateReason.java b/jdk/src/share/classes/javax/print/attribute/standard/PrinterStateReason.java
index 5c4f48f88536b9091a14ee7024fbe70d5eb851c1..ece9a53839733be321eec7109a4a0d943176fb42 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/PrinterStateReason.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterStateReason.java
@@ -61,7 +61,6 @@ import javax.print.attribute.Attribute;
  * 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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/PrinterStateReasons.java b/jdk/src/share/classes/javax/print/attribute/standard/PrinterStateReasons.java
index 89b08f311ada97fda0a29f0e838e45327cfd8f04..73e57658a45b882533840ef2b25f87c985f6eb7c 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/PrinterStateReasons.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterStateReasons.java
@@ -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 @@ import javax.print.attribute.PrintServiceAttribute;
  * 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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/PrinterURI.java b/jdk/src/share/classes/javax/print/attribute/standard/PrinterURI.java
index e7105f8db737e6f571917098db28791216e28dc1..9471b73481bf1760ae9fcac3455661369308b831 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/PrinterURI.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterURI.java
@@ -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 @@ import javax.print.attribute.PrintServiceAttribute;
  * <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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/QueuedJobCount.java b/jdk/src/share/classes/javax/print/attribute/standard/QueuedJobCount.java
index f2f94913176b9a77678ece65b790164784b57f37..f335288bd9c7056b01d6ebf984eaa72d99fcdfdb 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/QueuedJobCount.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/QueuedJobCount.java
@@ -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 @@ import javax.print.attribute.PrintServiceAttribute;
  * <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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/ReferenceUriSchemesSupported.java b/jdk/src/share/classes/javax/print/attribute/standard/ReferenceUriSchemesSupported.java
index a403843adeb0a670a233ba9b5d8dcaeafb171a9e..8597c3143eb38178106ba86c6b275718a6c2971f 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/ReferenceUriSchemesSupported.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/ReferenceUriSchemesSupported.java
@@ -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 @@ import javax.print.attribute.Attribute;
  * <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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/RequestingUserName.java b/jdk/src/share/classes/javax/print/attribute/standard/RequestingUserName.java
index 519d79ac94c906ed38418525412255e2ab1e0c37..62bd3e03763def7c5885e6e69162894dee756686 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/RequestingUserName.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/RequestingUserName.java
@@ -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 @@ import javax.print.attribute.PrintRequestAttribute;
  * <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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/Severity.java b/jdk/src/share/classes/javax/print/attribute/standard/Severity.java
index 67aaa8441acda862f9b97e4f773f4acf83cd335e..36df6b6f5d00b39180d6062c3e498db758df7d09 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/Severity.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/Severity.java
@@ -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 @@ import javax.print.attribute.Attribute;
  * 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
  */
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/SheetCollate.java b/jdk/src/share/classes/javax/print/attribute/standard/SheetCollate.java
index 92095a1a16bd9d13757a05cf9b89a94fff174049..1d264a5964e31bf5de94e3e86d845158459b6106 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/SheetCollate.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/SheetCollate.java
@@ -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 @@ import javax.print.attribute.PrintJobAttribute;
  * </UL>
  * <P>
  * <B>IPP Compatibility:</B> SheetCollate is not an IPP attribute at present.
- * <P>
  *
  * @see  MultipleDocumentHandling
  *
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/package.html b/jdk/src/share/classes/javax/print/attribute/standard/package.html
index 49fcbf37a76ed4d1a0ef93ac50f5bfccb398a0d6..78d29368527c463588ade261ded4f5545a33c3c0 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/package.html
+++ b/jdk/src/share/classes/javax/print/attribute/standard/package.html
@@ -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 @@ interpretation. Usage to the contrary is incorrect coding and may result
 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>
diff --git a/jdk/src/share/classes/javax/print/event/package.html b/jdk/src/share/classes/javax/print/event/package.html
index 10426d8df6080f81f2f6a18db1d0cf868bb13086..6e49d8b4fdaacfb3d5e385a67989c78f54cae86d 100644
--- a/jdk/src/share/classes/javax/print/event/package.html
+++ b/jdk/src/share/classes/javax/print/event/package.html
@@ -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 @@ interpretation. Usage to the contrary is incorrect coding and may result
 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>
diff --git a/jdk/src/share/classes/javax/print/package.html b/jdk/src/share/classes/javax/print/package.html
index e4076f87baa555653c6adf743053004ca32aba40..2ef9578cdea2d2ae82767ac986e34e8b09f8c67a 100644
--- a/jdk/src/share/classes/javax/print/package.html
+++ b/jdk/src/share/classes/javax/print/package.html
@@ -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 @@ interpretation. Usage to the contrary is incorrect coding and may result
 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>
diff --git a/jdk/src/share/classes/javax/sound/midi/MidiSystem.java b/jdk/src/share/classes/javax/sound/midi/MidiSystem.java
index d6ef5432978c00d9ec2d6bc2d04df31bafd49043..635dc54ce7aa60b62bcc2189ef7b6975feef5ddc 100644
--- a/jdk/src/share/classes/javax/sound/midi/MidiSystem.java
+++ b/jdk/src/share/classes/javax/sound/midi/MidiSystem.java
@@ -914,7 +914,7 @@ public class MidiSystem {
             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 @@ public class MidiSystem {
             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()];
diff --git a/jdk/src/share/classes/javax/swing/AbstractAction.java b/jdk/src/share/classes/javax/swing/AbstractAction.java
index 1f0ef9902435783d115f70d6905db959650deed5..5c8f6e6626fe2d6936494b771500a5123578af96 100644
--- a/jdk/src/share/classes/javax/swing/AbstractAction.java
+++ b/jdk/src/share/classes/javax/swing/AbstractAction.java
@@ -269,6 +269,10 @@ public abstract class AbstractAction implements Action, Cloneable, Serializable
      * 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 ||
diff --git a/jdk/src/share/classes/javax/swing/CellRendererPane.java b/jdk/src/share/classes/javax/swing/CellRendererPane.java
index 6050693eeeb59f3c61cf3319f8ed9ad70eafb332..c21a282bf296646b67eaab17bf8a6deecae5c757 100644
--- a/jdk/src/share/classes/javax/swing/CellRendererPane.java
+++ b/jdk/src/share/classes/javax/swing/CellRendererPane.java
@@ -120,6 +120,18 @@ public class CellRendererPane extends Container implements Accessible
      * 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 @@ public class CellRendererPane extends Container implements Accessible
 
     /**
      * 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 @@ public class CellRendererPane extends Container implements Accessible
 
     /**
      * 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);
diff --git a/jdk/src/share/classes/javax/swing/DebugGraphics.java b/jdk/src/share/classes/javax/swing/DebugGraphics.java
index 99a4f5b07ee9970b7c5dc3641068a03e1141c340..050ce604c697117e1d8b73340367fc29341301ef 100644
--- a/jdk/src/share/classes/javax/swing/DebugGraphics.java
+++ b/jdk/src/share/classes/javax/swing/DebugGraphics.java
@@ -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 @@ public class DebugGraphics extends Graphics {
 
     /**
      * 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 @@ public class DebugGraphics extends Graphics {
 
     /**
      * 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 @@ public class DebugGraphics extends Graphics {
 
     /**
      * 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 @@ public class DebugGraphics extends Graphics {
 
     /**
      * 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 @@ public class DebugGraphics extends Graphics {
 
     /**
      * 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 @@ public class DebugGraphics extends Graphics {
       * 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 @@ public class DebugGraphics extends Graphics {
         }
     }
 
-    /** 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;
     }
diff --git a/jdk/src/share/classes/javax/swing/DefaultBoundedRangeModel.java b/jdk/src/share/classes/javax/swing/DefaultBoundedRangeModel.java
index b7b989e07fad98701c27c97782d90097ab517d51..20f44a28ea3cc8336ee248382ad69a256536a722 100644
--- a/jdk/src/share/classes/javax/swing/DefaultBoundedRangeModel.java
+++ b/jdk/src/share/classes/javax/swing/DefaultBoundedRangeModel.java
@@ -88,6 +88,11 @@ public class DefaultBoundedRangeModel implements BoundedRangeModel, Serializable
      * <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 @@ public class DefaultBoundedRangeModel implements BoundedRangeModel, Serializable
      * 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>
diff --git a/jdk/src/share/classes/javax/swing/DefaultDesktopManager.java b/jdk/src/share/classes/javax/swing/DefaultDesktopManager.java
index ebee71521d92132a632e732068a2b6cd3f28046a..49eecf1e77cd544d4ee1092af042664fb6635c7c 100644
--- a/jdk/src/share/classes/javax/swing/DefaultDesktopManager.java
+++ b/jdk/src/share/classes/javax/swing/DefaultDesktopManager.java
@@ -71,7 +71,7 @@ public class DefaultDesktopManager implements DesktopManager, java.io.Serializab
     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) {
diff --git a/jdk/src/share/classes/javax/swing/DefaultSingleSelectionModel.java b/jdk/src/share/classes/javax/swing/DefaultSingleSelectionModel.java
index 75c522e79c917ef7aa3e71fae7a4bf4fbed723b9..532639c071fd22d2f028b2670d3d58b682887896 100644
--- a/jdk/src/share/classes/javax/swing/DefaultSingleSelectionModel.java
+++ b/jdk/src/share/classes/javax/swing/DefaultSingleSelectionModel.java
@@ -155,6 +155,7 @@ Serializable {
      * 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>
diff --git a/jdk/src/share/classes/javax/swing/DesktopManager.java b/jdk/src/share/classes/javax/swing/DesktopManager.java
index edcfaf4fabbd1bf02c92df4da9310300b715ccb8..5e08a6f139de5de46aa51d384267cd35fb4554ea 100644
--- a/jdk/src/share/classes/javax/swing/DesktopManager.java
+++ b/jdk/src/share/classes/javax/swing/DesktopManager.java
@@ -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 @@ package javax.swing;
   */
 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);
 }
diff --git a/jdk/src/share/classes/javax/swing/GrayFilter.java b/jdk/src/share/classes/javax/swing/GrayFilter.java
index 573edbedb6302b35a828da6603fb421e52801df2..af5947e5eecb7af9e827c04f7c3eddb656850fb1 100644
--- a/jdk/src/share/classes/javax/swing/GrayFilter.java
+++ b/jdk/src/share/classes/javax/swing/GrayFilter.java
@@ -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 @@ public class GrayFilter extends RGBImageFilter {
 
     /**
      * 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);
diff --git a/jdk/src/share/classes/javax/swing/Icon.java b/jdk/src/share/classes/javax/swing/Icon.java
index 87c53684711e6868085950ebeff639a495f24cb1..4bad4d461d34dd5a333fe05f10ff62e17e95074f 100644
--- a/jdk/src/share/classes/javax/swing/Icon.java
+++ b/jdk/src/share/classes/javax/swing/Icon.java
@@ -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 @@ public interface Icon
      * 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);
 
diff --git a/jdk/src/share/classes/javax/swing/JApplet.java b/jdk/src/share/classes/javax/swing/JApplet.java
index 651d004660d6ed65eb040dcd2dfd8b98809cb973..5f8570760276067681feac29e148ad77b8273f97 100644
--- a/jdk/src/share/classes/javax/swing/JApplet.java
+++ b/jdk/src/share/classes/javax/swing/JApplet.java
@@ -157,8 +157,11 @@ public class JApplet extends Applet implements Accessible,
         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 @@ public class JApplet extends Applet implements Accessible,
    /**
     * Returns the menubar set on this applet.
     *
+    * @return the menubar set on this applet
     * @see #setJMenuBar
     */
     public JMenuBar getJMenuBar() {
@@ -542,6 +546,9 @@ public class JApplet extends Applet implements Accessible,
 // Accessibility support
 ////////////////
 
+    /**
+     * {@code AccessibleContext} associated with this {@code JApplet}
+     */
     protected AccessibleContext accessibleContext = null;
 
     /**
diff --git a/jdk/src/share/classes/javax/swing/JComponent.java b/jdk/src/share/classes/javax/swing/JComponent.java
index 7d0b876dc9d48e5feb5bde3b8caa5667c8c28713..765610ebbad2c3f5b744df14bc32f88347cfdc14 100644
--- a/jdk/src/share/classes/javax/swing/JComponent.java
+++ b/jdk/src/share/classes/javax/swing/JComponent.java
@@ -496,6 +496,7 @@ public abstract class JComponent extends Container implements Serializable,
     /**
      * 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 @@ public abstract class JComponent extends Container implements Serializable,
      * <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 @@ public abstract class JComponent extends Container implements Serializable,
      * 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 @@ public abstract class JComponent extends Container implements Serializable,
      * 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 @@ public abstract class JComponent extends Container implements Serializable,
      * 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 @@ public abstract class JComponent extends Container implements Serializable,
      * 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 @@ public abstract class JComponent extends Container implements Serializable,
      * <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 @@ public abstract class JComponent extends Container implements Serializable,
      * 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 @@ public abstract class JComponent extends Container implements Serializable,
      * <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 @@ public abstract class JComponent extends Container implements Serializable,
          * 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 @@ public abstract class JComponent extends Container implements Serializable,
      * 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")
diff --git a/jdk/src/share/classes/javax/swing/JDesktopPane.java b/jdk/src/share/classes/javax/swing/JDesktopPane.java
index 35d53d2d91860cd1b5c8b29fb06cac71fe2107f2..54142344e3749822080b2f0781b8a589df92272b 100644
--- a/jdk/src/share/classes/javax/swing/JDesktopPane.java
+++ b/jdk/src/share/classes/javax/swing/JDesktopPane.java
@@ -208,8 +208,11 @@ public class JDesktopPane extends JLayeredPane implements Accessible
      }
 
     /**
-     * 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;
diff --git a/jdk/src/share/classes/javax/swing/JDialog.java b/jdk/src/share/classes/javax/swing/JDialog.java
index ae0a3519e93eea856880b2c41882614ff9d38db0..00e8198b03e83208299875a6ec344a9da9dc4440 100644
--- a/jdk/src/share/classes/javax/swing/JDialog.java
+++ b/jdk/src/share/classes/javax/swing/JDialog.java
@@ -664,6 +664,8 @@ public class JDialog extends Dialog implements WindowConstants,
     /**
      * 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 @@ public class JDialog extends Dialog implements WindowConstants,
    /**
     * Returns the menubar set on this dialog.
     *
+    * @return the menubar set on this dialog
     * @see #setJMenuBar
     */
     public JMenuBar getJMenuBar() {
@@ -1225,6 +1228,9 @@ public class JDialog extends Dialog implements WindowConstants,
 // Accessibility support
 ////////////////
 
+    /**
+     * {@code AccessibleContext} associated with this {@code JDialog}
+     */
     protected AccessibleContext accessibleContext = null;
 
     /**
diff --git a/jdk/src/share/classes/javax/swing/JEditorPane.java b/jdk/src/share/classes/javax/swing/JEditorPane.java
index d5a41d9bd665c97570f902b4d11b8269b02d654e..8319987ebdd680cf4db6a355a3186f4f294e733f 100644
--- a/jdk/src/share/classes/javax/swing/JEditorPane.java
+++ b/jdk/src/share/classes/javax/swing/JEditorPane.java
@@ -39,6 +39,7 @@ import javax.swing.text.*;
 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 @@ public class JEditorPane extends JTextComponent {
             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);
diff --git a/jdk/src/share/classes/javax/swing/JInternalFrame.java b/jdk/src/share/classes/javax/swing/JInternalFrame.java
index 3ecb82450d2fa610bb1420fd3f7c80a926f635bb..fec8440e8ccb55bbb4937a31993f10ba4c994053 100644
--- a/jdk/src/share/classes/javax/swing/JInternalFrame.java
+++ b/jdk/src/share/classes/javax/swing/JInternalFrame.java
@@ -2107,7 +2107,7 @@ public class JInternalFrame extends JComponent implements
             if (n == null) {
                 return false;
             }
-            setLayer(new Integer(n.intValue()));
+            setLayer(Integer.valueOf(n.intValue()));
             return true;
         }
 
diff --git a/jdk/src/share/classes/javax/swing/JLabel.java b/jdk/src/share/classes/javax/swing/JLabel.java
index 2b0be80b1c7ee4be688cc69a64d41038f706538e..3191f84ccf558d9c0e8460c244f3605ec8c8193e 100644
--- a/jdk/src/share/classes/javax/swing/JLabel.java
+++ b/jdk/src/share/classes/javax/swing/JLabel.java
@@ -128,6 +128,10 @@ public class JLabel extends JComponent implements SwingConstants, Accessible
     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 @@ public class JLabel extends JComponent implements SwingConstants, Accessible
      * <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 @@ public class JLabel extends JComponent implements SwingConstants, Accessible
      * <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 @@ public class JLabel extends JComponent implements SwingConstants, Accessible
      * 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 @@ public class JLabel extends JComponent implements SwingConstants, Accessible
      *
      * @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 @@ public class JLabel extends JComponent implements SwingConstants, Accessible
      *
      * @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 @@ public class JLabel extends JComponent implements SwingConstants, Accessible
      * <p>
      * This is a JavaBeans bound property.
      *
+     * @param iconTextGap  the space between the icon and text properties
      * @see #getIconTextGap
      * @beaninfo
      *        bound: true
diff --git a/jdk/src/share/classes/javax/swing/JLayeredPane.java b/jdk/src/share/classes/javax/swing/JLayeredPane.java
index ecb40a60bf5cff8ea160b3949135e6cb894cf23b..4a891217e2dab1859ffd32dfa3994803206eb6f5 100644
--- a/jdk/src/share/classes/javax/swing/JLayeredPane.java
+++ b/jdk/src/share/classes/javax/swing/JLayeredPane.java
@@ -159,15 +159,15 @@ import javax.accessibility.*;
 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 class JLayeredPane extends JComponent implements Accessible {
       */
     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 @@ public class JLayeredPane extends JComponent implements Accessible {
      * @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;
     }
 
     /**
diff --git a/jdk/src/share/classes/javax/swing/JPopupMenu.java b/jdk/src/share/classes/javax/swing/JPopupMenu.java
index 3f2a57323a56e44323bdc9d1d242c03e15025cb4..ca00144b77486af360be54a75f633710806b2ad3 100644
--- a/jdk/src/share/classes/javax/swing/JPopupMenu.java
+++ b/jdk/src/share/classes/javax/swing/JPopupMenu.java
@@ -298,6 +298,7 @@ public class JPopupMenu extends JComponent implements Accessible,MenuElement {
      * 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 @@ public class JPopupMenu extends JComponent implements Accessible,MenuElement {
     /**
      * 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 @@ public class JPopupMenu extends JComponent implements Accessible,MenuElement {
     @SuppressWarnings("serial")
     static public class Separator extends JSeparator
     {
+        /**
+         * Constructs a popup menu-specific Separator.
+         */
         public Separator( )
         {
             super( JSeparator.HORIZONTAL );
@@ -1553,6 +1560,7 @@ public class JPopupMenu extends JComponent implements Accessible,MenuElement {
      * 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
      */
diff --git a/jdk/src/share/classes/javax/swing/JScrollBar.java b/jdk/src/share/classes/javax/swing/JScrollBar.java
index 230ba8081c7758d2de5f6ab51cc1cb109ae91280..0f6b61640e71d7bb628944af3c9ef105ead0e433 100644
--- a/jdk/src/share/classes/javax/swing/JScrollBar.java
+++ b/jdk/src/share/classes/javax/swing/JScrollBar.java
@@ -341,7 +341,7 @@ public class JScrollBar extends JComponent implements Adjustable, Accessible
         if (accessibleContext != null) {
             accessibleContext.firePropertyChange(
                     AccessibleContext.ACCESSIBLE_VALUE_PROPERTY,
-                    oldValue, new Integer(model.getValue()));
+                    oldValue, model.getValue());
         }
     }
 
@@ -952,7 +952,7 @@ public class JScrollBar extends JComponent implements Adjustable, Accessible
          */
         public Number getMaximumAccessibleValue() {
             // TIGER - 4422362
-            return new Integer(model.getMaximum() - model.getExtent());
+            return model.getMaximum() - model.getExtent();
         }
 
     } // AccessibleJScrollBar
diff --git a/jdk/src/share/classes/javax/swing/JScrollPane.java b/jdk/src/share/classes/javax/swing/JScrollPane.java
index 373523e936e5086d5c0f61ffa549d60c9adbb9ae..39700a68429cf7ba4e6d4c3569091136bfd4d468 100644
--- a/jdk/src/share/classes/javax/swing/JScrollPane.java
+++ b/jdk/src/share/classes/javax/swing/JScrollPane.java
@@ -1102,6 +1102,7 @@ public class JScrollPane extends JComponent implements ScrollPaneConstants, Acce
      * <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 @@ public class JScrollPane extends JComponent implements ScrollPaneConstants, Acce
      * 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 @@ public class JScrollPane extends JComponent implements ScrollPaneConstants, Acce
     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() {
diff --git a/jdk/src/share/classes/javax/swing/JSpinner.java b/jdk/src/share/classes/javax/swing/JSpinner.java
index 1643257dec56dd52cce0f37737468ea51e2eecf6..2e51212ff3ad83538dc2a1ee27b25258372c7093 100644
--- a/jdk/src/share/classes/javax/swing/JSpinner.java
+++ b/jdk/src/share/classes/javax/swing/JSpinner.java
@@ -149,6 +149,7 @@ public class JSpinner extends JComponent implements Accessible
      * 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 @@ public class JSpinner extends JComponent implements Accessible
      * getModel().getValue()
      * </pre>
      *
+     * @return the current value of the model
      * @see #setValue
      * @see SpinnerModel#getValue
      */
@@ -349,6 +351,7 @@ public class JSpinner extends JComponent implements Accessible
      * 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
diff --git a/jdk/src/share/classes/javax/swing/JTextField.java b/jdk/src/share/classes/javax/swing/JTextField.java
index e90740362f567d65e943b318f9a531c53cb29014..942900528708520db59bf71df4841de0a28f5f50 100644
--- a/jdk/src/share/classes/javax/swing/JTextField.java
+++ b/jdk/src/share/classes/javax/swing/JTextField.java
@@ -675,6 +675,9 @@ public class JTextField extends JTextComponent implements SwingConstants {
      * 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
diff --git a/jdk/src/share/classes/javax/swing/JWindow.java b/jdk/src/share/classes/javax/swing/JWindow.java
index cf95a417fd5a77ea78b6e678e26ae981244ad494..804d4e3edc7759f7ec4245063fb2d7fdf31d887d 100644
--- a/jdk/src/share/classes/javax/swing/JWindow.java
+++ b/jdk/src/share/classes/javax/swing/JWindow.java
@@ -272,6 +272,8 @@ public class JWindow extends Window implements Accessible,
     /**
      * Called by the constructor methods to create the default
      * <code>rootPane</code>.
+     *
+     * @return a new {@code JRootPane}
      */
     protected JRootPane createRootPane() {
         JRootPane rp = new JRootPane();
diff --git a/jdk/src/share/classes/javax/swing/LookAndFeel.java b/jdk/src/share/classes/javax/swing/LookAndFeel.java
index 30c4c83dfc96bc0024c8f9268fe185a6822c1d8c..a61c7844d6e47528274a1f0da5d0987337e2c362 100644
--- a/jdk/src/share/classes/javax/swing/LookAndFeel.java
+++ b/jdk/src/share/classes/javax/swing/LookAndFeel.java
@@ -465,7 +465,7 @@ public abstract class LookAndFeel
      * @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);
     }
 
     /**
diff --git a/jdk/src/share/classes/javax/swing/ProgressMonitor.java b/jdk/src/share/classes/javax/swing/ProgressMonitor.java
index 506b443b4f5e2acf8171f0b7a993b9d110221c0c..e2af3ee44cd58dc2054d3d6c59ed1e3d7ff44139 100644
--- a/jdk/src/share/classes/javax/swing/ProgressMonitor.java
+++ b/jdk/src/share/classes/javax/swing/ProgressMonitor.java
@@ -369,6 +369,8 @@ public class ProgressMonitor implements Accessible
 
     /**
      * 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 @@ public class ProgressMonitor implements Accessible
      * 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 @@ public class ProgressMonitor implements Accessible
     /**
      * 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() {
diff --git a/jdk/src/share/classes/javax/swing/SortingFocusTraversalPolicy.java b/jdk/src/share/classes/javax/swing/SortingFocusTraversalPolicy.java
index 797f6f35524a8389ad32fec61e6a0bb18c003a02..7199531c61bd103421948a63de026321139d451a 100644
--- a/jdk/src/share/classes/javax/swing/SortingFocusTraversalPolicy.java
+++ b/jdk/src/share/classes/javax/swing/SortingFocusTraversalPolicy.java
@@ -109,11 +109,12 @@ public class SortingFocusTraversalPolicy
             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;
                     }
diff --git a/jdk/src/share/classes/javax/swing/SpinnerModel.java b/jdk/src/share/classes/javax/swing/SpinnerModel.java
index 7c060248eace971e743fc21d614b26860d955721..57af106271f6e481969904b4f611d9afd953a18d 100644
--- a/jdk/src/share/classes/javax/swing/SpinnerModel.java
+++ b/jdk/src/share/classes/javax/swing/SpinnerModel.java
@@ -88,6 +88,7 @@ public interface SpinnerModel
      * 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
      */
diff --git a/jdk/src/share/classes/javax/swing/Timer.java b/jdk/src/share/classes/javax/swing/Timer.java
index 2c25598b88c0da42f5b774589093700518b4af99..6caced7dd8dd74e69e848f88743919f1b39d15a0 100644
--- a/jdk/src/share/classes/javax/swing/Timer.java
+++ b/jdk/src/share/classes/javax/swing/Timer.java
@@ -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 @@ public class Timer implements Serializable
      * 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 @@ public class Timer implements Serializable
      * 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 @@ public class Timer implements Serializable
      * 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 @@ public class Timer implements Serializable
 
 
     /**
-     * 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 @@ public class Timer implements Serializable
      * 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 @@ public class Timer implements Serializable
 
 
     /**
-     * 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 @@ public class Timer implements Serializable
 
 
     /**
-     * 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() {
diff --git a/jdk/src/share/classes/javax/swing/filechooser/FileSystemView.java b/jdk/src/share/classes/javax/swing/filechooser/FileSystemView.java
index f11827b6df1501ab044e6e7257b4429b30996c88..96a7ed3d6076aea791ef778378b35a46000d9806 100644
--- a/jdk/src/share/classes/javax/swing/filechooser/FileSystemView.java
+++ b/jdk/src/share/classes/javax/swing/filechooser/FileSystemView.java
@@ -645,7 +645,7 @@ class UnixFileSystemView extends FileSystemView {
         int i = 1;
         while (newFolder.exists() && i < 100) {
             newFolder = createFileObject(containingDir, MessageFormat.format(
-                    newFolderNextString, new Integer(i)));
+                    newFolderNextString, i));
             i++;
         }
 
@@ -755,7 +755,7 @@ class WindowsFileSystemView extends FileSystemView {
         int i = 2;
         while (newFolder.exists() && i < 100) {
             newFolder = createFileObject(containingDir, MessageFormat.format(
-                newFolderNextString, new Integer(i)));
+                newFolderNextString, i));
             i++;
         }
 
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicArrowButton.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicArrowButton.java
index 750fe60c2355868eb65bc48600302f15ef20a7c4..4c1e590779eacc2ad7a3cfc1f33189489025e7ec 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicArrowButton.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicArrowButton.java
@@ -99,6 +99,8 @@ public class BasicArrowButton extends JButton implements SwingConstants
 
         /**
          * Returns the direction of the arrow.
+         *
+         * @return the direction of the arrow
          */
         public int getDirection() {
             return direction;
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicBorders.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicBorders.java
index 05a3093e25453c0dd059391a10634881c6a2c7a7..633b2f91ee4bb0b8430790d907513a8972761ab9 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicBorders.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicBorders.java
@@ -45,6 +45,11 @@ import java.awt.Graphics;
 
 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 @@ public class BasicBorders {
         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 @@ public class BasicBorders {
         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 @@ public class BasicBorders {
         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 @@ public class BasicBorders {
         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 @@ public class BasicBorders {
     }
 
     /**
-     * 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 @@ public class BasicBorders {
         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 @@ public class BasicBorders {
         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 @@ public class BasicBorders {
     @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 @@ public class BasicBorders {
         }
     }
 
+    /**
+     * 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 @@ public class BasicBorders {
 
     }
 
+    /**
+     * 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 @@ public class BasicBorders {
         }
     }
 
+    /**
+     * 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 @@ public class BasicBorders {
         }
     }
 
+    /**
+     * 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 @@ public class BasicBorders {
         }
     }
 
+    /**
+     * 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 @@ public class BasicBorders {
         }
     }
 
+    /**
+     * 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 @@ public class BasicBorders {
      * 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;
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicButtonListener.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicButtonListener.java
index 1367e0c58a8aa12ddb583323824070651a8b854b..3278d33e4a9ae7e5e659c0cbf1112baedbdc3bdb 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicButtonListener.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicButtonListener.java
@@ -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 @@ public class BasicButtonListener implements MouseListener, MouseMotionListener,
     }
 
 
+    /**
+     * Constructs a new instance of {@code BasicButtonListener}.
+     *
+     * @param b an abstract button
+     */
     public BasicButtonListener(AbstractButton b) {
     }
 
@@ -76,13 +81,20 @@ public class BasicButtonListener implements MouseListener, MouseMotionListener,
         }
     }
 
+    /**
+     * 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 @@ public class BasicButtonListener implements MouseListener, MouseMotionListener,
     }
 
     /**
-     * Unregister's default key actions
+     * Unregister default key actions.
+     *
+     * @param c a component
      */
     public void uninstallKeyboardActions(JComponent c) {
         SwingUtilities.replaceUIInputMap(c, JComponent.
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicButtonUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicButtonUI.java
index 34595149b95c797f601ea97ca8f167462db9f672..0e1aa403faca6e37711ee282fb7f6ac8619f930e 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicButtonUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicButtonUI.java
@@ -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 @@ public class BasicButtonUI extends ButtonUI{
     // 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 @@ public class BasicButtonUI extends ButtonUI{
     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 @@ public class BasicButtonUI extends ButtonUI{
     // ********************************
     //          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 @@ public class BasicButtonUI extends ButtonUI{
         return buttonUI;
     }
 
+    /**
+     * Returns the property prefix.
+     *
+     * @return the property prefix
+     */
     protected String getPropertyPrefix() {
         return propertyPrefix;
     }
@@ -91,6 +108,11 @@ public class BasicButtonUI extends ButtonUI{
         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 @@ public class BasicButtonUI extends ButtonUI{
         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 @@ public class BasicButtonUI extends ButtonUI{
         }
     }
 
+    /**
+     * Registers keyboard actions.
+     *
+     * @param b an abstract button
+     */
     protected void installKeyboardActions(AbstractButton b){
         BasicButtonListener listener = getButtonListener(b);
 
@@ -150,6 +182,11 @@ public class BasicButtonUI extends ButtonUI{
         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 @@ public class BasicButtonUI extends ButtonUI{
         }
     }
 
+    /**
+     * Unregisters listeners.
+     *
+     * @param b an abstract button
+     */
     protected void uninstallListeners(AbstractButton b) {
         BasicButtonListener listener = getButtonListener(b);
         if(listener != null) {
@@ -168,6 +210,11 @@ public class BasicButtonUI extends ButtonUI{
         }
     }
 
+    /**
+     * Uninstalls default properties.
+     *
+     * @param b an abstract button
+     */
     protected void uninstallDefaults(AbstractButton b) {
         LookAndFeel.uninstallBorder(b);
     }
@@ -175,10 +222,22 @@ public class BasicButtonUI extends ButtonUI{
     // ********************************
     //        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 @@ public class BasicButtonUI extends ButtonUI{
         }
     }
 
+    /**
+     * 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 @@ public class BasicButtonUI extends ButtonUI{
     }
 
     /**
+     * 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 @@ public class BasicButtonUI extends ButtonUI{
      *
      * @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 @@ public class BasicButtonUI extends ButtonUI{
 
     // 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;
     }
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicCheckBoxMenuItemUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicCheckBoxMenuItemUI.java
index 69a28c61723ed36c26ced785873a877e1b5cdb5d..99ffc8348449489fb28f37332643d403a5f35b94 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicCheckBoxMenuItemUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicCheckBoxMenuItemUI.java
@@ -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.*;
 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 @@ import java.io.Serializable;
  */
 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 @@ public class BasicCheckBoxMenuItemUI extends BasicMenuItemUI {
         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() &&
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicCheckBoxUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicCheckBoxUI.java
index 256a3afbfcf818012ed9026daa243424e402e8e2..d0deeb59ca557b4dcf58f2208760d01e3d5f3fd7 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicCheckBoxUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicCheckBoxUI.java
@@ -59,6 +59,13 @@ public class BasicCheckBoxUI extends BasicRadioButtonUI {
     // ********************************
     //            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 =
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicColorChooserUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicColorChooserUI.java
index 42b9a0b6c8bf0bb9103cc821a14fbc3e0936f1cb..7ad582a079285f9f2c77be729c1c94f375d61550 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicColorChooserUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicColorChooserUI.java
@@ -61,21 +61,45 @@ public class BasicColorChooserUI extends ColorChooserUI
     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 @@ public class BasicColorChooserUI extends ColorChooserUI
         handler = null;
     }
 
+    /**
+     * Installs preview panel.
+     */
     protected void installPreviewPanel() {
         JComponent previewPanel = this.chooser.getPreviewPanel();
         if (previewPanel == null) {
@@ -169,6 +196,9 @@ public class BasicColorChooserUI extends ColorChooserUI
         this.chooser.remove(this.previewPanelHolder);
     }
 
+    /**
+     * Installs default properties.
+     */
     protected void installDefaults() {
         LookAndFeel.installColorsAndFont(chooser, "ColorChooser.background",
                                               "ColorChooser.foreground",
@@ -180,16 +210,21 @@ public class BasicColorChooserUI extends ColorChooserUI
         }
     }
 
+    /**
+     * 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 @@ public class BasicColorChooserUI extends ColorChooserUI
         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);
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxEditor.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxEditor.java
index e9248631d1f74d910b41216706701c7a92a344cd..c7534c1e0c167e6b92091dc28de634e7d32e14c9 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxEditor.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxEditor.java
@@ -41,9 +41,15 @@ import sun.reflect.misc.MethodUtil;
  * @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();
     }
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxRenderer.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxRenderer.java
index 4b596dc4e196321926207a9a11e0909578ed663f..231eced6f52bdc0add6441faa334a15a1860b524 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxRenderer.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxRenderer.java
@@ -59,6 +59,9 @@ implements ListCellRenderer<Object>, Serializable {
     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);
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java
index de26e386efd8b898289ea4a14aa7fd2fe3dfda16..a144ce120e7078733ba987bf1a4cb18858b8df11 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java
@@ -61,6 +61,10 @@ import sun.swing.UIAction;
  * @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 @@ public class BasicComboBoxUI extends ComboBoxUI {
     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 @@ public class BasicComboBoxUI extends ComboBoxUI {
     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 @@ public class BasicComboBoxUI extends ComboBoxUI {
      */
     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 @@ public class BasicComboBoxUI extends ComboBoxUI {
     // 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 @@ public class BasicComboBoxUI extends ComboBoxUI {
      * 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 @@ public class BasicComboBoxUI extends ComboBoxUI {
 
     /**
      * 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 @@ public class BasicComboBoxUI extends ComboBoxUI {
 
     /**
      * Gets the insets from the JComboBox.
+     *
+     * @return the insets
      */
     protected Insets getInsets() {
         return comboBox.getInsets();
@@ -1206,6 +1248,10 @@ public class BasicComboBoxUI extends ComboBoxUI {
 
     /**
      * 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 @@ public class BasicComboBoxUI extends ComboBoxUI {
 
     /**
      * 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();
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboPopup.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboPopup.java
index 2f0cd03923da0291704896bdb7b456eac562a80e..9e06857d4b3434659379da944d1d3aab601f32c3 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboPopup.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboPopup.java
@@ -75,6 +75,9 @@ public class BasicComboPopup extends JPopupMenu implements ComboPopup {
 
     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 @@ public class BasicComboPopup extends JPopupMenu implements ComboPopup {
      * 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 @@ public class BasicComboPopup extends JPopupMenu implements ComboPopup {
         }
     }
 
+    /**
+     * Unregisters keyboard actions.
+     */
     protected void uninstallKeyboardActions() {
         // XXX - shouldn't call this method
 //        comboBox.unregisterKeyboardAction( KeyStroke.getKeyStroke( KeyEvent.VK_ENTER, 0 ) );
@@ -319,6 +344,12 @@ public class BasicComboPopup extends JPopupMenu implements ComboPopup {
     //===================================================================
     // 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 @@ public class BasicComboPopup extends JPopupMenu implements ComboPopup {
 
     /**
      * 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 @@ public class BasicComboPopup extends JPopupMenu implements ComboPopup {
         }
     }
 
+    /**
+     * Registers keyboard actions.
+     */
     protected void installKeyboardActions() {
 
         /* XXX - shouldn't call this method. take it out for testing.
@@ -1007,6 +1043,8 @@ public class BasicComboPopup extends JPopupMenu implements ComboPopup {
     /**
      * 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 @@ public class BasicComboPopup extends JPopupMenu implements ComboPopup {
      * 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 @@ public class BasicComboPopup extends JPopupMenu implements ComboPopup {
         }
     }
 
+    /**
+     * 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 @@ public class BasicComboPopup extends JPopupMenu implements ComboPopup {
     /**
      * 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 @@ public class BasicComboPopup extends JPopupMenu implements ComboPopup {
     /**
      * 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
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicDesktopIconUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicDesktopIconUI.java
index 8d68668af6a74b84ec27871f10acb7f18180b450..262f36ee7d8d881606d8510778ddab7758c0c267 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicDesktopIconUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicDesktopIconUI.java
@@ -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 @@ import java.beans.*;
  */
 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 @@ public class BasicDesktopIconUI extends DesktopIconUI {
     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 @@ public class BasicDesktopIconUI extends DesktopIconUI {
         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 @@ public class BasicDesktopIconUI extends DesktopIconUI {
         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 @@ public class BasicDesktopIconUI extends DesktopIconUI {
         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 @@ public class BasicDesktopIconUI extends DesktopIconUI {
                 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();
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicDesktopPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicDesktopPaneUI.java
index 695eb87bded9c2cdc5a3ac3cb46e095b1464d8a7..fe71487bdea78d3da16730b5d27214e475d67560 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicDesktopPaneUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicDesktopPaneUI.java
@@ -55,7 +55,14 @@ public class BasicDesktopPaneUI extends DesktopPaneUI {
     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 @@ public class BasicDesktopPaneUI extends DesktopPaneUI {
     @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 @@ public class BasicDesktopPaneUI extends DesktopPaneUI {
         handler = null;
     }
 
+    /**
+     * Installs default properties.
+     */
     protected void installDefaults() {
         if (desktop.getBackground() == null ||
             desktop.getBackground() instanceof UIResource) {
@@ -141,6 +160,9 @@ public class BasicDesktopPaneUI extends DesktopPaneUI {
         LookAndFeel.installProperty(desktop, "opaque", Boolean.TRUE);
     }
 
+    /**
+     * Uninstalls default properties.
+     */
     protected void uninstallDefaults() { }
 
     /**
@@ -169,6 +191,9 @@ public class BasicDesktopPaneUI extends DesktopPaneUI {
         pcl = null;
     }
 
+    /**
+     * Installs desktop manager.
+     */
     protected void installDesktopManager() {
         desktopManager = desktop.getDesktopManager();
         if(desktopManager == null) {
@@ -177,6 +202,9 @@ public class BasicDesktopPaneUI extends DesktopPaneUI {
         }
     }
 
+    /**
+     * Uninstalls desktop manager.
+     */
     protected void uninstallDesktopManager() {
         if(desktop.getDesktopManager() instanceof UIResource) {
             desktop.setDesktopManager(null);
@@ -184,6 +212,9 @@ public class BasicDesktopPaneUI extends DesktopPaneUI {
         desktopManager = null;
     }
 
+    /**
+     * Installs keyboard actions.
+     */
     protected void installKeyboardActions(){
         InputMap inputMap = getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
         if (inputMap != null) {
@@ -202,9 +233,15 @@ public class BasicDesktopPaneUI extends DesktopPaneUI {
         registerKeyboardActions();
     }
 
+    /**
+     * Registers keyboard actions.
+     */
     protected void registerKeyboardActions(){
     }
 
+    /**
+     * Unregisters keyboard actions.
+     */
     protected void unregisterKeyboardActions(){
     }
 
@@ -253,6 +290,9 @@ public class BasicDesktopPaneUI extends DesktopPaneUI {
         map.put(new Actions(Actions.NAVIGATE_PREVIOUS));
     }
 
+    /**
+     * Unregisters keyboard actions.
+     */
     protected void uninstallKeyboardActions(){
       unregisterKeyboardActions();
       SwingUtilities.replaceUIInputMap(desktop, JComponent.
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicDirectoryModel.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicDirectoryModel.java
index 6875367c91e4ce89089ba4d78769583abb12f8d1..c31332b15aac1cc859c470a52d02a2d2a230ef10 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicDirectoryModel.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicDirectoryModel.java
@@ -55,6 +55,11 @@ public class BasicDirectoryModel extends AbstractListModel<Object> implements Pr
 
     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 @@ public class BasicDirectoryModel extends AbstractListModel<Object> implements Pr
         }
     }
 
+    /**
+     * Returns a list of directories.
+     *
+     * @return a list of directories
+     */
     public Vector<File> getDirectories() {
         synchronized(fileCache) {
             if (directories != null) {
@@ -103,6 +113,11 @@ public class BasicDirectoryModel extends AbstractListModel<Object> implements Pr
         }
     }
 
+    /**
+     * Returns a list of files.
+     *
+     * @return a list of files
+     */
     public Vector<File> getFiles() {
         synchronized(fileCache) {
             if (files != null) {
@@ -126,6 +141,9 @@ public class BasicDirectoryModel extends AbstractListModel<Object> implements Pr
         }
     }
 
+    /**
+     * Validates content of file cache.
+     */
     public void validateFileCache() {
         File currentDirectory = filechooser.getCurrentDirectory();
         if (currentDirectory == null) {
@@ -163,20 +181,34 @@ public class BasicDirectoryModel extends AbstractListModel<Object> implements Pr
         }
     }
 
-
+    /**
+     * 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 class BasicDirectoryModel extends AbstractListModel<Object> implements Pr
     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);
     }
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicGraphicsUtils.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicGraphicsUtils.java
index d3e0bb795ec3d5bd72bd382f4361d6aed223e11b..941f09b28fb484a9a793b0bf3792eb95b462bc52 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicGraphicsUtils.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicGraphicsUtils.java
@@ -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 java.awt.event.InputEvent;
 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 @@ public class BasicGraphicsUtils
     }
 
 
+    /**
+     * 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 @@ public class BasicGraphicsUtils
     }
 
 
+    /**
+     * 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 @@ public class BasicGraphicsUtils
         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 @@ public class BasicGraphicsUtils
      }
 
 
-    /** 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 class BasicGraphicsUtils
     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 @@ public class BasicGraphicsUtils
         }
     }
 
+    /**
+     * 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) {
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicHTML.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicHTML.java
index 027198394963322132f61c90d7cee48581fabb86..0c0559948e5eae6c061cbf256905f11eaf8a3b83 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicHTML.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicHTML.java
@@ -48,6 +48,10 @@ public class BasicHTML {
     /**
      * 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 @@ public class BasicHTML {
      * 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 @@ public class BasicHTML {
      * 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;
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicIconFactory.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicIconFactory.java
index ec27f18dac14795448108c1e33baa6a0e0065f81..638885127b2d65b9df9b0e3e2f94a66fcc751932 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicIconFactory.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicIconFactory.java
@@ -61,6 +61,11 @@ public class BasicIconFactory implements Serializable
     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 @@ public class BasicIconFactory implements Serializable
         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 @@ public class BasicIconFactory implements Serializable
         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 @@ public class BasicIconFactory implements Serializable
         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 @@ public class BasicIconFactory implements Serializable
         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 @@ public class BasicIconFactory implements Serializable
         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 @@ public class BasicIconFactory implements Serializable
         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 @@ public class BasicIconFactory implements Serializable
         return radioButtonMenuItemIcon;
     }
 
+    /**
+     * Returns an empty frame icon.
+     *
+     * @return an empty frame icon
+     */
     public static Icon createEmptyFrameIcon() {
         if(frame_icon == null)
             frame_icon = new EmptyFrameIcon();
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java
index 3c4338fdc76a87de2be0671167ea436ffeb985d6..7ae4bc1b4088da6372f921842d7af0ff6c8afbde 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java
@@ -60,44 +60,125 @@ import sun.swing.UIAction;
 @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 @@ public class BasicInternalFrameTitlePane extends JComponent
     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 @@ public class BasicInternalFrameTitlePane extends JComponent
 
     }
 
+    /**
+     * Adds subcomponents.
+     */
     protected void addSubComponents() {
         add(menuBar);
         add(iconButton);
@@ -135,6 +227,9 @@ public class BasicInternalFrameTitlePane extends JComponent
         add(closeButton);
     }
 
+    /**
+     * Creates actions.
+     */
     protected void createActions() {
         maximizeAction = new MaximizeAction();
         iconifyAction = new IconifyAction();
@@ -151,6 +246,9 @@ public class BasicInternalFrameTitlePane extends JComponent
         return map;
     }
 
+    /**
+     * Registers listeners.
+     */
     protected void installListeners() {
         if( propertyChangeListener == null ) {
             propertyChangeListener = createPropertyChangeListener();
@@ -158,11 +256,17 @@ public class BasicInternalFrameTitlePane extends JComponent
         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 @@ public class BasicInternalFrameTitlePane extends JComponent
                 UIManager.getString("InternalFrame.maxButtonToolTip");
     }
 
-
+    /**
+     * Uninstalls default properties.
+     */
     protected void uninstallDefaults() {
     }
 
+    /**
+     * Creates buttons.
+     */
     protected void createButtons() {
         iconButton = new NoFocusButton(
                      "InternalFrameTitlePane.iconifyButtonAccessibleName",
@@ -213,6 +322,9 @@ public class BasicInternalFrameTitlePane extends JComponent
         setButtonIcons();
     }
 
+    /**
+     * Sets the button icons.
+     */
     protected void setButtonIcons() {
         if(frame.isIcon()) {
             if (minIcon != null) {
@@ -261,6 +373,9 @@ public class BasicInternalFrameTitlePane extends JComponent
         }
     }
 
+    /**
+     * Assembles system menu.
+     */
     protected void assembleSystemMenu() {
         menuBar = createSystemMenuBar();
         windowMenu = createSystemMenu();
@@ -269,6 +384,11 @@ public class BasicInternalFrameTitlePane extends JComponent
         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 @@ public class BasicInternalFrameTitlePane extends JComponent
         }
     }
 
+    /**
+     * 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 @@ public class BasicInternalFrameTitlePane extends JComponent
         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 @@ public class BasicInternalFrameTitlePane extends JComponent
         }
     }
 
-
+    /**
+     * Enables actions.
+     */
     protected void enableActions() {
         restoreAction.setEnabled(frame.isMaximum() || frame.isIcon());
         maximizeAction.setEnabled(
@@ -406,10 +551,20 @@ public class BasicInternalFrameTitlePane extends JComponent
         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 @@ public class BasicInternalFrameTitlePane extends JComponent
      * 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 @@ public class BasicInternalFrameTitlePane extends JComponent
      * 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 @@ public class BasicInternalFrameTitlePane extends JComponent
      * 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 @@ public class BasicInternalFrameTitlePane extends JComponent
      * 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 @@ public class BasicInternalFrameTitlePane extends JComponent
      * 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 @@ public class BasicInternalFrameTitlePane extends JComponent
      * 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"));
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicLabelUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicLabelUI.java
index 9c31265d1807b2e3d4930d6f44f8e53a776bf541..e5576c2aca97ad0b9784f95f90a0d78a167875b7 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicLabelUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicLabelUI.java
@@ -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 @@ public class BasicLabelUI extends LabelUI implements  PropertyChangeListener
      * 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 @@ public class BasicLabelUI extends LabelUI implements  PropertyChangeListener
     /**
      * 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 @@ public class BasicLabelUI extends LabelUI implements  PropertyChangeListener
      * 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 class BasicLabelUI extends LabelUI implements  PropertyChangeListener
 
 
     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 @@ public class BasicLabelUI extends LabelUI implements  PropertyChangeListener
         }
     }
 
+    /**
+     * 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 @@ public class BasicLabelUI extends LabelUI implements  PropertyChangeListener
         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();
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicListUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicListUI.java
index c66069e0ae6ec265226bcccda77088b996af740b..fd4292e6350b25a0fdd7ef7f32273460b0b14f54 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicListUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicListUI.java
@@ -59,20 +59,53 @@ public class BasicListUI extends ListUI
     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 @@ public class BasicListUI extends ListUI
      * 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 @@ public class BasicListUI extends ListUI
 
     /**
      * 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 @@ public class BasicListUI extends ListUI
 
 
     /**
-     * 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 @@ public class BasicListUI extends ListUI
     /**
      * 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 @@ public class BasicListUI extends ListUI
 
 
     /**
-     * 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 @@ public class BasicListUI extends ListUI
 
 
     /**
-     * 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 @@ public class BasicListUI extends ListUI
 
 
     /**
-     * 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 @@ public class BasicListUI extends ListUI
      * }
      * </pre>
      *
+     * @return an instance of {@code MouseInputListener}
      * @see MouseInputHandler
      * @see #installUI
      */
@@ -1566,6 +1632,9 @@ public class BasicListUI extends ListUI
      */
     public class FocusHandler implements FocusListener
     {
+        /**
+         * Repaints focused cells.
+         */
         protected void repaintCellFocus()
         {
             getHandler().repaintCellFocus();
@@ -1584,6 +1653,11 @@ public class BasicListUI extends ListUI
         }
     }
 
+    /**
+     * Returns an instance of {@code FocusListener}.
+     *
+     * @return an instance of {@code FocusListener}
+     */
     protected FocusListener createFocusListener() {
         return getHandler();
     }
@@ -1617,9 +1691,9 @@ public class BasicListUI extends ListUI
 
 
     /**
-     * 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 @@ public class BasicListUI extends ListUI
      * }
      * </pre>
      *
+     * @return an instance of {@code ListSelectionHandler}
      * @see ListSelectionHandler
      * @see #installUI
      */
@@ -1649,8 +1724,8 @@ public class BasicListUI extends ListUI
 
 
     /**
-     * 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 @@ public class BasicListUI extends ListUI
 
 
     /**
-     * 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 @@ public class BasicListUI extends ListUI
      * }
      * </pre>
      *
+     * @return an instance of {@code ListDataListener}
      * @see ListDataListener
      * @see JList#getModel
      * @see #installUI
@@ -1744,9 +1820,9 @@ public class BasicListUI extends ListUI
 
 
     /**
-     * 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 @@ public class BasicListUI extends ListUI
      * }
      * </pre>
      *
+     * @return an instance of {@code PropertyChangeHandler}
      * @see PropertyChangeListener
      * @see #installUI
      */
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java
index d2adadf2c926f564d350bd6f8071bd387de65ed9..6b8beeeafe3ef36d6b8a7608fbf4f8a7e1a17436 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java
@@ -455,7 +455,7 @@ public abstract class BasicLookAndFeel extends LookAndFeel implements Serializab
         initResourceBundle(table);
 
         // *** Shared Integers
-        Integer fiveHundred = new Integer(500);
+        Integer fiveHundred = 500;
 
         // *** Shared Longs
         Long oneThousand = 1000L;
@@ -673,7 +673,6 @@ public abstract class BasicLookAndFeel extends LookAndFeel implements Serializab
         Object editorMargin = threeInsets;
 
         Object caretBlinkRate = fiveHundred;
-        Integer four = new Integer(4);
 
         Object[] allAuditoryCues = new Object[] {
                 "CheckBoxMenuItem.commandSound",
@@ -714,7 +713,7 @@ public abstract class BasicLookAndFeel extends LookAndFeel implements Serializab
             "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 @@ public abstract class BasicLookAndFeel extends LookAndFeel implements Serializab
             "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 @@ public abstract class BasicLookAndFeel extends LookAndFeel implements Serializab
             "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 @@ public abstract class BasicLookAndFeel extends LookAndFeel implements Serializab
             "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 @@ public abstract class BasicLookAndFeel extends LookAndFeel implements Serializab
             "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 @@ public abstract class BasicLookAndFeel extends LookAndFeel implements Serializab
             "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 @@ public abstract class BasicLookAndFeel extends LookAndFeel implements Serializab
                         "LEFT", "positiveUnitIncrement",
                      "KP_LEFT", "positiveUnitIncrement",
                  }),
-            "ScrollBar.width", new Integer(16),
+            "ScrollBar.width", 16,
 
             "ScrollPane.font", dialogPlain12,
             "ScrollPane.background", control,
@@ -1332,7 +1331,7 @@ public abstract class BasicLookAndFeel extends LookAndFeel implements Serializab
             "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 @@ public abstract class BasicLookAndFeel extends LookAndFeel implements Serializab
             "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 @@ public abstract class BasicLookAndFeel extends LookAndFeel implements Serializab
             "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 @@ public abstract class BasicLookAndFeel extends LookAndFeel implements Serializab
             "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,
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuBarUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuBarUI.java
index 75b10bef98719f7c2590a82b22a4a90ab552f58a..2892a49afc71b51d108d72a041bcf471a1e47d29 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuBarUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuBarUI.java
@@ -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 @@ import javax.swing.plaf.*;
  * @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 @@ public class BasicMenuBarUI extends MenuBarUI  {
 
     }
 
+    /**
+     * Installs default properties.
+     */
     protected void installDefaults() {
         if (menuBar.getLayout() == null ||
             menuBar.getLayout() instanceof UIResource) {
@@ -90,6 +111,9 @@ public class BasicMenuBarUI extends MenuBarUI  {
                                               "MenuBar.font");
     }
 
+    /**
+     * Registers listeners.
+     */
     protected void installListeners() {
         containerListener = createContainerListener();
         changeListener = createChangeListener();
@@ -102,6 +126,9 @@ public class BasicMenuBarUI extends MenuBarUI  {
         menuBar.addContainerListener(containerListener);
     }
 
+    /**
+     * Registers keyboard actions.
+     */
     protected void installKeyboardActions() {
         InputMap inputMap = getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
 
@@ -131,12 +158,18 @@ public class BasicMenuBarUI extends MenuBarUI  {
         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 @@ public class BasicMenuBarUI extends MenuBarUI  {
         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();
     }
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java
index 9562a2089d6727a917cfde0a7234102d21f2d85e..d8e73a71290182834694f710898e74a2309a1ee7 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java
@@ -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 @@ import sun.swing.*;
  */
 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 @@ public class BasicMenuItemUI extends MenuItemUI
      */
     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 @@ public class BasicMenuItemUI extends MenuItemUI
     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 @@ public class BasicMenuItemUI extends MenuItemUI
         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 @@ public class BasicMenuItemUI extends MenuItemUI
         installKeyboardActions();
     }
 
-
+    /**
+     * Installs default properties.
+     */
     protected void installDefaults() {
         String prefix = getPropertyPrefix();
 
@@ -202,16 +250,26 @@ public class BasicMenuItemUI extends MenuItemUI
     }
 
     /**
+     *
+     * @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 @@ public class BasicMenuItemUI extends MenuItemUI
         }
     }
 
+    /**
+     * Registers keyboard action.
+     */
     protected void installKeyboardActions() {
         installLazyActionMap();
         updateAcceleratorBinding();
@@ -248,7 +309,9 @@ public class BasicMenuItemUI extends MenuItemUI
         menuItem = null;
     }
 
-
+    /**
+     * Uninstalls default properties.
+     */
     protected void uninstallDefaults() {
         LookAndFeel.uninstallBorder(menuItem);
         LookAndFeel.installProperty(menuItem, "borderPainted", oldBorderPainted);
@@ -261,12 +324,18 @@ public class BasicMenuItemUI extends MenuItemUI
     }
 
     /**
+     * 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 @@ public class BasicMenuItemUI extends MenuItemUI
         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 @@ public class BasicMenuItemUI extends MenuItemUI
         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 @@ public class BasicMenuItemUI extends MenuItemUI
                       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 @@ public class BasicMenuItemUI extends MenuItemUI
         }
     }
 
+    /**
+     * Returns a menu element path.
+     *
+     * @return a menu element path
+     */
     public MenuElement[] getPath() {
         MenuSelectionManager m = MenuSelectionManager.defaultManager();
         MenuElement oldPath[] = m.getSelectedPath();
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuUI.java
index 2ea9fb920ab2858217062e74f54c83c471217f57..7231ae2a570944e32db57e7a909eaef6f6dfc301 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuUI.java
@@ -48,7 +48,14 @@ import java.util.ArrayList;
  */
 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 @@ public class BasicMenuUI extends BasicMenuItemUI
 
     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 @@ public class BasicMenuUI extends BasicMenuItemUI
         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 @@ public class BasicMenuUI extends BasicMenuItemUI
         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 @@ public class BasicMenuUI extends BasicMenuItemUI
      * 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;
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java
index 22024b10a2fadbeb567d92dae14f7ee98e46c4fb..4296f281bfed8ea48920895a6c15244b5d84d7c1 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java
@@ -79,17 +79,26 @@ import sun.security.action.GetPropertyAction;
  */
 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 @@ public class BasicOptionPaneUI extends OptionPaneUI {
      * 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 @@ public class BasicOptionPaneUI extends OptionPaneUI {
 
 
     /**
-      * 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 @@ public class BasicOptionPaneUI extends OptionPaneUI {
         optionPane = null;
     }
 
+    /**
+     * Installs default properties.
+     */
     protected void installDefaults() {
         LookAndFeel.installColorsAndFont(optionPane, "OptionPane.background",
                                          "OptionPane.foreground", "OptionPane.font");
@@ -163,10 +180,16 @@ public class BasicOptionPaneUI extends OptionPaneUI {
         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 @@ public class BasicOptionPaneUI extends OptionPaneUI {
         optionPane.applyComponentOrientation(optionPane.getComponentOrientation());
     }
 
+    /**
+     * Unregisters components.
+     */
     protected void uninstallComponents() {
         hasCustomComponents = false;
         inputComponent = null;
@@ -185,16 +211,27 @@ public class BasicOptionPaneUI extends OptionPaneUI {
         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 @@ public class BasicOptionPaneUI extends OptionPaneUI {
         handler = null;
     }
 
+    /**
+     * Returns an instance of {@code PropertyChangeListener}.
+     *
+     * @return an instance of {@code PropertyChangeListener}
+     */
     protected PropertyChangeListener createPropertyChangeListener() {
         return getHandler();
     }
@@ -214,6 +256,9 @@ public class BasicOptionPaneUI extends OptionPaneUI {
         return handler;
     }
 
+    /**
+     * Registers keyboard actions.
+     */
     protected void installKeyboardActions() {
         InputMap map = getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
 
@@ -224,6 +269,9 @@ public class BasicOptionPaneUI extends OptionPaneUI {
                                            "OptionPane.actionMap");
     }
 
+    /**
+     * Unregisters keyboard actions.
+     */
     protected void uninstallKeyboardActions() {
         SwingUtilities.replaceUIInputMap(optionPane, JComponent.
                                        WHEN_IN_FOCUSED_WINDOW, null);
@@ -244,6 +292,8 @@ public class BasicOptionPaneUI extends OptionPaneUI {
     /**
      * 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 @@ public class BasicOptionPaneUI extends OptionPaneUI {
     }
 
     /**
-     * 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 @@ public class BasicOptionPaneUI extends OptionPaneUI {
     }
 
     /**
-     * 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 @@ public class BasicOptionPaneUI extends OptionPaneUI {
     }
 
     /**
-     * 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 @@ public class BasicOptionPaneUI extends OptionPaneUI {
 
     /**
      * 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 @@ public class BasicOptionPaneUI extends OptionPaneUI {
     }
 
     /**
-     * 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 @@ public class BasicOptionPaneUI extends OptionPaneUI {
 
     /**
      * 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 @@ public class BasicOptionPaneUI extends OptionPaneUI {
 
     /**
      * 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 @@ public class BasicOptionPaneUI extends OptionPaneUI {
         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 @@ public class BasicOptionPaneUI extends OptionPaneUI {
 
     /**
      * 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 @@ public class BasicOptionPaneUI extends OptionPaneUI {
         }
     }
 
+    /**
+     * 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 @@ public class BasicOptionPaneUI extends OptionPaneUI {
     }
 
     /**
-     * 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 @@ public class BasicOptionPaneUI extends OptionPaneUI {
      * 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 @@ public class BasicOptionPaneUI extends OptionPaneUI {
      * 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 @@ public class BasicOptionPaneUI extends OptionPaneUI {
          */
         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 @@ public class BasicOptionPaneUI extends OptionPaneUI {
             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 @@ public class BasicOptionPaneUI extends OptionPaneUI {
      * 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;
         }
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicPanelUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicPanelUI.java
index 985fae73f4feacca3bdc9d23b09bca25024c3ab6..46929bcca69f3c679176b4a8449af3fec6942383 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicPanelUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicPanelUI.java
@@ -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 @@ public class BasicPanelUI extends PanelUI {
     // 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 @@ public class BasicPanelUI extends PanelUI {
         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 @@ public class BasicPanelUI extends PanelUI {
         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);
     }
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicPopupMenuSeparatorUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicPopupMenuSeparatorUI.java
index ded6ad243d25756569b06f6824fc187e9f3da0f6..9122beae1f000cf4a1dd2f1c77a707e89d2db7a8 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicPopupMenuSeparatorUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicPopupMenuSeparatorUI.java
@@ -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 @@ import javax.swing.plaf.ComponentUI;
 
 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();
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicPopupMenuUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicPopupMenuUI.java
index 517615ac846974b07758c58a6dca5f91917746f7..e9d878a2ca2385cd7f2494b0b63e0d407abcb81c 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicPopupMenuUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicPopupMenuUI.java
@@ -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 @@ public class BasicPopupMenuUI extends PopupMenuUI {
     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 @@ public class BasicPopupMenuUI extends PopupMenuUI {
     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 @@ public class BasicPopupMenuUI extends PopupMenuUI {
         installKeyboardActions();
     }
 
+    /**
+     * Installs default properties.
+     */
     public void installDefaults() {
         if (popupMenu.getLayout() == null ||
             popupMenu.getLayout() instanceof UIResource)
@@ -101,11 +116,14 @@ public class BasicPopupMenuUI extends PopupMenuUI {
         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 @@ public class BasicPopupMenuUI extends PopupMenuUI {
         }
     }
 
+    /**
+     * Registers keyboard actions.
+     */
     protected void installKeyboardActions() {
     }
 
@@ -181,10 +202,16 @@ public class BasicPopupMenuUI extends PopupMenuUI {
         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 @@ public class BasicPopupMenuUI extends PopupMenuUI {
         }
     }
 
+    /**
+     * Unregisters keyboard actions.
+     */
     protected void uninstallKeyboardActions() {
         SwingUtilities.replaceUIActionMap(popupMenu, null);
         SwingUtilities.replaceUIInputMap(popupMenu,
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicProgressBarUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicProgressBarUI.java
index 8c4dbb1126ce6666bd32ecb9254629639900e542..caebdfe1688bfc07044c20343cc122148c4b2e8d 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicProgressBarUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicProgressBarUI.java
@@ -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 @@ public class BasicProgressBarUI extends ProgressBarUI {
 
     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 @@ public class BasicProgressBarUI extends ProgressBarUI {
 
     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 @@ public class BasicProgressBarUI extends ProgressBarUI {
         progressBar = null;
     }
 
+    /**
+     * Installs default properties.
+     */
     protected void installDefaults() {
         LookAndFeel.installProperty(progressBar, "opaque", Boolean.TRUE);
         LookAndFeel.installBorder(progressBar,"ProgressBar.border");
@@ -164,10 +178,16 @@ public class BasicProgressBarUI extends ProgressBarUI {
         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 @@ public class BasicProgressBarUI extends ProgressBarUI {
     // 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 @@ public class BasicProgressBarUI extends ProgressBarUI {
         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 @@ public class BasicProgressBarUI extends ProgressBarUI {
     /**
      * 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 @@ public class BasicProgressBarUI extends ProgressBarUI {
     /**
      * 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 @@ public class BasicProgressBarUI extends ProgressBarUI {
         }
     }
 
+    /**
+     * Sets the cell length.
+     *
+     * @param cellLen a new cell length
+     */
     protected void setCellLength(int cellLen) {
         this.cellLength = cellLen;
     }
@@ -374,6 +413,11 @@ public class BasicProgressBarUI extends ProgressBarUI {
         }
     }
 
+    /**
+     * Sets the cell spacing.
+     *
+     * @param cellSpace a new cell spacing
+     */
     protected void setCellSpacing(int cellSpace) {
         this.cellSpacing = cellSpace;
     }
@@ -384,6 +428,11 @@ public class BasicProgressBarUI extends ProgressBarUI {
      * 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 @@ public class BasicProgressBarUI extends ProgressBarUI {
      * 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 @@ public class BasicProgressBarUI extends ProgressBarUI {
      * 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 @@ public class BasicProgressBarUI extends ProgressBarUI {
         }
     }
 
-
+    /**
+     * 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 @@ public class BasicProgressBarUI extends ProgressBarUI {
      * 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 @@ public class BasicProgressBarUI extends ProgressBarUI {
     /**
      * Gets the index of the current animation frame.
      *
+     * @return the index of the current animation frame
      * @since 1.4
      */
     protected int getAnimationIndex() {
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicRadioButtonMenuItemUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicRadioButtonMenuItemUI.java
index 99c8e3aaabb106530de2e5cf3a852fcc67e4de29..6030aa743e14e2e69b9fb96624aa481823a3a50c 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicRadioButtonMenuItemUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicRadioButtonMenuItemUI.java
@@ -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 @@ import javax.swing.border.*;
  */
 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 @@ public class BasicRadioButtonMenuItemUI extends BasicMenuItemUI
         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() &&
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicRadioButtonUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicRadioButtonUI.java
index 47c9b7d75f80d992adebe27474e96d430174dea7..ec9e88defe1088c57cb18cdc7e7c63f1c3042b34 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicRadioButtonUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicRadioButtonUI.java
@@ -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 @@ public class BasicRadioButtonUI extends BasicToggleButtonUI
 {
     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 @@ public class BasicRadioButtonUI extends BasicToggleButtonUI
     // ********************************
     //        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 @@ public class BasicRadioButtonUI extends BasicToggleButtonUI
         defaults_initialized = false;
     }
 
+    /**
+     * Returns the default icon.
+     *
+     * @return the default icon
+     */
     public Icon getDefaultIcon() {
         return icon;
     }
@@ -195,6 +210,13 @@ public class BasicRadioButtonUI extends BasicToggleButtonUI
         }
     }
 
+    /**
+     * 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){
     }
 
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicRootPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicRootPaneUI.java
index 5c999e0089d23859237d0e9ffbf0cb824663b8cc..300e46a2e7bbc2f96f2456255e782054cdbbab2a 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicRootPaneUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicRootPaneUI.java
@@ -48,6 +48,12 @@ public class BasicRootPaneUI extends RootPaneUI implements
                   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 @@ public class BasicRootPaneUI extends RootPaneUI implements
         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 @@ public class BasicRootPaneUI extends RootPaneUI implements
         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);
     }
 
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicScrollPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicScrollPaneUI.java
index 646282046b3dae42257d2eb6be12eb027510f8de..18df8abf2021ed709cfbc3a15e28655611b3b901 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicScrollPaneUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicScrollPaneUI.java
@@ -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 @@ import java.awt.event.*;
 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 @@ public class BasicScrollPaneUI
      */
     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 @@ public class BasicScrollPaneUI
         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 @@ public class BasicScrollPaneUI
         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 @@ public class BasicScrollPaneUI
 
     }
 
+    /**
+     * 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 @@ public class BasicScrollPaneUI
         installKeyboardActions(scrollpane);
     }
 
-
+    /**
+     * Uninstalls default properties.
+     *
+     * @param c an instance of {@code JScrollPane}
+     */
     protected void uninstallDefaults(JScrollPane c) {
         LookAndFeel.uninstallBorder(scrollpane);
 
@@ -210,7 +251,11 @@ public class BasicScrollPaneUI
         }
     }
 
-
+    /**
+     * Unregisters listeners.
+     *
+     * @param c a component
+     */
     protected void uninstallListeners(JComponent c) {
         JViewport viewport = scrollpane.getViewport();
         JScrollBar vsb = scrollpane.getVerticalScrollBar();
@@ -242,7 +287,11 @@ public class BasicScrollPaneUI
         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 @@ public class BasicScrollPaneUI
         return handler;
     }
 
+    /**
+     * Synchronizes the {@code JScrollPane} with {@code Viewport}.
+     */
     protected void syncScrollPaneWithViewport()
     {
         JViewport viewport = scrollpane.getViewport();
@@ -453,6 +505,11 @@ public class BasicScrollPaneUI
         }
     }
 
+    /**
+     * Returns an instance of viewport {@code ChangeListener}.
+     *
+     * @return an instance of viewport {@code ChangeListener}
+     */
     protected ChangeListener createViewportChangeListener() {
         return getHandler();
     }
@@ -483,6 +540,11 @@ public class BasicScrollPaneUI
         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 @@ public class BasicScrollPaneUI
         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 @@ public class BasicScrollPaneUI
         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 @@ public class BasicScrollPaneUI
         }
     }
 
-
+    /**
+     * Updates row header.
+     *
+     * @param e the property change event
+     */
     protected void updateRowHeader(PropertyChangeEvent e)
     {
         JViewport newRowHead = (JViewport)(e.getNewValue());
@@ -611,7 +691,11 @@ public class BasicScrollPaneUI
         }
     }
 
-
+    /**
+     * Updates column header.
+     *
+     * @param e the property change event
+     */
     protected void updateColumnHeader(PropertyChangeEvent e)
     {
         JViewport newColHead = (JViewport)(e.getNewValue());
@@ -679,9 +763,9 @@ public class BasicScrollPaneUI
 
 
     /**
-     * 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 @@ public class BasicScrollPaneUI
      * }
      * </pre>
      *
+     * @return an instance of {@code PropertyChangeListener}
+     *
      * @see java.beans.PropertyChangeListener
      * @see #installUI
      */
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSeparatorUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSeparatorUI.java
index 0a83867618c0d360e341bb3cc5da0eac173b20af..8df41cb647ae3e00983b28a5ccaf56236dd7dcef 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSeparatorUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSeparatorUI.java
@@ -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 @@ import javax.swing.plaf.SeparatorUI;
 
 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 @@ public class BasicSeparatorUI extends SeparatorUI
         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 )
     {
     }
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSpinnerUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSpinnerUI.java
index 01c408382cd20b28b2d3af86e47b9c4c6dd33576..ee9cdefbe90ce8f3809ad15dabd4a492e6a1c9ee 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSpinnerUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSpinnerUI.java
@@ -400,6 +400,8 @@ public class BasicSpinnerUI extends SpinnerUI
      * 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
      */
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneDivider.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneDivider.java
index 36b4129598c4e257e82a4e8f28784f8b8383cdf7..34dfeb5710a77d986c3f5c2d03450565568d4d6e 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneDivider.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneDivider.java
@@ -65,9 +65,13 @@ public class BasicSplitPaneDivider extends Container
 {
     /**
      * 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 @@ public class BasicSplitPaneDivider extends Container
 
 
     /**
-     * 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 @@ public class BasicSplitPaneDivider extends Container
     }
 
     /**
-     * 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 @@ public class BasicSplitPaneDivider extends Container
 
 
     /**
-     * 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 @@ public class BasicSplitPaneDivider extends Container
 
 
     /**
-     * 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 @@ public class BasicSplitPaneDivider extends Container
     /**
      * 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 @@ public class BasicSplitPaneDivider extends Container
 
     /**
      * Sets the border of this component.
+     *
+     * @param border a new border
      * @since 1.3
      */
     public void setBorder(Border border) {
@@ -382,8 +397,10 @@ public class BasicSplitPaneDivider extends Container
 
 
     /**
-     * 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 @@ public class BasicSplitPaneDivider extends Container
 
 
     /**
-     * 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 @@ public class BasicSplitPaneDivider extends Container
     /**
      * 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 @@ public class BasicSplitPaneDivider extends Container
     /**
      * 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 @@ public class BasicSplitPaneDivider extends Container
          */
         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 @@ public class BasicSplitPaneDivider extends Container
 
 
         /**
-         * 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 @@ public class BasicSplitPaneDivider extends Container
         /**
          * 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 @@ public class BasicSplitPaneDivider extends Container
         /**
          * 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 @@ public class BasicSplitPaneDivider extends Container
             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 @@ public class BasicSplitPaneDivider extends Container
         /**
          * 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 @@ public class BasicSplitPaneDivider extends Container
         /**
          * 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 @@ public class BasicSplitPaneDivider extends Container
     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();
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java
index 405795b985dc9378c89966571417316ea5a7fb8b..133325ff9b7ce488e68ae5f11b24bd29fce16119 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java
@@ -286,7 +286,10 @@ public class BasicSplitPaneUI extends SplitPaneUI
 
 
     /**
-     * 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 @@ public class BasicSplitPaneUI extends SplitPaneUI
 
 
     /**
-     * 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 @@ public class BasicSplitPaneUI extends SplitPaneUI
 
 
     /**
-     * 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 @@ public class BasicSplitPaneUI extends SplitPaneUI
 
 
     /**
-     * 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 @@ public class BasicSplitPaneUI extends SplitPaneUI
 
 
     /**
-     * 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 @@ public class BasicSplitPaneUI extends SplitPaneUI
 
 
     /**
-     * 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 @@ public class BasicSplitPaneUI extends SplitPaneUI
 
 
     /**
-     * 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 @@ public class BasicSplitPaneUI extends SplitPaneUI
 
 
     /**
-     * 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 @@ public class BasicSplitPaneUI extends SplitPaneUI
 
 
     /**
-     * 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 @@ public class BasicSplitPaneUI extends SplitPaneUI
 
 
     /**
-     * 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 @@ public class BasicSplitPaneUI extends SplitPaneUI
 
 
     /**
-     * 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 @@ public class BasicSplitPaneUI extends SplitPaneUI
 
     /**
      * 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 @@ public class BasicSplitPaneUI extends SplitPaneUI
 
 
     /**
-     * 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 @@ public class BasicSplitPaneUI extends SplitPaneUI
 
 
     /**
-     * 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 @@ public class BasicSplitPaneUI extends SplitPaneUI
 
     /**
      * Returns the divider between the top Components.
+     *
+     * @return the divider between the top Components
      */
     public BasicSplitPaneDivider getDivider() {
         return divider;
@@ -828,6 +854,8 @@ public class BasicSplitPaneUI extends SplitPaneUI
     /**
      * 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 @@ public class BasicSplitPaneUI extends SplitPaneUI
 
 
     /**
-     * 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 @@ public class BasicSplitPaneUI extends SplitPaneUI
 
     /**
      * 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 @@ public class BasicSplitPaneUI extends SplitPaneUI
 
 
     /**
-     * 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 @@ public class BasicSplitPaneUI extends SplitPaneUI
 
 
     /**
-     * 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 @@ public class BasicSplitPaneUI extends SplitPaneUI
 
     /**
      * Creates the default divider.
+     *
+     * @return the default divider
      */
     public BasicSplitPaneDivider createDefaultDivider() {
         return new BasicSplitPaneDivider(this);
@@ -1108,6 +1147,9 @@ public class BasicSplitPaneUI extends SplitPaneUI
     /**
      * 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 @@ public class BasicSplitPaneUI extends SplitPaneUI
 
     /**
      * 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 @@ public class BasicSplitPaneUI extends SplitPaneUI
 
     /**
      * 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 @@ public class BasicSplitPaneUI extends SplitPaneUI
      * <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 BasicSplitPaneUI extends SplitPaneUI
     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 @@ public class BasicSplitPaneUI extends SplitPaneUI
 
         /**
          * 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 @@ public class BasicSplitPaneUI extends SplitPaneUI
 
 
         /**
-         * 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 @@ public class BasicSplitPaneUI extends SplitPaneUI
 
         /**
          * Returns the sizes of the components.
+         *
+         * @return the sizes of the components
          */
         protected int[] getSizes() {
             int[]         retSizes = new int[3];
@@ -1624,6 +1683,9 @@ public class BasicSplitPaneUI extends SplitPaneUI
 
         /**
          * 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 @@ public class BasicSplitPaneUI extends SplitPaneUI
 
         /**
          * 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 @@ public class BasicSplitPaneUI extends SplitPaneUI
 
         /**
          * 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 @@ public class BasicSplitPaneUI extends SplitPaneUI
 
         /**
          * 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 @@ public class BasicSplitPaneUI extends SplitPaneUI
 
 
         /**
-         * 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 @@ public class BasicSplitPaneUI extends SplitPaneUI
 
 
         /**
-         * 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 BasicSplitPaneUI extends SplitPaneUI
     public class BasicVerticalLayoutManager extends
             BasicHorizontalLayoutManager
     {
+        /**
+         * Constructs a new instance of {@code BasicVerticalLayoutManager}.
+         */
         public BasicVerticalLayoutManager() {
             super(1);
         }
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTableHeaderUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTableHeaderUI.java
index cdf38579fc8f3cea0053d60198a81c7c1126fb5d..4c8bb1d94d5f203c6668572e464ef7f04d2daaf8 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTableHeaderUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTableHeaderUI.java
@@ -49,11 +49,19 @@ public class BasicTableHeaderUI extends TableHeaderUI {
 // 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 @@ public class BasicTableHeaderUI extends TableHeaderUI {
 //
 
     /**
-     * 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 @@ public class BasicTableHeaderUI extends TableHeaderUI {
 //  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 @@ public class BasicTableHeaderUI extends TableHeaderUI {
         header = null;
     }
 
+    /**
+     * Uninstalls default properties
+     */
     protected void uninstallDefaults() {}
 
+    /**
+     * Unregisters listeners.
+     */
     protected void uninstallListeners() {
         header.removeMouseListener(mouseInputListener);
         header.removeMouseMotionListener(mouseInputListener);
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java
index ba92184b436360b7a8121cb2df16ed66b202ef2d..bff514b57ff0a96c93ca3fcde5c4bdb7fd4cab9e 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java
@@ -64,12 +64,29 @@ public class BasicTableUI extends TableUI
 //
 
     // 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 @@ public class BasicTableUI extends TableUI
     }
 
     /**
-     * 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 @@ public class BasicTableUI extends TableUI
 //  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 @@ public class BasicTableUI extends TableUI
         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 @@ public class BasicTableUI extends TableUI
         handler = null;
     }
 
+    /**
+     * Unregisters keyboard actions.
+     */
     protected void uninstallKeyboardActions() {
         SwingUtilities.replaceUIInputMap(table, JComponent.
                                    WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, null);
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextUI.java
index 0965c77789f883d16a875c949eb5fb50b2daeec1..2b23f9c0a0e3555938015d2a8b9e43c2f88788c7 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextUI.java
@@ -443,6 +443,9 @@ public abstract class BasicTextUI extends TextUI implements ViewFactory {
     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 @@ public abstract class BasicTextUI extends TextUI implements ViewFactory {
         return map;
     }
 
+    /**
+     * Unregisters keyboard actions.
+     */
     protected void uninstallKeyboardActions() {
         editor.setKeymap(null);
         SwingUtilities.replaceUIInputMap(editor, JComponent.
@@ -1280,8 +1286,14 @@ public abstract class BasicTextUI extends TextUI implements ViewFactory {
         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 {
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicToggleButtonUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicToggleButtonUI.java
index 163a5cd2b4688984c2cb7b0e9384ac928d821a15..5f394dbbefb88b1a8a290d04e788cb17b50361bd 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicToggleButtonUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicToggleButtonUI.java
@@ -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 @@ public class BasicToggleButtonUI extends BasicButtonUI {
     // ********************************
     //          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 @@ public class BasicToggleButtonUI extends BasicButtonUI {
         }
     }
 
+    /**
+     * 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;
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolBarSeparatorUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolBarSeparatorUI.java
index 1f2aac7e597fc16654db65d8c3a657b26c258fdd..4a5dd209df059271ddd92669adba6a01043abaf6 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolBarSeparatorUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolBarSeparatorUI.java
@@ -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 @@ import javax.swing.plaf.basic.BasicSeparatorUI;
 
 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();
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolBarUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolBarUI.java
index b301f200bc9eba045c5ef84ec2e5a08215993099..758ac2523adfb8e512cd3e5c766a8d684238172f 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolBarUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolBarUI.java
@@ -50,29 +50,65 @@ import sun.swing.UIAction;
  */
 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 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
 
     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 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
         c.putClientProperty( FOCUSED_COMP_INDEX, Integer.valueOf( focusedCompIndex ) );
     }
 
+    /**
+     * Installs default properties.
+     */
     protected void installDefaults( )
     {
         LookAndFeel.installBorder(toolBar,"ToolBar.border");
@@ -222,6 +267,9 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
         setRolloverBorders( isRolloverBorders() );
     }
 
+    /**
+     * Uninstalls default properties.
+     */
     protected void uninstallDefaults( )
     {
         LookAndFeel.uninstallBorder(toolBar);
@@ -237,14 +285,23 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
         nonRolloverToggleBorder = null;
     }
 
+    /**
+     * Registers components.
+     */
     protected void installComponents( )
     {
     }
 
+    /**
+     * Unregisters components.
+     */
     protected void uninstallComponents( )
     {
     }
 
+    /**
+     * Registers listeners.
+     */
     protected void installListeners( )
     {
         dockingListener = createDockingListener( );
@@ -278,6 +335,9 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
         }
     }
 
+    /**
+     * Unregisters listeners.
+     */
     protected void uninstallListeners( )
     {
         if ( dockingListener != null )
@@ -314,6 +374,9 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
         handler = null;
     }
 
+    /**
+     * Registers keyboard actions.
+     */
     protected void installKeyboardActions( )
     {
         InputMap km = getInputMap(JComponent.
@@ -342,6 +405,9 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
         map.put(new Actions(Actions.NAVIGATE_DOWN));
     }
 
+    /**
+     * Unregisters keyboard actions.
+     */
     protected void uninstallKeyboardActions( )
     {
         SwingUtilities.replaceUIActionMap(toolBar, null);
@@ -350,7 +416,12 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
                                          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 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
      * <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 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
      * <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 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
 
     /**
      * 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 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
     /**
      * 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 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
         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 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
         }
     }
 
+    /**
+     * 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 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
         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 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
 
     /**
      * 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 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
 
     /**
      * 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 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
 
     /**
      * 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 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
 
     /**
      * 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 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
         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 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
         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 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
         }
     }
 
+    /**
+     * 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 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
         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 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
         }
     }
 
+    /**
+     * The class listens for window events.
+     */
     protected class FrameListener extends WindowAdapter {
         public void windowClosing(WindowEvent w) {
             if (toolBar.isFloatable()) {
@@ -1276,6 +1439,9 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
 
     }
 
+    /**
+     * 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 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
 
     }
 
+    /**
+     * 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 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
             }
     }
 
+    /**
+     * 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 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
         // 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 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
         }
     }
 
+    /**
+     * The window which appears during dragging the {@code JToolBar}.
+     */
     @SuppressWarnings("serial") // Same-version serialization only
     protected class DragWindow extends Window
     {
@@ -1396,6 +1585,11 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
         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 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
             }
         }
 
+        /**
+         * 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 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
             repaint();
         }
 
+        /**
+         * Returns the border color.
+         *
+         * @return the border color
+         */
         public Color getBorderColor() {
             return this.borderColor;
         }
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolTipUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolTipUI.java
index 95a951cc6f962612d7f47c6aacaacbb4afd17658..8f79c7566fec2195f3f23d4e84b813eefd1f3e46 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolTipUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolTipUI.java
@@ -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 @@ public class BasicToolTipUI extends ToolTipUI
 
     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 @@ public class BasicToolTipUI extends ToolTipUI
         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 @@ public class BasicToolTipUI extends ToolTipUI
         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);
 
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java
index 1cc1ceb2dafa4d88174485ddf45bea17489c3a80..4b783a025857a0241a70d6a2d29682dafe16719b 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java
@@ -63,7 +63,13 @@ public class BasicTreeUI extends TreeUI
     // 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 @@ public class BasicTreeUI extends TreeUI
      */
     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 @@ public class BasicTreeUI extends TreeUI
         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 @@ public class BasicTreeUI extends TreeUI
         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 @@ public class BasicTreeUI extends TreeUI
         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 @@ public class BasicTreeUI extends TreeUI
 
     /**
      * Updates the componentListener, if necessary.
+     *
+     * @param largeModel the new value
      */
     protected void setLargeModel(boolean largeModel) {
         if(getRowHeight() < 1)
@@ -354,12 +420,19 @@ public class BasicTreeUI extends TreeUI
         }
     }
 
+    /**
+     * 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 @@ public class BasicTreeUI extends TreeUI
         }
     }
 
+    /**
+     * 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 @@ public class BasicTreeUI extends TreeUI
     }
 
     /**
-     * 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 @@ public class BasicTreeUI extends TreeUI
         }
     }
 
+    /**
+     * 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 @@ public class BasicTreeUI extends TreeUI
         }
     }
 
+    /**
+     * 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 @@ public class BasicTreeUI extends TreeUI
         }
     }
 
+    /**
+     * 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 @@ public class BasicTreeUI extends TreeUI
     /**
      * 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 @@ public class BasicTreeUI extends TreeUI
             tree.repaint();
     }
 
+    /**
+     * Returns the tree selection model.
+     *
+     * @return the tree selection model
+     */
     protected TreeSelectionModel getSelectionModel() {
         return treeSelectionModel;
     }
@@ -649,7 +773,7 @@ public class BasicTreeUI extends TreeUI
     }
 
     /**
-     * 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 @@ public class BasicTreeUI extends TreeUI
         updateSize();
     }
 
+    /**
+     * Installs default properties.
+     */
     protected void installDefaults() {
         if(tree.getBackground() == null ||
            tree.getBackground() instanceof UIResource) {
@@ -739,6 +866,9 @@ public class BasicTreeUI extends TreeUI
         }
     }
 
+    /**
+     * Registers listeners.
+     */
     protected void installListeners() {
         if ( (propertyChangeListener = createPropertyChangeListener())
              != null ) {
@@ -787,6 +917,9 @@ public class BasicTreeUI extends TreeUI
         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 @@ public class BasicTreeUI extends TreeUI
     //
 
     /**
-     * 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 @@ public class BasicTreeUI extends TreeUI
     /**
      * 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 @@ public class BasicTreeUI extends TreeUI
     /**
      * 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 @@ public class BasicTreeUI extends TreeUI
     /**
      * 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 @@ public class BasicTreeUI extends TreeUI
     /**
      * 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 @@ public class BasicTreeUI extends TreeUI
     /**
      * 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 @@ public class BasicTreeUI extends TreeUI
 
     /**
      * 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 @@ public class BasicTreeUI extends TreeUI
      * 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 @@ public class BasicTreeUI extends TreeUI
     /**
      * 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 @@ public class BasicTreeUI extends TreeUI
     /**
      * 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 @@ public class BasicTreeUI extends TreeUI
 
     /**
      * 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 @@ public class BasicTreeUI extends TreeUI
     }
 
     /**
-      * 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 @@ public class BasicTreeUI extends TreeUI
         completeUIUninstall();
     }
 
+    /**
+     * Invoked before unstallation of UI.
+     */
     protected void prepareForUIUninstall() {
     }
 
+    /**
+     * Uninstalls UI.
+     */
     protected void completeUIUninstall() {
         if(createdRenderer) {
             tree.setCellRenderer(null);
@@ -1016,12 +1185,18 @@ public class BasicTreeUI extends TreeUI
         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 @@ public class BasicTreeUI extends TreeUI
         handler = null;
     }
 
+    /**
+     * Unregisters keyboard actions.
+     */
     protected void uninstallKeyboardActions() {
         SwingUtilities.replaceUIActionMap(tree, null);
         SwingUtilities.replaceUIInputMap(tree, JComponent.
@@ -1340,8 +1518,18 @@ public class BasicTreeUI extends TreeUI
 
     /**
      * 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 @@ public class BasicTreeUI extends TreeUI
 
     /**
      * 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 @@ public class BasicTreeUI extends TreeUI
 
     /**
      * 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 @@ public class BasicTreeUI extends TreeUI
 
     /**
      * 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 @@ public class BasicTreeUI extends TreeUI
     }
 
     /**
-     * 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 @@ public class BasicTreeUI extends TreeUI
 
     /**
      * 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 @@ public class BasicTreeUI extends TreeUI
 
     /**
      * 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 @@ public class BasicTreeUI extends TreeUI
     /**
      * 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 @@ public class BasicTreeUI extends TreeUI
      * 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 @@ public class BasicTreeUI extends TreeUI
     // 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 @@ public class BasicTreeUI extends TreeUI
                       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);
+        drawDashedLine(g, x, y1, y2, true);
+    }
 
-        for (int y = y1; y <= y2; y+=2) {
-            g.drawLine(x, y, x, y);
+    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 @@ public class BasicTreeUI extends TreeUI
     }
 
     /**
-     * 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 @@ public class BasicTreeUI extends TreeUI
     }
 
     /**
-     * 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 @@ public class BasicTreeUI extends TreeUI
     }
 
     /**
-      * 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 @@ public class BasicTreeUI extends TreeUI
     }
 
     /**
-      * 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 @@ public class BasicTreeUI extends TreeUI
     }
 
     /**
-      * 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 @@ public class BasicTreeUI extends TreeUI
         }
     }
 
-    /** 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 @@ public class BasicTreeUI extends TreeUI
     }
 
     /**
-      * 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 @@ public class BasicTreeUI extends TreeUI
     }
 
     /**
-      * 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 @@ public class BasicTreeUI extends TreeUI
     //
 
     /**
-     * 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 @@ public class BasicTreeUI extends TreeUI
     }
 
     /**
-     * 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 @@ public class BasicTreeUI extends TreeUI
 
     /**
      * 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 @@ public class BasicTreeUI extends TreeUI
 
     /**
      * 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 @@ public class BasicTreeUI extends TreeUI
     }
 
     /**
-     * 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 @@ public class BasicTreeUI extends TreeUI
     }
 
     /**
-     * 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 @@ public class BasicTreeUI extends TreeUI
     }
 
     /**
-     * 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 @@ public class BasicTreeUI extends TreeUI
     }
 
     /**
-     * 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 @@ public class BasicTreeUI extends TreeUI
     }
 
     /**
-     * @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 @@ public class BasicTreeUI extends TreeUI
         }
 
         /**
-         * 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 @@ public class BasicTreeUI extends TreeUI
         }
 
         /**
-         * @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 @@ public class BasicTreeUI extends TreeUI
          * 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 @@ public class BasicTreeUI extends TreeUI
         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 @@ public class BasicTreeUI extends TreeUI
         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 @@ public class BasicTreeUI extends TreeUI
       */
     @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 @@ public class BasicTreeUI extends TreeUI
       */
     @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 @@ public class BasicTreeUI extends TreeUI
      */
     @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 @@ public class BasicTreeUI extends TreeUI
         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 @@ public class BasicTreeUI extends TreeUI
             removeFromSource();
         }
 
+        /**
+         * Removes an event from the source.
+         */
         protected void removeFromSource() {
             if(source != null) {
                 source.removeMouseListener(this);
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicViewportUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicViewportUI.java
index 70dad3c3c0dd4005033e2e8a453cc242dd910054..3620bdbcff8344c85cf2415d55969ab63189ba7a 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicViewportUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicViewportUI.java
@@ -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 @@ public class BasicViewportUI extends ViewportUI {
     // 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 @@ public class BasicViewportUI extends ViewportUI {
         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 @@ public class BasicViewportUI extends ViewportUI {
         LookAndFeel.installProperty(c, "opaque", Boolean.TRUE);
     }
 
+    /**
+     * Uninstall view port properties.
+     *
+     * @param c a component
+     */
     protected void uninstallDefaults(JComponent c) {
     }
 }
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/ComboPopup.java b/jdk/src/share/classes/javax/swing/plaf/basic/ComboPopup.java
index bd520c6e38e3274612a19cdc8f961443401056ef..f9c260d0653d6d39e9af278452e04ac7fce6b964 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/ComboPopup.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/ComboPopup.java
@@ -69,6 +69,8 @@ public interface ComboPopup {
      * 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 @@ public interface ComboPopup {
     /**
      * 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();
 
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/DefaultMenuLayout.java b/jdk/src/share/classes/javax/swing/plaf/basic/DefaultMenuLayout.java
index 627c3702a730d3060335a8b38b7007a3acca4dc6..730897a93d80d2cd6a0a8b9a3b1455e25f2dc41d 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/DefaultMenuLayout.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/DefaultMenuLayout.java
@@ -41,6 +41,17 @@ import java.awt.Dimension;
  */
 @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);
     }
diff --git a/jdk/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java b/jdk/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java
index b1aea28c79fdff6f47dbd40b124dd4c054e02d0b..5e3251eba489f7bd037ab46d09666da1fbff31f4 100644
--- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java
+++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java
@@ -633,7 +633,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel
         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 @@ public class MetalLookAndFeel extends BasicLookAndFeel
             "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 @@ public class MetalLookAndFeel extends BasicLookAndFeel
                     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 @@ public class MetalLookAndFeel extends BasicLookAndFeel
             "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 @@ public class MetalLookAndFeel extends BasicLookAndFeel
             "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 @@ public class MetalLookAndFeel extends BasicLookAndFeel
 
             // SplitPane
 
-            "SplitPane.dividerSize", new Integer(10),
+            "SplitPane.dividerSize", 10,
             "SplitPane.ancestorInputMap",
                new UIDefaults.LazyInputMap(new Object[] {
                         "UP", "negativeIncrement",
diff --git a/jdk/src/share/classes/javax/swing/plaf/nimbus/Defaults.template b/jdk/src/share/classes/javax/swing/plaf/nimbus/Defaults.template
index ee10c49bc47202c6ca0e0d766b272aea7c0ce7d5..8a27e35b2082bc4f9c4e34c71910d2606dba89a6 100644
--- a/jdk/src/share/classes/javax/swing/plaf/nimbus/Defaults.template
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/Defaults.template
@@ -398,7 +398,7 @@ ${UI_DEFAULT_INIT}
         @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 @@ ${UI_DEFAULT_INIT}
                 }
 
                 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 @@ ${UI_DEFAULT_INIT}
                 //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 @@ ${UI_DEFAULT_INIT}
             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 @@ ${UI_DEFAULT_INIT}
 
     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 @@ ${UI_DEFAULT_INIT}
         @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;
             }
             
diff --git a/jdk/src/share/classes/javax/swing/plaf/nimbus/StateImpl.template b/jdk/src/share/classes/javax/swing/plaf/nimbus/StateImpl.template
index 3323ab15581628ca6f0016b24bd37567f6ee5352..dfff2ea59f54ef3be43333b15827712ec0d67afd 100644
--- a/jdk/src/share/classes/javax/swing/plaf/nimbus/StateImpl.template
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/StateImpl.template
@@ -28,7 +28,7 @@ import java.awt.*;
 import javax.swing.*;
 
 
-class ${STATE_NAME} extends State {
+class ${STATE_NAME} extends State<JComponent> {
     ${STATE_NAME}() {
         super("${STATE_KEY}");
     }
diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthParser.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthParser.java
index ad490b6465c7d8c4333d30d08a902ba0a033d42b..d590b3f23171eee6252729c587aa29f6f42fc256 100644
--- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthParser.java
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthParser.java
@@ -764,7 +764,7 @@ class SynthParser extends DefaultHandler {
                 break;
             case 4: // integer
                 try {
-                    value = new Integer(Integer.parseInt(aValue));
+                    value = Integer.valueOf(aValue);
                 } catch (NumberFormatException nfe) {
                     throw new SAXException(property + " invalid value");
                 }
diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthStyle.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthStyle.java
index 0124fdba9053b90b7ec351da9672f1bdd940c15c..bf41d10dff16c449ea5dcc8676b03c646dc9e30e 100644
--- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthStyle.java
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthStyle.java
@@ -33,6 +33,7 @@ import javax.swing.text.DefaultEditorKit;
 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 @@ public abstract class SynthStyle {
               }));
 
         DEFAULT_VALUES.put("InternalFrame.icon",
-                           LookAndFeel.makeIcon(BasicLookAndFeel.class,
+                           SwingUtilities2.makeIcon(BasicLookAndFeel.class,
+                                                    BasicLookAndFeel.class,
                                                     "icons/JavaCup16.png"));
 
         DEFAULT_VALUES.put("InternalFrame.windowBindings",
diff --git a/jdk/src/share/classes/javax/swing/text/JTextComponent.java b/jdk/src/share/classes/javax/swing/text/JTextComponent.java
index 8d67e965f8ff3fbafc65a784abe6c10f280cd72f..ab4da54e3ce5f70b3b8444a96a42902987e0c5d0 100644
--- a/jdk/src/share/classes/javax/swing/text/JTextComponent.java
+++ b/jdk/src/share/classes/javax/swing/text/JTextComponent.java
@@ -2556,7 +2556,7 @@ public abstract class JTextComponent extends JComponent implements Scrollable, A
             if (caretPos != dot) {
                 // the caret moved
                 firePropertyChange(ACCESSIBLE_CARET_PROPERTY,
-                    new Integer(caretPos), new Integer(dot));
+                    caretPos, dot);
                 caretPos = dot;
 
                 try {
diff --git a/jdk/src/share/classes/javax/swing/text/html/CSS.java b/jdk/src/share/classes/javax/swing/text/html/CSS.java
index 6eb59f7605e83cac715afd1081aedd1ae77a7e33..344e8197f45282198fa717b39dfa1289f8a54cc8 100644
--- a/jdk/src/share/classes/javax/swing/text/html/CSS.java
+++ b/jdk/src/share/classes/javax/swing/text/html/CSS.java
@@ -1934,13 +1934,13 @@ public class CSS implements Serializable {
                 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;
diff --git a/jdk/src/share/classes/javax/swing/text/html/HTMLDocument.java b/jdk/src/share/classes/javax/swing/text/html/HTMLDocument.java
index 620e9cc1c7c7a7341a28ce10fddc1deb21461cff..1166f569728f41b5f0b7f3477f66a8e35b20d150 100644
--- a/jdk/src/share/classes/javax/swing/text/html/HTMLDocument.java
+++ b/jdk/src/share/classes/javax/swing/text/html/HTMLDocument.java
@@ -623,7 +623,7 @@ public class HTMLDocument extends DefaultStyledDocument {
      * @param n  the number of tokens to buffer
      */
     public void setTokenThreshold(int n) {
-        putProperty(TokenThreshold, new Integer(n));
+        putProperty(TokenThreshold, n);
     }
 
     /**
diff --git a/jdk/src/share/classes/javax/swing/text/rtf/RTFGenerator.java b/jdk/src/share/classes/javax/swing/text/rtf/RTFGenerator.java
index f56856652264831e3a9644abd00a1c5a460b4e42..4069bad51420fe46664e6cf33a13a9f41b25ed4d 100644
--- a/jdk/src/share/classes/javax/swing/text/rtf/RTFGenerator.java
+++ b/jdk/src/share/classes/javax/swing/text/rtf/RTFGenerator.java
@@ -165,14 +165,14 @@ public void examineElement(Element el)
         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 @@ public void examineElement(Element el)
 
         if (fontName != null &&
             fontTable.get(fontName) == null) {
-            fontTable.put(fontName, new Integer(fontCount));
+            fontTable.put(fontName, fontCount);
             fontCount ++;
         }
     }
@@ -200,7 +200,7 @@ private void tallyStyles(AttributeSet a) {
             Integer aNum = styleTable.get(a);
             if (aNum == null) {
                 styleCount = styleCount + 1;
-                aNum = new Integer(styleCount);
+                aNum = styleCount;
                 styleTable.put(a, aNum);
             }
         }
diff --git a/jdk/src/share/classes/jdk/nio/zipfs/ZipFileAttributeView.java b/jdk/src/share/classes/jdk/nio/zipfs/ZipFileAttributeView.java
index ef446d96cd4dbf405724631cf798ea82e24b70a0..6d479f02a0e49a86a532a1a63a2cfe306587001d 100644
--- a/jdk/src/share/classes/jdk/nio/zipfs/ZipFileAttributeView.java
+++ b/jdk/src/share/classes/jdk/nio/zipfs/ZipFileAttributeView.java
@@ -59,6 +59,7 @@ class ZipFileAttributeView implements BasicFileAttributeView
         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();
diff --git a/jdk/src/share/classes/jdk/nio/zipfs/ZipFileSystemProvider.java b/jdk/src/share/classes/jdk/nio/zipfs/ZipFileSystemProvider.java
index bd3bd411820f6bffa4aeb021267122ae3d7c0198..2961bc90129d6d2f5825e82f70aca320e8e3036a 100644
--- a/jdk/src/share/classes/jdk/nio/zipfs/ZipFileSystemProvider.java
+++ b/jdk/src/share/classes/jdk/nio/zipfs/ZipFileSystemProvider.java
@@ -271,6 +271,7 @@ public class ZipFileSystemProvider extends FileSystemProvider {
     }
 
     @Override
+    @SuppressWarnings("unchecked") // Cast to A
     public <A extends BasicFileAttributes> A
         readAttributes(Path path, Class<A> type, LinkOption... options)
         throws IOException
diff --git a/jdk/src/share/classes/sun/applet/AppletClassLoader.java b/jdk/src/share/classes/sun/applet/AppletClassLoader.java
index fe3459771b23d314c5c03f26e3adecf33da255a8..83684cb36f2d5a3136bb5ff61ca2fd892cd95998 100644
--- a/jdk/src/share/classes/sun/applet/AppletClassLoader.java
+++ b/jdk/src/share/classes/sun/applet/AppletClassLoader.java
@@ -137,7 +137,7 @@ public class AppletClassLoader extends URLClassLoader {
      * 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 @@ public class AppletClassLoader extends URLClassLoader {
      * 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 @@ public class AppletClassLoader extends URLClassLoader {
         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 @@ public class AppletClassLoader extends URLClassLoader {
      * 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 @@ public class AppletClassLoader extends URLClassLoader {
         }
 
         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 @@ public class AppletClassLoader extends URLClassLoader {
      * 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 class AppletClassLoader extends URLClassLoader {
     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 @@ public     void grab() {
 
 
     // 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 @@ public     void grab() {
      * @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 @@ public     void grab() {
      * @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 @@ public     void grab() {
      *         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 @@ public     void grab() {
      *         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 =
diff --git a/jdk/src/share/classes/sun/applet/AppletImageRef.java b/jdk/src/share/classes/sun/applet/AppletImageRef.java
index f264e890351f3284b809d4164eae29d3416df538..e3eb5a26fb1fbe639b5f258980f0db1c079ddd04 100644
--- a/jdk/src/share/classes/sun/applet/AppletImageRef.java
+++ b/jdk/src/share/classes/sun/applet/AppletImageRef.java
@@ -65,7 +65,7 @@ class AppletImageRef {
      * invoke reconstitute().
      */
     public synchronized void flush() {
-        SoftReference s = soft;
+        SoftReference<Image> s = soft;
         if (s != null) s.clear();
         soft = null;
     }
@@ -74,9 +74,9 @@ class AppletImageRef {
      * 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);
     }
 
     /**
diff --git a/jdk/src/share/classes/sun/applet/AppletObjectInputStream.java b/jdk/src/share/classes/sun/applet/AppletObjectInputStream.java
index 36bd8156e5b7f3b2dff451ed02078f405a8aae80..0906136bfece8492e930a041b6ebc70cf7d8863b 100644
--- a/jdk/src/share/classes/sun/applet/AppletObjectInputStream.java
+++ b/jdk/src/share/classes/sun/applet/AppletObjectInputStream.java
@@ -59,7 +59,7 @@ class AppletObjectInputStream extends ObjectInputStream
      * 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 @@ class AppletObjectInputStream extends ObjectInputStream
     /**
      * 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') {
diff --git a/jdk/src/share/classes/sun/applet/AppletPanel.java b/jdk/src/share/classes/sun/applet/AppletPanel.java
index 15ba72b288c6c0a3fa8e300087e4407c9b416db7..89514ddbcd389214135417a2de10e045b8cf1237 100644
--- a/jdk/src/share/classes/sun/applet/AppletPanel.java
+++ b/jdk/src/share/classes/sun/applet/AppletPanel.java
@@ -179,7 +179,7 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable {
 
         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 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable {
     /**
      * AppletEvent Queue
      */
-    private Queue queue = null;
+    private Queue<Integer> queue = null;
 
 
     synchronized public void addAppletListener(AppletListener l) {
@@ -282,7 +282,7 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable {
         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 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable {
         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 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable {
      * 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 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable {
     /**
      * 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 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable {
      * Flush all class loaders.
      */
     public static synchronized void flushClassLoaders() {
-        classloaders = new HashMap();
+        classloaders = new HashMap<>();
     }
 
     /**
@@ -1018,14 +1019,14 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable {
      * 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 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable {
                              * (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 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable {
      */
     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 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable {
         // 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 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable {
 
             // 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 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable {
         // 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
diff --git a/jdk/src/share/classes/sun/applet/AppletProps.java b/jdk/src/share/classes/sun/applet/AppletProps.java
index 466aa83735b7a5b455158d34f66a3071fad48fbe..161bc79a8c30fc68bb59e5eb1e25d85b81eb67d3 100644
--- a/jdk/src/share/classes/sun/applet/AppletProps.java
+++ b/jdk/src/share/classes/sun/applet/AppletProps.java
@@ -105,9 +105,9 @@ class AppletProps extends Frame {
         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 @@ class AppletProps extends Frame {
         // 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);
diff --git a/jdk/src/share/classes/sun/applet/AppletSecurity.java b/jdk/src/share/classes/sun/applet/AppletSecurity.java
index 9fb20e9662e3c2b6570ba0f0b64d0c2b0bce1300..2f11d43d19f0da0f34feb1c5b5821cbe4c6b5567 100644
--- a/jdk/src/share/classes/sun/applet/AppletSecurity.java
+++ b/jdk/src/share/classes/sun/applet/AppletSecurity.java
@@ -80,7 +80,7 @@ class AppletSecurity extends AWTSecurityManager {
     }
 
     // Cache to store known restricted packages
-    private HashSet restrictedPackages = new HashSet();
+    private HashSet<String> restrictedPackages = new HashSet<>();
 
     /**
      * Reset from Properties
@@ -90,11 +90,11 @@ class AppletSecurity extends AWTSecurityManager {
         // 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 @@ class AppletSecurity extends AWTSecurityManager {
             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 @@ class AppletSecurity extends AWTSecurityManager {
             final ClassLoader currentLoader = context[i].getClassLoader();
 
             if (currentLoader instanceof URLClassLoader) {
-                loader = (ClassLoader) AccessController.doPrivileged(new PrivilegedAction() {
-                    public Object run() {
-
-                        AccessControlContext acc = null;
-                        ProtectionDomain[] pds = null;
-
-                        try {
-                            acc = (AccessControlContext) facc.get(currentLoader);
-                            if (acc == null) {
-                                return null;
-                            }
-
-                            pds = (ProtectionDomain[]) fcontext.get(acc);
-                            if (pds == null) {
-                                return null;
+                loader = AccessController.doPrivileged(
+                    new PrivilegedAction<ClassLoader>() {
+                        public ClassLoader run() {
+
+                            AccessControlContext acc = null;
+                            ProtectionDomain[] pds = 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);
                             }
-                        } 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 @@ class AppletSecurity extends AWTSecurityManager {
         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
diff --git a/jdk/src/share/classes/sun/applet/AppletViewer.java b/jdk/src/share/classes/sun/applet/AppletViewer.java
index 92c4fc17f778b4c594bcbe101dfdcfd83a2e54ba..b58579fd096c4e6d09d614fb08f02f2c57b654d4 100644
--- a/jdk/src/share/classes/sun/applet/AppletViewer.java
+++ b/jdk/src/share/classes/sun/applet/AppletViewer.java
@@ -94,7 +94,7 @@ final class StdAppletViewerFactory implements AppletViewerFactory {
 
     @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 @@ public class AppletViewer extends Frame implements AppletContext, Printable {
     /**
      * 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 @@ public class AppletViewer extends Frame implements AppletContext, Printable {
      *             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 @@ public class AppletViewer extends Frame implements AppletContext, Printable {
      * 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 class AppletViewer extends Frame implements AppletContext, Printable {
     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 @@ public class AppletViewer extends Frame implements AppletContext, Printable {
         }
     }
 
-    private static Map imageRefs = new HashMap();
+    private static Map<URL, AppletImageRef> imageRefs = new HashMap<>();
 
     /**
      * Get an image.
@@ -403,7 +403,7 @@ public class AppletViewer extends Frame implements AppletContext, Printable {
     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 @@ public class AppletViewer extends Frame implements AppletContext, Printable {
         imageRefs.clear();
     }
 
-    static Vector appletPanels = new Vector();
+    static Vector<AppletPanel> appletPanels = new Vector<>();
 
     /**
      * Get an applet by name.
@@ -430,8 +430,8 @@ public class AppletViewer extends Frame implements AppletContext, Printable {
         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 @@ public class AppletViewer extends Frame implements AppletContext, Printable {
      * 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 @@ public class AppletViewer extends Frame implements AppletContext, Printable {
     }
 
     @Override
-    public Iterator getStreamKeys(){
+    public Iterator<String> getStreamKeys(){
         // We do nothing.
         return null;
     }
@@ -517,7 +517,7 @@ public class AppletViewer extends Frame implements AppletContext, Printable {
     /**
      * System parameters.
      */
-    static Hashtable systemParam = new Hashtable();
+    static Hashtable<String, String> systemParam = new Hashtable<>();
 
     static {
         systemParam.put("codebase", "codebase");
@@ -533,32 +533,32 @@ public class AppletViewer extends Frame implements AppletContext, Printable {
     /**
      * 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 @@ public class AppletViewer extends Frame implements AppletContext, Printable {
         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 @@ public class AppletViewer extends Frame implements AppletContext, Printable {
      * 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 @@ public class AppletViewer extends Frame implements AppletContext, Printable {
     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 @@ public class AppletViewer extends Frame implements AppletContext, Printable {
             @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 @@ public class AppletViewer extends Frame implements AppletContext, Printable {
     /**
      * 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 @@ public class AppletViewer extends Frame implements AppletContext, Printable {
         url = conn.getURL();
 
         int ydisp = 1;
-        Hashtable atts = null;
+        Hashtable<String, String> atts = null;
 
         while(true) {
             c = in.read();
@@ -1172,12 +1174,12 @@ public class AppletViewer extends Frame implements AppletContext, Printable {
                 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 @@ public class AppletViewer extends Frame implements AppletContext, Printable {
                     }
                     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);
diff --git a/jdk/src/share/classes/sun/applet/AppletViewerFactory.java b/jdk/src/share/classes/sun/applet/AppletViewerFactory.java
index 6fcfaa2ee446330952557a1fca9a434b2888da24..16b6db4679de142255bcb6c0ed9c7802d8348961 100644
--- a/jdk/src/share/classes/sun/applet/AppletViewerFactory.java
+++ b/jdk/src/share/classes/sun/applet/AppletViewerFactory.java
@@ -35,7 +35,8 @@ import java.awt.MenuBar;
 
 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();
 }
diff --git a/jdk/src/share/classes/sun/applet/AppletViewerPanel.java b/jdk/src/share/classes/sun/applet/AppletViewerPanel.java
index 93f064bb36d82a79f7c18f0ad2f7b995805583c1..1a8354c0035b7a6ae9787bc13bf9e7821f242d08 100644
--- a/jdk/src/share/classes/sun/applet/AppletViewerPanel.java
+++ b/jdk/src/share/classes/sun/applet/AppletViewerPanel.java
@@ -59,7 +59,7 @@ class AppletViewerPanel extends AppletPanel {
     /**
      * The attributes of the applet.
      */
-    Hashtable atts;
+    Hashtable<String, String> atts;
 
     /*
      * JDK 1.1 serialVersionUID
@@ -69,7 +69,7 @@ class AppletViewerPanel extends AppletPanel {
     /**
      * 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 @@ class AppletViewerPanel extends AppletPanel {
      * Get an applet parameter.
      */
     public String getParameter(String name) {
-        return (String)atts.get(name.toLowerCase());
+        return atts.get(name.toLowerCase());
     }
 
     /**
diff --git a/jdk/src/share/classes/sun/applet/Main.java b/jdk/src/share/classes/sun/applet/Main.java
index a95a36f2688d28febbad6223345c4da7d5a03208..d29ed5ffd23fed1e52c1248970a1fb67682f25ae 100644
--- a/jdk/src/share/classes/sun/applet/Main.java
+++ b/jdk/src/share/classes/sun/applet/Main.java
@@ -84,7 +84,7 @@ public class Main {
     /**
      * 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 @@ public class Main {
                 // 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 @@ public class Main {
         // 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 @@ public class Main {
         // 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;
diff --git a/jdk/src/share/classes/sun/audio/AudioData.java b/jdk/src/share/classes/sun/audio/AudioData.java
deleted file mode 100644
index 67038769462e916e5e237d76c3ceae8d4e2ea833..0000000000000000000000000000000000000000
--- a/jdk/src/share/classes/sun/audio/AudioData.java
+++ /dev/null
@@ -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);
-        }
-    }
-}
diff --git a/jdk/src/share/classes/sun/audio/AudioDevice.java b/jdk/src/share/classes/sun/audio/AudioDevice.java
deleted file mode 100644
index 6e0804d8aadd553d6236dbbc0de0c7d38d6c9643..0000000000000000000000000000000000000000
--- a/jdk/src/share/classes/sun/audio/AudioDevice.java
+++ /dev/null
@@ -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();
-            }
-        }
-    }
-
-
-
-}
diff --git a/jdk/src/share/classes/sun/audio/AudioPlayer.java b/jdk/src/share/classes/sun/audio/AudioPlayer.java
deleted file mode 100644
index 58ae9105d4cba8a6b2537b5e354388fb79e923c6..0000000000000000000000000000000000000000
--- a/jdk/src/share/classes/sun/audio/AudioPlayer.java
+++ /dev/null
@@ -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.");
-            }
-
-        }
-    }
diff --git a/jdk/src/share/classes/sun/audio/AudioStream.java b/jdk/src/share/classes/sun/audio/AudioStream.java
deleted file mode 100644
index 266f5eb88ef8010181ee93976001b836284c21ab..0000000000000000000000000000000000000000
--- a/jdk/src/share/classes/sun/audio/AudioStream.java
+++ /dev/null
@@ -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;
-        }
-    }
-}
diff --git a/jdk/src/share/classes/sun/audio/AudioStreamSequence.java b/jdk/src/share/classes/sun/audio/AudioStreamSequence.java
deleted file mode 100644
index 178764c1c3dc41a45f70b0c6607b1815a9fc533d..0000000000000000000000000000000000000000
--- a/jdk/src/share/classes/sun/audio/AudioStreamSequence.java
+++ /dev/null
@@ -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);
-        }
-}
diff --git a/jdk/src/share/classes/sun/audio/ContinuousAudioDataStream.java b/jdk/src/share/classes/sun/audio/ContinuousAudioDataStream.java
deleted file mode 100644
index e4adf18c33a2c4f0f713c89e0210013650b73794..0000000000000000000000000000000000000000
--- a/jdk/src/share/classes/sun/audio/ContinuousAudioDataStream.java
+++ /dev/null
@@ -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;
-        }
-    }
diff --git a/jdk/src/share/classes/sun/audio/NativeAudioStream.java b/jdk/src/share/classes/sun/audio/NativeAudioStream.java
deleted file mode 100644
index b5d956b15c18bac39778cfc48d0ca97fda597b31..0000000000000000000000000000000000000000
--- a/jdk/src/share/classes/sun/audio/NativeAudioStream.java
+++ /dev/null
@@ -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;
-        }
-    }
diff --git a/jdk/src/share/classes/sun/awt/AWTAccessor.java b/jdk/src/share/classes/sun/awt/AWTAccessor.java
index 0bec70b332a13e78300ea34ee2c2a15689514659..ddf88d39c7983ba23d74d513c1817f9718deff3e 100644
--- a/jdk/src/share/classes/sun/awt/AWTAccessor.java
+++ b/jdk/src/share/classes/sun/awt/AWTAccessor.java
@@ -481,10 +481,15 @@ public final class AWTAccessor {
         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.
          */
diff --git a/jdk/src/share/classes/sun/java2d/SunGraphics2D.java b/jdk/src/share/classes/sun/java2d/SunGraphics2D.java
index 8826a74718dcbdc6e36c689c9e78e357e0a78a64..a6e28f2a350096cbd343eb7e2b417592786f2e7a 100644
--- a/jdk/src/share/classes/sun/java2d/SunGraphics2D.java
+++ b/jdk/src/share/classes/sun/java2d/SunGraphics2D.java
@@ -1322,7 +1322,7 @@ public final class SunGraphics2D
             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:
diff --git a/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMSImageLayout.java b/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMSImageLayout.java
index 1bcb05ccbb78232c0aa4536ecb71b6516f3e6580..06f4ea6d99b3fbf1da8a82eb8a244f585068c818 100644
--- a/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMSImageLayout.java
+++ b/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMSImageLayout.java
@@ -384,7 +384,8 @@ class LCMSImageLayout {
     }
     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();
diff --git a/jdk/src/share/classes/sun/net/www/protocol/ftp/FtpURLConnection.java b/jdk/src/share/classes/sun/net/www/protocol/ftp/FtpURLConnection.java
index ee7684deb9de54021b7751559df04f37389e52de..d787ab3df1a435dc6e004f7765eb4b8c7dca5a2d 100644
--- a/jdk/src/share/classes/sun/net/www/protocol/ftp/FtpURLConnection.java
+++ b/jdk/src/share/classes/sun/net/www/protocol/ftp/FtpURLConnection.java
@@ -301,7 +301,7 @@ public class FtpURLConnection extends URLConnection {
             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
diff --git a/jdk/src/share/classes/sun/print/CustomMediaSizeName.java b/jdk/src/share/classes/sun/print/CustomMediaSizeName.java
index 2390495a703b60064597b84fcd962c41934f034c..5b9b4b19883a1d6502ebddd858c88c1825a8206b 100644
--- a/jdk/src/share/classes/sun/print/CustomMediaSizeName.java
+++ b/jdk/src/share/classes/sun/print/CustomMediaSizeName.java
@@ -67,6 +67,22 @@ class CustomMediaSizeName extends MediaSizeName {
                                             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;
+                }
+            }
+        }
     }
 
     /**
diff --git a/jdk/src/share/classes/sun/print/PSPrinterJob.java b/jdk/src/share/classes/sun/print/PSPrinterJob.java
index ae5d9bdeba6ec55c30dea6419b48c5ff103b8cad..3acb39389ecd4dde92d3c913c8a0be36d6c38b08 100644
--- a/jdk/src/share/classes/sun/print/PSPrinterJob.java
+++ b/jdk/src/share/classes/sun/print/PSPrinterJob.java
@@ -168,13 +168,6 @@ public class PSPrinterJob extends RasterPrinterJob {
     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 @@ public class PSPrinterJob extends RasterPrinterJob {
 
    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 @@ public class PSPrinterJob extends RasterPrinterJob {
         }
     }
 
+    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 @@ public class PSPrinterJob extends RasterPrinterJob {
             mPSStream.println(" >> setpagedevice");
         }
         mPSStream.println(PAGE_SAVE);
-        mPSStream.println(paperHeight + COORD_PREP);
+        mPSStream.println(paperHeight + getCoordPrep());
     }
 
     /**
@@ -1493,14 +1498,22 @@ public class PSPrinterJob extends RasterPrinterJob {
      * 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;
     }
 
     /**
diff --git a/jdk/src/share/classes/sun/print/RasterPrinterJob.java b/jdk/src/share/classes/sun/print/RasterPrinterJob.java
index f80970af362bbd227c4a9de6ac2eb0fe0ea4ad66..c4564b2750c361bd51638091adc33c7f09eb0d80 100644
--- a/jdk/src/share/classes/sun/print/RasterPrinterJob.java
+++ b/jdk/src/share/classes/sun/print/RasterPrinterJob.java
@@ -72,6 +72,7 @@ import javax.print.attribute.Attribute;
 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.MediaSize;
 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 @@ public abstract class RasterPrinterJob extends PrinterJob {
     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 @@ public abstract class RasterPrinterJob extends PrinterJob {
                                           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 @@ public abstract class RasterPrinterJob extends PrinterJob {
         /*  reset all values to defaults */
         setCollated(false);
         sidesAttr = null;
+        printerResAttr = null;
         pageRangesAttr = null;
         copiesAttr = 0;
         jobNameAttr = null;
@@ -1117,6 +1129,18 @@ public abstract class RasterPrinterJob extends PrinterJob {
             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;
diff --git a/jdk/src/share/classes/sun/print/ServiceDialog.java b/jdk/src/share/classes/sun/print/ServiceDialog.java
index 155d1430acb90bf0528cb6f5fbcd8710ff74bd94..dc90bfe2d535780f9ea4c2d729b12ffd64f8ce29 100644
--- a/jdk/src/share/classes/sun/print/ServiceDialog.java
+++ b/jdk/src/share/classes/sun/print/ServiceDialog.java
@@ -1017,8 +1017,8 @@ public class ServiceDialog extends JDialog implements ActionListener {
             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 @@ public class ServiceDialog extends JDialog implements ActionListener {
 
             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 @@ public class ServiceDialog extends JDialog implements ActionListener {
             } 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 @@ public class ServiceDialog extends JDialog implements ActionListener {
                 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 @@ public class ServiceDialog extends JDialog implements ActionListener {
             if ((value < 1) || (value > 100)) {
                 value = 1;
             }
-            snModel.setValue(new Integer(value));
+            snModel.setValue(value);
             lblPriority.setEnabled(jpSupported);
             spinPriority.setEnabled(jpSupported);
 
diff --git a/jdk/src/share/classes/sun/security/provider/SecureRandom.java b/jdk/src/share/classes/sun/security/provider/SecureRandom.java
index b0da8c51526ad46136b07743fdb976aaf6528a0f..4f7d7c3aad6a7317b216e22c6784af4d92e7eece 100644
--- a/jdk/src/share/classes/sun/security/provider/SecureRandom.java
+++ b/jdk/src/share/classes/sun/security/provider/SecureRandom.java
@@ -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.io.IOException;
 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 @@ implements java.io.Serializable {
      */
     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 @@ implements java.io.Serializable {
         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);
+            }
         }
     }
 }
diff --git a/jdk/src/share/classes/sun/security/ssl/DHCrypt.java b/jdk/src/share/classes/sun/security/ssl/DHCrypt.java
index ae9118f4ba5171a781e3a7241ae06a581e45d760..6deae7e2657546441e6bc6f3d2c54407bde6627d 100644
--- a/jdk/src/share/classes/sun/security/ssl/DHCrypt.java
+++ b/jdk/src/share/classes/sun/security/ssl/DHCrypt.java
@@ -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 @@ final class DHCrypt {
      *         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 @@ final class DHCrypt {
             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);
         }
     }
 
diff --git a/jdk/src/share/classes/sun/security/ssl/ECDHCrypt.java b/jdk/src/share/classes/sun/security/ssl/ECDHCrypt.java
index df52bc5948a6abafcee6343cc831d3760a4ac187..c1ce4e93cee2ff5aa5f18eb93d7771d9e9105538 100644
--- a/jdk/src/share/classes/sun/security/ssl/ECDHCrypt.java
+++ b/jdk/src/share/classes/sun/security/ssl/ECDHCrypt.java
@@ -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 java.security.spec.*;
 
 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 @@ final class ECDHCrypt {
     }
 
     // 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 @@ final class ECDHCrypt {
             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);
         }
     }
 
diff --git a/jdk/src/share/classes/sun/security/ssl/Handshaker.java b/jdk/src/share/classes/sun/security/ssl/Handshaker.java
index 9fea3fada986b7df6992a195122555e021f1961a..bea8608e6ff4bde3da6ef6c2b23b64292697aef7 100644
--- a/jdk/src/share/classes/sun/security/ssl/Handshaker.java
+++ b/jdk/src/share/classes/sun/security/ssl/Handshaker.java
@@ -656,8 +656,15 @@ abstract class Handshaker {
      */
     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 @@ abstract class Handshaker {
                         "No available cipher suite for " + protocol);
                 }
             }
+
+            if (!protocols.isEmpty() && enabledSSL20Hello) {
+                protocols.add(ProtocolVersion.SSL20Hello);
+            }
+
             activeProtocols = new ProtocolList(protocols);
         }
 
diff --git a/jdk/src/share/classes/sun/swing/PrintingStatus.java b/jdk/src/share/classes/sun/swing/PrintingStatus.java
index 0dd01a4593b6adb1539bb5000b61c5f3f0e98b85..1a49c94e03f068c64e2e90ad53159f99c6bb65e5 100644
--- a/jdk/src/share/classes/sun/swing/PrintingStatus.java
+++ b/jdk/src/share/classes/sun/swing/PrintingStatus.java
@@ -295,7 +295,7 @@ public class PrintingStatus {
         private void updateStatusOnEDT(int pageIndex) {
             assert SwingUtilities.isEventDispatchThread();
             Object[] pageNumber = new Object[]{
-                new Integer(pageIndex + 1)};
+                pageIndex + 1};
             statusLabel.setText(statusFormat.format(pageNumber));
         }
     }
diff --git a/jdk/src/share/classes/sun/swing/SwingUtilities2.java b/jdk/src/share/classes/sun/swing/SwingUtilities2.java
index d0f6748e2da7a6fc0fcca0c52f3fcdaf81248979..d370a34140ca8c3f53f4640c2242824988794e76 100644
--- a/jdk/src/share/classes/sun/swing/SwingUtilities2.java
+++ b/jdk/src/share/classes/sun/swing/SwingUtilities2.java
@@ -49,6 +49,8 @@ import javax.swing.tree.TreePath;
 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 class SwingUtilities2 {
     public static Object makeIcon(final Class<?> baseClass,
                                   final Class<?> rootClass,
                                   final String imageFile) {
+        return makeIcon(baseClass, rootClass, imageFile, true);
+    }
+
+    /**
+     * 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);
+    }
 
-        return new UIDefaults.LazyValue() {
-            public Object createValue(UIDefaults table) {
+    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 @@ public class SwingUtilities2 {
                  * 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
diff --git a/jdk/src/share/classes/sun/tools/asm/Assembler.java b/jdk/src/share/classes/sun/tools/asm/Assembler.java
index af169b20054a73c5278bcdc28b4fb475d8fb719e..7a9fdda2c730b728d8fd1bf7fb494ddcfb3ee0ca 100644
--- a/jdk/src/share/classes/sun/tools/asm/Assembler.java
+++ b/jdk/src/share/classes/sun/tools/asm/Assembler.java
@@ -238,7 +238,7 @@ class Assembler implements Constants {
         // 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 @@ class Assembler implements Constants {
         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 @@ public void GenJCov(Environment env) {
         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 @@ public void GenJCov(Environment env) {
         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;
diff --git a/jdk/src/share/classes/sun/tools/asm/ConstantPool.java b/jdk/src/share/classes/sun/tools/asm/ConstantPool.java
index cb0aaac51be6d3c76424ac45b9559c86cc137149..2292c2cd64b3bad841f0997fb198f2017ebbe5bf 100644
--- a/jdk/src/share/classes/sun/tools/asm/ConstantPool.java
+++ b/jdk/src/share/classes/sun/tools/asm/ConstantPool.java
@@ -42,7 +42,7 @@ import java.io.DataOutputStream;
  */
 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
diff --git a/jdk/src/share/classes/sun/tools/asm/SwitchData.java b/jdk/src/share/classes/sun/tools/asm/SwitchData.java
index 0e6387c88994f46b865cffb69621beacba770136..e7cd0f966ea56e4330a88a71f0ca014232046da7 100644
--- a/jdk/src/share/classes/sun/tools/asm/SwitchData.java
+++ b/jdk/src/share/classes/sun/tools/asm/SwitchData.java
@@ -39,9 +39,9 @@ public final
 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 @@ class SwitchData {
 
 // 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 @@ class SwitchDataEnumeration implements Enumeration<Integer> {
      * 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() ; ) {
diff --git a/jdk/src/share/classes/sun/tools/java/BinaryClass.java b/jdk/src/share/classes/sun/tools/java/BinaryClass.java
index 580d9e420a10369de1197e7095253bdf43fffda4..b7d75e44799eec15e481643dad6a77f90f489584 100644
--- a/jdk/src/share/classes/sun/tools/java/BinaryClass.java
+++ b/jdk/src/share/classes/sun/tools/java/BinaryClass.java
@@ -43,7 +43,7 @@ public final
 class BinaryClass extends ClassDefinition implements Constants {
     BinaryConstantPool cpool;
     BinaryAttribute atts;
-    Vector dependencies;
+    Vector<ClassDeclaration> dependencies;
     private boolean haveLoadedNested = false;
 
     /**
@@ -51,7 +51,7 @@ class BinaryClass extends ClassDefinition implements Constants {
      */
     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 @@ class BinaryClass extends ClassDefinition implements Constants {
         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 @@ class BinaryClass extends ClassDefinition implements Constants {
     /**
      * Get the dependencies
      */
-    public Enumeration getDependencies() {
+    public Enumeration<ClassDeclaration> getDependencies() {
         return dependencies.elements();
     }
 
diff --git a/jdk/src/share/classes/sun/tools/java/BinaryConstantPool.java b/jdk/src/share/classes/sun/tools/java/BinaryConstantPool.java
index 56082348f1957ff4088175bafdc47027c8afdb7e..9507a19362a173810573305a88e3ce3a60ae5f34 100644
--- a/jdk/src/share/classes/sun/tools/java/BinaryConstantPool.java
+++ b/jdk/src/share/classes/sun/tools/java/BinaryConstantPool.java
@@ -222,8 +222,8 @@ class BinaryConstantPool implements Constants {
      * 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 @@ class BinaryConstantPool implements Constants {
         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 @@ class BinaryConstantPool implements Constants {
     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 @@ class BinaryConstantPool implements Constants {
     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 @@ class BinaryConstantPool implements Constants {
      */
 
     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 @@ class BinaryConstantPool implements Constants {
             }
         }
         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);
         }
diff --git a/jdk/src/share/classes/sun/tools/java/BinaryMember.java b/jdk/src/share/classes/sun/tools/java/BinaryMember.java
index a66b48dacd9c66c0ce32a7a93707c34bc127e9b6..0b0b75a67724f405b9f237243003fc255423d9c7 100644
--- a/jdk/src/share/classes/sun/tools/java/BinaryMember.java
+++ b/jdk/src/share/classes/sun/tools/java/BinaryMember.java
@@ -82,9 +82,9 @@ class BinaryMember extends MemberDefinition {
     /**
      * 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;
diff --git a/jdk/src/share/classes/sun/tools/java/ClassDefinition.java b/jdk/src/share/classes/sun/tools/java/ClassDefinition.java
index 76e3b7b99fd5032536f1c23890c7fb001b41ad9c..47a163235d5af23b06e0085b4390719dd4c34adc 100644
--- a/jdk/src/share/classes/sun/tools/java/ClassDefinition.java
+++ b/jdk/src/share/classes/sun/tools/java/ClassDefinition.java
@@ -64,14 +64,14 @@ class ClassDefinition implements Constants {
     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 @@ class ClassDefinition implements Constants {
         return firstMember;
     }
     public final MemberDefinition getFirstMatch(Identifier name) {
-        return (MemberDefinition)fieldHash.get(name);
+        return fieldHash.get(name);
     }
 
     /**
@@ -519,9 +519,9 @@ class ClassDefinition implements Constants {
 
         // 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 @@ class ClassDefinition implements Constants {
         // 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 @@ class ClassDefinition implements Constants {
         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 @@ class ClassDefinition implements Constants {
                     // 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 @@ class ClassDefinition implements Constants {
         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 @@ class ClassDefinition implements Constants {
     // 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 @@ class ClassDefinition implements Constants {
 
         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 @@ class ClassDefinition implements Constants {
             // 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 @@ class ClassDefinition implements Constants {
      * 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 @@ class ClassDefinition implements Constants {
      * 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 @@ class ClassDefinition implements Constants {
      * affect our compilation.
      */
     protected void addMirandaMethods(Environment env,
-                                     Iterator mirandas) {
+                                     Iterator<MemberDefinition> mirandas) {
         // do nothing.
     }
 
@@ -1921,11 +1920,11 @@ class ClassDefinition implements Constants {
             // 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 @@ class ClassDefinition implements Constants {
         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);
     }
diff --git a/jdk/src/share/classes/sun/tools/java/ClassPath.java b/jdk/src/share/classes/sun/tools/java/ClassPath.java
index 5f8aa01e6b808cf8ef22476131b4004b160084bb..ae917d0553e30260832f702a02e7c8fea07b87d3 100644
--- a/jdk/src/share/classes/sun/tools/java/ClassPath.java
+++ b/jdk/src/share/classes/sun/tools/java/ClassPath.java
@@ -233,11 +233,11 @@ class ClassPath {
     /**
      * 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 @@ class ClassPathEntry {
     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);
diff --git a/jdk/src/share/classes/sun/tools/java/Identifier.java b/jdk/src/share/classes/sun/tools/java/Identifier.java
index 22cd413b55d038667b893240ea9b436bc606d746..5869d680724ff66855834aa0705314c59660e683 100644
--- a/jdk/src/share/classes/sun/tools/java/Identifier.java
+++ b/jdk/src/share/classes/sun/tools/java/Identifier.java
@@ -58,7 +58,7 @@ class Identifier implements Constants {
     /**
      * 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 @@ class Identifier implements Constants {
      */
     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));
         }
diff --git a/jdk/src/share/classes/sun/tools/java/Imports.java b/jdk/src/share/classes/sun/tools/java/Imports.java
index bc55164544943b77f108153ada5b94fd8a317ee2..e2b038bdb587d467f712025a1dc7d163aca2b367 100644
--- a/jdk/src/share/classes/sun/tools/java/Imports.java
+++ b/jdk/src/share/classes/sun/tools/java/Imports.java
@@ -67,20 +67,20 @@ class Imports implements Constants {
     /**
      * 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 @@ class Imports implements Constants {
         //     }
         // }
 
-        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 @@ class Imports implements Constants {
         }
         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 @@ class Imports implements Constants {
             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 @@ class Imports implements Constants {
         }
 
         // 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 @@ class Imports implements Constants {
         } 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 @@ class Imports implements Constants {
         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 @@ class Imports implements Constants {
         // 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 @@ class Imports implements Constants {
      * 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 @@ class Imports implements Constants {
      * Return an unmodifiable list of IdentifierToken representing
      * classes specified as imports.
      */
-    public List getImportedClasses() {
+    public List<IdentifierToken> getImportedClasses() {
         return Collections.unmodifiableList(singles);
     }
 
diff --git a/jdk/src/share/classes/sun/tools/java/MemberDefinition.java b/jdk/src/share/classes/sun/tools/java/MemberDefinition.java
index 5dde1624cd137afbdbc90f5b4dcd8a30883767f2..c7060e729d08f8ccd4c1cb3d3b97637b64e9e4e8 100644
--- a/jdk/src/share/classes/sun/tools/java/MemberDefinition.java
+++ b/jdk/src/share/classes/sun/tools/java/MemberDefinition.java
@@ -103,7 +103,7 @@ class MemberDefinition implements Constants {
      * 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 @@ class MemberDefinition implements Constants {
                                                    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 @@ class MemberDefinition implements Constants {
     /**
      * Get arguments (a vector of LocalMember)
      */
-    public Vector getArguments() {
-        return isMethod() ? new Vector() : null;
+    public Vector<MemberDefinition> getArguments() {
+        return isMethod() ? new Vector<>() : null;
     }
 
     /**
diff --git a/jdk/src/share/classes/sun/tools/java/MethodSet.java b/jdk/src/share/classes/sun/tools/java/MethodSet.java
index ecaf0236bfee90fbe06f9017d65fac293e74a0d0..c62eb00d167b464f799634329a71656a48003b09 100644
--- a/jdk/src/share/classes/sun/tools/java/MethodSet.java
+++ b/jdk/src/share/classes/sun/tools/java/MethodSet.java
@@ -46,7 +46,7 @@ class MethodSet {
      * 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 @@ class MethodSet {
      */
     public MethodSet() {
         frozen = false;
-        lookupMap = new HashMap();
+        lookupMap = new HashMap<>();
         count = 0;
     }
 
@@ -89,12 +89,12 @@ class MethodSet {
             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 @@ class MethodSet {
             // 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 @@ class MethodSet {
             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 @@ class MethodSet {
             // `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 @@ class MethodSet {
     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 @@ class MethodSet {
      * 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 @@ class MethodSet {
     /**
      * 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 @@ class MethodSet {
                 return false;
             }
 
-            public Object next() {
+            public MemberDefinition next() {
                 return listIter.next();
             }
 
@@ -262,7 +261,7 @@ class MethodSet {
     public String toString() {
         int len = size();
         StringBuilder sb = new StringBuilder();
-        Iterator all = iterator();
+        Iterator<MemberDefinition> all = iterator();
         sb.append("{");
 
         while (all.hasNext()) {
diff --git a/jdk/src/share/classes/sun/tools/java/Package.java b/jdk/src/share/classes/sun/tools/java/Package.java
index ef62af0114fab2cc1c23c66e3ef442aa602e7bfa..9d45d1c44d4a7326e21772cdef088343edf77f60 100644
--- a/jdk/src/share/classes/sun/tools/java/Package.java
+++ b/jdk/src/share/classes/sun/tools/java/Package.java
@@ -144,11 +144,11 @@ class Package {
         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");
     }
 
diff --git a/jdk/src/share/classes/sun/tools/java/Parser.java b/jdk/src/share/classes/sun/tools/java/Parser.java
index f8e4f10028c3ac0dbdcacd48bbc08b56e6c7a415..8c97f3b190610949e14c75a01e55bc9c8cf519d3 100644
--- a/jdk/src/share/classes/sun/tools/java/Parser.java
+++ b/jdk/src/share/classes/sun/tools/java/Parser.java
@@ -392,8 +392,8 @@ class Parser extends Scanner implements ParserActions, Constants {
             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 @@ class Parser extends Scanner implements ParserActions, Constants {
             // 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 @@ class Parser extends Scanner implements ParserActions, Constants {
         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 @@ class Parser extends Scanner implements ParserActions, Constants {
         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 @@ class Parser extends Scanner implements ParserActions, Constants {
      */
     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);
             }
         }
 
diff --git a/jdk/src/share/classes/sun/tools/java/Type.java b/jdk/src/share/classes/sun/tools/java/Type.java
index a84ae56be8850e0a71e504a6c6e977481d2002af..77348b4df767c61d2052f6f4d67eba8b1f815c9a 100644
--- a/jdk/src/share/classes/sun/tools/java/Type.java
+++ b/jdk/src/share/classes/sun/tools/java/Type.java
@@ -57,7 +57,7 @@ class Type implements Constants {
     /**
      * 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 @@ class Type implements Constants {
      */
     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 @@ class Type implements Constants {
             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 @@ class Type implements Constants {
         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 @@ class Type implements Constants {
      * @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;
         }
diff --git a/jdk/src/share/classes/sun/tools/javac/BatchEnvironment.java b/jdk/src/share/classes/sun/tools/javac/BatchEnvironment.java
index 01141c8155d9830aecced6ccc104014bd97ecafe..e20b386d3257d071a6be1b932647b3ac590b47f2 100644
--- a/jdk/src/share/classes/sun/tools/javac/BatchEnvironment.java
+++ b/jdk/src/share/classes/sun/tools/javac/BatchEnvironment.java
@@ -61,17 +61,17 @@ class BatchEnvironment extends Environment implements ErrorConsumer {
     /**
      * 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 @@ class BatchEnvironment extends Environment implements ErrorConsumer {
     /**
      * A list of files containing deprecation warnings.
      */
-    Vector deprecationFiles = new Vector();
+    Vector<Object> deprecationFiles = new Vector<>();
 
         /**
          * writes out error messages
@@ -271,7 +271,7 @@ class BatchEnvironment extends Environment implements ErrorConsumer {
      * 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 @@ class BatchEnvironment extends Environment implements ErrorConsumer {
      * 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 @@ class BatchEnvironment extends Environment implements ErrorConsumer {
         // 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 @@ class BatchEnvironment extends Environment implements ErrorConsumer {
     }
 
     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 @@ class BatchEnvironment extends Environment implements ErrorConsumer {
         }
         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 @@ class BatchEnvironment extends Environment implements ErrorConsumer {
      * 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 @@ class BatchEnvironment extends Environment implements ErrorConsumer {
             // (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 @@ class BatchEnvironment extends Environment implements ErrorConsumer {
             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 @@ class BatchEnvironment extends Environment implements ErrorConsumer {
     /**
      * 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 @@ class BatchEnvironment extends Environment implements ErrorConsumer {
                 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 @@ class BatchEnvironment extends Environment implements ErrorConsumer {
 
           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 @@ class BatchEnvironment extends Environment implements ErrorConsumer {
         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,
diff --git a/jdk/src/share/classes/sun/tools/javac/BatchParser.java b/jdk/src/share/classes/sun/tools/javac/BatchParser.java
index ab764ce5992b75a4479f1b509709c9d7c1996f16..03fc237da999d6f65bb35b9a3d32de3295a328a8 100644
--- a/jdk/src/share/classes/sun/tools/javac/BatchParser.java
+++ b/jdk/src/share/classes/sun/tools/javac/BatchParser.java
@@ -56,7 +56,7 @@ class BatchParser extends Parser {
     /**
      * The classes defined in this file
      */
-    protected Vector classes;
+    protected Vector<SourceClass> classes;
 
 
     /**
@@ -76,7 +76,7 @@ class BatchParser extends Parser {
         super(env, in);
 
         imports = new Imports(env);
-        classes = new Vector();
+        classes = new Vector<>();
         toplevelEnv = imports.newEnvironment(env);
     }
 
diff --git a/jdk/src/share/classes/sun/tools/javac/CompilerMember.java b/jdk/src/share/classes/sun/tools/javac/CompilerMember.java
index b3442fd776382056afc363e9a8dfe05360d3d82e..c62eee3b055bc5feacc18222f65e0ab03d46d53d 100644
--- a/jdk/src/share/classes/sun/tools/javac/CompilerMember.java
+++ b/jdk/src/share/classes/sun/tools/javac/CompilerMember.java
@@ -38,7 +38,7 @@ import sun.tools.asm.Assembler;
  */
 @Deprecated
 final
-class CompilerMember implements Comparable {
+class CompilerMember implements Comparable<Object> {
     MemberDefinition field;
     Assembler asm;
     Object value;
diff --git a/jdk/src/share/classes/sun/tools/javac/Main.java b/jdk/src/share/classes/sun/tools/javac/Main.java
index 0d02cffe6987d8f7f750a090cd8502819b875477..f7015dbd36e6ee8ec3382725813c060084fda09d 100644
--- a/jdk/src/share/classes/sun/tools/javac/Main.java
+++ b/jdk/src/share/classes/sun/tools/javac/Main.java
@@ -212,7 +212,7 @@ class Main implements Constants {
 //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 @@ class Main implements Constants {
 
         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 @@ class Main implements Constants {
 
             // 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 @@ class Main implements Constants {
             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()) {
diff --git a/jdk/src/share/classes/sun/tools/javac/SourceClass.java b/jdk/src/share/classes/sun/tools/javac/SourceClass.java
index d1744baf3c6c6106abc025ab8cc2da70c0050af3..f545845326007ad07046afdc26e89508c97a4b8e 100644
--- a/jdk/src/share/classes/sun/tools/javac/SourceClass.java
+++ b/jdk/src/share/classes/sun/tools/javac/SourceClass.java
@@ -70,7 +70,7 @@ class SourceClass extends ClassDefinition {
    /**
      * 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 @@ class SourceClass extends ClassDefinition {
                     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 @@ class SourceClass extends ClassDefinition {
             // 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 @@ class SourceClass extends ClassDefinition {
             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 @@ class SourceClass extends ClassDefinition {
      * 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 @@ class SourceClass extends ClassDefinition {
      * 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 @@ class SourceClass extends ClassDefinition {
 
     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 @@ class SourceClass extends ClassDefinition {
             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 @@ class SourceClass extends ClassDefinition {
         }
 
         // 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 @@ class SourceClass extends ClassDefinition {
         }
 
         // 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 @@ class SourceClass extends ClassDefinition {
         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 @@ class SourceClass extends ClassDefinition {
         // 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 @@ class SourceClass extends ClassDefinition {
             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 @@ class SourceClass extends ClassDefinition {
                 // 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 @@ class SourceClass extends ClassDefinition {
             //  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();
diff --git a/jdk/src/share/classes/sun/tools/javac/SourceMember.java b/jdk/src/share/classes/sun/tools/javac/SourceMember.java
index 8ba23ce07a0fc968c6e6ef53c79360acfea9fd5e..4c6c0d328c3703c0153cf2aed189e01c6ed7d32a 100644
--- a/jdk/src/share/classes/sun/tools/javac/SourceMember.java
+++ b/jdk/src/share/classes/sun/tools/javac/SourceMember.java
@@ -46,7 +46,7 @@ class SourceMember extends MemberDefinition implements Constants {
     /**
      * 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 @@ class SourceMember extends MemberDefinition implements Constants {
     static final int INLINED    = 4;
     static final int ERROR      = 5;
 
-    public Vector getArguments() {
+    public Vector<MemberDefinition> getArguments() {
         return args;
     }
 
@@ -74,7 +74,7 @@ class SourceMember extends MemberDefinition implements Constants {
      */
     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 @@ class SourceMember extends MemberDefinition implements Constants {
         }
     }
 
-    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 @@ class SourceMember extends MemberDefinition implements Constants {
             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 @@ class SourceMember extends MemberDefinition implements Constants {
                     // 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 @@ class SourceMember extends MemberDefinition implements Constants {
                     //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 @@ class SourceMember extends MemberDefinition implements Constants {
                     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 @@ class SourceMember extends MemberDefinition implements Constants {
                         }
                     }
                 } 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 @@ class SourceMember extends MemberDefinition implements Constants {
                     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 @@ class SourceMember extends MemberDefinition implements Constants {
                 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 @@ class SourceMember extends MemberDefinition implements Constants {
                 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());
diff --git a/jdk/src/share/classes/sun/tools/tree/AndExpression.java b/jdk/src/share/classes/sun/tools/tree/AndExpression.java
index 18082007153551d9b3cd0c852ec3152090468377..84eaa01b141e66e8a6793d6c94e053e74c3958e2 100644
--- a/jdk/src/share/classes/sun/tools/tree/AndExpression.java
+++ b/jdk/src/share/classes/sun/tools/tree/AndExpression.java
@@ -54,7 +54,7 @@ class AndExpression extends BinaryLogicalExpression {
      *        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);
diff --git a/jdk/src/share/classes/sun/tools/tree/ArrayAccessExpression.java b/jdk/src/share/classes/sun/tools/tree/ArrayAccessExpression.java
index 3997b33e07c3b1889ba561fdccf1fb97cc429c99..d720df67e04f18415165b849343ef46d96b8beb8 100644
--- a/jdk/src/share/classes/sun/tools/tree/ArrayAccessExpression.java
+++ b/jdk/src/share/classes/sun/tools/tree/ArrayAccessExpression.java
@@ -62,7 +62,7 @@ class ArrayAccessExpression extends UnaryExpression {
     /**
      * 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 @@ class ArrayAccessExpression extends UnaryExpression {
     }
 
     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 @@ class ArrayAccessExpression extends UnaryExpression {
      * 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 @@ class ArrayAccessExpression extends UnaryExpression {
      * 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);
     }
 
diff --git a/jdk/src/share/classes/sun/tools/tree/ArrayExpression.java b/jdk/src/share/classes/sun/tools/tree/ArrayExpression.java
index b784a263ce4814ea764d1c2131f9f3cb4ff5942b..a431159af349d720ded9643eac6ed2f448df6cda 100644
--- a/jdk/src/share/classes/sun/tools/tree/ArrayExpression.java
+++ b/jdk/src/share/classes/sun/tools/tree/ArrayExpression.java
@@ -47,11 +47,11 @@ class ArrayExpression extends NaryExpression {
     /**
      * 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);
diff --git a/jdk/src/share/classes/sun/tools/tree/AssignExpression.java b/jdk/src/share/classes/sun/tools/tree/AssignExpression.java
index 3a9b1d23239be59fa7dc96f0e32da347c9a11193..929335fc553b24259545367f6f03d852809921e8 100644
--- a/jdk/src/share/classes/sun/tools/tree/AssignExpression.java
+++ b/jdk/src/share/classes/sun/tools/tree/AssignExpression.java
@@ -50,7 +50,7 @@ class AssignExpression extends BinaryAssignExpression {
     /**
      * 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
diff --git a/jdk/src/share/classes/sun/tools/tree/AssignOpExpression.java b/jdk/src/share/classes/sun/tools/tree/AssignOpExpression.java
index b3493bc7d9a8500c579a325adae2b52a43cc85a0..b8185925c3c27d5e21f52d4cfa4fe479d586fc12 100644
--- a/jdk/src/share/classes/sun/tools/tree/AssignOpExpression.java
+++ b/jdk/src/share/classes/sun/tools/tree/AssignOpExpression.java
@@ -149,7 +149,7 @@ class AssignOpExpression extends BinaryAssignExpression {
     /**
      * 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();
diff --git a/jdk/src/share/classes/sun/tools/tree/BinaryAssignExpression.java b/jdk/src/share/classes/sun/tools/tree/BinaryAssignExpression.java
index f5f9f21c337cd7475bf374c5a4044ae1dd033646..5a45fe69d93ace2ab222fb30ce815a448702458d 100644
--- a/jdk/src/share/classes/sun/tools/tree/BinaryAssignExpression.java
+++ b/jdk/src/share/classes/sun/tools/tree/BinaryAssignExpression.java
@@ -67,7 +67,7 @@ class BinaryAssignExpression extends BinaryExpression {
     /**
      * 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);
     }
 
diff --git a/jdk/src/share/classes/sun/tools/tree/BinaryExpression.java b/jdk/src/share/classes/sun/tools/tree/BinaryExpression.java
index 9fd7fa33b557a2878aea930348eb043c10b7737a..d54f82509955f2748059f70ea50765f66b482bd5 100644
--- a/jdk/src/share/classes/sun/tools/tree/BinaryExpression.java
+++ b/jdk/src/share/classes/sun/tools/tree/BinaryExpression.java
@@ -64,7 +64,7 @@ class BinaryExpression extends UnaryExpression {
     /**
      * 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);
 
diff --git a/jdk/src/share/classes/sun/tools/tree/BinaryLogicalExpression.java b/jdk/src/share/classes/sun/tools/tree/BinaryLogicalExpression.java
index 9b2eed093e7b929b5088b7e09ec6b899ee713418..e86f178d5dbab0663ce22b12cfd0d17c40efb6c0 100644
--- a/jdk/src/share/classes/sun/tools/tree/BinaryLogicalExpression.java
+++ b/jdk/src/share/classes/sun/tools/tree/BinaryLogicalExpression.java
@@ -46,7 +46,7 @@ class BinaryLogicalExpression extends BinaryExpression {
      * 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 @@ class BinaryLogicalExpression extends BinaryExpression {
      */
     abstract
     public void checkCondition(Environment env, Context ctx, Vset vset,
-                               Hashtable exp, ConditionVars cvars);
+                               Hashtable<Object, Object> exp, ConditionVars cvars);
 
 
     /**
diff --git a/jdk/src/share/classes/sun/tools/tree/BooleanExpression.java b/jdk/src/share/classes/sun/tools/tree/BooleanExpression.java
index af5f0891401c865edd7ecb377e2e916c21fd6ba4..c82deb4d0c208409e12745e9f3a76f77c6dcbf55 100644
--- a/jdk/src/share/classes/sun/tools/tree/BooleanExpression.java
+++ b/jdk/src/share/classes/sun/tools/tree/BooleanExpression.java
@@ -86,7 +86,7 @@ class BooleanExpression extends ConstantExpression {
      */
 
     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;
diff --git a/jdk/src/share/classes/sun/tools/tree/BreakStatement.java b/jdk/src/share/classes/sun/tools/tree/BreakStatement.java
index f1801e32c551d43afc84fd53c088e317f3262ed0..3847f180d4056412093e786b2a61b57db3d68179 100644
--- a/jdk/src/share/classes/sun/tools/tree/BreakStatement.java
+++ b/jdk/src/share/classes/sun/tools/tree/BreakStatement.java
@@ -51,7 +51,7 @@ class BreakStatement extends Statement {
     /**
      * 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);
diff --git a/jdk/src/share/classes/sun/tools/tree/CaseStatement.java b/jdk/src/share/classes/sun/tools/tree/CaseStatement.java
index 0fa27556dac713e68151c2cb2b427803d388608c..cd8c33cb45b34b122542c057eb40db694e92e2cf 100644
--- a/jdk/src/share/classes/sun/tools/tree/CaseStatement.java
+++ b/jdk/src/share/classes/sun/tools/tree/CaseStatement.java
@@ -49,7 +49,7 @@ class CaseStatement extends Statement {
     /**
      * 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);
diff --git a/jdk/src/share/classes/sun/tools/tree/CastExpression.java b/jdk/src/share/classes/sun/tools/tree/CastExpression.java
index 0a53c2b926e5b89f4ecd3a362dd3fd67ad66b839..6826b173bb662259cccddbe92e71f53c7b302018 100644
--- a/jdk/src/share/classes/sun/tools/tree/CastExpression.java
+++ b/jdk/src/share/classes/sun/tools/tree/CastExpression.java
@@ -48,7 +48,7 @@ class CastExpression extends BinaryExpression {
     /**
      * 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);
 
diff --git a/jdk/src/share/classes/sun/tools/tree/CatchStatement.java b/jdk/src/share/classes/sun/tools/tree/CatchStatement.java
index 593699804a85de05f06dc9ddb4a3f067e97a7279..543396ee8814d534feccb4da1885aa1967fb9bb7 100644
--- a/jdk/src/share/classes/sun/tools/tree/CatchStatement.java
+++ b/jdk/src/share/classes/sun/tools/tree/CatchStatement.java
@@ -67,7 +67,7 @@ class CatchStatement extends Statement {
     /**
      * 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);
diff --git a/jdk/src/share/classes/sun/tools/tree/CommaExpression.java b/jdk/src/share/classes/sun/tools/tree/CommaExpression.java
index 2cbfa845442c48e1a1150292590e4d5049e5d8ef..1dcde645441b69ffe60211a2a3222a87c8fb25b9 100644
--- a/jdk/src/share/classes/sun/tools/tree/CommaExpression.java
+++ b/jdk/src/share/classes/sun/tools/tree/CommaExpression.java
@@ -46,7 +46,7 @@ class CommaExpression extends BinaryExpression {
     /**
      * 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;
diff --git a/jdk/src/share/classes/sun/tools/tree/CompoundStatement.java b/jdk/src/share/classes/sun/tools/tree/CompoundStatement.java
index 4fef3c5772f431ec2d394d0938cbf59fba61490f..b130bbbc651d597ef58207a2177141c4892eae3b 100644
--- a/jdk/src/share/classes/sun/tools/tree/CompoundStatement.java
+++ b/jdk/src/share/classes/sun/tools/tree/CompoundStatement.java
@@ -70,7 +70,7 @@ class CompoundStatement extends Statement {
     /**
      * 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);
diff --git a/jdk/src/share/classes/sun/tools/tree/ConditionalExpression.java b/jdk/src/share/classes/sun/tools/tree/ConditionalExpression.java
index bdd201598d0a439356ea3bf09d1194a05f4b20f8..7fb3bace37ab7c4ed95be2903e48cde5acae7b90 100644
--- a/jdk/src/share/classes/sun/tools/tree/ConditionalExpression.java
+++ b/jdk/src/share/classes/sun/tools/tree/ConditionalExpression.java
@@ -64,7 +64,7 @@ class ConditionalExpression extends BinaryExpression {
     /**
      * 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 @@ class ConditionalExpression extends BinaryExpression {
         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));
diff --git a/jdk/src/share/classes/sun/tools/tree/ContinueStatement.java b/jdk/src/share/classes/sun/tools/tree/ContinueStatement.java
index 13eaf61acedb4658f436828429d8e85ad0629c36..6cd22017fee37d138d2acf86a6ee0ccb1d604465 100644
--- a/jdk/src/share/classes/sun/tools/tree/ContinueStatement.java
+++ b/jdk/src/share/classes/sun/tools/tree/ContinueStatement.java
@@ -52,7 +52,7 @@ class ContinueStatement extends Statement {
      * 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
diff --git a/jdk/src/share/classes/sun/tools/tree/ConvertExpression.java b/jdk/src/share/classes/sun/tools/tree/ConvertExpression.java
index 13fdb2f89bbd6fb0788d6374f37fbc5033d40c21..eb2d25e3b772a3abeb87dac494ab21981baaaf79 100644
--- a/jdk/src/share/classes/sun/tools/tree/ConvertExpression.java
+++ b/jdk/src/share/classes/sun/tools/tree/ConvertExpression.java
@@ -47,7 +47,7 @@ class ConvertExpression extends UnaryExpression {
     /**
      * 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);
     }
 
diff --git a/jdk/src/share/classes/sun/tools/tree/DeclarationStatement.java b/jdk/src/share/classes/sun/tools/tree/DeclarationStatement.java
index 1ee52de6c7e77ea2830afce920f27588807fe624..82bbea39b4bc91ff738c7b9655d6043ab1b922c1 100644
--- a/jdk/src/share/classes/sun/tools/tree/DeclarationStatement.java
+++ b/jdk/src/share/classes/sun/tools/tree/DeclarationStatement.java
@@ -55,11 +55,11 @@ class DeclarationStatement extends Statement {
      * 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]);
         }
diff --git a/jdk/src/share/classes/sun/tools/tree/DoStatement.java b/jdk/src/share/classes/sun/tools/tree/DoStatement.java
index 87a6b9e40d33db03d780ccd388d93b592d1fe28d..974ae99400b4bf25bedd6cff6b20da980e8eac01 100644
--- a/jdk/src/share/classes/sun/tools/tree/DoStatement.java
+++ b/jdk/src/share/classes/sun/tools/tree/DoStatement.java
@@ -53,7 +53,7 @@ class DoStatement extends Statement {
     /**
      * 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
diff --git a/jdk/src/share/classes/sun/tools/tree/ExprExpression.java b/jdk/src/share/classes/sun/tools/tree/ExprExpression.java
index 796f559e877a0b8b5eb145c62d442416eedccb76..0e40b801abaccf2ddfc75117f0dc1e11760189c3 100644
--- a/jdk/src/share/classes/sun/tools/tree/ExprExpression.java
+++ b/jdk/src/share/classes/sun/tools/tree/ExprExpression.java
@@ -49,7 +49,7 @@ class ExprExpression extends UnaryExpression {
      * 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 @@ class ExprExpression extends UnaryExpression {
      * (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 @@ class ExprExpression extends UnaryExpression {
     // 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;
diff --git a/jdk/src/share/classes/sun/tools/tree/Expression.java b/jdk/src/share/classes/sun/tools/tree/Expression.java
index 5eca24e26e7d9cdf9676fc7cb1d60572a451644b..2a77971900dcb7c07498f95e56050871f6d42b2c 100644
--- a/jdk/src/share/classes/sun/tools/tree/Expression.java
+++ b/jdk/src/share/classes/sun/tools/tree/Expression.java
@@ -192,18 +192,18 @@ class Expression extends Node {
     /**
      * 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 @@ class Expression extends Node {
     }
 
     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 @@ class Expression extends Node {
      * 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 @@ class Expression extends Node {
      * 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 @@ class Expression extends Node {
      */
 
     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();
diff --git a/jdk/src/share/classes/sun/tools/tree/ExpressionStatement.java b/jdk/src/share/classes/sun/tools/tree/ExpressionStatement.java
index ee83fca196c0381cdee5b0ae11c69f9875fa8725..265311275ecfe93eb8a3b746488e7fdeb88e675d 100644
--- a/jdk/src/share/classes/sun/tools/tree/ExpressionStatement.java
+++ b/jdk/src/share/classes/sun/tools/tree/ExpressionStatement.java
@@ -50,7 +50,7 @@ class ExpressionStatement extends Statement {
     /**
      * 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);
     }
diff --git a/jdk/src/share/classes/sun/tools/tree/FieldExpression.java b/jdk/src/share/classes/sun/tools/tree/FieldExpression.java
index 4dc02f71b1a2e6b5cacc6ab3bc8935b70e88b451..c21551931aa275dd4cf82ba3231734f026716eb1 100644
--- a/jdk/src/share/classes/sun/tools/tree/FieldExpression.java
+++ b/jdk/src/share/classes/sun/tools/tree/FieldExpression.java
@@ -219,7 +219,7 @@ class FieldExpression extends UnaryExpression {
      */
 
     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 @@ class FieldExpression extends UnaryExpression {
      */
 
     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 @@ class FieldExpression extends UnaryExpression {
      */
 
     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 @@ class FieldExpression extends UnaryExpression {
      * 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 @@ class FieldExpression extends UnaryExpression {
      * 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 @@ class FieldExpression extends UnaryExpression {
      * 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);
diff --git a/jdk/src/share/classes/sun/tools/tree/FinallyStatement.java b/jdk/src/share/classes/sun/tools/tree/FinallyStatement.java
index f56dfe63e61c6eb269e082b3a957e9fd6ff4555d..710f03b94b85ec4f67dee6fab38b9e0f6f291dca 100644
--- a/jdk/src/share/classes/sun/tools/tree/FinallyStatement.java
+++ b/jdk/src/share/classes/sun/tools/tree/FinallyStatement.java
@@ -68,9 +68,9 @@ class FinallyStatement extends Statement {
     /**
      * 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 @@ class FinallyStatement extends Statement {
         // 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));
             }
diff --git a/jdk/src/share/classes/sun/tools/tree/ForStatement.java b/jdk/src/share/classes/sun/tools/tree/ForStatement.java
index c6cb38dc6f13a33916c8f25deb64c3f7d2c80f7e..639126f4beb8e3b32612190d542cc45d2bd6de9f 100644
--- a/jdk/src/share/classes/sun/tools/tree/ForStatement.java
+++ b/jdk/src/share/classes/sun/tools/tree/ForStatement.java
@@ -57,7 +57,7 @@ class ForStatement extends Statement {
     /**
      * 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);
diff --git a/jdk/src/share/classes/sun/tools/tree/IdentifierExpression.java b/jdk/src/share/classes/sun/tools/tree/IdentifierExpression.java
index 53594276400a8c7cbb5384605aca19a42ec302c3..1cbdb1a4317e8a7221a10da5aec22c45e93c5ad7 100644
--- a/jdk/src/share/classes/sun/tools/tree/IdentifierExpression.java
+++ b/jdk/src/share/classes/sun/tools/tree/IdentifierExpression.java
@@ -231,7 +231,7 @@ class IdentifierExpression extends Expression {
     /**
      * 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 @@ class IdentifierExpression extends Expression {
      * 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 @@ class IdentifierExpression extends Expression {
      * 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 @@ class IdentifierExpression extends Expression {
     /**
      * 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 @@ class IdentifierExpression extends Expression {
             implementation.print(out);
         }
     }
-}
\ No newline at end of file
+}
diff --git a/jdk/src/share/classes/sun/tools/tree/IfStatement.java b/jdk/src/share/classes/sun/tools/tree/IfStatement.java
index 479ff7e18df0410f0bc6eed356ea6204dea16821..c3235514c8bcb3220db2576c51a00b5098db7996 100644
--- a/jdk/src/share/classes/sun/tools/tree/IfStatement.java
+++ b/jdk/src/share/classes/sun/tools/tree/IfStatement.java
@@ -55,7 +55,7 @@ class IfStatement extends Statement {
     /**
      * 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.
diff --git a/jdk/src/share/classes/sun/tools/tree/IncDecExpression.java b/jdk/src/share/classes/sun/tools/tree/IncDecExpression.java
index cc85e6473c1a35373360eacef9f9cc6cdfd3cc49..591881cbce1ee2785796cd896df2cad1bfeaa2a5 100644
--- a/jdk/src/share/classes/sun/tools/tree/IncDecExpression.java
+++ b/jdk/src/share/classes/sun/tools/tree/IncDecExpression.java
@@ -49,7 +49,7 @@ class IncDecExpression extends UnaryExpression {
     /**
      * 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 @@ class IncDecExpression extends UnaryExpression {
     /**
      * 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);
     }
 
diff --git a/jdk/src/share/classes/sun/tools/tree/InstanceOfExpression.java b/jdk/src/share/classes/sun/tools/tree/InstanceOfExpression.java
index 114328955bb2080215aa3a55a440ad0e7c84d2cc..c6a2e684f40d0eafbacb7bc4ab65289c6f66dd7c 100644
--- a/jdk/src/share/classes/sun/tools/tree/InstanceOfExpression.java
+++ b/jdk/src/share/classes/sun/tools/tree/InstanceOfExpression.java
@@ -48,7 +48,7 @@ class InstanceOfExpression extends BinaryExpression {
     /**
      * 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));
 
diff --git a/jdk/src/share/classes/sun/tools/tree/LengthExpression.java b/jdk/src/share/classes/sun/tools/tree/LengthExpression.java
index 31f97ebc443e86ff591940a984721605e5b7580c..f9dfe706ed89ccb6c1b31562427cf71c04ccf2ca 100644
--- a/jdk/src/share/classes/sun/tools/tree/LengthExpression.java
+++ b/jdk/src/share/classes/sun/tools/tree/LengthExpression.java
@@ -46,7 +46,7 @@ class LengthExpression extends UnaryExpression {
     /**
      * 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);
diff --git a/jdk/src/share/classes/sun/tools/tree/LocalMember.java b/jdk/src/share/classes/sun/tools/tree/LocalMember.java
index 9890e073bb611b62ad92d68ca3391d1e90acacf5..b7067cf0f0eb89fc91d2f840ec50333fa96cb295 100644
--- a/jdk/src/share/classes/sun/tools/tree/LocalMember.java
+++ b/jdk/src/share/classes/sun/tools/tree/LocalMember.java
@@ -163,7 +163,7 @@ class LocalMember extends MemberDefinition {
      * 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++) {
diff --git a/jdk/src/share/classes/sun/tools/tree/MethodExpression.java b/jdk/src/share/classes/sun/tools/tree/MethodExpression.java
index b1f7fc2d5181328eea2ca0b29311a93fa27c71d6..ef5c8ea0fa3c0ec27d5fc8d71a1f0c99b6d9cfc5 100644
--- a/jdk/src/share/classes/sun/tools/tree/MethodExpression.java
+++ b/jdk/src/share/classes/sun/tools/tree/MethodExpression.java
@@ -78,7 +78,7 @@ class MethodExpression extends NaryExpression {
     /**
      * 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 @@ class MethodExpression extends NaryExpression {
     /**
      * 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);
     }
 
diff --git a/jdk/src/share/classes/sun/tools/tree/NewArrayExpression.java b/jdk/src/share/classes/sun/tools/tree/NewArrayExpression.java
index ffa85bafd465dbada7c076404942638d334527e0..4925e6b579245694541ff7ccc1a6e262d820d6ca 100644
--- a/jdk/src/share/classes/sun/tools/tree/NewArrayExpression.java
+++ b/jdk/src/share/classes/sun/tools/tree/NewArrayExpression.java
@@ -55,7 +55,7 @@ class NewArrayExpression extends NaryExpression {
     /**
      * 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
diff --git a/jdk/src/share/classes/sun/tools/tree/NewInstanceExpression.java b/jdk/src/share/classes/sun/tools/tree/NewInstanceExpression.java
index 0347c41efbf598974fdf544aac4d39bccbfd9911..408aa159614f735dd8ef565ad00bde05dc60beca 100644
--- a/jdk/src/share/classes/sun/tools/tree/NewInstanceExpression.java
+++ b/jdk/src/share/classes/sun/tools/tree/NewInstanceExpression.java
@@ -83,7 +83,7 @@ class NewInstanceExpression extends NaryExpression {
     /**
      * 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 @@ class NewInstanceExpression extends NaryExpression {
     /**
      * 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);
     }
 
diff --git a/jdk/src/share/classes/sun/tools/tree/NotExpression.java b/jdk/src/share/classes/sun/tools/tree/NotExpression.java
index 66b47819fe4251fbba93b4141d83bac35d7573f8..2bc42e8775cdeae4f5795bef76f2d6114cb12279 100644
--- a/jdk/src/share/classes/sun/tools/tree/NotExpression.java
+++ b/jdk/src/share/classes/sun/tools/tree/NotExpression.java
@@ -65,7 +65,7 @@ class NotExpression extends UnaryExpression {
      */
 
     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
diff --git a/jdk/src/share/classes/sun/tools/tree/OrExpression.java b/jdk/src/share/classes/sun/tools/tree/OrExpression.java
index e1bd6ec6215372c36f66ace9292062f0963ee67c..c1edd1cec02569ffd44bec8c0be6c3641510c24a 100644
--- a/jdk/src/share/classes/sun/tools/tree/OrExpression.java
+++ b/jdk/src/share/classes/sun/tools/tree/OrExpression.java
@@ -54,7 +54,7 @@ class OrExpression extends BinaryLogicalExpression {
      *        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);
diff --git a/jdk/src/share/classes/sun/tools/tree/ReturnStatement.java b/jdk/src/share/classes/sun/tools/tree/ReturnStatement.java
index 6cfc043bbe8b36ee0550f849335e1d7684c57796..7e2f6bfacec37452eb283f10e54876a4c0c53a21 100644
--- a/jdk/src/share/classes/sun/tools/tree/ReturnStatement.java
+++ b/jdk/src/share/classes/sun/tools/tree/ReturnStatement.java
@@ -51,7 +51,7 @@ class ReturnStatement extends Statement {
     /**
      * 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) {
diff --git a/jdk/src/share/classes/sun/tools/tree/Statement.java b/jdk/src/share/classes/sun/tools/tree/Statement.java
index 1cbdc80e1bd1d6a016989ed71056e41258904a40..70d25db27245a10f21bf0b024dfbf930c60b5c1d 100644
--- a/jdk/src/share/classes/sun/tools/tree/Statement.java
+++ b/jdk/src/share/classes/sun/tools/tree/Statement.java
@@ -100,7 +100,7 @@ class Statement extends Node {
     /**
      * 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 @@ class Statement extends Node {
 
         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 @@ class Statement extends Node {
         }
     }
 
-    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);
     }
 
diff --git a/jdk/src/share/classes/sun/tools/tree/SuperExpression.java b/jdk/src/share/classes/sun/tools/tree/SuperExpression.java
index e9975ac60e65c45f6d14f3dd94fdb32cdabbc044..dcce41058c73892daa25abdd1d322aecb6c27e54 100644
--- a/jdk/src/share/classes/sun/tools/tree/SuperExpression.java
+++ b/jdk/src/share/classes/sun/tools/tree/SuperExpression.java
@@ -61,7 +61,7 @@ class SuperExpression extends ThisExpression {
     /**
      * 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 @@ class SuperExpression extends ThisExpression {
      * 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);
diff --git a/jdk/src/share/classes/sun/tools/tree/SwitchStatement.java b/jdk/src/share/classes/sun/tools/tree/SwitchStatement.java
index d8899f2c3ba2946948a3b87dffb06c2f9a86813d..5eae83e825be7c4383ebf2f286ff8ffed8fa063e 100644
--- a/jdk/src/share/classes/sun/tools/tree/SwitchStatement.java
+++ b/jdk/src/share/classes/sun/tools/tree/SwitchStatement.java
@@ -54,7 +54,7 @@ class SwitchStatement extends Statement {
     /**
      * 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 @@ class SwitchStatement extends Statement {
 
         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.
diff --git a/jdk/src/share/classes/sun/tools/tree/SynchronizedStatement.java b/jdk/src/share/classes/sun/tools/tree/SynchronizedStatement.java
index 88ffbad81e4a485f6954eaf8fa08b291a9d6fe1a..945d539f7325cad189383f84291ec82059535fa2 100644
--- a/jdk/src/share/classes/sun/tools/tree/SynchronizedStatement.java
+++ b/jdk/src/share/classes/sun/tools/tree/SynchronizedStatement.java
@@ -56,7 +56,7 @@ class SynchronizedStatement extends Statement {
     /**
      * 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);
diff --git a/jdk/src/share/classes/sun/tools/tree/ThisExpression.java b/jdk/src/share/classes/sun/tools/tree/ThisExpression.java
index e4328f5a9086927d5d0e7358962c469083bdc600..59330e0d85abea3e18793cb0bde0b1628f4908a2 100644
--- a/jdk/src/share/classes/sun/tools/tree/ThisExpression.java
+++ b/jdk/src/share/classes/sun/tools/tree/ThisExpression.java
@@ -87,7 +87,7 @@ class ThisExpression extends Expression {
     /**
      * 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;
diff --git a/jdk/src/share/classes/sun/tools/tree/ThrowStatement.java b/jdk/src/share/classes/sun/tools/tree/ThrowStatement.java
index 2b4571ce9166a66e864640c4116045d364459678..53710843bdaee708244bc2a663d2b513c80c1fb3 100644
--- a/jdk/src/share/classes/sun/tools/tree/ThrowStatement.java
+++ b/jdk/src/share/classes/sun/tools/tree/ThrowStatement.java
@@ -50,7 +50,7 @@ class ThrowStatement extends Statement {
     /**
      * 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);
diff --git a/jdk/src/share/classes/sun/tools/tree/TryStatement.java b/jdk/src/share/classes/sun/tools/tree/TryStatement.java
index 5e5dbe3b07cd0e5c1cda9585eb030d3bb731172b..61cd11b6b30effdba7c668dab4e58e4462b1de4a 100644
--- a/jdk/src/share/classes/sun/tools/tree/TryStatement.java
+++ b/jdk/src/share/classes/sun/tools/tree/TryStatement.java
@@ -57,11 +57,11 @@ class TryStatement extends Statement {
     /**
      * 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 @@ class TryStatement extends Statement {
 
                 // 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 @@ class TryStatement extends Statement {
             }
 
             // 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;
diff --git a/jdk/src/share/classes/sun/tools/tree/TypeExpression.java b/jdk/src/share/classes/sun/tools/tree/TypeExpression.java
index ea31f272a3da00e3d35d2809648e2de698474257..419fab06a7fd5accf0a9c18d0813a9563ab86a5a 100644
--- a/jdk/src/share/classes/sun/tools/tree/TypeExpression.java
+++ b/jdk/src/share/classes/sun/tools/tree/TypeExpression.java
@@ -53,13 +53,13 @@ class TypeExpression extends Expression {
     /**
      * 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;
     }
diff --git a/jdk/src/share/classes/sun/tools/tree/UnaryExpression.java b/jdk/src/share/classes/sun/tools/tree/UnaryExpression.java
index ec54654f81b0bb3d3704eae21aa7cecafabe79d8..1db5157a7cb4436ee70f4829ca5485db3e2fdd26 100644
--- a/jdk/src/share/classes/sun/tools/tree/UnaryExpression.java
+++ b/jdk/src/share/classes/sun/tools/tree/UnaryExpression.java
@@ -69,7 +69,7 @@ class UnaryExpression extends Expression {
     /**
      * 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();
diff --git a/jdk/src/share/classes/sun/tools/tree/VarDeclarationStatement.java b/jdk/src/share/classes/sun/tools/tree/VarDeclarationStatement.java
index 744aa761c502f97e472ff99b2e4fc4cd1924151b..5a2e2c8a5a642ee489d9c628694bf509a32cfe4a 100644
--- a/jdk/src/share/classes/sun/tools/tree/VarDeclarationStatement.java
+++ b/jdk/src/share/classes/sun/tools/tree/VarDeclarationStatement.java
@@ -57,7 +57,7 @@ class VarDeclarationStatement extends Statement {
     /**
      * 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]);
         }
diff --git a/jdk/src/share/classes/sun/tools/tree/WhileStatement.java b/jdk/src/share/classes/sun/tools/tree/WhileStatement.java
index 4ddd5e666f704020bd0aa96cb782954b2b0b84ac..71bd4418cddbc52024b45f8f09304748fcc6c30e 100644
--- a/jdk/src/share/classes/sun/tools/tree/WhileStatement.java
+++ b/jdk/src/share/classes/sun/tools/tree/WhileStatement.java
@@ -53,7 +53,7 @@ class WhileStatement extends Statement {
     /**
      * 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
diff --git a/jdk/src/share/classes/sun/tools/util/CommandLine.java b/jdk/src/share/classes/sun/tools/util/CommandLine.java
index 4bf9582583cae0a55aec2274a0a387c029232645..da45f6a828487b65b5626b2c3541f53ea4ca1792 100644
--- a/jdk/src/share/classes/sun/tools/util/CommandLine.java
+++ b/jdk/src/share/classes/sun/tools/util/CommandLine.java
@@ -54,7 +54,7 @@ public class CommandLine {
     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 @@ public class CommandLine {
                 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));
diff --git a/jdk/src/share/native/sun/awt/image/awt_parseImage.c b/jdk/src/share/native/sun/awt/image/awt_parseImage.c
index 9cb03bee4a4c13bb5feef8b642cbb77aae0ab9a0..882c799efc4a4418518e657a852db4daf593ca7e 100644
--- a/jdk/src/share/native/sun/awt/image/awt_parseImage.c
+++ b/jdk/src/share/native/sun/awt/image/awt_parseImage.c
@@ -508,6 +508,7 @@ int awt_parseColorModel (JNIEnv *env, jobject jcmodel, int imageType,
     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;
diff --git a/jdk/src/share/native/sun/java2d/opengl/OGLBufImgOps.c b/jdk/src/share/native/sun/java2d/opengl/OGLBufImgOps.c
index 046018c81155c72fc8ab76679b308a0c29d1b827..b7e59341cf23ef4c0f942545657bad551e7497f8 100644
--- a/jdk/src/share/native/sun/java2d/opengl/OGLBufImgOps.c
+++ b/jdk/src/share/native/sun/java2d/opengl/OGLBufImgOps.c
@@ -636,6 +636,9 @@ OGLBufImgOps_EnableLookupOp(OGLContext *oglc, jlong pSrcOps,
                 "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();
diff --git a/jdk/src/share/native/sun/tracing/dtrace/JVM.c b/jdk/src/share/native/sun/tracing/dtrace/JVM.c
index 85cf155f375274eaf3b4bee5bd616e3d5b3adaf2..e81eb3d70643620570589084eee4d4a394dcba1f 100644
--- a/jdk/src/share/native/sun/tracing/dtrace/JVM.c
+++ b/jdk/src/share/native/sun/tracing/dtrace/JVM.c
@@ -144,32 +144,34 @@ static void readInterfaceAttributes(
         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 @@ JNIEXPORT jlong JNICALL Java_sun_tracing_dtrace_JVM_activate0(
     jlong handle = 0;
     jsize num_providers;
     jsize i;
+    jsize count = 0;
     JVM_DTraceProvider* jvm_providers;
 
     initialize();
@@ -195,16 +198,23 @@ JNIEXPORT jlong JNICALL Java_sun_tracing_dtrace_JVM_activate0(
     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]);
diff --git a/jdk/src/solaris/lib/flavormap.properties b/jdk/src/solaris/classes/sun/awt/datatransfer/flavormap.properties
similarity index 89%
rename from jdk/src/solaris/lib/flavormap.properties
rename to jdk/src/solaris/classes/sun/awt/datatransfer/flavormap.properties
index 223002a69aa4acf9694242679ba6f5f536a23b47..414ef017f3a63a5239ecf4ac4778a850e2ba798a 100644
--- a/jdk/src/solaris/lib/flavormap.properties
+++ b/jdk/src/solaris/classes/sun/awt/datatransfer/flavormap.properties
@@ -5,16 +5,9 @@
 # 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>=<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
@@ -23,9 +16,9 @@
 # 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.
+# 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
diff --git a/jdk/src/solaris/classes/sun/nio/ch/InheritedChannel.java b/jdk/src/solaris/classes/sun/nio/ch/InheritedChannel.java
index e7e485006fb75920df9244712faf945dcab8a150..e696d3eba07dac502949cf0bf1b06eb427b555d4 100644
--- a/jdk/src/solaris/classes/sun/nio/ch/InheritedChannel.java
+++ b/jdk/src/solaris/classes/sun/nio/ch/InheritedChannel.java
@@ -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 @@ class InheritedChannel {
         // 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) };
diff --git a/jdk/src/solaris/classes/sun/print/CUPSPrinter.java b/jdk/src/solaris/classes/sun/print/CUPSPrinter.java
index 57c91b0abd166f5d2c4d09c837eb04a7d4d47339..6d1b54e32f3ec5b9d69c97e074897ba1b376808f 100644
--- a/jdk/src/solaris/classes/sun/print/CUPSPrinter.java
+++ b/jdk/src/solaris/classes/sun/print/CUPSPrinter.java
@@ -39,6 +39,7 @@ import javax.print.attribute.standard.MediaSizeName;
 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 @@ public class CUPSPrinter  {
     // 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 class CUPSPrinter  {
     public  int nTrays = 0;
     private  String[] media;
     private  float[] pageSizes;
+    int[]   resolutionsArray;
     private String printer;
 
     private static boolean libFound;
@@ -119,6 +123,12 @@ public class CUPSPrinter  {
                 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 @@ public class CUPSPrinter  {
         return cupsMediaTrays;
     }
 
+    /**
+     * return the raw packed array of supported printer resolutions.
+     */
+    int[] getRawResolutions() {
+        return resolutionsArray;
+    }
 
     /**
      * Initialize media by translating PPD info to PrintService attributes.
diff --git a/jdk/src/solaris/classes/sun/print/IPPPrintService.java b/jdk/src/solaris/classes/sun/print/IPPPrintService.java
index c40233b4576ae38e3af53c9b4fdc34acd8b81e29..22cc7bb48bfd12699a93f61fc91c6f116b74463f 100644
--- a/jdk/src/solaris/classes/sun/print/IPPPrintService.java
+++ b/jdk/src/solaris/classes/sun/print/IPPPrintService.java
@@ -96,6 +96,8 @@ public class IPPPrintService implements PrintService, SunPrinterJobService {
     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 @@ public class IPPPrintService implements PrintService, SunPrinterJobService {
                     mediaTrays = cps.getMediaTrays();
                     customMediaSizeNames = cps.getCustomMediaSizeNames();
                     defaultMediaIndex = cps.getDefaultMediaIndex();
+                    rawResolutions = cps.getRawResolutions();
                     urlConnection.disconnect();
                     init = true;
                     return;
@@ -765,6 +768,15 @@ public class IPPPrintService implements PrintService, SunPrinterJobService {
                     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 @@ public class IPPPrintService implements PrintService, SunPrinterJobService {
         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 @@ public class IPPPrintService implements PrintService, SunPrinterJobService {
                 }
             }
             return false;
+        } if (attr.getCategory() == PrinterResolution.class) {
+            if (attr instanceof PrinterResolution) {
+                return isSupportedResolution((PrinterResolution)attr);
+            }
         }
         return true;
     }
@@ -1523,11 +1547,48 @@ public class IPPPrintService implements PrintService, SunPrinterJobService {
                 }
             }
             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;
     }
diff --git a/jdk/src/solaris/native/sun/awt/CUPSfuncs.c b/jdk/src/solaris/native/sun/awt/CUPSfuncs.c
index d7d989629bb5535a3743816891e44b125f07df3e..8949fb164248e12d0837fda97919022fed9b8425 100644
--- a/jdk/src/solaris/native/sun/awt/CUPSfuncs.c
+++ b/jdk/src/solaris/native/sun/awt/CUPSfuncs.c
@@ -394,3 +394,112 @@ Java_sun_print_CUPSPrinter_getPageSizes(JNIEnv *env,
     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);
+}
diff --git a/jdk/src/solaris/native/sun/awt/gtk2_interface.c b/jdk/src/solaris/native/sun/awt/gtk2_interface.c
index f61fee0b09db20797849052421f0560965d87c23..8204b8d4836ea7cbdb77333a0abce58d13347eb8 100644
--- a/jdk/src/solaris/native/sun/awt/gtk2_interface.c
+++ b/jdk/src/solaris/native/sun/awt/gtk2_interface.c
@@ -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 @@ gboolean gtk2_check_version()
             result = TRUE;
         }
 
-        dlclose(lib);
+        // 8048289: workaround for https://bugzilla.gnome.org/show_bug.cgi?id=733065
+        // dlclose(lib);
 
         return result;
     }
diff --git a/jdk/src/solaris/native/sun/java2d/x11/X11PMBlitLoops.c b/jdk/src/solaris/native/sun/java2d/x11/X11PMBlitLoops.c
index 6b35df41414aad4ad341db5cc63251a05b84aa2a..c94d58b8a626a7ba74da9502895ba7aef144b05a 100644
--- a/jdk/src/solaris/native/sun/java2d/x11/X11PMBlitLoops.c
+++ b/jdk/src/solaris/native/sun/java2d/x11/X11PMBlitLoops.c
@@ -241,9 +241,12 @@ Java_sun_java2d_x11_X11PMBlitLoops_updateBitmask
                                       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 @@ Java_sun_java2d_x11_X11PMBlitLoops_updateBitmask
                          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 @@ Java_sun_java2d_x11_X11PMBlitLoops_updateBitmask
     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;
diff --git a/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c b/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c
index eb82d64a92126285759f67ee5ad12b7f9539f71c..d9af8ddf6e1a57254f0599f60182cc9d2235670c 100644
--- a/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c
+++ b/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c
@@ -454,6 +454,7 @@ jboolean XShared_initSurface(JNIEnv *env, X11SDOps *xsdo, jint depth, jint width
             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 @@ jboolean XShared_initSurface(JNIEnv *env, X11SDOps *xsdo, jint depth, jint width
                                      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 @@ Java_sun_java2d_x11_X11SurfaceData_initSurface(JNIEnv *env, jclass xsd,
 
     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 @@ static jint X11SD_Lock(JNIEnv *env,
          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 @@ static jint X11SD_Lock(JNIEnv *env,
          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 @@ static jint X11SD_Lock(JNIEnv *env,
          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))) {
diff --git a/jdk/src/windows/lib/flavormap.properties b/jdk/src/windows/classes/sun/awt/datatransfer/flavormap.properties
similarity index 86%
rename from jdk/src/windows/lib/flavormap.properties
rename to jdk/src/windows/classes/sun/awt/datatransfer/flavormap.properties
index c80f1cf90f0155f74355940aaf193b8e87bf82cf..b7303273aa88579e5840194849279049c429e944 100644
--- a/jdk/src/windows/lib/flavormap.properties
+++ b/jdk/src/windows/classes/sun/awt/datatransfer/flavormap.properties
@@ -5,16 +5,9 @@
 # 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>=<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
@@ -23,10 +16,9 @@
 # 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.
-#
+# 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"
@@ -70,8 +62,8 @@ 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
+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
diff --git a/jdk/src/windows/native/sun/java2d/d3d/D3DBufImgOps.cpp b/jdk/src/windows/native/sun/java2d/d3d/D3DBufImgOps.cpp
index 5cf48427950360c4bf232682003d337d74d1acf9..b8b1ec892c12e641d804f9e5f3b622c684f577e1 100644
--- a/jdk/src/windows/native/sun/java2d/d3d/D3DBufImgOps.cpp
+++ b/jdk/src/windows/native/sun/java2d/d3d/D3DBufImgOps.cpp
@@ -201,6 +201,9 @@ D3DBufImgOps_EnableLookupOp(D3DContext *d3dc,
     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);
diff --git a/jdk/src/windows/native/sun/nio/ch/FileDispatcherImpl.c b/jdk/src/windows/native/sun/nio/ch/FileDispatcherImpl.c
index 0fdc2ab51fbb1057e23465c7b0646b7140112f64..fcf0d04fbf8ac766e6a1ffc76bfab049aaca610f 100644
--- a/jdk/src/windows/native/sun/nio/ch/FileDispatcherImpl.c
+++ b/jdk/src/windows/native/sun/nio/ch/FileDispatcherImpl.c
@@ -406,6 +406,14 @@ Java_sun_nio_ch_FileDispatcherImpl_lock0(JNIEnv *env, jobject this, jobject fdo,
     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;
diff --git a/jdk/src/windows/native/sun/security/mscapi/security.cpp b/jdk/src/windows/native/sun/security/mscapi/security.cpp
index 49cbe81e418bddff9b89cdec4b8870d694cddc78..8b5d8aeb8a9442a65e46169404cef5917eb31f06 100644
--- a/jdk/src/windows/native/sun/security/mscapi/security.cpp
+++ b/jdk/src/windows/native/sun/security/mscapi/security.cpp
@@ -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 @@ ALG_ID MapHashAlgorithm(JNIEnv *env, jstring jHashAlgorithm) {
     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 @@ JNIEXPORT jbyteArray JNICALL Java_sun_security_mscapi_PRNG_generateSeed
          */
         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 @@ JNIEXPORT jbyteArray JNICALL Java_sun_security_mscapi_PRNG_generateSeed
         } 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 @@ JNIEXPORT void JNICALL Java_sun_security_mscapi_KeyStore_loadKeysOrCertificateCh
     __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 @@ JNIEXPORT jobject JNICALL Java_sun_security_mscapi_RSAKeyPairGenerator_generateR
 
     __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 @@ JNIEXPORT void JNICALL Java_sun_security_mscapi_KeyStore_storeCertificate
     __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 @@ JNIEXPORT void JNICALL Java_sun_security_mscapi_KeyStore_removeCertificate
     __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 @@ JNIEXPORT void JNICALL Java_sun_security_mscapi_KeyStore_removeCertificate
                 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 @@ JNIEXPORT void JNICALL Java_sun_security_mscapi_KeyStore_destroyKeyContainer
 
     __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 @@ JNIEXPORT jlong JNICALL Java_sun_security_mscapi_RSACipher_findCertificateUsingA
 
     __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 @@ JNIEXPORT jbyteArray JNICALL Java_sun_security_mscapi_RSAPublicKey_getExponent
     __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 @@ JNIEXPORT jbyteArray JNICALL Java_sun_security_mscapi_RSAPublicKey_getModulus
     __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 @@ int convertToLittleEndian(JNIEnv *env, jbyteArray source, jbyte* destination,
     }
 
     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 @@ jbyteArray generateKeyBlob(
         }
         // 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 @@ JNIEXPORT jobject JNICALL Java_sun_security_mscapi_KeyStore_storePrivateKey
 
     __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 @@ JNIEXPORT jobject JNICALL Java_sun_security_mscapi_RSASignature_importPublicKey
     __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
diff --git a/jdk/src/windows/native/sun/windows/awt_Component.cpp b/jdk/src/windows/native/sun/windows/awt_Component.cpp
index 66fb1284e19b5dec6b1140eb9e8b05ab6ba829fb..5ab74c7e858b42561b48daf0814d6c092f359457 100644
--- a/jdk/src/windows/native/sun/windows/awt_Component.cpp
+++ b/jdk/src/windows/native/sun/windows/awt_Component.cpp
@@ -6935,9 +6935,9 @@ Java_sun_awt_windows_WComponentPeer_nativeHandlesWheelScrolling (JNIEnv* env,
 {
     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 @@ Java_sun_awt_windows_WComponentPeer_isObscured(JNIEnv* env,
 
     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);
diff --git a/jdk/src/windows/native/sun/windows/awt_List.cpp b/jdk/src/windows/native/sun/windows/awt_List.cpp
index c6cec8fe08b2c3a40db761af720420d7a426e595..5188c85984fe055af99494a0982957168328e2b6 100644
--- a/jdk/src/windows/native/sun/windows/awt_List.cpp
+++ b/jdk/src/windows/native/sun/windows/awt_List.cpp
@@ -1018,8 +1018,8 @@ Java_sun_awt_windows_WListPeer_isSelected(JNIEnv *env, jobject self,
     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);
diff --git a/jdk/test/ProblemList.txt b/jdk/test/ProblemList.txt
index 254f9fe8d56d6b8cb16f56bf50c6854cb557c79f..774b43a811fa154238766c19b8f0f6410c628f4b 100644
--- a/jdk/test/ProblemList.txt
+++ b/jdk/test/ProblemList.txt
@@ -204,10 +204,8 @@ sun/rmi/transport/proxy/EagerHttpFallback.java                  generic-all
 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/ReadCertificates.java                    solaris-all
 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 @@ sun/security/tools/keytool/standard.sh                          solaris-all
 # 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 @@ tools/launcher/FXLauncherTest.java                              linux-all
 # 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
diff --git a/jdk/test/com/sun/jdi/ExclusiveBind.java b/jdk/test/com/sun/jdi/ExclusiveBind.java
index a4801fa4ab6b5b41b32b283a9930915ba441246c..c20bb2d2f1cd77ec64b7e17769457755c3a7e6c2 100644
--- a/jdk/test/com/sun/jdi/ExclusiveBind.java
+++ b/jdk/test/com/sun/jdi/ExclusiveBind.java
@@ -108,7 +108,7 @@ public class ExclusiveBind {
                 "process1",
                 process1,
                 line -> line.equals("Listening for transport dt_socket at address: " + address),
-                Math.round(5000 * Utils.TIMEOUT_FACTOR),
+                Utils.adjustTimeout(5000),
                 TimeUnit.MILLISECONDS
         );
 
diff --git a/jdk/test/com/sun/org/apache/xml/internal/security/transforms/ClassLoaderTest.java b/jdk/test/com/sun/org/apache/xml/internal/security/transforms/ClassLoaderTest.java
index d0a56b6c7b8c2890ba885298b71f4d64ddf1bc72..010cdd1004cce67782bdaf05be36752bab39c6ca 100644
--- a/jdk/test/com/sun/org/apache/xml/internal/security/transforms/ClassLoaderTest.java
+++ b/jdk/test/com/sun/org/apache/xml/internal/security/transforms/ClassLoaderTest.java
@@ -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
  */
diff --git a/jdk/test/java/awt/Frame/MaximizedUndecorated/MaximizedUndecorated.java b/jdk/test/java/awt/Frame/MaximizedUndecorated/MaximizedUndecorated.java
new file mode 100644
index 0000000000000000000000000000000000000000..62e80101c2641d1e43a3c58d7c7d236ac65ca667
--- /dev/null
+++ b/jdk/test/java/awt/Frame/MaximizedUndecorated/MaximizedUndecorated.java
@@ -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);
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDDAppModalTest.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDDAppModalTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..b04cd70db7e12a23b51478cd8c0b02a0a7b1e14f
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDDAppModalTest.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDDDocModalTest.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDDDocModalTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..e73867ed49568eb1e83c6d4e14c3c8243c41d435
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDDDocModalTest.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDDModelessTest.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDDModelessTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..f38c3d688985e47aecbe0d7a2a72138afdb2b91b
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDDModelessTest.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDDNonModalTest.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDDNonModalTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..f3f558e71701837aa38ce5844593ed14a33cec0d
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDDNonModalTest.java
@@ -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();
+    }
+}
diff --git a/jdk/src/share/classes/sun/audio/InvalidAudioFormatException.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDDSetModalTest.java
similarity index 57%
rename from jdk/src/share/classes/sun/audio/InvalidAudioFormatException.java
rename to jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDDSetModalTest.java
index 39b33f87be47bf8d519488e91b5c8ff7f1d837f1..3b89dadb667d14520c9f57ac621e1f512c866649 100644
--- a/jdk/src/share/classes/sun/audio/InvalidAudioFormatException.java
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDDSetModalTest.java
@@ -1,12 +1,10 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * 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.
+ * published by the Free Software Foundation.
  *
  * This code is distributed in the hope that it will be useful, but WITHOUT
  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@@ -23,27 +21,25 @@
  * questions.
  */
 
-package sun.audio;
-import java.io.IOException;
 
-/**
- * Signals an invalid audio stream for the stream handler.
+/*
+ * @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
  */
-@SuppressWarnings("serial") // JDK-implementation class
-final class InvalidAudioFormatException extends IOException {
 
+public class BlockingDDSetModalTest {
 
-    /**
-     * Constructor.
-     */
-    InvalidAudioFormatException() {
-        super();
-    }
-
-    /**
-     * Constructor with a detail message.
-     */
-    InvalidAudioFormatException(String s) {
-        super(s);
+    public static void main(String[] args) throws Exception {
+        (new BlockingDDTest()).doTest();
     }
 }
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDDTest.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDDTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..ecddb82d42d4f5403523c9f4d3936f063d43bb48
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDDTest.java
@@ -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(); }
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDDToolkitModalTest.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDDToolkitModalTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..e386dc1b123ece57e7a63bf1e9ec80b17b529b68
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDDToolkitModalTest.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFAppModalTest.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFAppModalTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..7ebc7657cec7fcb254e1cb8d3900e9cc89ecae15
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFAppModalTest.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFSetModalTest.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFSetModalTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..790d5e03b7c726a87c3d0cc5f22be1013d2b92c3
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFSetModalTest.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFTest.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..b07b8105c6162987dcfe1fec4713a0031b4f41ff
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFTest.java
@@ -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(); }
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFToolkitModalTest.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFToolkitModalTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..de09b5d05d2b7cdfe074096f56c5c6108a2b0041
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFToolkitModalTest.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFWModeless1Test.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFWModeless1Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..5c9c3f3fc774b375555cfaaca97fcbf476368777
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFWModeless1Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFWModeless2Test.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFWModeless2Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..430dff23d0ec49e57fdff8ddf3f0f71b6c94d773
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFWModeless2Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFWNonModal1Test.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFWNonModal1Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..58242e425cf721b247bdb29ff06d162fa89f549a
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFWNonModal1Test.java
@@ -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();
+    }
+}
diff --git a/jdk/src/share/classes/sun/audio/AudioTranslatorStream.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFWNonModal2Test.java
similarity index 54%
rename from jdk/src/share/classes/sun/audio/AudioTranslatorStream.java
rename to jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFWNonModal2Test.java
index 44c76b4d1c864abab1baf4113502d579411a4e93..acd9fb8b0ae8fc22baf839961ab26d84b819e868 100644
--- a/jdk/src/share/classes/sun/audio/AudioTranslatorStream.java
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFWNonModal2Test.java
@@ -1,12 +1,10 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * 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.
+ * published by the Free Software Foundation.
  *
  * This code is distributed in the hope that it will be useful, but WITHOUT
  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@@ -23,26 +21,28 @@
  * questions.
  */
 
-package sun.audio;
 
-import java.io.InputStream;
-import java.io.IOException;
-
-/**
- * Translator for native audio formats (not implemented in this release).
+/*
+ * @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 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 class BlockingDFWNonModal2Test {
 
-        public int getLength() {
-            return length;
-        }
+    public static void main(String[] args) throws Exception {
+        (new BlockingDFWTest(
+            BlockingDFWTest.Parent.DIALOG, null)).doTest();
     }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFWTest.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFWTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..7659ddd5450ea21d52fc4cefeeb1f06efec41e8f
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFWTest.java
@@ -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); }
+        }
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDocModalTest.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDocModalTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..638c67a55075221e0f0afe4bd688e6d9995232ce
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDocModalTest.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDAppModalTest.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDAppModalTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..e446498c0fcae69a9cf33662742dd48549f1cb57
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDAppModalTest.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDDocModalTest.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDDocModalTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..1f9168fbcf2a2d6dc3443fe1947941a33a3404a9
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDDocModalTest.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDModelessTest.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDModelessTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..d63d1f3d11c00dccf441d5181b932d386e077c0e
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDModelessTest.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDNonModalTest.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDNonModalTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..f91bcfb23f99fcc462e4729fafe3a69b2230c87d
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDNonModalTest.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDSetModalTest.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDSetModalTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..21f1720861e27c20efe0918add5b483cc0669201
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDSetModalTest.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDTest.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..38a936f805cf1d06a6533177d0b07e8dc0610c88
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDTest.java
@@ -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); }
+        }
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDToolkitModalTest.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDToolkitModalTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..f907276fc44dedbaecda28d0d62e3fe3a7ceff3b
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDToolkitModalTest.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWDocModal1Test.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWDocModal1Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..8f24edc24446b826d198eb804e9f0a41cbcd7c9b
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWDocModal1Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWDocModal2Test.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWDocModal2Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..41b3f07119df624e0893390216981d2f6f4c3b96
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWDocModal2Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWDocModal3Test.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWDocModal3Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..4cc992e5e1a9949d718868ef0f0d5578910dafe5
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWDocModal3Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWDocModal4Test.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWDocModal4Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..a84af093f24ca41c69c66cc76a43a0ce3992933b
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWDocModal4Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWModeless1Test.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWModeless1Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..2872d59c4edd89ac5be84077b42bb3a5b81c84b7
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWModeless1Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWModeless2Test.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWModeless2Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..d8a9417d78ba674e44ca468dfafd3444f939be87
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWModeless2Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWModeless3Test.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWModeless3Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..b85b23df383703d1211662bda4123e951d45ed1e
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWModeless3Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWModeless4Test.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWModeless4Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..37a04b434e0035697f78c6bb4943518751111c6e
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWModeless4Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWNonModal1Test.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWNonModal1Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..440d42882c7dd6e7c9562c0e4a246acfbe97cddf
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWNonModal1Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWNonModal2Test.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWNonModal2Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..ece480922509fd59c508c498df9cd9a252fbbca1
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWNonModal2Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWNonModal3Test.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWNonModal3Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..759967a2de87fcd09a300efa79fa3a6dcc77b7a4
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWNonModal3Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWNonModal4Test.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWNonModal4Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..e24f818a2382cc0909e9727ccb51c2e564600129
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWNonModal4Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWTest.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..cbcab392d518fe982851b3d03670f169114d2e21
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWTest.java
@@ -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();
+        }
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsAppModal1Test.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsAppModal1Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..4a840f8ca63f0570e570bc43c7040f1065387c12
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsAppModal1Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsAppModal2Test.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsAppModal2Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..46a37f86a62f51c4bd181ecf68c156e5d6feddb1
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsAppModal2Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsAppModal3Test.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsAppModal3Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..c58fe745773a8173257226cffa97c8f911804695
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsAppModal3Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsAppModal4Test.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsAppModal4Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..651ef125fbdcb812ed3efca4018fea6ab6aab283
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsAppModal4Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsAppModal5Test.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsAppModal5Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..0fd12ae0f1d227d3f1b16de8b5f3834da72001ac
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsAppModal5Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsAppModal6Test.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsAppModal6Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..39ae804586e6e1a687b405dda68cab6b6dac1a21
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsAppModal6Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsDocModal1Test.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsDocModal1Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..dbb13829c40c89e05e5d20f4d31402830691168c
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsDocModal1Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsDocModal2Test.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsDocModal2Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..da39e5db2af798d08b144f7ff07388a24baf34cf
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsDocModal2Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsDocModalTest.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsDocModalTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..7ffc5e1ce4998dbaa8254ca5379be6783f7beeb6
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsDocModalTest.java
@@ -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); }
+        }
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsSetModal1Test.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsSetModal1Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..c4b7e366e42f9b86e31505d8866a6c08cadd5d41
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsSetModal1Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsSetModal2Test.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsSetModal2Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..5eccd050d8b959e5399e9cd5c34254294c065ca0
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsSetModal2Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsSetModal3Test.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsSetModal3Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..7bfdc05ee95ffa68f47f4b66b369205196ae4248
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsSetModal3Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsSetModal4Test.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsSetModal4Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..1019335ec6d6881103915bdfc3725fc37e839367
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsSetModal4Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsSetModal5Test.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsSetModal5Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..067cd4e0f4a08d325035ab70480a2238312d43d9
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsSetModal5Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsSetModal6Test.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsSetModal6Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..57d43ca3043d4993ecb9049b8d4192158a18024e
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsSetModal6Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsTest.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..74e71a745dce36280404aef9936ad0c592ae5b8f
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsTest.java
@@ -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);
+            }
+        }
+    }
+}
+
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsToolkitModal1Test.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsToolkitModal1Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..0a9d6a18ba06e24d2a07ee03a3f029f039603130
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsToolkitModal1Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsToolkitModal2Test.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsToolkitModal2Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..32080274b9de1f2aed88d76cd8115a615d6e07a9
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsToolkitModal2Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsToolkitModal3Test.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsToolkitModal3Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..6b4aaf7e5c7d0eaf50805ffbfc67380ef8a2dbc3
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsToolkitModal3Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsToolkitModal4Test.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsToolkitModal4Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..f8ddae7c0d7e07839bc6494b724b98e233f92bd1
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsToolkitModal4Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsToolkitModal5Test.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsToolkitModal5Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..cb55619792e172da643c0fbe21fbdf298e109aa0
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsToolkitModal5Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsToolkitModal6Test.java b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsToolkitModal6Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..6407def149eef39fae18784cdeb78cdf09247083
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsToolkitModal6Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/UnblockedDialogAppModalTest.java b/jdk/test/java/awt/Modal/ModalBlockingTests/UnblockedDialogAppModalTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..81965d281b2fb77f6312643d0cfc0ce98d36c938
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/UnblockedDialogAppModalTest.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/UnblockedDialogDocModalTest.java b/jdk/test/java/awt/Modal/ModalBlockingTests/UnblockedDialogDocModalTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..ce4fb9d302f634e136f49c06bed9fa69add9111b
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/UnblockedDialogDocModalTest.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/UnblockedDialogModelessTest.java b/jdk/test/java/awt/Modal/ModalBlockingTests/UnblockedDialogModelessTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..e566b718e3b518997571348f2539816f12bccdd3
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/UnblockedDialogModelessTest.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/UnblockedDialogNonModalTest.java b/jdk/test/java/awt/Modal/ModalBlockingTests/UnblockedDialogNonModalTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..664ddc709f8ae1a222d12c98c53d0fe83222d447
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/UnblockedDialogNonModalTest.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/UnblockedDialogSetModalTest.java b/jdk/test/java/awt/Modal/ModalBlockingTests/UnblockedDialogSetModalTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..4c7996b496d4d977256997de9ff791009f0cc9d0
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/UnblockedDialogSetModalTest.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/UnblockedDialogTest.java b/jdk/test/java/awt/Modal/ModalBlockingTests/UnblockedDialogTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..1406a145dee5d0355f176a4c5bd2d5c997299080
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/UnblockedDialogTest.java
@@ -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(); }
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalBlockingTests/UnblockedDialogToolkitModalTest.java b/jdk/test/java/awt/Modal/ModalBlockingTests/UnblockedDialogToolkitModalTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..213d0297385d6d2817f4ada4e9092d97962581d9
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/UnblockedDialogToolkitModalTest.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFAppModalTest.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFAppModalTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..20f15fbe4ded580240d158e646a7246d16afa27e
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFAppModalTest.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFDocModalTest.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFDocModalTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..bb70a4fc09001494c02d256192c7afb70ec372d0
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFDocModalTest.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFModelessTest.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFModelessTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..eb2ca1ecd0821561255964d80fddf7e48820549f
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFModelessTest.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFNonModalTest.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFNonModalTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..697c5c3d409ac71e59fc24793bab2c462d54ef26
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFNonModalTest.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFTest.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..c6097b74b92f7862d76632f0980412be64c993f7
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFTest.java
@@ -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);
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsAppModalTest.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsAppModalTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..900c388978682273a4de96be9cefb0183ba8f3af
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsAppModalTest.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsDocModalTest.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsDocModalTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..62e04584dc6a8fa8a76cc62e90eeec905f62c039
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsDocModalTest.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsModelessTest.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsModelessTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..2215b5a9b3629d9a2eb3045213c5ef2651b74b38
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsModelessTest.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsNonModalTest.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsNonModalTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..dc87c0f4268a0bb51f393b21566b216ab63ec4ad
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsNonModalTest.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsTest.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..322dd6b94d4cbe329b363976d06901dac206c0e2
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsTest.java
@@ -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);
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWAppModalTest.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWAppModalTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..f3fc961d4607a3f8ac8656bb2e6c777273ec9e5b
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWAppModalTest.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWDocModalTest.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWDocModalTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..9a163e47bbcbe450d77cd52f3e5d7e97db6d9dc6
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWDocModalTest.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWModelessTest.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWModelessTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..41dce55fea8290b626083b26546d08d22374526b
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWModelessTest.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWNonModalTest.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWNonModalTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..32117624ecb978a3e1eec43391628ade72375ece
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWNonModalTest.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWTest.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..41e2fb086f2c3289964907bddf5cbc7e2c375ac1
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWTest.java
@@ -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);
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDAppModal1Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDAppModal1Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..121aeb5494fee80d486e8b80dfc61a3e144d738d
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDAppModal1Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDAppModal2Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDAppModal2Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..ba1ff589406f253fc6deedad2627f9b151856487
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDAppModal2Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDAppModal3Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDAppModal3Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..5098658d7e9f6e1520077e583f82954b256caff7
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDAppModal3Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDAppModal4Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDAppModal4Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..f4ae06489aa3792e563303c50148a1be928d13f3
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDAppModal4Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDDocModal1Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDDocModal1Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..4f3958f98d46f51738a991fc0dd8c6015efb92bf
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDDocModal1Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDDocModal2Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDDocModal2Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..f68eb0e3a63e9f22e5eb756196dfa2c91c28e837
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDDocModal2Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDDocModal3Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDDocModal3Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..7ad9e8e3d4aec54c9296ddb178c8986f1c83ea31
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDDocModal3Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDDocModal4Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDDocModal4Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..d689b61be83d335d293f6ceda5c1ca6a7c91efac
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDDocModal4Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDModeless1Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDModeless1Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..bdf00c0ca24e6751a9705c3b4e0fa0b20afd5b4b
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDModeless1Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDModeless2Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDModeless2Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..a1d31e4328add3ea78094a1153aa7f0e28b3b044
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDModeless2Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDModeless3Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDModeless3Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..6ed6f9eab21e0685f8beea2e04251721791a95f6
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDModeless3Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDModeless4Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDModeless4Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..956b69127bb09deea0b4846969755c9dd3b210a9
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDModeless4Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal1Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal1Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..fd06036bce7dd01512254e6e4da8af6ce2a2cb67
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal1Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal2Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal2Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..82283113c8c292cba26a7981ff6e4dd7729dd98c
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal2Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal3Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal3Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..4475351ba432e350973f0bbcc5b3621ae73c1f4e
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal3Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal4Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal4Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..6ceed53737616012c3b32aface142961a78acd98
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal4Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDTest.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..2d7a37419d10033e1fabd353f6690ad432a8288b
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDTest.java
@@ -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);
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFAppModal1Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFAppModal1Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..d23593634c1e18247dd69f9b92d5c08ccc83611e
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFAppModal1Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFAppModal2Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFAppModal2Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..e37420f3cdb8c58ca78c28009976c39a3da0d98a
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFAppModal2Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFAppModal3Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFAppModal3Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..f75c869272a9435cdb70911640debe57c11a05fb
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFAppModal3Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFDocModal1Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFDocModal1Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..cd1e9e8f9d96e38690e2b956e7614c11fe974b75
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFDocModal1Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFDocModal2Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFDocModal2Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..9f3a1f88cc89344eb314af48ee34becf1f5192d6
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFDocModal2Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFDocModal3Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFDocModal3Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..2c116b0967742d904db3585d83fa6c444313fc79
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFDocModal3Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFModeless1Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFModeless1Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..73d36b65bf0b778f6d8b0677970543281a04cf13
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFModeless1Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFModeless2Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFModeless2Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..e496e253f58edb5333c9e8a4f4fb9d71a5f7c8d0
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFModeless2Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFModeless3Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFModeless3Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..df3ff81dc3d2bce1a870e6595f6a93379d2058d1
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFModeless3Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFNonModal1Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFNonModal1Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..c700a0541366c35552fcc453b3b75f1239123291
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFNonModal1Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFNonModal2Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFNonModal2Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..5e36b8d50a7bff065fb293bd3dc1444c080b2eef
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFNonModal2Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFNonModal3Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFNonModal3Test.java
new file mode 100644
index 0000000000000000000000000000000000000000..e0d3ebbb1f2bbd2891a20eb18769684ba99143e5
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFNonModal3Test.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFTest.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..d79e715bfe9c8c0d0288b2d33f869265307d5384
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFTest.java
@@ -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);
+    }
+}
diff --git a/jdk/test/java/awt/Modal/ModalitySettingsTest/ModalitySettingsTest.java b/jdk/test/java/awt/Modal/ModalitySettingsTest/ModalitySettingsTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..614b32cd090fc00b0c7c11c9809c6c93993310a6
--- /dev/null
+++ b/jdk/test/java/awt/Modal/ModalitySettingsTest/ModalitySettingsTest.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/NullModalityDialogTest/NullModalityDialogTest.java b/jdk/test/java/awt/Modal/NullModalityDialogTest/NullModalityDialogTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..f8632ff14df8470090aa3ecb9a97c6170596ea8e
--- /dev/null
+++ b/jdk/test/java/awt/Modal/NullModalityDialogTest/NullModalityDialogTest.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Modal/helpers/TestDialog.java b/jdk/test/java/awt/Modal/helpers/TestDialog.java
index a3791778bc1c5a3013235a8b47af710f601c1a2f..d547886cddc4021b17f55b85106fba9863c2f0d4 100644
--- a/jdk/test/java/awt/Modal/helpers/TestDialog.java
+++ b/jdk/test/java/awt/Modal/helpers/TestDialog.java
@@ -332,35 +332,47 @@ public class TestDialog extends Dialog implements ActionListener,
             "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);
     }
 }
diff --git a/jdk/test/java/awt/Modal/helpers/TestFrame.java b/jdk/test/java/awt/Modal/helpers/TestFrame.java
index 8b646f822912c07df7501ae46ff2ec0adb8be4cd..cbe0feac0c62b05e5b0c5482b75288149cdbb2d1 100644
--- a/jdk/test/java/awt/Modal/helpers/TestFrame.java
+++ b/jdk/test/java/awt/Modal/helpers/TestFrame.java
@@ -292,13 +292,13 @@ public class TestFrame extends Frame implements ActionListener,
         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 @@ public class TestFrame extends Frame implements ActionListener,
             "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(boolean refState) {
+        checkOpenButtonFocusGained(refState, Flag.ATTEMPTS);
     }
 
-    public void checkOpenButtonFocusGained() {
+    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);
     }
 }
diff --git a/jdk/test/java/awt/Modal/helpers/TestWindow.java b/jdk/test/java/awt/Modal/helpers/TestWindow.java
index c929aefbf73d1f373d6b219df4619f0522e2f209..4e7cdb6fe793e8993e6351d0d42668f234f43925 100644
--- a/jdk/test/java/awt/Modal/helpers/TestWindow.java
+++ b/jdk/test/java/awt/Modal/helpers/TestWindow.java
@@ -295,39 +295,51 @@ public class TestWindow extends Window implements ActionListener,
             "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);
     }
 }
diff --git a/jdk/test/java/awt/Toolkit/DesktopProperties/rfe4758438.java b/jdk/test/java/awt/Toolkit/DesktopProperties/rfe4758438.java
new file mode 100644
index 0000000000000000000000000000000000000000..e5b2e4dd1e1c3bcdd6556d13b9715d7daee78dbc
--- /dev/null
+++ b/jdk/test/java/awt/Toolkit/DesktopProperties/rfe4758438.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/Toolkit/DesktopProperties/rfe4758438.sh b/jdk/test/java/awt/Toolkit/DesktopProperties/rfe4758438.sh
new file mode 100644
index 0000000000000000000000000000000000000000..6a55d727c7b97d8fd10440171ee7e3eb3ad94765
--- /dev/null
+++ b/jdk/test/java/awt/Toolkit/DesktopProperties/rfe4758438.sh
@@ -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
diff --git a/jdk/test/java/awt/event/KeyEvent/ExtendedModifiersTest/ExtendedModifiersTest.java b/jdk/test/java/awt/event/KeyEvent/ExtendedModifiersTest/ExtendedModifiersTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..f6b00c4c1cfb45fec52e9580b4192afa3daec436
--- /dev/null
+++ b/jdk/test/java/awt/event/KeyEvent/ExtendedModifiersTest/ExtendedModifiersTest.java
@@ -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();
+    }
+}
+
diff --git a/jdk/test/java/awt/event/KeyEvent/KeyMaskTest/KeyMaskTest.java b/jdk/test/java/awt/event/KeyEvent/KeyMaskTest/KeyMaskTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..3400444ebbd748263951fecbc55f5b320103cd20
--- /dev/null
+++ b/jdk/test/java/awt/event/KeyEvent/KeyMaskTest/KeyMaskTest.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/event/MouseEvent/MouseButtonsAndKeyMasksTest/MouseButtonsAndKeyMasksTest.java b/jdk/test/java/awt/event/MouseEvent/MouseButtonsAndKeyMasksTest/MouseButtonsAndKeyMasksTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..850679c6d4451119dab628cb2cdaa24d0f64567a
--- /dev/null
+++ b/jdk/test/java/awt/event/MouseEvent/MouseButtonsAndKeyMasksTest/MouseButtonsAndKeyMasksTest.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/event/MouseEvent/MouseButtonsTest/MouseButtonsTest.java b/jdk/test/java/awt/event/MouseEvent/MouseButtonsTest/MouseButtonsTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..cc36b0c35b87c0596905cb94034fceb8e124114a
--- /dev/null
+++ b/jdk/test/java/awt/event/MouseEvent/MouseButtonsTest/MouseButtonsTest.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/event/MouseEvent/MultipleMouseButtonsTest/MultipleMouseButtonsTest.java b/jdk/test/java/awt/event/MouseEvent/MultipleMouseButtonsTest/MultipleMouseButtonsTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..df143b78c0509cfd4fe29f915f75c49fca8d1f89
--- /dev/null
+++ b/jdk/test/java/awt/event/MouseEvent/MultipleMouseButtonsTest/MultipleMouseButtonsTest.java
@@ -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();
+    }
+}
diff --git a/jdk/test/java/awt/event/helpers/lwcomponents/LWButton.java b/jdk/test/java/awt/event/helpers/lwcomponents/LWButton.java
new file mode 100644
index 0000000000000000000000000000000000000000..866844e1ce70d47c2b5d6222b39e3773c46d22df
--- /dev/null
+++ b/jdk/test/java/awt/event/helpers/lwcomponents/LWButton.java
@@ -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;
+  }
+
+}
diff --git a/jdk/test/java/awt/event/helpers/lwcomponents/LWComponent.java b/jdk/test/java/awt/event/helpers/lwcomponents/LWComponent.java
new file mode 100644
index 0000000000000000000000000000000000000000..2209d0c107a9a21f51e65cfcd61a7fcbcdd8fef0
--- /dev/null
+++ b/jdk/test/java/awt/event/helpers/lwcomponents/LWComponent.java
@@ -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);
+  }
+
+}
diff --git a/jdk/test/java/awt/event/helpers/lwcomponents/LWList.java b/jdk/test/java/awt/event/helpers/lwcomponents/LWList.java
new file mode 100644
index 0000000000000000000000000000000000000000..d08a3141340e01c4c7464f8a928c121f97b90cce
--- /dev/null
+++ b/jdk/test/java/awt/event/helpers/lwcomponents/LWList.java
@@ -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);
+  }
+
+}
+
diff --git a/jdk/test/java/lang/ProcessBuilder/Basic.java b/jdk/test/java/lang/ProcessBuilder/Basic.java
index d59688e9d7d328add7c28d0149a147dd0aa87cf7..bb955f2de2020a452a69d64a89578adb2e3ff8d4 100644
--- a/jdk/test/java/lang/ProcessBuilder/Basic.java
+++ b/jdk/test/java/lang/ProcessBuilder/Basic.java
@@ -2269,9 +2269,9 @@ public class Basic {
                 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();
diff --git a/jdk/test/java/lang/reflect/Modifier/toStringTest.java b/jdk/test/java/lang/reflect/Modifier/toStringTest.java
index 694e8ecc7f954e1422f56bcd9f4f5ac376acee06..85bceb483397c23ca87f4cff4ee77b6c3ec3384a 100644
--- a/jdk/test/java/lang/reflect/Modifier/toStringTest.java
+++ b/jdk/test/java/lang/reflect/Modifier/toStringTest.java
@@ -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 {
 
diff --git a/jdk/test/java/util/Collections/CheckedListReplaceAll.java b/jdk/test/java/util/Collections/CheckedListReplaceAll.java
index 8ac05d095f2e3a95cfd52fd55389d690f2f764e7..19042db24d6b5c5d320615013d9bf31f20e9f20f 100644
--- a/jdk/test/java/util/Collections/CheckedListReplaceAll.java
+++ b/jdk/test/java/util/Collections/CheckedListReplaceAll.java
@@ -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 @@ public class CheckedListReplaceAll {
             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!");
+        }
     }
 }
diff --git a/jdk/test/java/util/Collections/SyncSubMutexes.java b/jdk/test/java/util/Collections/SyncSubMutexes.java
new file mode 100644
index 0000000000000000000000000000000000000000..05dbcc3df714a7dc24aec4abc9115996a26b1bcf
--- /dev/null
+++ b/jdk/test/java/util/Collections/SyncSubMutexes.java
@@ -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);
+        }
+    }
+
+}
diff --git a/jdk/test/javax/imageio/plugins/png/PngDitDepthTest.java b/jdk/test/javax/imageio/plugins/png/PngDitDepthTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..7317f87c5039ab74049b71467a56fb1b86be9290
--- /dev/null
+++ b/jdk/test/javax/imageio/plugins/png/PngDitDepthTest.java
@@ -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);
+
+    }
+}
diff --git a/jdk/test/javax/management/monitor/StartStopTest.java b/jdk/test/javax/management/monitor/StartStopTest.java
index c1feb2959568cd8a2a2e3ca5af228defb3781296..95787972412e8058699282003fa66f284978ec7b 100644
--- a/jdk/test/javax/management/monitor/StartStopTest.java
+++ b/jdk/test/javax/management/monitor/StartStopTest.java
@@ -213,6 +213,6 @@ public class StartStopTest {
     }
 
     private static void doSleep(long ms) throws Exception {
-        Thread.sleep(Math.round(ms * Utils.TIMEOUT_FACTOR));
+        Thread.sleep(Utils.adjustTimeout(ms));
     }
 }
diff --git a/jdk/test/javax/naming/InitialContext/AppletIsNotUsed.java b/jdk/test/javax/naming/InitialContext/AppletIsNotUsed.java
new file mode 100644
index 0000000000000000000000000000000000000000..6165d36440558ad2ac853dd7fefaa02df8484981
--- /dev/null
+++ b/jdk/test/javax/naming/InitialContext/AppletIsNotUsed.java
@@ -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");
+    }
+}
diff --git a/jdk/test/javax/naming/InitialContext/NoApplet.java b/jdk/test/javax/naming/InitialContext/NoApplet.java
index 0c6969c0b904dcfec4cfba4ad09050f5d98906ce..8b4e59de82c0cb469f91d41198c4c547e7817e78 100644
--- a/jdk/test/javax/naming/InitialContext/NoApplet.java
+++ b/jdk/test/javax/naming/InitialContext/NoApplet.java
@@ -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 javax.naming.*;
 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();
     }
 }
diff --git a/jdk/test/javax/net/ssl/TLSv12/ProtocolFilter.java b/jdk/test/javax/net/ssl/TLSv12/ProtocolFilter.java
new file mode 100644
index 0000000000000000000000000000000000000000..ec58bc74d0cf53a62dfd6b5d709d566f2cc2fbed
--- /dev/null
+++ b/jdk/test/javax/net/ssl/TLSv12/ProtocolFilter.java
@@ -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;
+            }
+        }
+    }
+}
diff --git a/jdk/test/javax/print/attribute/PrintResAttr.java b/jdk/test/javax/print/attribute/PrintResAttr.java
new file mode 100644
index 0000000000000000000000000000000000000000..c5467b32532750c06702f15680a8f6504a3017db
--- /dev/null
+++ b/jdk/test/javax/print/attribute/PrintResAttr.java
@@ -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]);
+          }
+      }
+   }
+}
diff --git a/jdk/src/share/classes/sun/audio/AudioSecurityAction.java b/jdk/test/javax/xml/jaxp/common/8032908/TestFunc.java
similarity index 72%
rename from jdk/src/share/classes/sun/audio/AudioSecurityAction.java
rename to jdk/test/javax/xml/jaxp/common/8032908/TestFunc.java
index 3debfb3dc90e877282867956e2ce54cf7e926072..20eb23fa513da3fef777ecb9b3021a95d3ee3437 100644
--- a/jdk/src/share/classes/sun/audio/AudioSecurityAction.java
+++ b/jdk/test/javax/xml/jaxp/common/8032908/TestFunc.java
@@ -1,12 +1,10 @@
 /*
- * Copyright (c) 1999, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * published by the Free Software Foundation.
  *
  * This code is distributed in the hope that it will be useful, but WITHOUT
  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@@ -23,8 +21,13 @@
  * questions.
  */
 
-package sun.audio;
+import org.w3c.dom.Node;
+
+public class TestFunc {
+
+    public static String test(Node node) {
+        String s = node.getTextContent();
+        return s;
+    }
 
-public interface AudioSecurityAction {
-    Object run();
 }
diff --git a/jdk/test/javax/xml/jaxp/common/8032908/XSLT.java b/jdk/test/javax/xml/jaxp/common/8032908/XSLT.java
new file mode 100644
index 0000000000000000000000000000000000000000..77ddcbcfaea783facdfcb23663ad700653c6455e
--- /dev/null
+++ b/jdk/test/javax/xml/jaxp/common/8032908/XSLT.java
@@ -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");
+        }
+    }
+}
diff --git a/jdk/test/javax/xml/jaxp/common/8032908/in.xml b/jdk/test/javax/xml/jaxp/common/8032908/in.xml
new file mode 100644
index 0000000000000000000000000000000000000000..005858563700aa0358ffe6c676ff38ebdf221de3
--- /dev/null
+++ b/jdk/test/javax/xml/jaxp/common/8032908/in.xml
@@ -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>
diff --git a/jdk/test/javax/xml/jaxp/common/8032908/test.xsl b/jdk/test/javax/xml/jaxp/common/8032908/test.xsl
new file mode 100644
index 0000000000000000000000000000000000000000..268be0a01a884ef79519b9f1ef69d39abe23a3b5
--- /dev/null
+++ b/jdk/test/javax/xml/jaxp/common/8032908/test.xsl
@@ -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>
diff --git a/jdk/test/lib/testlibrary/jdk/testlibrary/ProcessThread.java b/jdk/test/lib/testlibrary/jdk/testlibrary/ProcessThread.java
index 8c0ddb33822af72ae66c1e71da823794100a6cc2..0aee786e7b10abfc4f25a7b8183cbd1f4c8effa7 100644
--- a/jdk/test/lib/testlibrary/jdk/testlibrary/ProcessThread.java
+++ b/jdk/test/lib/testlibrary/jdk/testlibrary/ProcessThread.java
@@ -148,9 +148,7 @@ public class ProcessThread extends TestThread {
          */
         @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();
 
diff --git a/jdk/test/lib/testlibrary/jdk/testlibrary/ProcessTools.java b/jdk/test/lib/testlibrary/jdk/testlibrary/ProcessTools.java
index 042c8c65e0cb1ddb4f5f3a3b9df5908d041d8f99..1610fec9f082eb25c22a747f812c9ec6ed96d05e 100644
--- a/jdk/test/lib/testlibrary/jdk/testlibrary/ProcessTools.java
+++ b/jdk/test/lib/testlibrary/jdk/testlibrary/ProcessTools.java
@@ -74,7 +74,7 @@ public final class ProcessTools {
     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 @@ public final class ProcessTools {
      *                      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 @@ public final class ProcessTools {
             };
             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) {
@@ -180,6 +185,31 @@ public final class ProcessTools {
         return p;
     }
 
+    /**
+     * <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.
      *
diff --git a/jdk/test/lib/testlibrary/jdk/testlibrary/Utils.java b/jdk/test/lib/testlibrary/jdk/testlibrary/Utils.java
index 90c473e6231ad0fbe4c7ff67a379b1e2a3634182..954aefcc49d130c5d42937093f127ab4e44c56c5 100644
--- a/jdk/test/lib/testlibrary/jdk/testlibrary/Utils.java
+++ b/jdk/test/lib/testlibrary/jdk/testlibrary/Utils.java
@@ -280,4 +280,13 @@ public final class Utils {
         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);
+    }
 }
diff --git a/jdk/test/sun/awt/image/bug8038000.java b/jdk/test/sun/awt/image/bug8038000.java
index 2bfdc27d2b7de54e58d9db2e821b9ab1bb06ec2b..20affe806c217b8c83ae3926505075d0dff5d40c 100644
--- a/jdk/test/sun/awt/image/bug8038000.java
+++ b/jdk/test/sun/awt/image/bug8038000.java
@@ -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
  */
diff --git a/jdk/test/sun/net/ftp/FtpURL.java b/jdk/test/sun/net/ftp/FtpURL.java
index 117913f6a636c171e7f6a059f3f26f2db9ca5439..64c4e8fc890b06a88892aa2e991f43d25eacfda7 100644
--- a/jdk/test/sun/net/ftp/FtpURL.java
+++ b/jdk/test/sun/net/ftp/FtpURL.java
@@ -483,7 +483,7 @@ public class FtpURL {
 
             // 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 {
diff --git a/jdk/test/sun/security/pkcs11/ec/ReadCertificates.java b/jdk/test/sun/security/pkcs11/ec/ReadCertificates.java
index 8311b8d1e2057f36b2a008c93b3315dea62f2f74..82b7f4abc2608ffba0b5adfae5c289cc07e287ff 100644
--- a/jdk/test/sun/security/pkcs11/ec/ReadCertificates.java
+++ b/jdk/test/sun/security/pkcs11/ec/ReadCertificates.java
@@ -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 @@ public class ReadCertificates extends PKCS11Test {
                 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) {
diff --git a/jdk/test/tools/launcher/TestSpecialArgs.java b/jdk/test/tools/launcher/TestSpecialArgs.java
index 344869bfbaee7f243406201d7ef9b1490b0cd05f..04344e6adfba986661dc62be5e28372513335618 100644
--- a/jdk/test/tools/launcher/TestSpecialArgs.java
+++ b/jdk/test/tools/launcher/TestSpecialArgs.java
@@ -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 @@ public class TestSpecialArgs extends TestHelper {
                 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;
diff --git a/make/Jprt.gmk b/make/Jprt.gmk
index a7f9226d99f3d21ee800ac8fe389eacb5efd256f..59b76cdf4eb0e6ffa5dbaf5e440a785f4023a5cb 100644
--- a/make/Jprt.gmk
+++ b/make/Jprt.gmk
@@ -46,6 +46,10 @@ ifndef JPRT_ARCHIVE_INSTALL_BUNDLE
   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)
diff --git a/make/jprt.properties b/make/jprt.properties
index d3d9c9e9e6c91bee9d0c2b377012680f41825633..eed8b41077d8532260e176a950b9b7ce8d12675b 100644
--- a/make/jprt.properties
+++ b/make/jprt.properties
@@ -249,7 +249,7 @@ my.test.targets.hotspot.solaris.sparcv9=				\
     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 @@ my.test.targets.hotspot.solaris.x64=					\
     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 @@ my.test.targets.hotspot.linux.i586=					\
     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 @@ my.test.targets.hotspot.windows.i586=					\
     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 @@ my.test.targets.hotspot.windows.x64=					\
     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,		\
diff --git a/nashorn/.hgtags b/nashorn/.hgtags
index b59b5a487f0f61b3ab010a550bf62b9bddee88c7..f529a5ef4ece309c7db64a279fd04cddd073c16d 100644
--- a/nashorn/.hgtags
+++ b/nashorn/.hgtags
@@ -258,3 +258,4 @@ d703c59c556f9fcd9604272806ef7acf55c92363 jdk9-b20
 a9d39bcfeb1bb3f7de929c56a2ecbea10a554ca1 jdk9-b22
 aa3fda2d2967847dbd264aa962d624c07fc6c29f jdk9-b23
 49d7a2a66ae6b70fee367e2ceb29d0c20f8be01b jdk9-b24
+b33633fc10c5bffd39d3492ed2602dadd8d44642 jdk9-b25
diff --git a/nashorn/src/jdk/internal/dynalink/linker/GuardedInvocation.java b/nashorn/src/jdk/internal/dynalink/linker/GuardedInvocation.java
index 34dcdc03d76fdbb2dae98b92c8b2e6e71feca4b6..00ee9dc77cb24acbff9a8eca5e970be8cad4409c 100644
--- a/nashorn/src/jdk/internal/dynalink/linker/GuardedInvocation.java
+++ b/nashorn/src/jdk/internal/dynalink/linker/GuardedInvocation.java
@@ -193,7 +193,7 @@ public class GuardedInvocation {
         invocation.getClass(); // NPE check
         this.invocation = invocation;
         this.guard = guard;
-        this.switchPoints = switchPoints;
+        this.switchPoints = switchPoints == null ? null : switchPoints.clone();
         this.exception = exception;
     }
 
diff --git a/nashorn/src/jdk/internal/dynalink/support/CompositeTypeBasedGuardingDynamicLinker.java b/nashorn/src/jdk/internal/dynalink/support/CompositeTypeBasedGuardingDynamicLinker.java
index 9194696937003c6e9e04984d0381e3039443b4cc..d1ff028076fed5ec58a40ada6ab3c549769c0e85 100644
--- a/nashorn/src/jdk/internal/dynalink/support/CompositeTypeBasedGuardingDynamicLinker.java
+++ b/nashorn/src/jdk/internal/dynalink/support/CompositeTypeBasedGuardingDynamicLinker.java
@@ -111,7 +111,7 @@ public class CompositeTypeBasedGuardingDynamicLinker implements TypeBasedGuardin
         private final TypeBasedGuardingDynamicLinker[] linkers;
         private final List<TypeBasedGuardingDynamicLinker>[] singletonLinkers;
 
-        @SuppressWarnings(value={"unchecked", "rawtypes"})
+        @SuppressWarnings({"unchecked", "rawtypes"})
         ClassToLinker(final TypeBasedGuardingDynamicLinker[] linkers) {
             this.linkers = linkers;
             singletonLinkers = new List[linkers.length];
@@ -135,7 +135,6 @@ public class CompositeTypeBasedGuardingDynamicLinker implements TypeBasedGuardin
                         case 1: {
                             list = new LinkedList<>(list);
                         }
-                        //$FALL-THROUGH$
                         default: {
                             list.add(linker);
                         }
diff --git a/nashorn/src/jdk/nashorn/api/scripting/NashornScriptEngine.java b/nashorn/src/jdk/nashorn/api/scripting/NashornScriptEngine.java
index f19857386e6a75bbbd8dd06880ecd58d9528d018..abdb79c287c6df1893b26e78c648ea07940798d8 100644
--- a/nashorn/src/jdk/nashorn/api/scripting/NashornScriptEngine.java
+++ b/nashorn/src/jdk/nashorn/api/scripting/NashornScriptEngine.java
@@ -40,6 +40,7 @@ import java.security.ProtectionDomain;
 import java.text.MessageFormat;
 import java.util.Locale;
 import java.util.ResourceBundle;
+
 import javax.script.AbstractScriptEngine;
 import javax.script.Bindings;
 import javax.script.Compilable;
@@ -50,6 +51,7 @@ import javax.script.ScriptEngine;
 import javax.script.ScriptEngineFactory;
 import javax.script.ScriptException;
 import javax.script.SimpleBindings;
+
 import jdk.nashorn.internal.objects.Global;
 import jdk.nashorn.internal.runtime.Context;
 import jdk.nashorn.internal.runtime.ErrorManager;
@@ -429,7 +431,7 @@ public final class NashornScriptEngine extends AbstractScriptEngine implements C
         return evalImpl(script, ctxt, getNashornGlobalFrom(ctxt));
     }
 
-    private Object evalImpl(final Context.MultiGlobalCompiledScript mgcs, final ScriptContext ctxt, final Global ctxtGlobal) throws ScriptException {
+    private static Object evalImpl(final Context.MultiGlobalCompiledScript mgcs, final ScriptContext ctxt, final Global ctxtGlobal) throws ScriptException {
         final Global oldGlobal = Context.getGlobal();
         final boolean globalChanged = (oldGlobal != ctxtGlobal);
         try {
@@ -450,7 +452,7 @@ public final class NashornScriptEngine extends AbstractScriptEngine implements C
         }
     }
 
-    private Object evalImpl(final ScriptFunction script, final ScriptContext ctxt, final Global ctxtGlobal) throws ScriptException {
+    private static Object evalImpl(final ScriptFunction script, final ScriptContext ctxt, final Global ctxtGlobal) throws ScriptException {
         if (script == null) {
             return null;
         }
diff --git a/nashorn/src/jdk/nashorn/internal/codegen/CodeGenerator.java b/nashorn/src/jdk/nashorn/internal/codegen/CodeGenerator.java
index 46a6b86bfd37b862f8c0c1c6a943ca5238996477..5b7bf91ab2a4cfa267ad15e99dbfbb7f71cf0ebc 100644
--- a/nashorn/src/jdk/nashorn/internal/codegen/CodeGenerator.java
+++ b/nashorn/src/jdk/nashorn/internal/codegen/CodeGenerator.java
@@ -314,7 +314,7 @@ final class CodeGenerator extends NodeOperatorVisitor<CodeGeneratorLexicalContex
         if (!symbol.isScope()) {
             final Type type = identNode.getType();
             if(type == Type.UNDEFINED) {
-                return method.loadUndefined(Type.OBJECT);
+                return method.loadUndefined(resultBounds.widest);
             }
 
             assert symbol.hasSlot() || symbol.isParam();
@@ -1097,7 +1097,11 @@ final class CodeGenerator extends NodeOperatorVisitor<CodeGeneratorLexicalContex
 
         closeBlockVariables(block);
         lc.releaseSlots();
-        assert !method.isReachable() || (lc.isFunctionBody() ? 0 : lc.getUsedSlotCount()) == method.getFirstTemp();
+        assert !method.isReachable() || (lc.isFunctionBody() ? 0 : lc.getUsedSlotCount()) == method.getFirstTemp() :
+            "reachable="+method.isReachable() +
+            " isFunctionBody=" + lc.isFunctionBody() +
+            " usedSlotCount=" + lc.getUsedSlotCount() +
+            " firstTemp=" + method.getFirstTemp();
 
         return block;
     }
@@ -4738,7 +4742,7 @@ final class CodeGenerator extends NodeOperatorVisitor<CodeGeneratorLexicalContex
          */
         private void replaceCompileTimeProperty(final Object propertyValue) {
             assert method.peekType().isObject();
-            if(propertyValue instanceof String) {
+            if(propertyValue instanceof String || propertyValue == null) {
                 method.load((String)propertyValue);
             } else if(propertyValue instanceof Integer) {
                 method.load(((Integer)propertyValue).intValue());
diff --git a/nashorn/src/jdk/nashorn/internal/codegen/CompilationPhase.java b/nashorn/src/jdk/nashorn/internal/codegen/CompilationPhase.java
index 8b3819266f4be08e99e3b71e81a3c1a1a7e57c99..5dea042bed715264943bf385e08d3be0bd741459 100644
--- a/nashorn/src/jdk/nashorn/internal/codegen/CompilationPhase.java
+++ b/nashorn/src/jdk/nashorn/internal/codegen/CompilationPhase.java
@@ -43,7 +43,6 @@ import java.io.PrintWriter;
 import java.util.ArrayList;
 import java.util.EnumSet;
 import java.util.HashMap;
-import java.util.IdentityHashMap;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
@@ -334,15 +333,15 @@ enum CompilationPhase {
                     sb.append("$restOf");
                 }
                 newUnit = compiler.createCompileUnit(sb.toString(), oldUnit.getWeight());
-                log.info("Creating new compile unit ", oldUnit, " => ", newUnit);
+                log.fine("Creating new compile unit ", oldUnit, " => ", newUnit);
                 map.put(oldUnit, newUnit);
                 assert newUnit != null;
                 newUnits.add(newUnit);
             }
 
-            log.info("Replacing compile units in Compiler...");
+            log.fine("Replacing compile units in Compiler...");
             compiler.replaceCompileUnits(newUnits);
-            log.info("Done");
+            log.fine("Done");
 
             //replace old compile units in function nodes, if any are assigned,
             //for example by running the splitter on this function node in a previous
@@ -564,7 +563,7 @@ enum CompilationPhase {
                     append(compiler.getCompileUnits().size()).
                     append(" compile unit(s)]");
 
-                log.info(sb.toString());
+                log.fine(sb.toString());
             }
 
             return setStates(fn.setRootClass(null, rootClass), BYTECODE_INSTALLED);
diff --git a/nashorn/src/jdk/nashorn/internal/codegen/Compiler.java b/nashorn/src/jdk/nashorn/internal/codegen/Compiler.java
index f5281ba9d56488dd48a2909fd732a137eaa6931e..205c65b6fe9b587e302d8baa7bbcc96093a35042 100644
--- a/nashorn/src/jdk/nashorn/internal/codegen/Compiler.java
+++ b/nashorn/src/jdk/nashorn/internal/codegen/Compiler.java
@@ -50,6 +50,7 @@ import java.util.TreeMap;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.function.Consumer;
 import java.util.logging.Level;
+
 import jdk.internal.dynalink.support.NameCodec;
 import jdk.nashorn.internal.codegen.ClassEmitter.Flag;
 import jdk.nashorn.internal.codegen.types.Type;
@@ -502,7 +503,7 @@ public final class Compiler implements Loggable {
      */
     public FunctionNode compile(final FunctionNode functionNode, final CompilationPhases phases) throws CompilationException {
 
-        log.info("Starting compile job for ", DebugLogger.quote(functionNode.getName()), " phases=", quote(phases.getDesc()));
+        log.finest("Starting compile job for ", DebugLogger.quote(functionNode.getName()), " phases=", quote(phases.getDesc()));
         log.indent();
 
         final String name = DebugLogger.quote(functionNode.getName());
@@ -531,7 +532,7 @@ public final class Compiler implements Loggable {
             time += (env.isTimingEnabled() ? phase.getEndTime() - phase.getStartTime() : 0L);
         }
 
-        if(typeInformationFile != null && !phases.isRestOfCompilation()) {
+        if (typeInformationFile != null && !phases.isRestOfCompilation()) {
             OptimisticTypesPersistence.store(typeInformationFile, invalidatedProgramPoints);
         }
 
diff --git a/nashorn/src/jdk/nashorn/internal/codegen/LocalVariableTypesCalculator.java b/nashorn/src/jdk/nashorn/internal/codegen/LocalVariableTypesCalculator.java
index df763c1ba4fe87ad3da7019947dcccf6f98a14d2..130bd66f906f58bbbcb3f14e5d37e9f7fb4d73bd 100644
--- a/nashorn/src/jdk/nashorn/internal/codegen/LocalVariableTypesCalculator.java
+++ b/nashorn/src/jdk/nashorn/internal/codegen/LocalVariableTypesCalculator.java
@@ -1196,9 +1196,7 @@ final class LocalVariableTypesCalculator extends NodeVisitor<LexicalContext>{
                 } else if(binaryNode.isOptimisticUndecidedType()) {
                     // At this point, we can assign a static type to the optimistic binary ADD operator as now we know
                     // the types of its operands.
-                    final Type type = Type.widest(binaryNode.lhs().getType(), binaryNode.rhs().getType());
-                    // Use Type.CHARSEQUENCE instead of Type.STRING to avoid conversion of ConsStrings to Strings.
-                    return binaryNode.setType(type.equals(Type.STRING) ? Type.CHARSEQUENCE : type);
+                    return binaryNode.decideType();
                 }
                 return binaryNode;
             }
diff --git a/nashorn/src/jdk/nashorn/internal/codegen/Lower.java b/nashorn/src/jdk/nashorn/internal/codegen/Lower.java
index 9f713e04dde6c9f81804087b78f532283f1c6c77..f2808791e2107721d34197e716d67413365cbaa4 100644
--- a/nashorn/src/jdk/nashorn/internal/codegen/Lower.java
+++ b/nashorn/src/jdk/nashorn/internal/codegen/Lower.java
@@ -34,6 +34,7 @@ import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 import java.util.ListIterator;
+
 import jdk.nashorn.internal.ir.BaseNode;
 import jdk.nashorn.internal.ir.BinaryNode;
 import jdk.nashorn.internal.ir.Block;
diff --git a/nashorn/src/jdk/nashorn/internal/codegen/OptimisticTypesPersistence.java b/nashorn/src/jdk/nashorn/internal/codegen/OptimisticTypesPersistence.java
index 00e59b3c65da97e834791252d3add8faf36629ad..3d5dc27e5b6fa144cea72709a6a498564af69a59 100644
--- a/nashorn/src/jdk/nashorn/internal/codegen/OptimisticTypesPersistence.java
+++ b/nashorn/src/jdk/nashorn/internal/codegen/OptimisticTypesPersistence.java
@@ -41,6 +41,7 @@ import java.util.Base64;
 import java.util.Date;
 import java.util.Map;
 import java.util.TreeMap;
+
 import jdk.nashorn.internal.codegen.types.Type;
 import jdk.nashorn.internal.runtime.Context;
 import jdk.nashorn.internal.runtime.RecompilableScriptFunctionData;
@@ -111,6 +112,7 @@ public final class OptimisticTypesPersistence {
             return;
         }
         final File file = ((LocationDescriptor)locationDescriptor).file;
+
         AccessController.doPrivileged(new PrivilegedAction<Void>() {
             @Override
             public Void run() {
@@ -119,7 +121,7 @@ public final class OptimisticTypesPersistence {
                         out.getChannel().lock(); // lock exclusive
                         final DataOutputStream dout = new DataOutputStream(new BufferedOutputStream(out));
                         dout.writeInt(optimisticTypes.size());
-                        for(Map.Entry<Integer, Type> e: optimisticTypes.entrySet()) {
+                        for(final Map.Entry<Integer, Type> e: optimisticTypes.entrySet()) {
                             dout.writeInt(e.getKey());
                             final byte typeChar;
                             final Type type = e.getValue();
@@ -156,7 +158,6 @@ public final class OptimisticTypesPersistence {
             return null;
         }
         final File file = ((LocationDescriptor)locationDescriptor).file;
-
         return AccessController.doPrivileged(new PrivilegedAction<Map<Integer, Type>>() {
             @Override
             public Map<Integer, Type> run() {
@@ -229,7 +230,7 @@ public final class OptimisticTypesPersistence {
                 final String versionDirName;
                 try {
                     versionDirName = getVersionDirName();
-                } catch(Exception e) {
+                } catch(final Exception e) {
                     getLogger().warning("Failed to calculate version dir name", e);
                     return null;
                 }
@@ -306,7 +307,7 @@ public final class OptimisticTypesPersistence {
 
     private static long getLastModifiedClassFile(final File dir, final long max) {
         long currentMax = max;
-        for(File f: dir.listFiles()) {
+        for(final File f: dir.listFiles()) {
             if(f.getName().endsWith(".class")) {
                 final long lastModified = f.lastModified();
                 if(lastModified > currentMax) {
diff --git a/nashorn/src/jdk/nashorn/internal/ir/BinaryNode.java b/nashorn/src/jdk/nashorn/internal/ir/BinaryNode.java
index 8411e263bfa448bfb5d93ad1dd40fdcd17afa614..f32f6325622fd350958c334d8983655d51ed34c1 100644
--- a/nashorn/src/jdk/nashorn/internal/ir/BinaryNode.java
+++ b/nashorn/src/jdk/nashorn/internal/ir/BinaryNode.java
@@ -183,17 +183,31 @@ public final class BinaryNode extends Expression implements Assignment<Expressio
         switch (tokenType()) {
         case ADD:
         case ASSIGN_ADD: {
+            // Compare this logic to decideType(Type, Type); it's similar, but it handles the optimistic type
+            // calculation case while this handles the conservative case.
             final Type lhsType = lhs.getType(localVariableTypes);
             final Type rhsType = rhs.getType(localVariableTypes);
             if(lhsType == Type.BOOLEAN && rhsType == Type.BOOLEAN) {
+                // Will always fit in an int, as the value range is [0, 1, 2]. If we didn't treat them specially here,
+                // they'd end up being treated as generic INT operands and their sum would be conservatively considered
+                // to be a LONG in the generic case below; we can do better here.
                 return Type.INT;
+            } else if(isString(lhsType) || isString(rhsType)) {
+                // We can statically figure out that this is a string if either operand is a string. In this case, use
+                // CHARSEQUENCE to prevent it from being proactively flattened.
+                return Type.CHARSEQUENCE;
             }
-            final Type widestOperandType = Type.widest(lhs.getType(localVariableTypes), rhs.getType(localVariableTypes));
+            final Type widestOperandType = Type.widest(undefinedToNumber(booleanToInt(lhsType)), undefinedToNumber(booleanToInt(rhsType)));
             if(widestOperandType == Type.INT) {
                 return Type.LONG;
             } else if (widestOperandType.isNumeric()) {
                 return Type.NUMBER;
             }
+            // We pretty much can't know what it will be statically. Must presume OBJECT conservatively, as we can end
+            // up getting either a string or an object when adding something + object, e.g.:
+            // 1 + {} == "1[object Object]", but
+            // 1 + {valueOf: function() { return 2 }} == 3. Also:
+            // 1 + {valueOf: function() { return "2" }} == "12".
             return Type.OBJECT;
         }
         case SHR:
@@ -256,10 +270,18 @@ public final class BinaryNode extends Expression implements Assignment<Expressio
         }
     }
 
+    private static boolean isString(final Type type) {
+        return type == Type.STRING || type == Type.CHARSEQUENCE;
+    }
+
     private static Type booleanToInt(final Type type) {
         return type == Type.BOOLEAN ? Type.INT : type;
     }
 
+    private static Type undefinedToNumber(final Type type) {
+        return type == Type.UNDEFINED ? Type.NUMBER : type;
+    }
+
     /**
      * Check if this node is an assignment
      *
@@ -527,7 +549,7 @@ public final class BinaryNode extends Expression implements Assignment<Expressio
 
     private Type getTypeUncached(final Function<Symbol, Type> localVariableTypes) {
         if(type == OPTIMISTIC_UNDECIDED_TYPE) {
-            return Type.widest(lhs.getType(localVariableTypes), rhs.getType(localVariableTypes));
+            return decideType(lhs.getType(localVariableTypes), rhs.getType(localVariableTypes));
         }
         final Type widest = getWidestOperationType(localVariableTypes);
         if(type == null) {
@@ -536,6 +558,32 @@ public final class BinaryNode extends Expression implements Assignment<Expressio
         return Type.narrowest(widest, Type.widest(type, Type.widest(lhs.getType(localVariableTypes), rhs.getType(localVariableTypes))));
     }
 
+    private static Type decideType(final Type lhsType, final Type rhsType) {
+        // Compare this to getWidestOperationType() for ADD and ASSIGN_ADD cases. There's some similar logic, but these
+        // are optimistic decisions, meaning that we don't have to treat boolean addition separately (as it'll become
+        // int addition in the general case anyway), and that we also don't conservatively widen sums of ints to
+        // longs, or sums of longs to doubles.
+        if(isString(lhsType) || isString(rhsType)) {
+            return Type.CHARSEQUENCE;
+        }
+        // NOTE: We don't have optimistic object-to-(int, long) conversions. Therefore, if any operand is an Object, we
+        // bail out of optimism here and presume a conservative Object return value, as the object's ToPrimitive() can
+        // end up returning either a number or a string, and their common supertype is Object, for better or worse.
+        final Type widest = Type.widest(undefinedToNumber(booleanToInt(lhsType)), undefinedToNumber(booleanToInt(rhsType)));
+        return widest.isObject() ? Type.OBJECT : widest;
+    }
+
+    /**
+     * If the node is a node representing an add operation and has {@link #isOptimisticUndecidedType() optimistic
+     * undecided type}, decides its type. Should be invoked after its operands types have been finalized.
+     * @return returns a new node similar to this node, but with its type set to the type decided from the type of its
+     * operands.
+     */
+    public BinaryNode decideType() {
+        assert type == OPTIMISTIC_UNDECIDED_TYPE;
+        return setType(decideType(lhs.getType(), rhs.getType()));
+    }
+
     @Override
     public BinaryNode setType(final Type type) {
         if (this.type == type) {
diff --git a/nashorn/src/jdk/nashorn/internal/ir/Block.java b/nashorn/src/jdk/nashorn/internal/ir/Block.java
index 9d4356db6e79a7586ec48ea0bad2cb9dc05cd677..c157626547c6ec115bbf9c3abf7fd8e27108c6ca 100644
--- a/nashorn/src/jdk/nashorn/internal/ir/Block.java
+++ b/nashorn/src/jdk/nashorn/internal/ir/Block.java
@@ -149,7 +149,7 @@ public class Block extends Node implements BreakableNode, Terminal, Flags<Block>
     @Override
     public Node accept(final LexicalContext lc, final NodeVisitor<? extends LexicalContext> visitor) {
         if (visitor.enterBlock(this)) {
-            return visitor.leaveBlock(setStatements(lc, Node.accept(visitor, Statement.class, statements)));
+            return visitor.leaveBlock(setStatements(lc, Node.accept(visitor, statements)));
         }
 
         return this;
diff --git a/nashorn/src/jdk/nashorn/internal/ir/CallNode.java b/nashorn/src/jdk/nashorn/internal/ir/CallNode.java
index 0751ce4087d63d885a5324cd1ba5475fbf58103e..be7abe3287f7618cf956eb15f3f7224e3532ab74 100644
--- a/nashorn/src/jdk/nashorn/internal/ir/CallNode.java
+++ b/nashorn/src/jdk/nashorn/internal/ir/CallNode.java
@@ -30,6 +30,7 @@ import static jdk.nashorn.internal.runtime.UnwarrantedOptimismException.INVALID_
 import java.util.Collections;
 import java.util.List;
 import java.util.function.Function;
+
 import jdk.nashorn.internal.codegen.types.Type;
 import jdk.nashorn.internal.ir.annotations.Ignore;
 import jdk.nashorn.internal.ir.annotations.Immutable;
@@ -175,10 +176,10 @@ public final class CallNode extends LexicalContextExpression implements Optimist
         if (visitor.enterCallNode(this)) {
             final CallNode newCallNode = (CallNode)visitor.leaveCallNode(
                     setFunction((Expression)function.accept(visitor)).
-                    setArgs(Node.accept(visitor, Expression.class, args)).
+                    setArgs(Node.accept(visitor, args)).
                     setEvalArgs(evalArgs == null ?
                             null :
-                            evalArgs.setArgs(Node.accept(visitor, Expression.class, evalArgs.getArgs()))));
+                            evalArgs.setArgs(Node.accept(visitor, evalArgs.getArgs()))));
             // Theoretically, we'd need to instead pass lc to every setter and do a replacement on each. In practice,
             // setType from TypeOverride can't accept a lc, and we don't necessarily want to go there now.
             if (this != newCallNode) {
diff --git a/nashorn/src/jdk/nashorn/internal/ir/FunctionNode.java b/nashorn/src/jdk/nashorn/internal/ir/FunctionNode.java
index 282c19ed0c79f3f547ee3a4ac314550092bcb8cf..9481b3ad95c9d52b5d93dd774b06742cad6a9db0 100644
--- a/nashorn/src/jdk/nashorn/internal/ir/FunctionNode.java
+++ b/nashorn/src/jdk/nashorn/internal/ir/FunctionNode.java
@@ -359,7 +359,7 @@ public final class FunctionNode extends LexicalContextExpression implements Flag
      * @return a list of parameter nodes, potentially modified from original ones by the visitor.
      */
     public List<IdentNode> visitParameters(final NodeVisitor<? extends LexicalContext> visitor) {
-        return Node.accept(visitor, IdentNode.class, parameters);
+        return Node.accept(visitor, parameters);
     }
 
     /**
diff --git a/nashorn/src/jdk/nashorn/internal/ir/LexicalContext.java b/nashorn/src/jdk/nashorn/internal/ir/LexicalContext.java
index 2a1a4249fb6a339e6bba199eff6ad306e493cd4b..543dc08a0b067381dffac7da390d8f8974257910 100644
--- a/nashorn/src/jdk/nashorn/internal/ir/LexicalContext.java
+++ b/nashorn/src/jdk/nashorn/internal/ir/LexicalContext.java
@@ -27,6 +27,7 @@ package jdk.nashorn.internal.ir;
 import java.io.File;
 import java.util.Iterator;
 import java.util.NoSuchElementException;
+
 import jdk.nashorn.internal.runtime.Debug;
 import jdk.nashorn.internal.runtime.Source;
 
@@ -652,6 +653,7 @@ public class LexicalContext {
             return lnext;
         }
 
+        @SuppressWarnings("unchecked")
         private T findNext() {
             for (int i = index; i >= 0; i--) {
                 final Object node = stack[i];
@@ -660,7 +662,7 @@ public class LexicalContext {
                 }
                 if (clazz.isAssignableFrom(node.getClass())) {
                     index = i - 1;
-                    return clazz.cast(node);
+                    return (T)node;
                 }
             }
             return null;
diff --git a/nashorn/src/jdk/nashorn/internal/ir/LiteralNode.java b/nashorn/src/jdk/nashorn/internal/ir/LiteralNode.java
index b71e450389f04a7f40e0940e34d87fdc362bb849..787aae225c4ad9cbaf230624c3bd9ba9c9c5991d 100644
--- a/nashorn/src/jdk/nashorn/internal/ir/LiteralNode.java
+++ b/nashorn/src/jdk/nashorn/internal/ir/LiteralNode.java
@@ -934,7 +934,7 @@ public abstract class LiteralNode<T> extends Expression implements PropertyKey {
         public Node accept(final LexicalContext lc, final NodeVisitor<? extends LexicalContext> visitor) {
             if (visitor.enterLiteralNode(this)) {
                 final List<Expression> oldValue = Arrays.asList(value);
-                final List<Expression> newValue = Node.accept(visitor, Expression.class, oldValue);
+                final List<Expression> newValue = Node.accept(visitor, oldValue);
                 return visitor.leaveLiteralNode(oldValue != newValue ? setValue(lc, newValue) : this);
             }
             return this;
diff --git a/nashorn/src/jdk/nashorn/internal/ir/Node.java b/nashorn/src/jdk/nashorn/internal/ir/Node.java
index 191d702ab64d7ba7bd8c870c7693c51358ebe621..29feadd31ea0d693dbf4d33670b312ce036dc592 100644
--- a/nashorn/src/jdk/nashorn/internal/ir/Node.java
+++ b/nashorn/src/jdk/nashorn/internal/ir/Node.java
@@ -27,6 +27,7 @@ package jdk.nashorn.internal.ir;
 
 import java.util.ArrayList;
 import java.util.List;
+
 import jdk.nashorn.internal.ir.visitor.NodeVisitor;
 import jdk.nashorn.internal.parser.Token;
 import jdk.nashorn.internal.parser.TokenType;
@@ -232,19 +233,34 @@ public abstract class Node implements Cloneable {
     }
 
     //on change, we have to replace the entire list, that's we can't simple do ListIterator.set
-    static <T extends Node> List<T> accept(final NodeVisitor<? extends LexicalContext> visitor, final Class<T> clazz, final List<T> list) {
-        boolean changed = false;
-        final List<T> newList = new ArrayList<>();
+    static <T extends Node> List<T> accept(final NodeVisitor<? extends LexicalContext> visitor, final List<T> list) {
+        final int size = list.size();
+        if (size == 0) {
+            return list;
+        }
+
+         List<T> newList = null;
 
-        for (final Node node : list) {
-            final T newNode = node == null ? null : clazz.cast(node.accept(visitor));
+        for (int i = 0; i < size; i++) {
+            final T node = list.get(i);
+            @SuppressWarnings("unchecked")
+            final T newNode = node == null ? null : (T)node.accept(visitor);
             if (newNode != node) {
-                changed = true;
+                if (newList == null) {
+                    newList = new ArrayList<>(size);
+                    for (int j = 0; j < i; j++) {
+                        newList.add(list.get(j));
+                    }
+                }
+                newList.add(newNode);
+            } else {
+                if (newList != null) {
+                    newList.add(node);
+                }
             }
-            newList.add(newNode);
         }
 
-        return changed ? newList : list;
+        return newList == null ? list : newList;
     }
 
     static <T extends LexicalContextNode> T replaceInLexicalContext(final LexicalContext lc, final T oldNode, final T newNode) {
diff --git a/nashorn/src/jdk/nashorn/internal/ir/ObjectNode.java b/nashorn/src/jdk/nashorn/internal/ir/ObjectNode.java
index ca08162bdac9478764776128246da78c76a9077b..38fd667d0950af6c19e2d5a7b48343b2ba9b803b 100644
--- a/nashorn/src/jdk/nashorn/internal/ir/ObjectNode.java
+++ b/nashorn/src/jdk/nashorn/internal/ir/ObjectNode.java
@@ -61,7 +61,7 @@ public final class ObjectNode extends Expression {
     @Override
     public Node accept(final NodeVisitor<? extends LexicalContext> visitor) {
         if (visitor.enterObjectNode(this)) {
-            return visitor.leaveObjectNode(setElements(Node.accept(visitor, PropertyNode.class, elements)));
+            return visitor.leaveObjectNode(setElements(Node.accept(visitor, elements)));
         }
 
         return this;
diff --git a/nashorn/src/jdk/nashorn/internal/ir/SwitchNode.java b/nashorn/src/jdk/nashorn/internal/ir/SwitchNode.java
index 095fd1987c6553fc66689e227cb0f06d1fb7d285..a3eac1ce26f05b7501861a750418c76ce9905f9c 100644
--- a/nashorn/src/jdk/nashorn/internal/ir/SwitchNode.java
+++ b/nashorn/src/jdk/nashorn/internal/ir/SwitchNode.java
@@ -104,7 +104,7 @@ public final class SwitchNode extends BreakableStatement {
         if (visitor.enterSwitchNode(this)) {
             return visitor.leaveSwitchNode(
                 setExpression(lc, (Expression)expression.accept(visitor)).
-                setCases(lc, Node.accept(visitor, CaseNode.class, cases), defaultCaseIndex));
+                setCases(lc, Node.accept(visitor, cases), defaultCaseIndex));
         }
 
         return this;
diff --git a/nashorn/src/jdk/nashorn/internal/ir/TryNode.java b/nashorn/src/jdk/nashorn/internal/ir/TryNode.java
index 29338615881b1433fc986b580686842ecb6f0944..87a8c565d6d8c6466ac48f30fb0ab251a5224903 100644
--- a/nashorn/src/jdk/nashorn/internal/ir/TryNode.java
+++ b/nashorn/src/jdk/nashorn/internal/ir/TryNode.java
@@ -112,7 +112,7 @@ public final class TryNode extends Statement implements JoinPredecessor {
             return visitor.leaveTryNode(
                 setBody(newBody).
                 setFinallyBody(newFinallyBody).
-                setCatchBlocks(Node.accept(visitor, Block.class, catchBlocks)).
+                setCatchBlocks(Node.accept(visitor, catchBlocks)).
                 setFinallyCatchAll(finallyCatchAll));
         }
 
diff --git a/nashorn/src/jdk/nashorn/internal/ir/debug/ClassHistogramElement.java b/nashorn/src/jdk/nashorn/internal/ir/debug/ClassHistogramElement.java
index c65f8ef7ce709cdbc93bfe33c975c6f7dab08e3d..d5c8174fe1c280eba28cd4183528323692b20499 100644
--- a/nashorn/src/jdk/nashorn/internal/ir/debug/ClassHistogramElement.java
+++ b/nashorn/src/jdk/nashorn/internal/ir/debug/ClassHistogramElement.java
@@ -30,7 +30,7 @@ import java.util.Comparator;
 /**
  * Class histogram element for IR / Java object instrumentation
  */
-public class ClassHistogramElement {
+public final class ClassHistogramElement {
     /**
      * Instance comparator
      */
diff --git a/nashorn/src/jdk/nashorn/internal/ir/debug/NashornTextifier.java b/nashorn/src/jdk/nashorn/internal/ir/debug/NashornTextifier.java
index 0ec3ea3ccb8542b29543c5f05270ec16c611fbdd..5dbf35432cb8b01a2b2c85f67a6c41773cf48207 100644
--- a/nashorn/src/jdk/nashorn/internal/ir/debug/NashornTextifier.java
+++ b/nashorn/src/jdk/nashorn/internal/ir/debug/NashornTextifier.java
@@ -39,6 +39,7 @@ import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+
 import jdk.internal.org.objectweb.asm.Attribute;
 import jdk.internal.org.objectweb.asm.Handle;
 import jdk.internal.org.objectweb.asm.Label;
@@ -1082,11 +1083,15 @@ public final class NashornTextifier extends Printer {
             contents.put(node, sb);
         }
 
+        private static String dottyFriendly(final String name) {
+            return name.replace(':', '_');
+        }
+
         @Override
         public String toString() {
 
             final StringBuilder sb = new StringBuilder();
-            sb.append("digraph " + name + " {");
+            sb.append("digraph " + dottyFriendly(name) + " {");
             sb.append("\n");
             sb.append("\tgraph [fontname=courier]\n");
             sb.append("\tnode [style=filled,color="+COLOR_DEFAULT+",fontname=courier]\n");
diff --git a/nashorn/src/jdk/nashorn/internal/ir/debug/ObjectSizeCalculator.java b/nashorn/src/jdk/nashorn/internal/ir/debug/ObjectSizeCalculator.java
index 9e3d9ce5e8f06f4f1c6c2fe7e884b6cd97abbbe5..53a09a68aa8126dad785c3508d132f9394904469 100644
--- a/nashorn/src/jdk/nashorn/internal/ir/debug/ObjectSizeCalculator.java
+++ b/nashorn/src/jdk/nashorn/internal/ir/debug/ObjectSizeCalculator.java
@@ -52,7 +52,7 @@ import java.util.Map;
  * this fact and will report incorrect sizes, as it will presume the default JVM
  * behavior.
  */
-public class ObjectSizeCalculator {
+public final class ObjectSizeCalculator {
 
     /**
      * Describes constant memory overheads for various constructs in a JVM implementation.
diff --git a/nashorn/src/jdk/nashorn/internal/lookup/MethodHandleFactory.java b/nashorn/src/jdk/nashorn/internal/lookup/MethodHandleFactory.java
index 0e8de8900c9a0531e5b79588b419711f65ea8c46..8ef13d794c0d4e3a558a50737cd43a7487c2959c 100644
--- a/nashorn/src/jdk/nashorn/internal/lookup/MethodHandleFactory.java
+++ b/nashorn/src/jdk/nashorn/internal/lookup/MethodHandleFactory.java
@@ -124,11 +124,13 @@ public final class MethodHandleFactory {
      * @return return value unmodified
      */
     static Object traceReturn(final DebugLogger logger, final Object value) {
-        final String str = "    return" +
-                (VOID_TAG.equals(value) ?
-                    ";" :
-                    " " + stripName(value) + "; // [type=" + (value == null ? "null]" : stripName(value.getClass()) + ']'));
-        logger.log(TRACE_LEVEL, str);
+        if (logger.isEnabled()) {
+            final String str = "    return" +
+                    (VOID_TAG.equals(value) ?
+                        ";" :
+                        " " + stripName(value) + "; // [type=" + (value == null ? "null]" : stripName(value.getClass()) + ']'));
+            logger.log(TRACE_LEVEL, str);
+        }
         return value;
     }
 
diff --git a/nashorn/src/jdk/nashorn/internal/objects/Global.java b/nashorn/src/jdk/nashorn/internal/objects/Global.java
index 1c7e96b5a2cbc72a62218d9b3bbdd44f6e298903..8e72be7efa0a06e9e4a1e632437f38d02db094b4 100644
--- a/nashorn/src/jdk/nashorn/internal/objects/Global.java
+++ b/nashorn/src/jdk/nashorn/internal/objects/Global.java
@@ -46,8 +46,10 @@ import java.util.Map;
 import java.util.concurrent.Callable;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.atomic.AtomicReference;
+
 import javax.script.ScriptContext;
 import javax.script.ScriptEngine;
+
 import jdk.internal.dynalink.linker.GuardedInvocation;
 import jdk.internal.dynalink.linker.LinkRequest;
 import jdk.nashorn.api.scripting.ScriptObjectMirror;
@@ -563,6 +565,8 @@ public final class Global extends ScriptObject implements Scope {
      * Initialize standard builtin objects like "Object", "Array", "Function" etc.
      * as well as our extension builtin objects like "Java", "JSAdapter" as properties
      * of the global scope object.
+     *
+     * @param engine ScriptEngine to initialize
      */
     public void initBuiltinObjects(final ScriptEngine engine) {
         if (this.builtinObject != null) {
@@ -1936,15 +1940,16 @@ public final class Global extends ScriptObject implements Scope {
     }
 
     private Object printImpl(final boolean newLine, final Object... objects) {
+        @SuppressWarnings("resource")
         final PrintWriter out = scontext != null? new PrintWriter(scontext.getWriter()) : getContext().getEnv().getOut();
         final StringBuilder sb = new StringBuilder();
 
-        for (final Object object : objects) {
+        for (final Object obj : objects) {
             if (sb.length() != 0) {
                 sb.append(' ');
             }
 
-            sb.append(JSType.toString(object));
+            sb.append(JSType.toString(obj));
         }
 
         // Print all at once to ensure thread friendly result.
diff --git a/nashorn/src/jdk/nashorn/internal/objects/NativeDate.java b/nashorn/src/jdk/nashorn/internal/objects/NativeDate.java
index 0f42998d26194212995a089858b78a082097f3c9..eac59c46cc3de500270bf61e764024bcad334a60 100644
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeDate.java
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeDate.java
@@ -935,7 +935,6 @@ public final class NativeDate extends ScriptObject {
                     }
                     sb.append(' ');
 
-                    //$FALL-THROUGH$
                 case FORMAT_TIME:
                     final TimeZone tz = nd.getTimeZone();
                     final double utcTime = nd.getTime();
diff --git a/nashorn/src/jdk/nashorn/internal/objects/NativeObject.java b/nashorn/src/jdk/nashorn/internal/objects/NativeObject.java
index 08ad24cc8a726a77d22eb82e9a67a5a3b8aa2f59..0a56d5cdd53ed899317d6764edc1969dd36966dd 100644
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeObject.java
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeObject.java
@@ -39,6 +39,7 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 import java.util.concurrent.Callable;
+
 import jdk.internal.dynalink.beans.BeansLinker;
 import jdk.internal.dynalink.beans.StaticClass;
 import jdk.internal.dynalink.linker.GuardedInvocation;
@@ -716,7 +717,7 @@ public final class NativeObject {
         return target;
     }
 
-    /*
+    /**
      * Binds the source mirror object's properties to the target object. Binding
      * properties allows two-way read/write for the properties of the source object.
      * All inherited, enumerable properties are also bound. This method is used to
@@ -731,7 +732,7 @@ public final class NativeObject {
         // make accessor properties using dynamic invoker getters and setters
         final AccessorProperty[] props = new AccessorProperty[keys.size()];
         int idx = 0;
-        for (String name : keys) {
+        for (final String name : keys) {
             final MethodHandle getter = Bootstrap.createDynamicInvoker("dyn:getMethod|getProp|getElem:" + name, MIRROR_GETTER_TYPE);
             final MethodHandle setter = Bootstrap.createDynamicInvoker("dyn:setProp|setElem:" + name, MIRROR_SETTER_TYPE);
             props[idx] = AccessorProperty.create(name, 0, getter, setter);
diff --git a/nashorn/src/jdk/nashorn/internal/objects/NativeUint8ClampedArray.java b/nashorn/src/jdk/nashorn/internal/objects/NativeUint8ClampedArray.java
index 8e81924d3cf9ebcef7d501530fa7b7131371e8fa..db19ab37a595834665ebb499775808e2625f2f12 100644
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeUint8ClampedArray.java
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeUint8ClampedArray.java
@@ -80,7 +80,8 @@ public final class NativeUint8ClampedArray extends ArrayBufferView {
 
         private static final MethodHandle GET_ELEM = specialCall(MethodHandles.lookup(), Uint8ClampedArrayData.class, "getElem", int.class, int.class).methodHandle();
         private static final MethodHandle SET_ELEM = specialCall(MethodHandles.lookup(), Uint8ClampedArrayData.class, "setElem", void.class, int.class, int.class).methodHandle();
-        private static final MethodHandle RINT     = staticCall(MethodHandles.lookup(), Uint8ClampedArrayData.class, "rint", double.class, double.class).methodHandle();
+        private static final MethodHandle RINT_D   = staticCall(MethodHandles.lookup(), Uint8ClampedArrayData.class, "rint", double.class, double.class).methodHandle();
+        private static final MethodHandle RINT_O   = staticCall(MethodHandles.lookup(), Uint8ClampedArrayData.class, "rint", Object.class, Object.class).methodHandle();
         private static final MethodHandle CLAMP_LONG = staticCall(MethodHandles.lookup(), Uint8ClampedArrayData.class, "clampLong", long.class, long.class).methodHandle();
 
         private Uint8ClampedArrayData(final ByteBuffer nb, final int start, final int end) {
@@ -109,8 +110,10 @@ public final class NativeUint8ClampedArray extends ArrayBufferView {
         public MethodHandle getElementSetter(final Class<?> elementType) {
             final MethodHandle setter = super.getElementSetter(elementType); //getContinuousElementSetter(getClass(), setElem(), elementType);
             if (setter != null) {
-                if (elementType == double.class) {
-                    return MH.filterArguments(setter, 2, RINT);
+                if (elementType == Object.class) {
+                    return MH.filterArguments(setter, 2, RINT_O);
+                } else if (elementType == double.class) {
+                    return MH.filterArguments(setter, 2, RINT_D);
                 } else if (elementType == long.class) {
                     return MH.filterArguments(setter, 2, CLAMP_LONG);
                 }
@@ -190,6 +193,11 @@ public final class NativeUint8ClampedArray extends ArrayBufferView {
             return (int)Math.rint(rint);
         }
 
+        @SuppressWarnings("unused")
+        private static Object rint(final Object rint) {
+            return rint(JSType.toNumber(rint));
+        }
+
         @SuppressWarnings("unused")
         private static long clampLong(final long l) {
             if(l < 0L) {
diff --git a/nashorn/src/jdk/nashorn/internal/runtime/ECMAErrors.java b/nashorn/src/jdk/nashorn/internal/runtime/ECMAErrors.java
index 462028e886bf5af354cbba3ec83760bdceac5073..d7d23eacaf36cf6ab68c738446f19ab11589efb9 100644
--- a/nashorn/src/jdk/nashorn/internal/runtime/ECMAErrors.java
+++ b/nashorn/src/jdk/nashorn/internal/runtime/ECMAErrors.java
@@ -28,7 +28,7 @@ package jdk.nashorn.internal.runtime;
 import java.text.MessageFormat;
 import java.util.Locale;
 import java.util.ResourceBundle;
-import jdk.nashorn.api.scripting.NashornException;
+
 import jdk.nashorn.internal.codegen.CompilerConstants;
 import jdk.nashorn.internal.objects.Global;
 import jdk.nashorn.internal.scripts.JS;
diff --git a/nashorn/src/jdk/nashorn/internal/runtime/RecompilableScriptFunctionData.java b/nashorn/src/jdk/nashorn/internal/runtime/RecompilableScriptFunctionData.java
index fc14707730bc47f7cba62ade91a699b4a82fc181..e042007ce00eacec2e4d212641b22c9af1effd2e 100644
--- a/nashorn/src/jdk/nashorn/internal/runtime/RecompilableScriptFunctionData.java
+++ b/nashorn/src/jdk/nashorn/internal/runtime/RecompilableScriptFunctionData.java
@@ -36,6 +36,7 @@ import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
 import java.util.TreeMap;
+
 import jdk.internal.dynalink.support.NameCodec;
 import jdk.nashorn.internal.codegen.CompileUnit;
 import jdk.nashorn.internal.codegen.Compiler;
@@ -236,14 +237,14 @@ public final class RecompilableScriptFunctionData extends ScriptFunctionData imp
     /**
      * Initialize transient fields on deserialized instances
      *
-     * @param source source
-     * @param installer code installer
+     * @param src source
+     * @param inst code installer
      */
-    public void initTransients(final Source source, final CodeInstaller<ScriptEnvironment> installer) {
+    public void initTransients(final Source src, final CodeInstaller<ScriptEnvironment> inst) {
         if (this.source == null && this.installer == null) {
-            this.source = source;
-            this.installer = installer;
-        } else if (this.source != source || this.installer != installer) {
+            this.source    = src;
+            this.installer = inst;
+        } else if (this.source != src || this.installer != inst) {
             // Existing values must be same as those passed as parameters
             throw new IllegalArgumentException();
         }
diff --git a/nashorn/src/jdk/nashorn/internal/runtime/ScriptObject.java b/nashorn/src/jdk/nashorn/internal/runtime/ScriptObject.java
index 4f36eb55e38b42d1206a079d907a52fc4d1fddbe..fc42e86b55b71a1ca3e207e90280e25cefc756ff 100644
--- a/nashorn/src/jdk/nashorn/internal/runtime/ScriptObject.java
+++ b/nashorn/src/jdk/nashorn/internal/runtime/ScriptObject.java
@@ -3626,7 +3626,6 @@ public abstract class ScriptObject implements PropertyAccess {
         return MH.insertArguments(KNOWNFUNCPROPGUARDPROTO, 1, map, getter, depth, func);
     }
 
-    @SuppressWarnings("unused")
     private static ScriptObject getProto(final ScriptObject self, final int depth) {
         ScriptObject proto = self;
         for (int d = 0; d < depth; d++) {
diff --git a/nashorn/src/jdk/nashorn/internal/runtime/ScriptRuntime.java b/nashorn/src/jdk/nashorn/internal/runtime/ScriptRuntime.java
index a73b7ab992f90a2ca045545a3202332cbc441cd5..d4350c5998a48f63e8d10a9e600adad14bda0480 100644
--- a/nashorn/src/jdk/nashorn/internal/runtime/ScriptRuntime.java
+++ b/nashorn/src/jdk/nashorn/internal/runtime/ScriptRuntime.java
@@ -484,17 +484,16 @@ public final class ScriptRuntime {
             final Object unwrapped = ScriptObjectMirror.unwrap(expression, global);
             if (unwrapped instanceof ScriptObject) {
                 return new WithObject(scope, (ScriptObject)unwrapped);
-            } else {
-                // foreign ScriptObjectMirror
-                ScriptObject exprObj = global.newObject();
-                NativeObject.bindAllProperties(exprObj, (ScriptObjectMirror)expression);
-                return new WithObject(scope, exprObj);
-            }
-        } else {
-            final Object wrappedExpr = JSType.toScriptObject(global, expression);
-            if (wrappedExpr instanceof ScriptObject) {
-                return new WithObject(scope, (ScriptObject)wrappedExpr);
             }
+            // foreign ScriptObjectMirror
+            final ScriptObject exprObj = global.newObject();
+            NativeObject.bindAllProperties(exprObj, (ScriptObjectMirror)expression);
+            return new WithObject(scope, exprObj);
+        }
+
+        final Object wrappedExpr = JSType.toScriptObject(global, expression);
+        if (wrappedExpr instanceof ScriptObject) {
+            return new WithObject(scope, (ScriptObject)wrappedExpr);
         }
 
         throw typeError(global, "cant.apply.with.to.non.scriptobject");
@@ -819,9 +818,8 @@ public final class ScriptRuntime {
 
     /** ECMA 11.9.6 The Strict Equality Comparison Algorithm */
     private static boolean strictEquals(final Object x, final Object y) {
-        if(x == y) {
-            return true;
-        }
+        // NOTE: you might be tempted to do a quick x == y comparison. Remember, though, that any Double object having
+        // NaN value is not equal to itself by value even though it is referentially.
 
         final JSType xType = JSType.ofNoFunction(x);
         final JSType yType = JSType.ofNoFunction(y);
diff --git a/nashorn/src/jdk/nashorn/internal/runtime/WithObject.java b/nashorn/src/jdk/nashorn/internal/runtime/WithObject.java
index ac5f5a76e4a4864092796164a2c713d96cbb0156..009d7b943a9963c1587767d3a881eaecfb9a3c2c 100644
--- a/nashorn/src/jdk/nashorn/internal/runtime/WithObject.java
+++ b/nashorn/src/jdk/nashorn/internal/runtime/WithObject.java
@@ -31,12 +31,13 @@ import java.lang.invoke.MethodHandle;
 import java.lang.invoke.MethodHandles;
 import java.lang.invoke.MethodType;
 import java.lang.invoke.SwitchPoint;
-import jdk.nashorn.api.scripting.AbstractJSObject;
-import jdk.nashorn.api.scripting.ScriptObjectMirror;
+
 import jdk.internal.dynalink.CallSiteDescriptor;
 import jdk.internal.dynalink.linker.GuardedInvocation;
 import jdk.internal.dynalink.linker.LinkRequest;
 import jdk.internal.dynalink.support.CallSiteDescriptorFactory;
+import jdk.nashorn.api.scripting.AbstractJSObject;
+import jdk.nashorn.api.scripting.ScriptObjectMirror;
 import jdk.nashorn.internal.runtime.linker.NashornCallSiteDescriptor;
 import jdk.nashorn.internal.runtime.linker.NashornGuards;
 
@@ -322,6 +323,7 @@ public final class WithObject extends ScriptObject implements Scope {
                 // We need to make sure correct 'this' is used for calls with Ident call
                 // expressions. We do so here using an AbstractJSObject instance.
                 return new AbstractJSObject() {
+                    @Override
                     public Object call(final Object thiz, final Object... args) {
                         return mirror.call(withFilterExpression(receiver), args);
                     }
diff --git a/nashorn/src/jdk/nashorn/internal/runtime/options/Options.java b/nashorn/src/jdk/nashorn/internal/runtime/options/Options.java
index db755cb9a0e15a32be411cec0ce2fc2467662b76..ed39fa95481c70f64e147f459df1c4533b16ef30 100644
--- a/nashorn/src/jdk/nashorn/internal/runtime/options/Options.java
+++ b/nashorn/src/jdk/nashorn/internal/runtime/options/Options.java
@@ -78,7 +78,10 @@ public final class Options {
     /** The options map of enabled options */
     private final TreeMap<String, Option<?>> options;
 
-    /** System property that can be used for command line option propagation */
+    /** System property that can be used to prepend options to the explicitly specified command line. */
+    private static final String NASHORN_ARGS_PREPEND_PROPERTY = "nashorn.args.prepend";
+
+    /** System property that can be used to append options to the explicitly specified command line. */
     private static final String NASHORN_ARGS_PROPERTY = "nashorn.args";
 
     /**
@@ -419,15 +422,9 @@ public final class Options {
      */
     public void process(final String[] args) {
         final LinkedList<String> argList = new LinkedList<>();
+        addSystemProperties(NASHORN_ARGS_PREPEND_PROPERTY, argList);
         Collections.addAll(argList, args);
-
-        final String extra = getStringProperty(NASHORN_ARGS_PROPERTY, null);
-        if (extra != null) {
-            final StringTokenizer st = new StringTokenizer(extra);
-            while (st.hasMoreTokens()) {
-                argList.add(st.nextToken());
-            }
-        }
+        addSystemProperties(NASHORN_ARGS_PROPERTY, argList);
 
         while (!argList.isEmpty()) {
             final String arg = argList.remove(0);
@@ -509,6 +506,16 @@ public final class Options {
         }
     }
 
+    private static void addSystemProperties(final String sysPropName, final List<String> argList) {
+        final String sysArgs = getStringProperty(sysPropName, null);
+        if (sysArgs != null) {
+            final StringTokenizer st = new StringTokenizer(sysArgs);
+            while (st.hasMoreTokens()) {
+                argList.add(st.nextToken());
+            }
+        }
+    }
+
     private static OptionTemplate getOptionTemplate(final String key) {
         for (final OptionTemplate t : Options.validOptions) {
             if (t.matches(key)) {
diff --git a/nashorn/test/script/basic/JDK-8030182_2.js b/nashorn/test/script/basic/JDK-8030182_2.js
index 4c2f5c429f61624751b1aadfde2750a23773fad7..9ad8f31bae5e0e6f4e724bf967e23778ed452f3c 100644
--- a/nashorn/test/script/basic/JDK-8030182_2.js
+++ b/nashorn/test/script/basic/JDK-8030182_2.js
@@ -41,6 +41,6 @@ str +="g()";
 try {
     eval(str);
 } catch (e) {
-    print(e.stack.replace(/\\/g, '/'));
+    print(e.stack.replace(/\\/g, '/').replace(/<eval>@[0-9]+/, '<eval>@<id>'));
 }
 
diff --git a/nashorn/test/script/basic/JDK-8030182_2.js.EXPECTED b/nashorn/test/script/basic/JDK-8030182_2.js.EXPECTED
index 090bd1f1ab23cdfea8824dc6a8fdc60edfa5ea8f..9fdd913f12df4d410842c185e5b9ac3fd9262b33 100644
--- a/nashorn/test/script/basic/JDK-8030182_2.js.EXPECTED
+++ b/nashorn/test/script/basic/JDK-8030182_2.js.EXPECTED
@@ -1,3 +1,3 @@
 ReferenceError: "g" is not defined
-	at <program> (test/script/basic/JDK-8030182_2.js#42:4<eval>@1:-1)
+	at <program> (test/script/basic/JDK-8030182_2.js#42:4<eval>@<id>:-1)
 	at <program> (test/script/basic/JDK-8030182_2.js:42)
diff --git a/jdk/src/macosx/bundle/JavaAppLauncher/src/JavaAppLauncher.h b/nashorn/test/script/basic/JDK-8051439.js
similarity index 63%
rename from jdk/src/macosx/bundle/JavaAppLauncher/src/JavaAppLauncher.h
rename to nashorn/test/script/basic/JDK-8051439.js
index 046eb6758ea82a873ea4cbc91e6792dca365242e..a1f017d12338c122c0ef99135cc05bcc98cd84a2 100644
--- a/jdk/src/macosx/bundle/JavaAppLauncher/src/JavaAppLauncher.h
+++ b/nashorn/test/script/basic/JDK-8051439.js
@@ -1,43 +1,52 @@
 /*
- * Copyright (c) 2011, 2012, 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
  * 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.
- *
+ * published by the Free Software Foundation.
+ * 
  * This code is distributed in the hope that it will be useful, but WITHOUT
  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  * version 2 for more details (a copy is included in the LICENSE file that
  * accompanied this code).
- *
+ * 
  * You should have received a copy of the GNU General Public License version
  * 2 along with this work; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ * 
  * Please 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;
+/**
+ * JDK-8051439: Wrong type calculated for ADD operator with undefined operand
+ *
+ * @test
+ * @run
+ */
 
-@end
+// Test + operator
+function f1() { 
+    var x; 
+    for (var i = 0;i < 3; i++) { 
+        x = x + i; 
+    }
+    x = x + "test"; 
+    return x; 
+} 
+
+// Test += operator
+function f2() { 
+    var x; 
+    for (var i = 0;i < 3; i++) { 
+        x += i; 
+    }
+    x += "test"; 
+    return x; 
+} 
+
+print(f1());
+print(f2());
diff --git a/nashorn/test/script/basic/JDK-8051439.js.EXPECTED b/nashorn/test/script/basic/JDK-8051439.js.EXPECTED
new file mode 100644
index 0000000000000000000000000000000000000000..5c0f70f1b6e4a6893378010b4f207165ca2a7c5c
--- /dev/null
+++ b/nashorn/test/script/basic/JDK-8051439.js.EXPECTED
@@ -0,0 +1,2 @@
+NaNtest
+NaNtest
diff --git a/nashorn/test/script/basic/compile-octane-normal.js b/nashorn/test/script/basic/compile-octane-normal.js
new file mode 100644
index 0000000000000000000000000000000000000000..c4dd91ed0e339f076fe3fff4cbb8cd08fc626d82
--- /dev/null
+++ b/nashorn/test/script/basic/compile-octane-normal.js
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Make sure that we run with the class cache off to so that every
+ * run produces compile time and with optimistic type info caching
+ * and persistent code store off, for the same reasons. These last two
+ * are currently default, but this is not guaranteed to be the case
+ * forever, so make this test future safe, we specify them explicitly
+ *
+ * @test
+ * @runif external.octane
+ * @option -scripting
+ * @option -Dnashorn.typeInfo.disabled=true
+ * @option --class-cache-size=0
+ * @option --persistent-code-cache=false
+ */
+
+var fn  = __DIR__ + 'compile-octane.js';
+var url = "file://" + fn; 
+loadWithNewGlobal(new java.net.URL(url));
diff --git a/nashorn/test/script/basic/compile-octane-normal.js.EXPECTED b/nashorn/test/script/basic/compile-octane-normal.js.EXPECTED
new file mode 100644
index 0000000000000000000000000000000000000000..5577bcca0c234808fa7f3b26bea1699789a8a4b6
--- /dev/null
+++ b/nashorn/test/script/basic/compile-octane-normal.js.EXPECTED
@@ -0,0 +1,30 @@
+Compiling 'box2d'...
+Done.
+Compiling 'code-load'...
+Done.
+Compiling 'crypto'...
+Done.
+Compiling 'deltablue'...
+Done.
+Compiling 'earley-boyer'...
+Done.
+Compiling 'gbemu'... (2 files)
+Done.
+Compiling 'mandreel'...
+Done.
+Compiling 'navier-stokes'...
+Done.
+Compiling 'pdfjs'...
+Done.
+Compiling 'raytrace'...
+Done.
+Compiling 'regexp'...
+Done.
+Compiling 'richards'...
+Done.
+Compiling 'splay'...
+Done.
+Compiling 'typescript'... (3 files)
+Done.
+Compiling 'zlib'... (2 files)
+Done.
diff --git a/nashorn/test/script/basic/compile-octane-splitter.js b/nashorn/test/script/basic/compile-octane-splitter.js
index d1256398faf02a85b1a2c1d90f1e28c273337c28..2bba0e3f4f09ad7e2afbf7cd3ee43018fd960f25 100644
--- a/nashorn/test/script/basic/compile-octane-splitter.js
+++ b/nashorn/test/script/basic/compile-octane-splitter.js
@@ -22,12 +22,22 @@
  */
 
 /**
+ * Make sure that we run with the class cache off to so that every
+ * run produces compile time and with optimistic type info caching
+ * and persistent code store off, for the same reasons. These last two
+ * are currently default, but this is not guaranteed to be the case
+ * forever, so make this test future safe, we specify them explicitly
+ *
  * @test
  * @option -Dnashorn.compiler.splitter.threshold=1000
  * @fork
  * @runif external.octane
  * @option -scripting
+ * @option -Dnashorn.typeInfo.disabled=true
+ * @option --class-cache-size=0
+ * @option --persistent-code-cache=false
  */
 
-compile_only = true;
-load(__DIR__ + 'run-octane.js');
+var fn  = __DIR__ + 'compile-octane.js';
+var url = "file://" + fn; 
+loadWithNewGlobal(new java.net.URL(url));
diff --git a/nashorn/test/script/basic/compile-octane-splitter.js.EXPECTED b/nashorn/test/script/basic/compile-octane-splitter.js.EXPECTED
index 565866d0e171c1e3c2f4046b3a2d2e23a8827455..5577bcca0c234808fa7f3b26bea1699789a8a4b6 100644
--- a/nashorn/test/script/basic/compile-octane-splitter.js.EXPECTED
+++ b/nashorn/test/script/basic/compile-octane-splitter.js.EXPECTED
@@ -1,15 +1,30 @@
-[box2d] Compiled OK
-[code-load] Compiled OK
-[crypto] Compiled OK
-[deltablue] Compiled OK
-[earley-boyer] Compiled OK
-[gbemu] Compiled OK
-[mandreel] Compiled OK
-[navier-stokes] Compiled OK
-[pdfjs] Compiled OK
-[raytrace] Compiled OK
-[regexp] Compiled OK
-[richards] Compiled OK
-[splay] Compiled OK
-[typescript] Compiled OK
-[zlib] Compiled OK
+Compiling 'box2d'...
+Done.
+Compiling 'code-load'...
+Done.
+Compiling 'crypto'...
+Done.
+Compiling 'deltablue'...
+Done.
+Compiling 'earley-boyer'...
+Done.
+Compiling 'gbemu'... (2 files)
+Done.
+Compiling 'mandreel'...
+Done.
+Compiling 'navier-stokes'...
+Done.
+Compiling 'pdfjs'...
+Done.
+Compiling 'raytrace'...
+Done.
+Compiling 'regexp'...
+Done.
+Compiling 'richards'...
+Done.
+Compiling 'splay'...
+Done.
+Compiling 'typescript'... (3 files)
+Done.
+Compiling 'zlib'... (2 files)
+Done.
diff --git a/nashorn/test/script/basic/compile-octane.js b/nashorn/test/script/basic/compile-octane.js
index ef37c536295b2fa49e93c703e45db664c7fa8081..7d019bbece450b321b61dfbee9b9cfac9ce7ef4a 100644
--- a/nashorn/test/script/basic/compile-octane.js
+++ b/nashorn/test/script/basic/compile-octane.js
@@ -22,10 +22,122 @@
  */
 
 /**
- * @test
- * @runif external.octane
- * @option -scripting
+ * Make sure that we run with the class cache off to so that every
+ * run produces compile time and with optimistic type info caching
+ * and persistent code store off, for the same reasons. These last two
+ * are currently default, but this is not guaranteed to be the case
+ * forever, so make this test future safe, we specify them explicitly
+ *
+ * This means that if you use this subtest as a compilation test
+ * harness, pass the arguments:
+ *
+ * -scripting -Dnashorn.typeInfo.disabled=true --class-cache-size=0 
+ * --persistent-code-cache=false
+ *
+ * @subtest
  */
 
-compile_only = true;
-load(__DIR__ + 'run-octane.js');
+load(__DIR__ + 'octane-payload.js');
+
+var DEFAULT_ITERS = 1; //default is one iteration through each benchmark
+var iters = DEFAULT_ITERS; 
+var args = [];
+
+if (typeof $ARGS !== 'undefined') {
+    args = $ARGS;
+} else if (typeof arguments !== 'undefined' && arguments.length != 0) {
+    args = arguments;
+}
+
+var onlyTheseTests = [];
+var verbose = false;
+
+for (var i = 0; i < args.length; ) {
+    var arg = args[i];
+    if (arg === '--iterations') {
+	iters = +args[++i];
+    } else if (arg === '--verbose') {
+	verbose = true;
+    } else {
+	onlyTheseTests.push(arg);
+    }
+    i++;
+}
+
+if (isNaN(iters)) {
+    iters = DEFAULT_ITERS;
+}
+
+if (iters != DEFAULT_ITERS) {
+    print("Running " + iters + " iterations of each compilation.");
+}
+
+function print_if_verbose(x) {
+    if (verbose) {
+	print(x);
+    }
+}
+
+function contains(a, obj) {
+    for (var i = 0; i < a.length; i++) {
+        if (a[i] === obj) {
+            return true;
+        }
+    }
+    return false;
+}
+
+var testsCompiled = [];
+
+for (var j in tests) {
+    var test_name = tests[j].name;
+    var files = tests[j].files;
+
+    if (onlyTheseTests.length > 0 && !contains(onlyTheseTests, test_name)) {
+	print_if_verbose("Skipping " + test_name);
+	continue;
+    }
+
+    if (!contains(testsCompiled, test_name)) {
+	testsCompiled.push(test_name);
+    }
+
+    var str = "Compiling '" + test_name + "'...";
+    if (files.length > 1) {
+	str += " (" + files.length + " files)";
+    }
+    if (iters != 1) {
+	str += " (" + iters + " times)";
+    }
+    str + "...";
+    print(str);
+
+    for (var iteration = 0; iteration < iters; iteration++) {
+
+	//get a new global to avoid symbol pollution and reloads of base
+	//in the same namespace
+	var newGlobal = loadWithNewGlobal({script:'this', name:'test'});
+
+	//load base into the new global so we get BenchmarkSuite etc
+	newGlobal.load(base); 
+
+	//load all files in the single benchmark
+	for (var k in files) {	    
+	    var file = files[k];
+	    if (iteration >= 0) { //only display message on first iteration
+		var str2 = "\t";
+		if (iters > 1) {
+		    str2 += " [iteration " + (iteration + 1) + "]";
+		}
+		str2 += " processing file: " + file + "...";
+		print_if_verbose(str2);
+	    }
+	    newGlobal.load("file://" + path + file);
+	}
+    }
+    print("Done.");
+}
+
+if (testsCompiled.length == 0) {
+    print("Error: no tests given to compile");
+}
diff --git a/nashorn/test/script/basic/compile-octane.js.EXPECTED b/nashorn/test/script/basic/compile-octane.js.EXPECTED
deleted file mode 100644
index 565866d0e171c1e3c2f4046b3a2d2e23a8827455..0000000000000000000000000000000000000000
--- a/nashorn/test/script/basic/compile-octane.js.EXPECTED
+++ /dev/null
@@ -1,15 +0,0 @@
-[box2d] Compiled OK
-[code-load] Compiled OK
-[crypto] Compiled OK
-[deltablue] Compiled OK
-[earley-boyer] Compiled OK
-[gbemu] Compiled OK
-[mandreel] Compiled OK
-[navier-stokes] Compiled OK
-[pdfjs] Compiled OK
-[raytrace] Compiled OK
-[regexp] Compiled OK
-[richards] Compiled OK
-[splay] Compiled OK
-[typescript] Compiled OK
-[zlib] Compiled OK
diff --git a/nashorn/test/script/basic/hideLocationProperties.js b/nashorn/test/script/basic/hideLocationProperties.js
index 66041dccfaa9b716492f8507293eaeb03b1e692c..62c1ec06322525e27ed7b777c0d1c5c63d337054 100644
--- a/nashorn/test/script/basic/hideLocationProperties.js
+++ b/nashorn/test/script/basic/hideLocationProperties.js
@@ -46,7 +46,7 @@ function z(__FILE__) {
     (function() { print(__FILE__) })()
 }
 
-print(__FILE__)
+print(__FILE__.replace(/\\/g, "/"))
 
 var o = { __FILE__: "woot" }
 with(o) { print(__FILE__) }
diff --git a/nashorn/test/script/basic/octane-payload.js b/nashorn/test/script/basic/octane-payload.js
new file mode 100644
index 0000000000000000000000000000000000000000..36c780d768f2afb9329ed71309ff842f6f211138
--- /dev/null
+++ b/nashorn/test/script/basic/octane-payload.js
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @subtest
+ */
+
+function initZlib() {
+    zlib = new BenchmarkSuite('zlib', [152815148], [
+                            new Benchmark('zlib', false, true, 10,
+                                  runZlib, undefined, tearDownZlib, null, 3)]);
+}
+
+var tests = [
+    {name:"box2d",         files:["box2d.js"],                         suite:"Box2DBenchmark"},
+    {name:"code-load",     files:["code-load.js"],                     suite:"CodeLoad"},
+    {name:"crypto",        files:["crypto.js"],                        suite:"Crypto"},
+    {name:"deltablue",     files:["deltablue.js"],                     suite:"DeltaBlue"},
+    {name:"earley-boyer",  files:["earley-boyer.js"],                  suite:"EarleyBoyer"},
+    {name:"gbemu",         files:["gbemu-part1.js", "gbemu-part2.js"], suite:"GameboyBenchmark"},
+    {name:"mandreel",      files:["mandreel.js"],                      suite:"MandreelBenchmark"},
+    {name:"navier-stokes", files:["navier-stokes.js"],                 suite:"NavierStokes"},
+    {name:"pdfjs",         files:["pdfjs.js"],                         suite:"PdfJS"},
+    {name:"raytrace",      files:["raytrace.js"],                      suite:"RayTrace"},
+    {name:"regexp",        files:["regexp.js"],                        suite:"RegExpSuite"},
+    {name:"richards",      files:["richards.js"],                      suite:"Richards"},
+    {name:"splay",         files:["splay.js"],                         suite:"Splay"},
+    {name:"typescript",    files:["typescript.js", "typescript-input.js", "typescript-compiler.js"], suite:"typescript"},
+    //zlib currently disabled - requires read
+    {name:"zlib",          files:["zlib.js", "zlib-data.js"], suite:"zlib", before:initZlib}
+];
+
+var dir = (typeof(__DIR__) == 'undefined') ? "test/script/basic/" : __DIR__;
+
+// TODO: why is this path hard coded when it's defined in project properties?
+var path = dir + "../external/octane/";
+var base = path + "base.js";
+
diff --git a/nashorn/test/script/basic/optimistic_arithmetic_check_type.js b/nashorn/test/script/basic/optimistic_arithmetic_check_type.js
index 66b1e361508036ed25df368783f16e02115a77e9..62ff301d0f095a196a77a778b81147408179336f 100644
--- a/nashorn/test/script/basic/optimistic_arithmetic_check_type.js
+++ b/nashorn/test/script/basic/optimistic_arithmetic_check_type.js
@@ -25,6 +25,7 @@
  * @test
  * @bug 8036987, 8037572
  * @summary Implement tests that checks static types in the compiled code
+ * @option --optimistic-types=true
  * @run
  */
 
diff --git a/nashorn/test/script/basic/optimistic_assignment_check_type.js b/nashorn/test/script/basic/optimistic_assignment_check_type.js
index 2665c18d9ba4a3a9e9f360d015181caa65d62d2a..7ead00d8448d9c88a3d39748fa6cf8fe06777ee9 100644
--- a/nashorn/test/script/basic/optimistic_assignment_check_type.js
+++ b/nashorn/test/script/basic/optimistic_assignment_check_type.js
@@ -25,6 +25,7 @@
  * @test
  * @bug 8036987, 8037572
  * @summary Implement tests that checks static types in the compiled code
+ * @option --optimistic-types=true
  * @run
  */
 
diff --git a/nashorn/test/script/basic/optimistic_check_type.js b/nashorn/test/script/basic/optimistic_check_type.js
index 163244e817b0d943ffed9799f0674615445b5ec7..d2b50a4c3fb6a0ccd12ce2d3f6ef03f6fdc24337 100644
--- a/nashorn/test/script/basic/optimistic_check_type.js
+++ b/nashorn/test/script/basic/optimistic_check_type.js
@@ -25,6 +25,7 @@
  * @test
  * @bug 8036987, 8037572
  * @summary Implement tests that checks static types in the compiled code
+ * @option --optimistic-types=true
  * @run
  */
 
diff --git a/nashorn/test/script/basic/run-octane.js b/nashorn/test/script/basic/run-octane.js
index 92f71110614db4bf266982baa9c7effc7e5534ef..0c666f2f12c60135cf89fe57c8200108bcb2bbc0 100644
--- a/nashorn/test/script/basic/run-octane.js
+++ b/nashorn/test/script/basic/run-octane.js
@@ -24,36 +24,8 @@
 /**
  * @subtest
  */
-
-
-function initZlib() {
-    zlib = new BenchmarkSuite('zlib', [152815148], [
-                            new Benchmark('zlib', false, true, 10,
-                                  runZlib, undefined, tearDownZlib, null, 3)]);
-}
-
-var tests = [
-    {name:"box2d",         files:["box2d.js"],                         suite:"Box2DBenchmark"},
-    {name:"code-load",     files:["code-load.js"],                     suite:"CodeLoad"},
-    {name:"crypto",        files:["crypto.js"],                        suite:"Crypto"},
-    {name:"deltablue",     files:["deltablue.js"],                     suite:"DeltaBlue"},
-    {name:"earley-boyer",  files:["earley-boyer.js"],                  suite:"EarleyBoyer"},
-    {name:"gbemu",         files:["gbemu-part1.js", "gbemu-part2.js"], suite:"GameboyBenchmark"},
-    {name:"mandreel",      files:["mandreel.js"],                      suite:"MandreelBenchmark"},
-    {name:"navier-stokes", files:["navier-stokes.js"],                 suite:"NavierStokes"},
-    {name:"pdfjs",         files:["pdfjs.js"],                         suite:"PdfJS"},
-    {name:"raytrace",      files:["raytrace.js"],                      suite:"RayTrace"},
-    {name:"regexp",        files:["regexp.js"],                        suite:"RegExpSuite"},
-    {name:"richards",      files:["richards.js"],                      suite:"Richards"},
-    {name:"splay",         files:["splay.js"],                         suite:"Splay"},
-    {name:"typescript",    files:["typescript.js", "typescript-input.js", "typescript-compiler.js"], suite:"typescript"},
-    //zlib currently disabled - requires read
-    {name:"zlib",          files:["zlib.js", "zlib-data.js"], suite:"zlib", before:initZlib}
-];
-var dir = (typeof(__DIR__) == 'undefined') ? "test/script/basic/" : __DIR__;
-
-// TODO: why is this path hard coded when it's defined in project properties?
-var path = dir + "../external/octane/";
+var payload = __DIR__ + "octane-payload.js";
+load(payload);
 
 var runtime = undefined;
 var verbose = false;
diff --git a/nashorn/test/script/nosecurity/JDK-8050964.js b/nashorn/test/script/nosecurity/JDK-8050964.js
index 35b001f6d841803f5dc136553dba205d1038eea3..186d627030dcccb5e832011463005ce5d94de08f 100644
--- a/nashorn/test/script/nosecurity/JDK-8050964.js
+++ b/nashorn/test/script/nosecurity/JDK-8050964.js
@@ -46,8 +46,11 @@ if (! nashornJar.isAbsolute()) {
     nashornJar = new File(".", nashornJar);
 }
 
+var javahome = System.getProperty("java.home");
+var jdepsPath = javahome + "/../bin/jdeps".replaceAll(/\//g, File.separater);
+
 // run jdep on nashorn.jar - only summary but print profile info
-`jdeps -s -P ${nashornJar.absolutePath}`
+`${jdepsPath} -s -P ${nashornJar.absolutePath}`
 
 // check for "(compact1)" in output from jdep tool
 if (! /(compact1)/.test($OUT)) {
diff --git a/nashorn/test/script/trusted/event_queue.js b/nashorn/test/script/trusted/event_queue.js
index 305240eff4508a4108ed4050ee0a2b9177d404e1..feecc201da5198bef9bc78006a276fac9bc82711 100644
--- a/nashorn/test/script/trusted/event_queue.js
+++ b/nashorn/test/script/trusted/event_queue.js
@@ -29,6 +29,7 @@
  * @fork
  * @option -Dnashorn.debug=true
  * @option --log=recompile:quiet
+ * @option --optimistic-types=true
  */
 
 print(Debug);
diff --git a/nashorn/test/script/trusted/optimistic_recompilation.js b/nashorn/test/script/trusted/optimistic_recompilation.js
index 2435ed510f96036f4f66ed65c0118040aedfde67..9c9a9c751b0560fed6574991ac7822f75ed6ea1e 100644
--- a/nashorn/test/script/trusted/optimistic_recompilation.js
+++ b/nashorn/test/script/trusted/optimistic_recompilation.js
@@ -28,6 +28,7 @@
  * @fork
  * @option -Dnashorn.debug=true
  * @option --log=recompile:quiet
+ * @option --optimistic-types=true
  */
 
 var forName       = java.lang.Class["forName(String)"];
diff --git a/nashorn/test/src/jdk/nashorn/api/scripting/ScriptEngineTest.java b/nashorn/test/src/jdk/nashorn/api/scripting/ScriptEngineTest.java
index 3beaf274fcff6abf81f4238050d02846aa2b8abf..4b524ef90923c54e52406efd38e3c134ac1d95a5 100644
--- a/nashorn/test/src/jdk/nashorn/api/scripting/ScriptEngineTest.java
+++ b/nashorn/test/src/jdk/nashorn/api/scripting/ScriptEngineTest.java
@@ -607,6 +607,14 @@ public class ScriptEngineTest {
         assertEquals(res, "hello");
     }
 
+    // @bug 8054223: Nashorn: AssertionError when use __DIR__ and ScriptEngine.eval()
+    @Test
+    public void check__DIR__Test() throws ScriptException {
+        final ScriptEngineManager m = new ScriptEngineManager();
+        final ScriptEngine e = m.getEngineByName("nashorn");
+        e.eval("__DIR__");
+    }
+
     // @bug 8050432:javax.script.filename variable should not be enumerable
     // with nashorn engine's ENGINE_SCOPE bindings
     @Test