Merge
diff --git a/.hgtags-top-repo b/.hgtags-top-repo
index acd76c4..000fb23 100644
--- a/.hgtags-top-repo
+++ b/.hgtags-top-repo
@@ -240,3 +240,4 @@
 cbfe5da942c63ef865cab4a7159e01eff7d7fcf5 jdk8-b116
 a4afb0a8d55ef75aef5b0d77b434070468fb89f8 jdk8-b117
 0a6db1aac998cdc88e52f9adb97d40ca5b0f1da6 jdk8-b118
+9e90215673be68a3e77a9e444e4232076373734d jdk8-b119
diff --git a/Makefile b/Makefile
index c021078..cd5f66b 100644
--- a/Makefile
+++ b/Makefile
@@ -66,12 +66,12 @@
     # First, find out the valid targets
     # Run the makefile with an arbitrary SPEC using -p -q (quiet dry-run and dump rules) to find
     # available PHONY targets. Use this list as valid targets to pass on to the repeated calls.
-    all_phony_targets=$(filter-out $(global_targets) bundles-only, $(strip $(shell \
-        $(MAKE) -p -q -f make/Main.gmk FRC SPEC=$(firstword $(SPEC)) | \
+    all_phony_targets=$(filter-out $(global_targets) bundles bundles-only final-images-only, $(strip $(shell \
+        cd $(root_dir) && $(MAKE) -p -q FRC SPEC=$(firstword $(SPEC)) | \
         grep ^.PHONY: | head -n 1 | cut -d " " -f 2-)))
 
     $(all_phony_targets):
-	@$(foreach spec,$(SPEC),($(MAKE) -f NewMakefile.gmk SPEC=$(spec) \
+	@$(foreach spec,$(SPEC),(cd $(root_dir) && $(MAKE) SPEC=$(spec) \
 	    $(VERBOSE) VERBOSE=$(VERBOSE) LOG_LEVEL=$(LOG_LEVEL) $@) &&) true
 
     .PHONY: $(all_phony_targets)
diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in
index 08412bc..e8649dd 100644
--- a/common/autoconf/spec.gmk.in
+++ b/common/autoconf/spec.gmk.in
@@ -236,7 +236,6 @@
 JDK_OUTPUTDIR=$(BUILD_OUTPUT)/jdk
 NASHORN_OUTPUTDIR=$(BUILD_OUTPUT)/nashorn
 IMAGES_OUTPUTDIR=$(BUILD_OUTPUT)/images
-JCE_OUTPUTDIR=$(BUILD_OUTPUT)/jce-release
 
 LANGTOOLS_DIST=$(LANGTOOLS_OUTPUTDIR)/dist
 CORBA_DIST=$(CORBA_OUTPUTDIR)/dist
diff --git a/corba/.hgtags b/corba/.hgtags
index 17aa59f..f734c61 100644
--- a/corba/.hgtags
+++ b/corba/.hgtags
@@ -240,3 +240,4 @@
 5fdc4465208933ba704825b2b05e1afd062235fb jdk8-b116
 e53d1ee4d2ae898f1cf58688d45a5afe7c482173 jdk8-b117
 d6820a414f182a011a53a29a52370c696cd58dab jdk8-b118
+379fc7609beb7a3d85ebc0cc21a8a51c60d3c7d3 jdk8-b119
diff --git a/hotspot/.hgtags b/hotspot/.hgtags
index 85c0435..fb0b2e0 100644
--- a/hotspot/.hgtags
+++ b/hotspot/.hgtags
@@ -399,3 +399,5 @@
 abad3b2d905d9e1ad767c94baa94aba6ed5b207b hs25-b60
 c9f439732b18ea16f7e65815327d5ea7092cc258 jdk8-b118
 b2426da30009cd3069d03de073f351e6432c7682 hs25-b61
+ce42d815dd2130250acf6132b51b624001638f0d jdk8-b119
+05fedd51e40da22c9460bf17c7185889e435db3d hs25-b62
diff --git a/hotspot/agent/make/jsdbproc64.sh b/hotspot/agent/make/jsdbproc64.sh
index 9f8007e..ac7d9c3 100644
--- a/hotspot/agent/make/jsdbproc64.sh
+++ b/hotspot/agent/make/jsdbproc64.sh
@@ -1,7 +1,7 @@
-#!/bin/sh

+#!/bin/sh
 
 #
-# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 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
@@ -21,10 +21,10 @@
 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 # or visit www.oracle.com if you need additional information or have any
 # questions.
-#  
+#
 #
 
-

-. `dirname $0`/saenv64.sh

-

-$SA_JAVA_CMD sun.jvm.hotspot.tools.JSDB $*

+
+. `dirname $0`/saenv64.sh
+
+$SA_JAVA_CMD sun.jvm.hotspot.tools.soql.JSDB $*
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_implementation/g1/G1HeapRegionTable.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_implementation/g1/G1HeapRegionTable.java
index 11657ce..cfbea40 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_implementation/g1/G1HeapRegionTable.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_implementation/g1/G1HeapRegionTable.java
@@ -103,14 +103,14 @@
         @Override
         public void remove()     { /* not supported */    }
 
-        HeapRegionIterator(Address addr) {
+        HeapRegionIterator(long committedLength) {
             index = 0;
-            length = length();
+            length = committedLength;
         }
     }
 
-    public Iterator<HeapRegion> heapRegionIterator() {
-        return new HeapRegionIterator(addr);
+    public Iterator<HeapRegion> heapRegionIterator(long committedLength) {
+        return new HeapRegionIterator(committedLength);
     }
 
     public G1HeapRegionTable(Address addr) {
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_implementation/g1/HeapRegionSeq.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_implementation/g1/HeapRegionSeq.java
index f8b47ab..190bf56 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_implementation/g1/HeapRegionSeq.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_implementation/g1/HeapRegionSeq.java
@@ -42,6 +42,8 @@
 public class HeapRegionSeq extends VMObject {
     // G1HeapRegionTable _regions
     static private long regionsFieldOffset;
+    // uint _committed_length
+    static private CIntegerField committedLengthField;
 
     static {
         VM.registerVMInitializedObserver(new Observer() {
@@ -55,6 +57,7 @@
         Type type = db.lookupType("HeapRegionSeq");
 
         regionsFieldOffset = type.getField("_regions").getOffset();
+        committedLengthField = type.getCIntegerField("_committed_length");
     }
 
     private G1HeapRegionTable regions() {
@@ -67,8 +70,12 @@
         return regions().length();
     }
 
+    public long committedLength() {
+        return committedLengthField.getValue(addr);
+    }
+
     public Iterator<HeapRegion> heapRegionIterator() {
-        return regions().heapRegionIterator();
+        return regions().heapRegionIterator(committedLength());
     }
 
     public HeapRegionSeq(Address addr) {
diff --git a/hotspot/make/hotspot_version b/hotspot/make/hotspot_version
index f2c98d1..94de662 100644
--- a/hotspot/make/hotspot_version
+++ b/hotspot/make/hotspot_version
@@ -35,7 +35,7 @@
 
 HS_MAJOR_VER=25
 HS_MINOR_VER=0
-HS_BUILD_NUMBER=61
+HS_BUILD_NUMBER=62
 
 JDK_MAJOR_VER=1
 JDK_MINOR_VER=8
diff --git a/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp b/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp
index 392b7f5..84aff34 100644
--- a/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp
@@ -89,6 +89,27 @@
   _supports_cx8 = has_v9();
   _supports_atomic_getset4 = true; // swap instruction
 
+  // There are Fujitsu Sparc64 CPUs which support blk_init as well so
+  // we have to take this check out of the 'is_niagara()' block below.
+  if (has_blk_init()) {
+    // When using CMS or G1, we cannot use memset() in BOT updates
+    // because the sun4v/CMT version in libc_psr uses BIS which
+    // exposes "phantom zeros" to concurrent readers. See 6948537.
+    if (FLAG_IS_DEFAULT(UseMemSetInBOT) && (UseConcMarkSweepGC || UseG1GC)) {
+      FLAG_SET_DEFAULT(UseMemSetInBOT, false);
+    }
+    // Issue a stern warning if the user has explicitly set
+    // UseMemSetInBOT (it is known to cause issues), but allow
+    // use for experimentation and debugging.
+    if (UseConcMarkSweepGC || UseG1GC) {
+      if (UseMemSetInBOT) {
+        assert(!FLAG_IS_DEFAULT(UseMemSetInBOT), "Error");
+        warning("Experimental flag -XX:+UseMemSetInBOT is known to cause instability"
+                " on sun4v; please understand that you are using at your own risk!");
+      }
+    }
+  }
+
   if (is_niagara()) {
     // Indirect branch is the same cost as direct
     if (FLAG_IS_DEFAULT(UseInlineCaches)) {
@@ -98,12 +119,6 @@
     if (FLAG_IS_DEFAULT(OptoLoopAlignment)) {
       FLAG_SET_DEFAULT(OptoLoopAlignment, 4);
     }
-    // When using CMS or G1, we cannot use memset() in BOT updates
-    // because the sun4v/CMT version in libc_psr uses BIS which
-    // exposes "phantom zeros" to concurrent readers. See 6948537.
-    if (FLAG_IS_DEFAULT(UseMemSetInBOT) && (UseConcMarkSweepGC || UseG1GC)) {
-      FLAG_SET_DEFAULT(UseMemSetInBOT, false);
-    }
 #ifdef _LP64
     // 32-bit oops don't make sense for the 64-bit VM on sparc
     // since the 32-bit VM has the same registers and smaller objects.
diff --git a/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp b/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp
index f4cc8bf..c8faa78 100644
--- a/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp
@@ -94,7 +94,13 @@
   static bool is_M_family(int features) { return (features & M_family_m) != 0; }
   static bool is_T_family(int features) { return (features & T_family_m) != 0; }
   static bool is_niagara() { return is_T_family(_features); }
-  DEBUG_ONLY( static bool is_niagara(int features)  { return (features & sun4v_m) != 0; } )
+#ifdef ASSERT
+  static bool is_niagara(int features)  {
+    // 'sun4v_m' may be defined on both Sun/Oracle Sparc CPUs as well as
+    // on Fujitsu Sparc64 CPUs, but only Sun/Oracle Sparcs can be 'niagaras'.
+    return (features & sun4v_m) != 0 && (features & sparc64_family_m) == 0;
+  }
+#endif
 
   // Returns true if it is niagara1 (T1).
   static bool is_T1_model(int features) { return is_T_family(features) && ((features & T1_model_m) != 0); }
diff --git a/hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp b/hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp
index f2210f0..2f562bb 100644
--- a/hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp
@@ -1719,10 +1719,12 @@
 
         BarrierSet* bs = Universe::heap()->barrier_set();
         CardTableModRefBS* ct = (CardTableModRefBS*)bs;
+        assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust this code");
+
         Label done;
         Label runtime;
 
-        // At this point we know new_value is non-NULL and the new_value crosses regsion.
+        // At this point we know new_value is non-NULL and the new_value crosses regions.
         // Must check to see if card is already dirty
 
         const Register thread = NOT_LP64(rax) LP64_ONLY(r15_thread);
@@ -1735,26 +1737,17 @@
         __ push(rax);
         __ push(rcx);
 
-        NOT_LP64(__ get_thread(thread);)
-        ExternalAddress cardtable((address)ct->byte_map_base);
-        assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust this code");
-
+        const Register cardtable = rax;
         const Register card_addr = rcx;
-#ifdef _LP64
-        const Register tmp = rscratch1;
-        f.load_argument(0, card_addr);
-        __ shrq(card_addr, CardTableModRefBS::card_shift);
-        __ lea(tmp, cardtable);
-        // get the address of the card
-        __ addq(card_addr, tmp);
-#else
-        const Register card_index = rcx;
-        f.load_argument(0, card_index);
-        __ shrl(card_index, CardTableModRefBS::card_shift);
 
-        Address index(noreg, card_index, Address::times_1);
-        __ leal(card_addr, __ as_Address(ArrayAddress(cardtable, index)));
-#endif
+        f.load_argument(0, card_addr);
+        __ shrptr(card_addr, CardTableModRefBS::card_shift);
+        // Do not use ExternalAddress to load 'byte_map_base', since 'byte_map_base' is NOT
+        // a valid address and therefore is not properly handled by the relocation code.
+        __ movptr(cardtable, (intptr_t)ct->byte_map_base);
+        __ addptr(card_addr, cardtable);
+
+        NOT_LP64(__ get_thread(thread);)
 
         __ cmpb(Address(card_addr, 0), (int)G1SATBCardTableModRefBS::g1_young_card_val());
         __ jcc(Assembler::equal, done);
diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp
index 5059a38..b4797bf 100644
--- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp
@@ -3354,6 +3354,8 @@
 
   BarrierSet* bs = Universe::heap()->barrier_set();
   CardTableModRefBS* ct = (CardTableModRefBS*)bs;
+  assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust this code");
+
   Label done;
   Label runtime;
 
@@ -3371,28 +3373,16 @@
 
   // storing region crossing non-NULL, is card already dirty?
 
-  ExternalAddress cardtable((address) ct->byte_map_base);
-  assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust this code");
-#ifdef _LP64
   const Register card_addr = tmp;
+  const Register cardtable = tmp2;
 
-  movq(card_addr, store_addr);
-  shrq(card_addr, CardTableModRefBS::card_shift);
+  movptr(card_addr, store_addr);
+  shrptr(card_addr, CardTableModRefBS::card_shift);
+  // Do not use ExternalAddress to load 'byte_map_base', since 'byte_map_base' is NOT
+  // a valid address and therefore is not properly handled by the relocation code.
+  movptr(cardtable, (intptr_t)ct->byte_map_base);
+  addptr(card_addr, cardtable);
 
-  lea(tmp2, cardtable);
-
-  // get the address of the card
-  addq(card_addr, tmp2);
-#else
-  const Register card_index = tmp;
-
-  movl(card_index, store_addr);
-  shrl(card_index, CardTableModRefBS::card_shift);
-
-  Address index(noreg, card_index, Address::times_1);
-  const Register card_addr = tmp;
-  lea(card_addr, as_Address(ArrayAddress(cardtable, index)));
-#endif
   cmpb(Address(card_addr, 0), (int)G1SATBCardTableModRefBS::g1_young_card_val());
   jcc(Assembler::equal, done);
 
@@ -3416,7 +3406,7 @@
   movq(Address(tmp2, 0), card_addr);
 #else
   addl(tmp2, queue_index);
-  movl(Address(tmp2, 0), card_index);
+  movl(Address(tmp2, 0), card_addr);
 #endif
   jmp(done);
 
@@ -3468,25 +3458,19 @@
 
   // The calculation for byte_map_base is as follows:
   // byte_map_base = _byte_map - (uintptr_t(low_bound) >> card_shift);
-  // So this essentially converts an address to a displacement and
-  // it will never need to be relocated. On 64bit however the value may be too
-  // large for a 32bit displacement
-
+  // So this essentially converts an address to a displacement and it will
+  // never need to be relocated. On 64bit however the value may be too
+  // large for a 32bit displacement.
   intptr_t disp = (intptr_t) ct->byte_map_base;
   if (is_simm32(disp)) {
     Address cardtable(noreg, obj, Address::times_1, disp);
     movb(cardtable, 0);
   } else {
-    // By doing it as an ExternalAddress disp could be converted to a rip-relative
-    // displacement and done in a single instruction given favorable mapping and
-    // a smarter version of as_Address. Worst case it is two instructions which
-    // is no worse off then loading disp into a register and doing as a simple
-    // Address() as above.
-    // We can't do as ExternalAddress as the only style since if disp == 0 we'll
-    // assert since NULL isn't acceptable in a reloci (see 6644928). In any case
-    // in some cases we'll get a single instruction version.
-
-    ExternalAddress cardtable((address)disp);
+    // By doing it as an ExternalAddress 'disp' could be converted to a rip-relative
+    // displacement and done in a single instruction given favorable mapping and a
+    // smarter version of as_Address. However, 'ExternalAddress' generates a relocation
+    // entry and that entry is not properly handled by the relocation code.
+    AddressLiteral cardtable((address)ct->byte_map_base, relocInfo::none);
     Address index(noreg, obj, Address::times_1);
     movb(as_Address(ArrayAddress(cardtable, index)), 0);
   }
diff --git a/hotspot/src/share/vm/classfile/defaultMethods.cpp b/hotspot/src/share/vm/classfile/defaultMethods.cpp
index 619856d..129eecb 100644
--- a/hotspot/src/share/vm/classfile/defaultMethods.cpp
+++ b/hotspot/src/share/vm/classfile/defaultMethods.cpp
@@ -625,13 +625,13 @@
   while (super != NULL) {
     for (int i = 0; i < super->methods()->length(); ++i) {
       Method* m = super->methods()->at(i);
-      if (m->is_overpass()) {
+      if (m->is_overpass() || m->is_static()) {
         // m is a method that would have been a miranda if not for the
         // default method processing that occurred on behalf of our superclass,
         // so it's a method we want to re-examine in this new context.  That is,
         // unless we have a real implementation of it in the current class.
         Method* impl = klass->lookup_method(m->name(), m->signature());
-        if (impl == NULL || impl->is_overpass()) {
+        if (impl == NULL || impl->is_overpass() || impl->is_static()) {
           if (!already_in_vtable_slots(slots, m)) {
             slots->append(new EmptyVtableSlot(m));
           }
@@ -648,7 +648,7 @@
         // so it's a method we want to re-examine in this new context.  That is,
         // unless we have a real implementation of it in the current class.
         Method* impl = klass->lookup_method(m->name(), m->signature());
-        if (impl == NULL || impl->is_overpass()) {
+        if (impl == NULL || impl->is_overpass() || impl->is_static()) {
           if (!already_in_vtable_slots(slots, m)) {
             slots->append(new EmptyVtableSlot(m));
           }
diff --git a/hotspot/src/share/vm/gc_implementation/shared/markSweep.cpp b/hotspot/src/share/vm/gc_implementation/shared/markSweep.cpp
index 7bdcd55..1bc3ea4 100644
--- a/hotspot/src/share/vm/gc_implementation/shared/markSweep.cpp
+++ b/hotspot/src/share/vm/gc_implementation/shared/markSweep.cpp
@@ -66,29 +66,10 @@
   klass->oops_do(&MarkSweep::adjust_pointer_closure);
 }
 
-void MarkSweep::follow_klass(Klass* klass) {
-  ClassLoaderData* cld = klass->class_loader_data();
-  // The actual processing of the klass is done when we
-  // traverse the list of Klasses in the class loader data.
-  MarkSweep::follow_class_loader(cld);
-}
-
-void MarkSweep::adjust_klass(Klass* klass) {
-  ClassLoaderData* cld = klass->class_loader_data();
-  // The actual processing of the klass is done when we
-  // traverse the list of Klasses in the class loader data.
-  MarkSweep::adjust_class_loader(cld);
-}
-
 void MarkSweep::follow_class_loader(ClassLoaderData* cld) {
   cld->oops_do(&MarkSweep::mark_and_push_closure, &MarkSweep::follow_klass_closure, true);
 }
 
-void MarkSweep::adjust_class_loader(ClassLoaderData* cld) {
-  cld->oops_do(&MarkSweep::adjust_pointer_closure, &MarkSweep::adjust_klass_closure, true);
-}
-
-
 void MarkSweep::follow_stack() {
   do {
     while (!_marking_stack.is_empty()) {
diff --git a/hotspot/src/share/vm/gc_implementation/shared/markSweep.hpp b/hotspot/src/share/vm/gc_implementation/shared/markSweep.hpp
index 2c08a68..38fc8e7 100644
--- a/hotspot/src/share/vm/gc_implementation/shared/markSweep.hpp
+++ b/hotspot/src/share/vm/gc_implementation/shared/markSweep.hpp
@@ -172,10 +172,8 @@
   static void follow_stack();   // Empty marking stack.
 
   static void follow_klass(Klass* klass);
-  static void adjust_klass(Klass* klass);
 
   static void follow_class_loader(ClassLoaderData* cld);
-  static void adjust_class_loader(ClassLoaderData* cld);
 
   static void preserve_mark(oop p, markOop mark);
                                 // Save the mark word so it can be restored later
diff --git a/hotspot/src/share/vm/gc_implementation/shared/markSweep.inline.hpp b/hotspot/src/share/vm/gc_implementation/shared/markSweep.inline.hpp
index 8ffe0f7..e70e3af 100644
--- a/hotspot/src/share/vm/gc_implementation/shared/markSweep.inline.hpp
+++ b/hotspot/src/share/vm/gc_implementation/shared/markSweep.inline.hpp
@@ -44,6 +44,11 @@
   }
 }
 
+inline void MarkSweep::follow_klass(Klass* klass) {
+  oop op = klass->klass_holder();
+  MarkSweep::mark_and_push(&op);
+}
+
 template <class T> inline void MarkSweep::follow_root(T* p) {
   assert(!Universe::heap()->is_in_reserved(p),
          "roots shouldn't be things within the heap");
diff --git a/hotspot/src/share/vm/interpreter/linkResolver.cpp b/hotspot/src/share/vm/interpreter/linkResolver.cpp
index da5a1e7..573ccc1 100644
--- a/hotspot/src/share/vm/interpreter/linkResolver.cpp
+++ b/hotspot/src/share/vm/interpreter/linkResolver.cpp
@@ -242,7 +242,7 @@
 
 // Look up method in klasses, including static methods
 // Then look up local default methods
-void LinkResolver::lookup_method_in_klasses(methodHandle& result, KlassHandle klass, Symbol* name, Symbol* signature, TRAPS) {
+void LinkResolver::lookup_method_in_klasses(methodHandle& result, KlassHandle klass, Symbol* name, Symbol* signature, bool checkpolymorphism, TRAPS) {
   Method* result_oop = klass->uncached_lookup_method(name, signature);
   if (result_oop == NULL) {
     Array<Method*>* default_methods = InstanceKlass::cast(klass())->default_methods();
@@ -251,7 +251,7 @@
     }
   }
 
-  if (EnableInvokeDynamic && result_oop != NULL) {
+  if (checkpolymorphism && EnableInvokeDynamic && result_oop != NULL) {
     vmIntrinsics::ID iid = result_oop->intrinsic_id();
     if (MethodHandles::is_signature_polymorphic(iid)) {
       // Do not link directly to these.  The VM must produce a synthetic one using lookup_polymorphic_method.
@@ -267,8 +267,8 @@
   Method* result_oop = klass->uncached_lookup_method(name, signature);
   result = methodHandle(THREAD, result_oop);
   while (!result.is_null() && result->is_static() && result->method_holder()->super() != NULL) {
-    klass = KlassHandle(THREAD, result->method_holder()->super());
-    result = methodHandle(THREAD, klass->uncached_lookup_method(name, signature));
+    KlassHandle super_klass = KlassHandle(THREAD, result->method_holder()->super());
+    result = methodHandle(THREAD, super_klass->uncached_lookup_method(name, signature));
   }
 
   if (result.is_null()) {
@@ -503,11 +503,14 @@
   }
 
   if (code == Bytecodes::_invokeinterface) {
-    resolve_interface_method(resolved_method, resolved_klass, method_name, method_signature, current_klass, true, CHECK);
+    resolve_interface_method(resolved_method, resolved_klass, method_name, method_signature, current_klass, true, true, CHECK);
   } else if (code == Bytecodes::_invokevirtual) {
     resolve_method(resolved_method, resolved_klass, method_name, method_signature, current_klass, true, true, CHECK);
-  } else {
+  } else if (!resolved_klass->is_interface()) {
     resolve_method(resolved_method, resolved_klass, method_name, method_signature, current_klass, true, false, CHECK);
+  } else {
+    bool nostatics = (code == Bytecodes::_invokestatic) ? false : true;
+    resolve_interface_method(resolved_method, resolved_klass, method_name, method_signature, current_klass, true, nostatics, CHECK);
   }
 }
 
@@ -528,7 +531,7 @@
   }
 
   // 2. lookup method in resolved klass and its super klasses
-  lookup_method_in_klasses(resolved_method, resolved_klass, method_name, method_signature, CHECK);
+  lookup_method_in_klasses(resolved_method, resolved_klass, method_name, method_signature, true, CHECK);
 
   if (resolved_method.is_null()) { // not found in the class hierarchy
     // 3. lookup method in all the interfaces implemented by the resolved klass
@@ -612,7 +615,8 @@
                                             Symbol* method_name,
                                             Symbol* method_signature,
                                             KlassHandle current_klass,
-                                            bool check_access, TRAPS) {
+                                            bool check_access,
+                                            bool nostatics, TRAPS) {
 
  // check if klass is interface
   if (!resolved_klass->is_interface()) {
@@ -623,7 +627,8 @@
   }
 
   // lookup method in this interface or its super, java.lang.Object
-  lookup_instance_method_in_klasses(resolved_method, resolved_klass, method_name, method_signature, CHECK);
+  // JDK8: also look for static methods
+  lookup_method_in_klasses(resolved_method, resolved_klass, method_name, method_signature, false, CHECK);
 
   if (resolved_method.is_null()) {
     // lookup method in all the super-interfaces
@@ -638,6 +643,16 @@
     }
   }
 
+  if (nostatics && resolved_method->is_static()) {
+    ResourceMark rm(THREAD);
+    char buf[200];
+    jio_snprintf(buf, sizeof(buf), "Expected instance not static method %s", Method::name_and_sig_as_C_string(resolved_klass(),
+                                                      resolved_method->name(),
+                                                      resolved_method->signature()));
+    THROW_MSG(vmSymbols::java_lang_IncompatibleClassChangeError(), buf);
+  }
+
+
   if (check_access) {
     // JDK8 adds non-public interface methods, and accessability check requirement
     assert(current_klass.not_null() , "current_klass should not be null");
@@ -864,7 +879,11 @@
                                                   Symbol* method_name, Symbol* method_signature,
                                                   KlassHandle current_klass, bool check_access, TRAPS) {
 
-  resolve_method(resolved_method, resolved_klass, method_name, method_signature, current_klass, check_access, false, CHECK);
+  if (!resolved_klass->is_interface()) {
+    resolve_method(resolved_method, resolved_klass, method_name, method_signature, current_klass, check_access, false, CHECK);
+  } else {
+    resolve_interface_method(resolved_method, resolved_klass, method_name, method_signature, current_klass, check_access, false, CHECK);
+  }
   assert(resolved_method->name() != vmSymbols::class_initializer_name(), "should have been checked in verifier");
 
   // check if static
@@ -898,7 +917,11 @@
   // and the selected method is recalculated relative to the direct superclass
   // superinterface.method, which explicitly does not check shadowing
 
-  resolve_method(resolved_method, resolved_klass, method_name, method_signature, current_klass, check_access, false, CHECK);
+  if (!resolved_klass->is_interface()) {
+    resolve_method(resolved_method, resolved_klass, method_name, method_signature, current_klass, check_access, false, CHECK);
+  } else {
+    resolve_interface_method(resolved_method, resolved_klass, method_name, method_signature, current_klass, check_access, true, CHECK);
+  }
 
   // check if method name is <init>, that it is found in same klass as static type
   if (resolved_method->name() == vmSymbols::object_initializer_name() &&
@@ -1219,7 +1242,7 @@
 void LinkResolver::linktime_resolve_interface_method(methodHandle& resolved_method, KlassHandle resolved_klass, Symbol* method_name,
                                                      Symbol* method_signature, KlassHandle current_klass, bool check_access, TRAPS) {
   // normal interface method resolution
-  resolve_interface_method(resolved_method, resolved_klass, method_name, method_signature, current_klass, check_access, CHECK);
+  resolve_interface_method(resolved_method, resolved_klass, method_name, method_signature, current_klass, check_access, true, CHECK);
 
   assert(resolved_method->name() != vmSymbols::object_initializer_name(), "should have been checked in verifier");
   assert(resolved_method->name() != vmSymbols::class_initializer_name (), "should have been checked in verifier");
diff --git a/hotspot/src/share/vm/interpreter/linkResolver.hpp b/hotspot/src/share/vm/interpreter/linkResolver.hpp
index 1411d90..4b13de8 100644
--- a/hotspot/src/share/vm/interpreter/linkResolver.hpp
+++ b/hotspot/src/share/vm/interpreter/linkResolver.hpp
@@ -124,7 +124,7 @@
   friend class klassItable;
 
  private:
-  static void lookup_method_in_klasses          (methodHandle& result, KlassHandle klass, Symbol* name, Symbol* signature, TRAPS);
+  static void lookup_method_in_klasses          (methodHandle& result, KlassHandle klass, Symbol* name, Symbol* signature, bool checkpolymorphism, TRAPS);
   static void lookup_instance_method_in_klasses (methodHandle& result, KlassHandle klass, Symbol* name, Symbol* signature, TRAPS);
   static void lookup_method_in_interfaces       (methodHandle& result, KlassHandle klass, Symbol* name, Symbol* signature, TRAPS);
   static void lookup_polymorphic_method         (methodHandle& result, KlassHandle klass, Symbol* name, Symbol* signature,
@@ -134,7 +134,7 @@
 
   static void resolve_pool  (KlassHandle& resolved_klass, Symbol*& method_name, Symbol*& method_signature, KlassHandle& current_klass, constantPoolHandle pool, int index, TRAPS);
 
-  static void resolve_interface_method(methodHandle& resolved_method, KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass, bool check_access, TRAPS);
+  static void resolve_interface_method(methodHandle& resolved_method, KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass, bool check_access, bool nostatics, TRAPS);
   static void resolve_method          (methodHandle& resolved_method, KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass, bool check_access, bool require_methodref, TRAPS);
 
   static void linktime_resolve_static_method    (methodHandle& resolved_method, KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass, bool check_access, TRAPS);
diff --git a/hotspot/src/share/vm/oops/instanceKlass.cpp b/hotspot/src/share/vm/oops/instanceKlass.cpp
index 5077f12..77be530 100644
--- a/hotspot/src/share/vm/oops/instanceKlass.cpp
+++ b/hotspot/src/share/vm/oops/instanceKlass.cpp
@@ -1427,6 +1427,17 @@
   return InstanceKlass::find_method(methods(), name, signature);
 }
 
+// find_instance_method looks up the name/signature in the local methods array
+// and skips over static methods
+Method* InstanceKlass::find_instance_method(
+    Array<Method*>* methods, Symbol* name, Symbol* signature) {
+  Method* meth = InstanceKlass::find_method(methods, name, signature);
+  if (meth != NULL && meth->is_static()) {
+      meth = NULL;
+  }
+  return meth;
+}
+
 // find_method looks up the name/signature in the local methods array
 Method* InstanceKlass::find_method(
     Array<Method*>* methods, Symbol* name, Symbol* signature) {
@@ -2169,7 +2180,6 @@
     obj, \
     MarkSweep::adjust_pointer(p), \
     assert_is_in)
-  MarkSweep::adjust_klass(obj->klass());
   return size;
 }
 
diff --git a/hotspot/src/share/vm/oops/instanceKlass.hpp b/hotspot/src/share/vm/oops/instanceKlass.hpp
index c667f2c..84cc004 100644
--- a/hotspot/src/share/vm/oops/instanceKlass.hpp
+++ b/hotspot/src/share/vm/oops/instanceKlass.hpp
@@ -515,6 +515,7 @@
   // find a local method (returns NULL if not found)
   Method* find_method(Symbol* name, Symbol* signature) const;
   static Method* find_method(Array<Method*>* methods, Symbol* name, Symbol* signature);
+  static Method* find_instance_method(Array<Method*>* methods, Symbol* name, Symbol* signature);
 
   // find a local method index in default_methods (returns -1 if not found)
   static int find_method_index(Array<Method*>* methods, Symbol* name, Symbol* signature);
diff --git a/hotspot/src/share/vm/oops/instanceMirrorKlass.cpp b/hotspot/src/share/vm/oops/instanceMirrorKlass.cpp
index 3eabba7..8256332 100644
--- a/hotspot/src/share/vm/oops/instanceMirrorKlass.cpp
+++ b/hotspot/src/share/vm/oops/instanceMirrorKlass.cpp
@@ -155,7 +155,13 @@
   // Follow the klass field in the mirror.
   Klass* klass = java_lang_Class::as_Klass(obj);
   if (klass != NULL) {
-    MarkSweep::follow_klass(klass);
+    // For anonymous classes we need to handle the class loader data,
+    // otherwise it won't be claimed and can be unloaded.
+    if (klass->oop_is_instance() && InstanceKlass::cast(klass)->is_anonymous()) {
+      MarkSweep::follow_class_loader(klass->class_loader_data());
+    } else {
+      MarkSweep::follow_klass(klass);
+    }
   } else {
     // If klass is NULL then this a mirror for a primitive type.
     // We don't have to follow them, since they are handled as strong
@@ -196,17 +202,6 @@
   int size = oop_size(obj);
   InstanceKlass::oop_adjust_pointers(obj);
 
-  // Follow the klass field in the mirror.
-  Klass* klass = java_lang_Class::as_Klass(obj);
-  if (klass != NULL) {
-    MarkSweep::adjust_klass(klass);
-  } else {
-    // If klass is NULL then this a mirror for a primitive type.
-    // We don't have to follow them, since they are handled as strong
-    // roots in Universe::oops_do.
-    assert(java_lang_Class::is_primitive(obj), "Sanity check");
-  }
-
   InstanceMirrorKlass_OOP_ITERATE(                                                    \
     start_of_static_fields(obj), java_lang_Class::static_oop_field_count(obj),        \
     MarkSweep::adjust_pointer(p),                                                     \
diff --git a/hotspot/src/share/vm/oops/klassVtable.cpp b/hotspot/src/share/vm/oops/klassVtable.cpp
index 1399a41..509c788 100644
--- a/hotspot/src/share/vm/oops/klassVtable.cpp
+++ b/hotspot/src/share/vm/oops/klassVtable.cpp
@@ -665,6 +665,11 @@
 
 // check if a method is a miranda method, given a class's methods table,
 // its default_method table  and its super
+// Miranda methods are calculated twice:
+// first: before vtable size calculation: including abstract and default
+// This is seen by default method creation
+// Second: recalculated during vtable initialization: only abstract
+// This is seen by link resolution and selection.
 // "miranda" means not static, not defined by this class.
 // private methods in interfaces do not belong in the miranda list.
 // the caller must make sure that the method belongs to an interface implemented by the class
@@ -678,7 +683,8 @@
   }
   Symbol* name = m->name();
   Symbol* signature = m->signature();
-  if (InstanceKlass::find_method(class_methods, name, signature) == NULL) {
+
+  if (InstanceKlass::find_instance_method(class_methods, name, signature) == NULL) {
     // did not find it in the method table of the current class
     if ((default_methods == NULL) ||
         InstanceKlass::find_method(default_methods, name, signature) == NULL) {
@@ -688,6 +694,12 @@
       }
 
       Method* mo = InstanceKlass::cast(super)->lookup_method(name, signature);
+      while (mo != NULL && mo->access_flags().is_static()
+             && mo->method_holder() != NULL
+             && mo->method_holder()->super() != NULL)
+      {
+         mo = mo->method_holder()->super()->uncached_lookup_method(name, signature);
+      }
       if (mo == NULL || mo->access_flags().is_private() ) {
         // super class hierarchy does not implement it or protection is different
         return true;
diff --git a/hotspot/src/share/vm/oops/objArrayKlass.cpp b/hotspot/src/share/vm/oops/objArrayKlass.cpp
index f2f3491..94c990a 100644
--- a/hotspot/src/share/vm/oops/objArrayKlass.cpp
+++ b/hotspot/src/share/vm/oops/objArrayKlass.cpp
@@ -569,7 +569,6 @@
   // Get size before changing pointers.
   // Don't call size() or oop_size() since that is a virtual call.
   int size = a->object_size();
-  MarkSweep::adjust_klass(a->klass());
   ObjArrayKlass_OOP_ITERATE(a, p, MarkSweep::adjust_pointer(p))
   return size;
 }
diff --git a/hotspot/src/share/vm/opto/c2_globals.hpp b/hotspot/src/share/vm/opto/c2_globals.hpp
index d1c4b2c..207daab 100644
--- a/hotspot/src/share/vm/opto/c2_globals.hpp
+++ b/hotspot/src/share/vm/opto/c2_globals.hpp
@@ -637,7 +637,7 @@
   diagnostic(bool, OptimizeExpensiveOps, true,                              \
           "Find best control for expensive operations")                     \
                                                                             \
-  product(bool, UseMathExactIntrinsics, true,                               \
+  experimental(bool, UseMathExactIntrinsics, false,                         \
           "Enables intrinsification of various java.lang.Math functions")   \
                                                                             \
   experimental(bool, ReplaceInParentMaps, false,                            \
diff --git a/hotspot/src/share/vm/prims/jvmtiEnvThreadState.cpp b/hotspot/src/share/vm/prims/jvmtiEnvThreadState.cpp
index 0f0eed6..5bdec52 100644
--- a/hotspot/src/share/vm/prims/jvmtiEnvThreadState.cpp
+++ b/hotspot/src/share/vm/prims/jvmtiEnvThreadState.cpp
@@ -269,11 +269,20 @@
   void doit() {
     ResourceMark rmark; // _thread != Thread::current()
     RegisterMap rm(_thread, false);
-    javaVFrame* vf = _thread->last_java_vframe(&rm);
-    assert(vf != NULL, "must have last java frame");
-    Method* method = vf->method();
-    _method_id = method->jmethod_id();
-    _bci = vf->bci();
+    // There can be a race condition between a VM_Operation reaching a safepoint
+    // and the target thread exiting from Java execution.
+    // We must recheck the last Java frame still exists.
+    if (_thread->has_last_Java_frame()) {
+      javaVFrame* vf = _thread->last_java_vframe(&rm);
+      assert(vf != NULL, "must have last java frame");
+      Method* method = vf->method();
+      _method_id = method->jmethod_id();
+      _bci = vf->bci();
+    } else {
+      // Clear current location as the target thread has no Java frames anymore.
+      _method_id = (jmethodID)NULL;
+      _bci = 0;
+    }
   }
   void get_current_location(jmethodID *method_id, int *bci) {
     *method_id = _method_id;
diff --git a/hotspot/src/share/vm/prims/jvmtiImpl.hpp b/hotspot/src/share/vm/prims/jvmtiImpl.hpp
index fc502c7..c1e4b81 100644
--- a/hotspot/src/share/vm/prims/jvmtiImpl.hpp
+++ b/hotspot/src/share/vm/prims/jvmtiImpl.hpp
@@ -299,7 +299,7 @@
   static inline bool is_breakpoint(address bcp);
 
   static void oops_do(OopClosure* f);
-  static void metadata_do(void f(Metadata*));
+  static void metadata_do(void f(Metadata*)) NOT_JVMTI_RETURN;
   static void gc_epilogue();
 };
 
diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp
index 51fb3f7..5a8ea0d 100644
--- a/hotspot/src/share/vm/runtime/arguments.cpp
+++ b/hotspot/src/share/vm/runtime/arguments.cpp
@@ -2278,18 +2278,6 @@
   status = status && verify_percentage(MarkSweepDeadRatio, "MarkSweepDeadRatio");
 
   status = status && verify_min_value(MarkSweepAlwaysCompactCount, 1, "MarkSweepAlwaysCompactCount");
-#ifdef SPARC
-  if (UseConcMarkSweepGC || UseG1GC) {
-    // Issue a stern warning if the user has explicitly set
-    // UseMemSetInBOT (it is known to cause issues), but allow
-    // use for experimentation and debugging.
-    if (VM_Version::is_sun4v() && UseMemSetInBOT) {
-      assert(!FLAG_IS_DEFAULT(UseMemSetInBOT), "Error");
-      warning("Experimental flag -XX:+UseMemSetInBOT is known to cause instability"
-          " on sun4v; please understand that you are using at your own risk!");
-    }
-  }
-#endif // SPARC
 
   if (PrintNMTStatistics) {
 #if INCLUDE_NMT
diff --git a/hotspot/test/TEST.groups b/hotspot/test/TEST.groups
index 18fb1d9..ee67fe9 100644
--- a/hotspot/test/TEST.groups
+++ b/hotspot/test/TEST.groups
@@ -70,7 +70,6 @@
   runtime/7107135/Test7107135.sh \
   runtime/7158988/FieldMonitor.java \
   runtime/7194254/Test7194254.java \
-  runtime/8026365/InvokeSpecialAnonTest.java \
   runtime/jsig/Test8017498.sh \
   runtime/Metaspace/FragmentMetaspace.java \
   runtime/NMT/BaselineWithParameter.java \
diff --git a/hotspot/test/compiler/intrinsics/mathexact/AddExactICondTest.java b/hotspot/test/compiler/intrinsics/mathexact/AddExactICondTest.java
index 8862160..f0835cd 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/AddExactICondTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/AddExactICondTest.java
@@ -26,7 +26,7 @@
  * @bug 8024924
  * @summary Test non constant addExact
  * @compile AddExactICondTest.java
- * @run main AddExactICondTest
+ * @run main AddExactICondTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
  *
  */
 
diff --git a/hotspot/test/compiler/intrinsics/mathexact/AddExactIConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/AddExactIConstantTest.java
index 77000a1..ed85254 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/AddExactIConstantTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/AddExactIConstantTest.java
@@ -26,7 +26,7 @@
  * @bug 8024924
  * @summary Test constant addExact
  * @compile AddExactIConstantTest.java Verify.java
- * @run main AddExactIConstantTest
+ * @run main AddExactIConstantTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
  *
  */
 
diff --git a/hotspot/test/compiler/intrinsics/mathexact/AddExactILoadTest.java b/hotspot/test/compiler/intrinsics/mathexact/AddExactILoadTest.java
index 2d96bb8..4175a8a 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/AddExactILoadTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/AddExactILoadTest.java
@@ -26,7 +26,7 @@
  * @bug 8024924
  * @summary Test non constant addExact
  * @compile AddExactILoadTest.java Verify.java
- * @run main AddExactILoadTest
+ * @run main AddExactILoadTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
  *
  */
 
diff --git a/hotspot/test/compiler/intrinsics/mathexact/AddExactILoopDependentTest.java b/hotspot/test/compiler/intrinsics/mathexact/AddExactILoopDependentTest.java
index 99aae0d..56da9f4 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/AddExactILoopDependentTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/AddExactILoopDependentTest.java
@@ -26,7 +26,7 @@
  * @bug 8024924
  * @summary Test non constant addExact
  * @compile AddExactILoopDependentTest.java Verify.java
- * @run main AddExactILoopDependentTest
+ * @run main AddExactILoopDependentTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
  *
  */
 
diff --git a/hotspot/test/compiler/intrinsics/mathexact/AddExactINonConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/AddExactINonConstantTest.java
index b3a2475..52e208d 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/AddExactINonConstantTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/AddExactINonConstantTest.java
@@ -26,7 +26,7 @@
  * @bug 8024924
  * @summary Test non constant addExact
  * @compile AddExactINonConstantTest.java Verify.java
- * @run main AddExactINonConstantTest
+ * @run main AddExactINonConstantTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
  *
  */
 
diff --git a/hotspot/test/compiler/intrinsics/mathexact/AddExactIRepeatTest.java b/hotspot/test/compiler/intrinsics/mathexact/AddExactIRepeatTest.java
index d111b66..7bb1deb 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/AddExactIRepeatTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/AddExactIRepeatTest.java
@@ -26,7 +26,7 @@
  * @bug 8025657
  * @summary Test repeating addExact
  * @compile AddExactIRepeatTest.java Verify.java
- * @run main AddExactIRepeatTest
+ * @run main AddExactIRepeatTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
  *
  */
 
diff --git a/hotspot/test/compiler/intrinsics/mathexact/AddExactLConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/AddExactLConstantTest.java
index dc75140..3514ce2 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/AddExactLConstantTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/AddExactLConstantTest.java
@@ -26,7 +26,7 @@
  * @bug 8026844
  * @summary Test constant addExact
  * @compile AddExactLConstantTest.java Verify.java
- * @run main AddExactLConstantTest
+ * @run main AddExactLConstantTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
  *
  */
 
diff --git a/hotspot/test/compiler/intrinsics/mathexact/AddExactLNonConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/AddExactLNonConstantTest.java
index efd5fd7..3e16cb9 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/AddExactLNonConstantTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/AddExactLNonConstantTest.java
@@ -26,7 +26,7 @@
  * @bug 8026844
  * @summary Test non constant addExact
  * @compile AddExactLNonConstantTest.java Verify.java
- * @run main AddExactLNonConstantTest
+ * @run main AddExactLNonConstantTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
  *
  */
 
diff --git a/hotspot/test/compiler/intrinsics/mathexact/CompareTest.java b/hotspot/test/compiler/intrinsics/mathexact/CompareTest.java
index f6785c0..c77dd47 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/CompareTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/CompareTest.java
@@ -26,7 +26,7 @@
  * @bug 8026722
  * @summary Verify that the compare after addExact is a signed compare
  * @compile CompareTest.java
- * @run main CompareTest
+ * @run main CompareTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
  *
  */
 
diff --git a/hotspot/test/compiler/intrinsics/mathexact/DecExactITest.java b/hotspot/test/compiler/intrinsics/mathexact/DecExactITest.java
index 7e6e1ca..2712bed 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/DecExactITest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/DecExactITest.java
@@ -26,7 +26,7 @@
  * @bug 8026844
  * @summary Test decrementExact
  * @compile DecExactITest.java Verify.java
- * @run main DecExactITest
+ * @run main DecExactITest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
  *
  */
 
diff --git a/hotspot/test/compiler/intrinsics/mathexact/DecExactLTest.java b/hotspot/test/compiler/intrinsics/mathexact/DecExactLTest.java
index 7dca00b..ad83dca 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/DecExactLTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/DecExactLTest.java
@@ -25,8 +25,8 @@
  * @test
  * @bug 8026844
  * @summary Test decrementExact
- * @compile DecExactITest.java Verify.java
- * @run main DecExactITest
+ * @compile DecExactLTest.java Verify.java
+ * @run main DecExactLTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
  *
  */
 
diff --git a/hotspot/test/compiler/intrinsics/mathexact/GVNTest.java b/hotspot/test/compiler/intrinsics/mathexact/GVNTest.java
index 23fba15..864555e 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/GVNTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/GVNTest.java
@@ -26,7 +26,7 @@
  * @bug 8028207
  * @summary Verify that GVN doesn't mess up the two addExacts
  * @compile GVNTest.java
- * @run main GVNTest
+ * @run main GVNTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
  *
  */
 
diff --git a/hotspot/test/compiler/intrinsics/mathexact/IncExactITest.java b/hotspot/test/compiler/intrinsics/mathexact/IncExactITest.java
index 9f7ddbd..41ab825 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/IncExactITest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/IncExactITest.java
@@ -26,7 +26,7 @@
  * @bug 8026844
  * @summary Test incrementExact
  * @compile IncExactITest.java Verify.java
- * @run main IncExactITest
+ * @run main IncExactITest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
  *
  */
 
diff --git a/hotspot/test/compiler/intrinsics/mathexact/IncExactLTest.java b/hotspot/test/compiler/intrinsics/mathexact/IncExactLTest.java
index 755d819..6ece979 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/IncExactLTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/IncExactLTest.java
@@ -26,7 +26,7 @@
  * @bug 8026844
  * @summary Test incrementExact
  * @compile IncExactLTest.java Verify.java
- * @run main IncExactLTest
+ * @run main IncExactLTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
  *
  */
 
diff --git a/hotspot/test/compiler/intrinsics/mathexact/MulExactICondTest.java b/hotspot/test/compiler/intrinsics/mathexact/MulExactICondTest.java
index 5f3e1e6..e9bf6b9 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/MulExactICondTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/MulExactICondTest.java
@@ -26,7 +26,7 @@
  * @bug 8026844
  * @summary Test multiplyExact as condition
  * @compile MulExactICondTest.java
- * @run main MulExactICondTest
+ * @run main MulExactICondTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
  *
  */
 
diff --git a/hotspot/test/compiler/intrinsics/mathexact/MulExactIConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/MulExactIConstantTest.java
index 120bef5..6bb74d1 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/MulExactIConstantTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/MulExactIConstantTest.java
@@ -26,7 +26,7 @@
  * @bug 8026844
  * @summary Test constant multiplyExact
  * @compile MulExactIConstantTest.java Verify.java
- * @run main MulExactIConstantTest
+ * @run main MulExactIConstantTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
  *
  */
 
diff --git a/hotspot/test/compiler/intrinsics/mathexact/MulExactILoadTest.java b/hotspot/test/compiler/intrinsics/mathexact/MulExactILoadTest.java
index 36aa3d4..8878b6f 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/MulExactILoadTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/MulExactILoadTest.java
@@ -26,7 +26,7 @@
  * @bug 8026844
  * @summary Test multiplyExact
  * @compile MulExactILoadTest.java Verify.java
- * @run main MulExactILoadTest
+ * @run main MulExactILoadTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
  *
  */
 
diff --git a/hotspot/test/compiler/intrinsics/mathexact/MulExactILoopDependentTest.java b/hotspot/test/compiler/intrinsics/mathexact/MulExactILoopDependentTest.java
index 5ba4ad3..7c5c7e7 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/MulExactILoopDependentTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/MulExactILoopDependentTest.java
@@ -26,7 +26,7 @@
  * @bug 8026844
  * @summary Test loop dependent multiplyExact
  * @compile MulExactILoopDependentTest.java Verify.java
- * @run main MulExactILoopDependentTest
+ * @run main MulExactILoopDependentTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
  *
  */
 public class MulExactILoopDependentTest {
diff --git a/hotspot/test/compiler/intrinsics/mathexact/MulExactINonConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/MulExactINonConstantTest.java
index e108059..e924311 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/MulExactINonConstantTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/MulExactINonConstantTest.java
@@ -26,7 +26,7 @@
  * @bug 8026844
  * @summary Test non constant multiplyExact
  * @compile MulExactINonConstantTest.java Verify.java
- * @run main MulExactINonConstantTest
+ * @run main MulExactINonConstantTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
  *
  */
 
diff --git a/hotspot/test/compiler/intrinsics/mathexact/MulExactIRepeatTest.java b/hotspot/test/compiler/intrinsics/mathexact/MulExactIRepeatTest.java
index dd14ce21..5d5a93d 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/MulExactIRepeatTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/MulExactIRepeatTest.java
@@ -26,7 +26,7 @@
  * @bug 8026844
  * @summary Test repeating multiplyExact
  * @compile MulExactIRepeatTest.java Verify.java
- * @run main MulExactIRepeatTest
+ * @run main MulExactIRepeatTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
  *
  */
 
diff --git a/hotspot/test/compiler/intrinsics/mathexact/MulExactLConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/MulExactLConstantTest.java
index c687cc2..9668ddf 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/MulExactLConstantTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/MulExactLConstantTest.java
@@ -26,7 +26,7 @@
  * @bug 8026844
  * @summary Test constant mulExact
  * @compile MulExactLConstantTest.java Verify.java
- * @run main MulExactLConstantTest
+ * @run main MulExactLConstantTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
  *
  */
 
diff --git a/hotspot/test/compiler/intrinsics/mathexact/MulExactLNonConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/MulExactLNonConstantTest.java
index f9d82ed..3486588 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/MulExactLNonConstantTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/MulExactLNonConstantTest.java
@@ -26,7 +26,7 @@
  * @bug 8026844
  * @summary Test non constant mulExact
  * @compile MulExactLNonConstantTest.java Verify.java
- * @run main MulExactLNonConstantTest
+ * @run main MulExactLNonConstantTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
  *
  */
 
diff --git a/hotspot/test/compiler/intrinsics/mathexact/NegExactIConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/NegExactIConstantTest.java
index ba49d77..0a5e164 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/NegExactIConstantTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/NegExactIConstantTest.java
@@ -26,7 +26,7 @@
  * @bug 8026844
  * @summary Test constant negExact
  * @compile NegExactIConstantTest.java Verify.java
- * @run main NegExactIConstantTest
+ * @run main NegExactIConstantTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
  *
  */
 
diff --git a/hotspot/test/compiler/intrinsics/mathexact/NegExactILoadTest.java b/hotspot/test/compiler/intrinsics/mathexact/NegExactILoadTest.java
index 371f3ae..e789683 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/NegExactILoadTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/NegExactILoadTest.java
@@ -26,7 +26,7 @@
  * @bug 8026844
  * @summary Test negExact
  * @compile NegExactILoadTest.java Verify.java
- * @run main NegExactILoadTest
+ * @run main NegExactILoadTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
  *
  */
 
diff --git a/hotspot/test/compiler/intrinsics/mathexact/NegExactILoopDependentTest.java b/hotspot/test/compiler/intrinsics/mathexact/NegExactILoopDependentTest.java
index 882f80b..a18b0c1 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/NegExactILoopDependentTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/NegExactILoopDependentTest.java
@@ -26,7 +26,7 @@
  * @bug 8026844
  * @summary Test negExact loop dependent
  * @compile NegExactILoopDependentTest.java Verify.java
- * @run main NegExactILoopDependentTest
+ * @run main NegExactILoopDependentTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
  *
  */
 public class NegExactILoopDependentTest {
diff --git a/hotspot/test/compiler/intrinsics/mathexact/NegExactINonConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/NegExactINonConstantTest.java
index 6f044f0..ee87bd8 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/NegExactINonConstantTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/NegExactINonConstantTest.java
@@ -26,7 +26,7 @@
  * @bug 8026844
  * @summary Test non constant negExact
  * @compile NegExactINonConstantTest.java Verify.java
- * @run main NegExactINonConstantTest
+ * @run main NegExactINonConstantTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
  *
  */
 
diff --git a/hotspot/test/compiler/intrinsics/mathexact/NegExactLConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/NegExactLConstantTest.java
index 382cd5c..82e02a9 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/NegExactLConstantTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/NegExactLConstantTest.java
@@ -26,7 +26,7 @@
  * @bug 8026844
  * @summary Test constant negExact
  * @compile NegExactLConstantTest.java Verify.java
- * @run main NegExactLConstantTest
+ * @run main NegExactLConstantTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
  *
  */
 
diff --git a/hotspot/test/compiler/intrinsics/mathexact/NegExactLNonConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/NegExactLNonConstantTest.java
index 0bcad8b..b7b967d 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/NegExactLNonConstantTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/NegExactLNonConstantTest.java
@@ -26,7 +26,7 @@
  * @bug 8026844
  * @summary Test constant negExact
  * @compile NegExactLNonConstantTest.java Verify.java
- * @run main NegExactLNonConstantTest
+ * @run main NegExactLNonConstantTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
  *
  */
 
diff --git a/hotspot/test/compiler/intrinsics/mathexact/NestedMathExactTest.java b/hotspot/test/compiler/intrinsics/mathexact/NestedMathExactTest.java
index 211dc8b..883fcce 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/NestedMathExactTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/NestedMathExactTest.java
@@ -26,7 +26,7 @@
  * @bug 8027444
  * @summary Test nested loops
  * @compile NestedMathExactTest.java
- * @run main NestedMathExactTest
+ * @run main NestedMathExactTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
  *
  */
 
diff --git a/hotspot/test/compiler/intrinsics/mathexact/SplitThruPhiTest.java b/hotspot/test/compiler/intrinsics/mathexact/SplitThruPhiTest.java
index b3b0c0d..67f3afa 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/SplitThruPhiTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/SplitThruPhiTest.java
@@ -26,7 +26,7 @@
  * @bug 8028198
  * @summary Verify that split through phi does the right thing
  * @compile SplitThruPhiTest.java
- * @run main SplitThruPhiTest
+ * @run main SplitThruPhiTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
  *
  */
 
diff --git a/hotspot/test/compiler/intrinsics/mathexact/SubExactICondTest.java b/hotspot/test/compiler/intrinsics/mathexact/SubExactICondTest.java
index f539bdc..b4dd4f7 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/SubExactICondTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/SubExactICondTest.java
@@ -26,7 +26,7 @@
  * @bug 8026844
  * @summary Test subtractExact as condition
  * @compile SubExactICondTest.java Verify.java
- * @run main SubExactICondTest
+ * @run main SubExactICondTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
  *
  */
 
diff --git a/hotspot/test/compiler/intrinsics/mathexact/SubExactIConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/SubExactIConstantTest.java
index b450bd9..20a27ce 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/SubExactIConstantTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/SubExactIConstantTest.java
@@ -26,7 +26,7 @@
  * @bug 8026844
  * @summary Test constant subtractExact
  * @compile SubExactIConstantTest.java Verify.java
- * @run main SubExactIConstantTest
+ * @run main SubExactIConstantTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
  *
  */
 
diff --git a/hotspot/test/compiler/intrinsics/mathexact/SubExactILoadTest.java b/hotspot/test/compiler/intrinsics/mathexact/SubExactILoadTest.java
index af2ed01..5be582f 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/SubExactILoadTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/SubExactILoadTest.java
@@ -26,7 +26,7 @@
  * @bug 8026844
  * @summary Test non constant subtractExact
  * @compile SubExactILoadTest.java Verify.java
- * @run main SubExactILoadTest
+ * @run main SubExactILoadTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
  *
  */
 
diff --git a/hotspot/test/compiler/intrinsics/mathexact/SubExactILoopDependentTest.java b/hotspot/test/compiler/intrinsics/mathexact/SubExactILoopDependentTest.java
index 67ebcbc..b4e7b4a 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/SubExactILoopDependentTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/SubExactILoopDependentTest.java
@@ -26,7 +26,7 @@
  * @bug 8026844
  * @summary Test non constant subtractExact
  * @compile SubExactILoopDependentTest.java Verify.java
- * @run main SubExactILoopDependentTest
+ * @run main SubExactILoopDependentTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
  *
  */
 
diff --git a/hotspot/test/compiler/intrinsics/mathexact/SubExactINonConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/SubExactINonConstantTest.java
index b815381..82dc81c 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/SubExactINonConstantTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/SubExactINonConstantTest.java
@@ -26,7 +26,7 @@
  * @bug 8026844
  * @summary Test non constant subtractExact
  * @compile SubExactINonConstantTest.java Verify.java
- * @run main SubExactINonConstantTest
+ * @run main SubExactINonConstantTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
  *
  */
 
diff --git a/hotspot/test/compiler/intrinsics/mathexact/SubExactIRepeatTest.java b/hotspot/test/compiler/intrinsics/mathexact/SubExactIRepeatTest.java
index 3c57f6f..63e4b3d 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/SubExactIRepeatTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/SubExactIRepeatTest.java
@@ -26,7 +26,7 @@
  * @bug 8026844
  * @summary Test repeating subtractExact
  * @compile SubExactIRepeatTest.java Verify.java
- * @run main SubExactIRepeatTest
+ * @run main SubExactIRepeatTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
  *
  */
 
diff --git a/hotspot/test/compiler/intrinsics/mathexact/SubExactLConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/SubExactLConstantTest.java
index ec554d7..973aa6a 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/SubExactLConstantTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/SubExactLConstantTest.java
@@ -27,7 +27,7 @@
  * @bug 8027353
  * @summary Test constant subtractExact
  * @compile SubExactLConstantTest.java Verify.java
- * @run main SubExactLConstantTest
+ * @run main SubExactLConstantTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
  *
  */
 
diff --git a/hotspot/test/compiler/intrinsics/mathexact/SubExactLNonConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/SubExactLNonConstantTest.java
index 86ecf20..bc0c733 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/SubExactLNonConstantTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/SubExactLNonConstantTest.java
@@ -27,7 +27,7 @@
  * @bug 8027353
  * @summary Test non constant subtractExact
  * @compile SubExactLNonConstantTest.java Verify.java
- * @run main SubExactLNonConstantTest
+ * @run main SubExactLNonConstantTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
  *
  */
 
diff --git a/hotspot/test/runtime/8024804/RegisterNatives.java b/hotspot/test/runtime/8024804/RegisterNatives.java
index 8a5772a..a0c5ee1 100644
--- a/hotspot/test/runtime/8024804/RegisterNatives.java
+++ b/hotspot/test/runtime/8024804/RegisterNatives.java
@@ -22,6 +22,7 @@
  */
 
 /*
+ * @ignore 8028741
  * @test
  * @bug 8024804
  * @summary registerNatives() interface resolution should receive IAE
diff --git a/jaxp/.hgtags b/jaxp/.hgtags
index db5acb1..330a992 100644
--- a/jaxp/.hgtags
+++ b/jaxp/.hgtags
@@ -240,3 +240,4 @@
 e757eb9aee3d6bec7da074c47e07616104a8df33 jdk8-b116
 c1d234d4f16472a5163464420fa00b25ffa5298a jdk8-b117
 e4e5069250e717defcb556e2f6be291460988c51 jdk8-b118
+69a930376c70beb9877970128bad0f04cb0c6eb1 jdk8-b119
diff --git a/jaxp/src/javax/xml/stream/FactoryFinder.java b/jaxp/src/javax/xml/stream/FactoryFinder.java
index 886caa5..f34d0f8 100644
--- a/jaxp/src/javax/xml/stream/FactoryFinder.java
+++ b/jaxp/src/javax/xml/stream/FactoryFinder.java
@@ -262,9 +262,7 @@
             }
             if (systemProp != null) {
                 dPrint("found system property, value=" + systemProp);
-                // There's a bug here - because 'cl' is ignored.
-                // This will be handled separately.
-                return newInstance(type, systemProp, null, true);
+                return newInstance(type, systemProp, cl, true);
             }
         }
         catch (SecurityException se) {
@@ -303,9 +301,7 @@
 
             if (factoryClassName != null) {
                 dPrint("found in " + configFile + " value=" + factoryClassName);
-                // There's a bug here - because 'cl' is ignored.
-                // This will be handled separately.
-                return newInstance(type, factoryClassName, null, true);
+                return newInstance(type, factoryClassName, cl, true);
             }
         }
         catch (Exception ex) {
@@ -314,7 +310,7 @@
 
         if (type.getName().equals(factoryId)) {
             // Try Jar Service Provider Mechanism
-            final T provider = findServiceProvider(type);
+            final T provider = findServiceProvider(type, cl);
             if (provider != null) {
                 return provider;
             }
@@ -340,12 +336,18 @@
      *
      * @return instance of provider class if found or null
      */
-    private static <T> T findServiceProvider(final Class<T> type) {
+    private static <T> T findServiceProvider(final Class<T> type, final ClassLoader cl) {
         try {
             return AccessController.doPrivileged(new PrivilegedAction<T>() {
                 @Override
                 public T run() {
-                    final ServiceLoader<T> serviceLoader = ServiceLoader.load(type);
+                    final ServiceLoader<T> serviceLoader;
+                    if (cl == null) {
+                        //the current thread's context class loader
+                        serviceLoader = ServiceLoader.load(type);
+                    } else {
+                        serviceLoader = ServiceLoader.load(type, cl);
+                    }
                     final Iterator<T> iterator = serviceLoader.iterator();
                     if (iterator.hasNext()) {
                         return iterator.next();
diff --git a/jaxp/src/javax/xml/stream/XMLEventFactory.java b/jaxp/src/javax/xml/stream/XMLEventFactory.java
index 81a7c55..7d54321 100644
--- a/jaxp/src/javax/xml/stream/XMLEventFactory.java
+++ b/jaxp/src/javax/xml/stream/XMLEventFactory.java
@@ -158,9 +158,10 @@
    *   If {@code factoryId} is "javax.xml.stream.XMLEventFactory",
    *   use the service-provider loading facilities, defined by the
    *   {@link java.util.ServiceLoader} class, to attempt to locate and load an
-   *   implementation of the service using the {@linkplain
-   *   java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}:
-   *   the service-provider loading facility will use the {@linkplain
+   *   implementation of the service using the specified {@code ClassLoader}.
+   *   If {@code classLoader} is null, the {@linkplain
+   *   java.util.ServiceLoader#load(java.lang.Class) default loading mechanism} will apply:
+   *   That is, the service-provider loading facility will use the {@linkplain
    *   java.lang.Thread#getContextClassLoader() current thread's context class loader}
    *   to attempt to load the service. If the context class
    *   loader is null, the {@linkplain
@@ -179,6 +180,10 @@
    * to the deprecated method.
    * </p>
    *
+   * @apiNote The parameter factoryId defined here is inconsistent with that
+   * of other JAXP factories where the first parameter is fully qualified
+   * factory class name that provides implementation of the factory.
+   *
    * @param factoryId             Name of the factory to find, same as
    *                              a property name
    * @param classLoader           classLoader to use
diff --git a/jaxp/src/javax/xml/stream/XMLInputFactory.java b/jaxp/src/javax/xml/stream/XMLInputFactory.java
index 96bd13b..2275ad7 100644
--- a/jaxp/src/javax/xml/stream/XMLInputFactory.java
+++ b/jaxp/src/javax/xml/stream/XMLInputFactory.java
@@ -248,9 +248,10 @@
    *   If {@code factoryId} is "javax.xml.stream.XMLInputFactory",
    *   use the service-provider loading facilities, defined by the
    *   {@link java.util.ServiceLoader} class, to attempt to locate and load an
-   *   implementation of the service using the {@linkplain
-   *   java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}:
-   *   the service-provider loading facility will use the {@linkplain
+   *   implementation of the service using the specified {@code ClassLoader}.
+   *   If {@code classLoader} is null, the {@linkplain
+   *   java.util.ServiceLoader#load(java.lang.Class) default loading mechanism} will apply:
+   *   That is, the service-provider loading facility will use the {@linkplain
    *   java.lang.Thread#getContextClassLoader() current thread's context class loader}
    *   to attempt to load the service. If the context class
    *   loader is null, the {@linkplain
@@ -269,6 +270,10 @@
    * to the deprecated method.
    * </p>
    *
+   * @apiNote The parameter factoryId defined here is inconsistent with that
+   * of other JAXP factories where the first parameter is fully qualified
+   * factory class name that provides implementation of the factory.
+   *
    * @param factoryId             Name of the factory to find, same as
    *                              a property name
    * @param classLoader           classLoader to use
diff --git a/jaxp/src/javax/xml/stream/XMLOutputFactory.java b/jaxp/src/javax/xml/stream/XMLOutputFactory.java
index 55ced98..bff3d95 100644
--- a/jaxp/src/javax/xml/stream/XMLOutputFactory.java
+++ b/jaxp/src/javax/xml/stream/XMLOutputFactory.java
@@ -222,9 +222,10 @@
    *   If {@code factoryId} is "javax.xml.stream.XMLOutputFactory",
    *   use the service-provider loading facilities, defined by the
    *   {@link java.util.ServiceLoader} class, to attempt to locate and load an
-   *   implementation of the service using the {@linkplain
-   *   java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}:
-   *   the service-provider loading facility will use the {@linkplain
+   *   implementation of the service using the specified {@code ClassLoader}.
+   *   If {@code classLoader} is null, the {@linkplain
+   *   java.util.ServiceLoader#load(java.lang.Class) default loading mechanism} will apply:
+   *   That is, the service-provider loading facility will use the {@linkplain
    *   java.lang.Thread#getContextClassLoader() current thread's context class loader}
    *   to attempt to load the service. If the context class
    *   loader is null, the {@linkplain
@@ -235,6 +236,10 @@
    * </li>
    * </ul>
    *
+   * @apiNote The parameter factoryId defined here is inconsistent with that
+   * of other JAXP factories where the first parameter is fully qualified
+   * factory class name that provides implementation of the factory.
+   *
    * <p>
    * Note that this is a new method that replaces the deprecated
    *   {@link #newInstance(java.lang.String, java.lang.ClassLoader)
diff --git a/jaxws/.hgtags b/jaxws/.hgtags
index 3565808..969556f 100644
--- a/jaxws/.hgtags
+++ b/jaxws/.hgtags
@@ -240,3 +240,4 @@
 587560c222a2476066852224ed02d39b5090a299 jdk8-b116
 fe56ba456fd32758c72db629938d69067468d89c jdk8-b117
 76a598cf50c4e1dc1fc8adc08b451943aa1a3179 jdk8-b118
+172b8e056ff259044ca48c5425d643dc8e2e05c8 jdk8-b119
diff --git a/jdk/.hgtags b/jdk/.hgtags
index 5cda4ed..3d8cec5 100644
--- a/jdk/.hgtags
+++ b/jdk/.hgtags
@@ -240,3 +240,4 @@
 0dc0067f3b8efb299a4c23f76ee26ea64df9e1d7 jdk8-b116
 fc4ac66aa657e09de5f8257c3174f240ed0cbaf7 jdk8-b117
 28ca338366ff2774ac9002f9f6eaff4101a3ea3b jdk8-b118
+e4499a6529e8c3e762ba86f45cdd774c92a8e7bc jdk8-b119
diff --git a/jdk/make/CreateSecurityJars.gmk b/jdk/make/CreateSecurityJars.gmk
index 337ea5f..d5b3b8e 100644
--- a/jdk/make/CreateSecurityJars.gmk
+++ b/jdk/make/CreateSecurityJars.gmk
@@ -54,7 +54,7 @@
 ##########################################################################################
 # For security and crypto jars, always build the jar, but for closed, install the prebuilt
 # signed version instead of the newly built jar. Unsigned jars are treated as intermediate
-# targets and explicitly added to the JARS list. For open, signing is not needed. See
+# targets and explicitly added to the TARGETS list. For open, signing is not needed. See
 # SignJars.gmk for more information.
 #
 # The source for the crypto jars is not available for all licensees. The BUILD_CRYPTO
@@ -63,7 +63,7 @@
 # other way to get the jars than to build them.
 
 SUNPKCS11_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunpkcs11.jar
-SUNPKCS11_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/unsigned/sunpkcs11.jar
+SUNPKCS11_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/jce/unsigned/sunpkcs11.jar
 
 $(eval $(call SetupArchive,BUILD_SUNPKCS11_JAR, , \
     SRCS := $(JDK_OUTPUTDIR)/classes_security, \
@@ -78,19 +78,19 @@
 ifndef OPENJDK
   SUNPKCS11_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/pkcs11/sunpkcs11.jar
   $(SUNPKCS11_JAR_DST): $(SUNPKCS11_JAR_SRC)
-	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunPKCS11 provider..."
+	@$(ECHO) $(LOG_INFO) Copying prebuilt $(@F)
 	$(install-file)
 else
   $(SUNPKCS11_JAR_DST): $(SUNPKCS11_JAR_UNSIGNED)
 	$(install-file)
 endif
 
-JARS += $(SUNPKCS11_JAR_UNSIGNED) $(SUNPKCS11_JAR_DST)
+TARGETS += $(SUNPKCS11_JAR_UNSIGNED) $(SUNPKCS11_JAR_DST)
 
 ##########################################################################################
 
 SUNEC_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunec.jar
-SUNEC_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/unsigned/sunec.jar
+SUNEC_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/jce/unsigned/sunec.jar
 
 $(eval $(call SetupArchive,BUILD_SUNEC_JAR, , \
     SRCS := $(JDK_OUTPUTDIR)/classes_security, \
@@ -105,19 +105,19 @@
 ifndef OPENJDK
   SUNEC_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/ec/sunec.jar
   $(SUNEC_JAR_DST): $(SUNEC_JAR_SRC)
-	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunEC provider..."
+	@$(ECHO) $(LOG_INFO) Copying prebuilt $(@F)
 	$(install-file)
 else
   $(SUNEC_JAR_DST): $(SUNEC_JAR_UNSIGNED)
 	$(install-file)
 endif
 
-JARS += $(SUNEC_JAR_UNSIGNED) $(SUNEC_JAR_DST)
+TARGETS += $(SUNEC_JAR_UNSIGNED) $(SUNEC_JAR_DST)
 
 ##########################################################################################
 
 SUNJCE_PROVIDER_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunjce_provider.jar
-SUNJCE_PROVIDER_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/unsigned/sunjce_provider.jar
+SUNJCE_PROVIDER_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/jce/unsigned/sunjce_provider.jar
 
 ifneq ($(BUILD_CRYPTO), no)
   $(eval $(call SetupArchive,BUILD_SUNJCE_PROVIDER_JAR, , \
@@ -130,25 +130,25 @@
 
   $(SUNJCE_PROVIDER_JAR_UNSIGNED): $(JCE_MANIFEST)
 
-  JARS += $(SUNJCE_PROVIDER_JAR_UNSIGNED)
+  TARGETS += $(SUNJCE_PROVIDER_JAR_UNSIGNED)
 endif
 
 ifndef OPENJDK
   SUNJCE_PROVIDER_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/jce/sunjce_provider.jar
   $(SUNJCE_PROVIDER_JAR_DST): $(SUNJCE_PROVIDER_JAR_SRC)
-	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunJCE provider..."
+	@$(ECHO) $(LOG_INFO) Copying prebuilt $(@F)
 	$(install-file)
 else
   $(SUNJCE_PROVIDER_JAR_DST): $(SUNJCE_PROVIDER_JAR_UNSIGNED)
 	$(install-file)
 endif
 
-JARS += $(SUNJCE_PROVIDER_JAR_DST)
+TARGETS += $(SUNJCE_PROVIDER_JAR_DST)
 
 ##########################################################################################
 
 JCE_JAR_DST := $(JDK_OUTPUTDIR)/lib/jce.jar
-JCE_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/unsigned/jce.jar
+JCE_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/jce/unsigned/jce.jar
 
 ifneq ($(BUILD_CRYPTO), no)
   $(eval $(call SetupArchive,BUILD_JCE_JAR, , \
@@ -161,36 +161,43 @@
 
   $(JCE_JAR_UNSIGNED): $(JCE_MANIFEST)
 
-  JARS += $(JCE_JAR_UNSIGNED)
+  TARGETS += $(JCE_JAR_UNSIGNED)
 endif
 
 ifndef OPENJDK
   JCE_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/jce/jce.jar
   $(JCE_JAR_DST): $(JCE_JAR_SRC)
-	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt jce.jar..."
+	@$(ECHO) $(LOG_INFO) Copying prebuilt $(@F)
 	$(install-file)
 else
   $(JCE_JAR_DST): $(JCE_JAR_UNSIGNED)
 	$(install-file)
 endif
 
-JARS += $(JCE_JAR_DST)
+TARGETS += $(JCE_JAR_DST)
 
 ##########################################################################################
 
 US_EXPORT_POLICY_JAR_DST := $(JDK_OUTPUTDIR)/lib/security/US_export_policy.jar
-US_EXPORT_POLICY_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/unsigned/US_export_policy.jar
 
 ifneq ($(BUILD_CRYPTO), no)
+
+  US_EXPORT_POLICY_JAR_LIMITED_UNSIGNED := \
+      $(JDK_OUTPUTDIR)/jce/unsigned/policy/limited/US_export_policy.jar
+  US_EXPORT_POLICY_JAR_UNLIMITED_UNSIGNED := \
+      $(JDK_OUTPUTDIR)/jce/unsigned/policy/unlimited/US_export_policy.jar
+
   #
   # TODO fix so that SetupArchive does not write files into SRCS
   # then we don't need this extra copying
   #
   # NOTE: We currently do not place restrictions on our limited export
-  # policy. This was not a typo.
+  # policy. This was not a typo. This means we are shipping the same file
+  # for both limimted and unlimited US_export_policy.jar.
   #
   US_EXPORT_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/data/cryptopolicy/unlimited
-  US_EXPORT_POLICY_JAR_TMP := $(JDK_OUTPUTDIR)/US_export_policy_jar.tmp
+  US_EXPORT_POLICY_JAR_TMP := \
+      $(JDK_OUTPUTDIR)/jce/unsigned/policy/unlimited/US_export_policy_jar.tmp
 
   $(US_EXPORT_POLICY_JAR_TMP)/%: $(US_EXPORT_POLICY_JAR_SRC_DIR)/%
 	$(install-file)
@@ -200,77 +207,113 @@
   $(eval $(call SetupArchive,BUILD_US_EXPORT_POLICY_JAR, $(US_EXPORT_POLICY_JAR_DEPS), \
       SRCS := $(US_EXPORT_POLICY_JAR_TMP), \
       SUFFIXES := .policy, \
-      JAR := $(US_EXPORT_POLICY_JAR_UNSIGNED), \
+      JAR := $(US_EXPORT_POLICY_JAR_UNLIMITED_UNSIGNED), \
       EXTRA_MANIFEST_ATTR := Crypto-Strength: unlimited, \
       SKIP_METAINF := true))
 
-  JARS += $(US_EXPORT_POLICY_JAR_UNSIGNED)
+  $(US_EXPORT_POLICY_JAR_LIMITED_UNSIGNED): $(US_EXPORT_POLICY_JAR_UNLIMITED_UNSIGNED)
+	$(ECHO) $(LOG_INFO) Copying unlimited $(patsubst $(OUTPUT_ROOT)/%,%,$@)
+	$(install-file)
+
+  TARGETS += $(US_EXPORT_POLICY_JAR_LIMITED_UNSIGNED) \
+      $(US_EXPORT_POLICY_JAR_UNLIMITED_UNSIGNED)
 endif
 
 ifndef OPENJDK
+  ifeq ($(UNLIMITED_CRYPTO), true)
+    $(error No prebuilt unlimited crypto jars available)
+  endif
   $(US_EXPORT_POLICY_JAR_DST): $(JDK_TOPDIR)/make/closed/tools/crypto/jce/US_export_policy.jar
-	$(ECHO) $(LOG_INFO) Copying $(@F)
+	$(ECHO) $(LOG_INFO) Copying prebuilt $(@F)
 	$(install-file)
 else
-  $(US_EXPORT_POLICY_JAR_DST): $(US_EXPORT_POLICY_JAR_UNSIGNED)
+  ifeq ($(UNLIMITED_CRYPTO), true)
+    $(US_EXPORT_POLICY_JAR_DST): $(US_EXPORT_POLICY_JAR_UNLIMITED_UNSIGNED)
 	$(install-file)
+  else
+    $(US_EXPORT_POLICY_JAR_DST): $(US_EXPORT_POLICY_JAR_LIMITED_UNSIGNED)
+	$(install-file)
+  endif
 endif
 
-JARS += $(US_EXPORT_POLICY_JAR_DST)
+TARGETS += $(US_EXPORT_POLICY_JAR_DST)
 
 ##########################################################################################
 
 LOCAL_POLICY_JAR_DST := $(JDK_OUTPUTDIR)/lib/security/local_policy.jar
-LOCAL_POLICY_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/unsigned/local_policy.jar
 
 ifneq ($(BUILD_CRYPTO), no)
+
+  LOCAL_POLICY_JAR_LIMITED_UNSIGNED := \
+      $(JDK_OUTPUTDIR)/jce/unsigned/policy/limited/local_policy.jar
+  LOCAL_POLICY_JAR_UNLIMITED_UNSIGNED := \
+      $(JDK_OUTPUTDIR)/jce/unsigned/policy/unlimited/local_policy.jar
+
   #
   # TODO fix so that SetupArchive does not write files into SRCS
   # then we don't need this extra copying
   #
-  LOCAL_POLICY_JAR_TMP := $(JDK_OUTPUTDIR)/local_policy_jar.tmp
+  LOCAL_POLICY_JAR_LIMITED_TMP := \
+      $(JDK_OUTPUTDIR)/jce/unsigned/policy/limited/local_policy_jar.tmp
+  LOCAL_POLICY_JAR_UNLIMITED_TMP := \
+      $(JDK_OUTPUTDIR)/jce/unsigned/policy/unlimited/local_policy_jar.tmp
 
-  ifeq ($(UNLIMITED_CRYPTO), true)
-    LOCAL_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/data/cryptopolicy/unlimited
-    LOCAL_POLICY_JAR_DEPS := $(LOCAL_POLICY_JAR_TMP)/default_local.policy
-    LOCAL_POLICY_JAR_ATTR := Crypto-Strength: unlimited
-  else
-    LOCAL_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/data/cryptopolicy/limited
-    LOCAL_POLICY_JAR_DEPS := $(LOCAL_POLICY_JAR_TMP)/exempt_local.policy \
-        $(LOCAL_POLICY_JAR_TMP)/default_local.policy
-    LOCAL_POLICY_JAR_ATTR := Crypto-Strength: limited
-  endif
-
-  $(LOCAL_POLICY_JAR_TMP)/%: $(LOCAL_POLICY_JAR_SRC_DIR)/%
+  $(LOCAL_POLICY_JAR_LIMITED_TMP)/%: $(JDK_TOPDIR)/make/data/cryptopolicy/limited/%
 	$(install-file)
 
-  $(eval $(call SetupArchive,BUILD_LOCAL_POLICY_JAR, $(LOCAL_POLICY_JAR_DEPS), \
-      SRCS := $(LOCAL_POLICY_JAR_TMP), \
+  $(LOCAL_POLICY_JAR_UNLIMITED_TMP)/%: $(JDK_TOPDIR)/make/data/cryptopolicy/unlimited/%
+	$(install-file)
+
+  $(eval $(call SetupArchive,BUILD_LOCAL_POLICY_JAR_LIMITED, \
+      $(LOCAL_POLICY_JAR_LIMITED_TMP)/exempt_local.policy \
+      $(LOCAL_POLICY_JAR_LIMITED_TMP)/default_local.policy, \
+      SRCS := $(LOCAL_POLICY_JAR_LIMITED_TMP), \
       SUFFIXES := .policy, \
-      JAR := $(LOCAL_POLICY_JAR_UNSIGNED), \
-      EXTRA_MANIFEST_ATTR := $(LOCAL_POLICY_JAR_ATTR), \
+      JAR := $(LOCAL_POLICY_JAR_LIMITED_UNSIGNED), \
+      EXTRA_MANIFEST_ATTR := Crypto-Strength: limited, \
       SKIP_METAINF := true))
 
-  JARS += $(LOCAL_POLICY_JAR_UNSIGNED)
+  $(eval $(call SetupArchive,BUILD_LOCAL_POLICY_JAR_UNLIMITED, \
+      $(LOCAL_POLICY_JAR_UNLIMITED_TMP)/default_local.policy, \
+      SRCS := $(LOCAL_POLICY_JAR_UNLIMITED_TMP), \
+      SUFFIXES := .policy, \
+      JAR := $(LOCAL_POLICY_JAR_UNLIMITED_UNSIGNED), \
+      EXTRA_MANIFEST_ATTR := Crypto-Strength: unlimited, \
+      SKIP_METAINF := true))
+
+  TARGETS += $(LOCAL_POLICY_JAR_LIMITED_UNSIGNED) $(LOCAL_POLICY_JAR_UNLIMITED_UNSIGNED)
+
+  ifndef OPENJDK
+    $(JDK_OUTPUTDIR)/jce/unsigned/policy/unlimited/README.txt: \
+        $(JDK_TOPDIR)/make/closed/javax/crypto/doc/README.txt
+		$(install-file)
+
+    TARGETS += $(JDK_OUTPUTDIR)/jce/unsigned/policy/unlimited/README.txt
+  endif
 endif
 
 ifndef OPENJDK
   $(LOCAL_POLICY_JAR_DST): $(JDK_TOPDIR)/make/closed/tools/crypto/jce/local_policy.jar
-	$(ECHO) $(LOG_INFO) Copying $(@F)
+	$(ECHO) $(LOG_INFO) Copying prebuilt $(@F)
 	$(install-file)
 else
-  $(LOCAL_POLICY_JAR_DST): $(LOCAL_POLICY_JAR_UNSIGNED)
+  ifeq ($(UNLIMITED_CRYPTO), true)
+    $(LOCAL_POLICY_JAR_DST): $(LOCAL_POLICY_JAR_UNLIMITED_UNSIGNED)
 	$(install-file)
+  else
+    $(LOCAL_POLICY_JAR_DST): $(LOCAL_POLICY_JAR_LIMITED_UNSIGNED)
+	$(install-file)
+  endif
 endif
 
-JARS += $(LOCAL_POLICY_JAR_DST)
+TARGETS += $(LOCAL_POLICY_JAR_DST)
 
 ##########################################################################################
 
 ifeq ($(OPENJDK_TARGET_OS), windows)
 
   SUNMSCAPI_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunmscapi.jar
-  SUNMSCAPI_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/unsigned/sunmscapi.jar
+  SUNMSCAPI_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/jce/unsigned/sunmscapi.jar
 
   $(eval $(call SetupArchive,BUILD_SUNMSCAPI_JAR, , \
       SRCS := $(JDK_OUTPUTDIR)/classes_security, \
@@ -285,14 +328,14 @@
   ifndef OPENJDK
     SUNMSCAPI_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/mscapi/sunmscapi.jar
     $(SUNMSCAPI_JAR_DST): $(SUNMSCAPI_JAR_SRC)
-	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunMSCAPI provider..."
+	@$(ECHO) $(LOG_INFO) Copying prebuilt $(@F)
 	$(install-file)
   else
     $(SUNMSCAPI_JAR_DST): $(SUNMSCAPI_JAR_UNSIGNED)
 	$(install-file)
   endif
 
-  JARS += $(SUNMSCAPI_JAR_UNSIGNED) $(SUNMSCAPI_JAR_DST)
+  TARGETS += $(SUNMSCAPI_JAR_UNSIGNED) $(SUNMSCAPI_JAR_DST)
 
 endif
 
@@ -302,7 +345,7 @@
   ifndef OPENJDK
 
     UCRYPTO_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/ucrypto.jar
-    UCRYPTO_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/unsigned/ucrypto.jar
+    UCRYPTO_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/jce/unsigned/ucrypto.jar
     UCRYPTO_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/ucrypto/ucrypto.jar
 
     $(eval $(call SetupArchive,BUILD_UCRYPTO_JAR, , \
@@ -316,14 +359,14 @@
     $(UCRYPTO_JAR_UNSIGNED): $(JCE_MANIFEST)
 
     $(UCRYPTO_JAR_DST): $(UCRYPTO_JAR_SRC)
-	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt OracleUcrypto provider..."
+	@$(ECHO) $(LOG_INFO) Copying prebuilt $(@F)
 	$(install-file)
 
-    JARS += $(UCRYPTO_JAR_UNSIGNED) $(UCRYPTO_JAR_DST)
+    TARGETS += $(UCRYPTO_JAR_UNSIGNED) $(UCRYPTO_JAR_DST)
 
   endif
 endif
 
-all: $(JARS)
+all: $(TARGETS)
 
 .PHONY: default all
diff --git a/jdk/make/SignJars.gmk b/jdk/make/SignJars.gmk
index 5365bb8..2164788 100644
--- a/jdk/make/SignJars.gmk
+++ b/jdk/make/SignJars.gmk
@@ -80,7 +80,7 @@
 	  exit 2; \
 	fi
 
-$(JCE_OUTPUTDIR)/%: $(JDK_OUTPUTDIR)/unsigned/%
+$(JDK_OUTPUTDIR)/jce/signed/%: $(JDK_OUTPUTDIR)/jce/unsigned/%
 	$(call install-file)
 	$(JARSIGNER) -keystore $(SIGNING_KEYSTORE) \
 	    $@ $(SIGNING_ALIAS) < $(SIGNING_PASSPHRASE)
@@ -88,26 +88,33 @@
 
 JAR_LIST := \
     jce.jar \
-    local_policy.jar \
+    policy/limited/local_policy.jar \
+    policy/limited/US_export_policy.jar \
+    policy/unlimited/local_policy.jar \
+    policy/unlimited/US_export_policy.jar \
     sunec.jar \
     sunjce_provider.jar \
     sunpkcs11.jar \
-    US_export_policy.jar \
     sunmscapi.jar \
     ucrypto.jar \
     #
 
-UNSIGNED_JARS := $(wildcard $(addprefix $(JDK_OUTPUTDIR)/unsigned/, $(JAR_LIST)))
+UNSIGNED_JARS := $(wildcard $(addprefix $(JDK_OUTPUTDIR)/jce/unsigned/, $(JAR_LIST)))
 
 ifeq ($(UNSIGNED_JARS), )
-  $(error No jars found in $(JDK_OUTPUTDIR)/unsigned/)
+  $(error No jars found in $(JDK_OUTPUTDIR)/jce/unsigned/)
 endif
 
-SIGNED_JARS := $(patsubst $(JDK_OUTPUTDIR)/unsigned/%,$(JCE_OUTPUTDIR)/%, $(UNSIGNED_JARS))
+SIGNED_JARS := $(patsubst $(JDK_OUTPUTDIR)/jce/unsigned/%,$(JDK_OUTPUTDIR)/jce/signed/%, \
+    $(UNSIGNED_JARS))
 
 $(SIGNED_JARS): check-keystore
 
-all: $(SIGNED_JARS)
+$(JDK_OUTPUTDIR)/jce/signed/policy/unlimited/README.txt: \
+    $(JDK_OUTPUTDIR)/jce/unsigned/policy/unlimited/README.txt
+	$(install-file)
+
+all: $(SIGNED_JARS) $(JDK_OUTPUTDIR)/jce/signed/policy/unlimited/README.txt
 	@$(PRINTF) "\n*** The jar files built by the 'sign-jars' target are developer      ***"
 	@$(PRINTF) "\n*** builds only and *MUST NOT* be checked into the closed workspace. ***"
 	@$(PRINTF) "\n***                                                                  ***"
diff --git a/jdk/make/data/cryptopolicy/limited/LIMITED b/jdk/make/data/cryptopolicy/limited/LIMITED
deleted file mode 100644
index b58f7ac..0000000
--- a/jdk/make/data/cryptopolicy/limited/LIMITED
+++ /dev/null
@@ -1 +0,0 @@
-Crypto-Strength: limited
diff --git a/jdk/make/data/cryptopolicy/unlimited/UNLIMITED b/jdk/make/data/cryptopolicy/unlimited/UNLIMITED
deleted file mode 100644
index 7fc7743..0000000
--- a/jdk/make/data/cryptopolicy/unlimited/UNLIMITED
+++ /dev/null
@@ -1 +0,0 @@
-Crypto-Strength: unlimited
diff --git a/jdk/src/bsd/doc/man/jdeps.1 b/jdk/src/bsd/doc/man/jdeps.1
index 9b8f698..c3884aa 100644
--- a/jdk/src/bsd/doc/man/jdeps.1
+++ b/jdk/src/bsd/doc/man/jdeps.1
@@ -62,7 +62,7 @@
 \fIoptions\fR
 Command-line options\&. See Options\&.
 .TP     
-\fIclass\fR\fIes\fR
+\fIclasses\fR
 Name of the classes to analyze\&. You can specify a class that can be found in the class path, by its file name, a directory, or a JAR file\&.
 .SH DESCRIPTION    
 The \fI\fR\f3jdeps\fR command shows the package-level or class-level dependencies of Java class files\&. The input class can be a path name to a \f3\&.class\fR file, a directory, a JAR file, or it can be a fully qualified class name to analyze all class files\&. The options determine the output\&. By default, \f3jdeps\fR outputs the dependencies to the system output\&. It can generate the dependencies in DOT language (see the \f3-dotoutput\fR option)\&.
@@ -106,6 +106,12 @@
 .br
 Restricts analysis to classes matching pattern\&. This option filters the list of classes to be analyzed\&. It can be used together with \f3-p\fR and \f3-e\fR which apply pattern to the dependencies\&.
 .TP
+-jdkinternals
+.br
+Finds class-level dependences in JDK internal APIs\&. By default, it analyzes all classes specified in the \f3-classpath\fR option and in input files unless you specified the \f3-include\fR option\&. You cannot use this option with the \f3-p\fR, \f3-e\fR, and \f3-s\fR options\&.
+
+\fIWarning\fR: JDK internal APIs may not be accessible in upcoming releases\&.
+.TP
 -P, -profile
 .br
 Shows profile or the file containing a package\&.
diff --git a/jdk/src/linux/doc/man/jdeps.1 b/jdk/src/linux/doc/man/jdeps.1
index 9b8f698..c3884aa 100644
--- a/jdk/src/linux/doc/man/jdeps.1
+++ b/jdk/src/linux/doc/man/jdeps.1
@@ -62,7 +62,7 @@
 \fIoptions\fR
 Command-line options\&. See Options\&.
 .TP     
-\fIclass\fR\fIes\fR
+\fIclasses\fR
 Name of the classes to analyze\&. You can specify a class that can be found in the class path, by its file name, a directory, or a JAR file\&.
 .SH DESCRIPTION    
 The \fI\fR\f3jdeps\fR command shows the package-level or class-level dependencies of Java class files\&. The input class can be a path name to a \f3\&.class\fR file, a directory, a JAR file, or it can be a fully qualified class name to analyze all class files\&. The options determine the output\&. By default, \f3jdeps\fR outputs the dependencies to the system output\&. It can generate the dependencies in DOT language (see the \f3-dotoutput\fR option)\&.
@@ -106,6 +106,12 @@
 .br
 Restricts analysis to classes matching pattern\&. This option filters the list of classes to be analyzed\&. It can be used together with \f3-p\fR and \f3-e\fR which apply pattern to the dependencies\&.
 .TP
+-jdkinternals
+.br
+Finds class-level dependences in JDK internal APIs\&. By default, it analyzes all classes specified in the \f3-classpath\fR option and in input files unless you specified the \f3-include\fR option\&. You cannot use this option with the \f3-p\fR, \f3-e\fR, and \f3-s\fR options\&.
+
+\fIWarning\fR: JDK internal APIs may not be accessible in upcoming releases\&.
+.TP
 -P, -profile
 .br
 Shows profile or the file containing a package\&.
diff --git a/jdk/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java b/jdk/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java
index c5b2689..9a59817 100644
--- a/jdk/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java
+++ b/jdk/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java
@@ -916,8 +916,7 @@
                 char[] tmpPassword = ((PasswordCallback)
                                       callbacks[0]).getPassword();
                 if (tmpPassword == null) {
-                    // treat a NULL password as an empty password
-                    tmpPassword = new char[0];
+                    throw new LoginException("No password provided");
                 }
                 password = new char[tmpPassword.length];
                 System.arraycopy(tmpPassword, 0,
diff --git a/jdk/src/share/classes/java/applet/Applet.java b/jdk/src/share/classes/java/applet/Applet.java
index 2e8e39a..63d3f0a 100644
--- a/jdk/src/share/classes/java/applet/Applet.java
+++ b/jdk/src/share/classes/java/applet/Applet.java
@@ -392,7 +392,7 @@
      * Each element of the array should be a set of three
      * <code>Strings</code> containing the name, the type, and a
      * description. For example:
-     * <p><blockquote><pre>
+     * <blockquote><pre>
      * String pinfo[][] = {
      *   {"fps",    "1-10",    "frames per second"},
      *   {"repeat", "boolean", "repeat image loop"},
diff --git a/jdk/src/share/classes/java/applet/AppletContext.java b/jdk/src/share/classes/java/applet/AppletContext.java
index f28308c..c031686 100644
--- a/jdk/src/share/classes/java/applet/AppletContext.java
+++ b/jdk/src/share/classes/java/applet/AppletContext.java
@@ -107,7 +107,7 @@
      * <code>target</code> argument indicates in which HTML frame the
      * document is to be displayed.
      * The target argument is interpreted as follows:
-     * <p>
+     *
      * <center><table border="3" summary="Target arguments and their descriptions">
      * <tr><th>Target Argument</th><th>Description</th></tr>
      * <tr><td><code>"_self"</code>  <td>Show in the window and frame that
diff --git a/jdk/src/share/classes/java/awt/AWTPermission.java b/jdk/src/share/classes/java/awt/AWTPermission.java
index 2b371bc..0859872 100644
--- a/jdk/src/share/classes/java/awt/AWTPermission.java
+++ b/jdk/src/share/classes/java/awt/AWTPermission.java
@@ -43,7 +43,6 @@
  * target names, and for each provides a description of what the
  * permission allows and a discussion of the risks of granting code
  * the permission.
- * <P>
  *
  * <table border=1 cellpadding=5 summary="AWTPermission target names, descriptions, and associated risks.">
  * <tr>
diff --git a/jdk/src/share/classes/java/awt/AlphaComposite.java b/jdk/src/share/classes/java/awt/AlphaComposite.java
index 9f8b64f..f08ea2b 100644
--- a/jdk/src/share/classes/java/awt/AlphaComposite.java
+++ b/jdk/src/share/classes/java/awt/AlphaComposite.java
@@ -175,7 +175,6 @@
  * <em>F<sub>s</sub></em> and <em>F<sub>d</sub></em> and then the resulting
  * premultiplied components <em>A<sub>r</sub></em> and <em>C<sub>r</sub></em>.
  *
- * <p>
  * <h3>Preparing Results</h3>
  *
  * <p>
@@ -193,7 +192,6 @@
  * by zero" and the color components are left as
  * all zeros.
  *
- * <p>
  * <h3>Performance Considerations</h3>
  *
  * <p>
@@ -216,7 +214,6 @@
  * for their pixels.  Such sources supply an alpha of 1.0 for
  * all of their pixels.
  *
- * <p>
  * <li>
  * Many destinations also have no place to store the alpha values
  * that result from the blending calculations performed by this class.
@@ -227,7 +224,6 @@
  * values by the resulting alpha value before storing the color
  * values and discarding the alpha value.
  *
- * <p>
  * <li>
  * The accuracy of the results depends on the manner in which pixels
  * are stored in the destination.
@@ -248,7 +244,6 @@
  * the need to choose a pixel from a limited palette to match the
  * results of the blending equations.
  *
- * <p>
  * <li>
  * Nearly all formats store pixels as discrete integers rather than
  * the floating point values used in the reference equations above.
@@ -268,7 +263,6 @@
  * represents 0.0 and 0xff represents
  * 1.0.
  *
- * <p>
  * <li>
  * The internal implementation can approximate some of the equations
  * and it can also eliminate some steps to avoid unnecessary operations.
@@ -332,7 +326,6 @@
  * <p>
  * and thus they would all match.
  *
- * <p>
  * <li>
  * Because of the technique of simplifying the equations for
  * calculation efficiency, some implementations might perform
diff --git a/jdk/src/share/classes/java/awt/BasicStroke.java b/jdk/src/share/classes/java/awt/BasicStroke.java
index 5cc4666..80b4a3d 100644
--- a/jdk/src/share/classes/java/awt/BasicStroke.java
+++ b/jdk/src/share/classes/java/awt/BasicStroke.java
@@ -39,7 +39,7 @@
  * {@link Shape} and the decorations applied at the ends and joins of
  * path segments of the <code>Shape</code>.
  * These rendering attributes include:
- * <dl compact>
+ * <dl>
  * <dt><i>width</i>
  * <dd>The pen width, measured perpendicularly to the pen trajectory.
  * <dt><i>end caps</i>
diff --git a/jdk/src/share/classes/java/awt/BorderLayout.java b/jdk/src/share/classes/java/awt/BorderLayout.java
index 8b131c4..52f56ed 100644
--- a/jdk/src/share/classes/java/awt/BorderLayout.java
+++ b/jdk/src/share/classes/java/awt/BorderLayout.java
@@ -99,7 +99,7 @@
  * style="float:center; margin: 7px 10px;">
  * <p>
  * The code for this applet is as follows:
- * <p>
+ *
  * <hr><blockquote><pre>
  * import java.awt.*;
  * import java.applet.Applet;
diff --git a/jdk/src/share/classes/java/awt/Button.java b/jdk/src/share/classes/java/awt/Button.java
index 83506b6..da7a01f 100644
--- a/jdk/src/share/classes/java/awt/Button.java
+++ b/jdk/src/share/classes/java/awt/Button.java
@@ -388,7 +388,7 @@
      * This method is not called unless action events are
      * enabled for this button. Action events are enabled
      * when one of the following occurs:
-     * <p><ul>
+     * <ul>
      * <li>An <code>ActionListener</code> object is registered
      * via <code>addActionListener</code>.
      * <li>Action events are enabled via <code>enableEvents</code>.
diff --git a/jdk/src/share/classes/java/awt/Checkbox.java b/jdk/src/share/classes/java/awt/Checkbox.java
index 7568b0c5..0215382 100644
--- a/jdk/src/share/classes/java/awt/Checkbox.java
+++ b/jdk/src/share/classes/java/awt/Checkbox.java
@@ -41,7 +41,7 @@
  * <p>
  * The following code example creates a set of check boxes in
  * a grid layout:
- * <p>
+ *
  * <hr><blockquote><pre>
  * setLayout(new GridLayout(3, 1));
  * add(new Checkbox("one", null, true));
@@ -558,7 +558,7 @@
      * This method is not called unless item events are
      * enabled for this component. Item events are enabled
      * when one of the following occurs:
-     * <p><ul>
+     * <ul>
      * <li>An <code>ItemListener</code> object is registered
      * via <code>addItemListener</code>.
      * <li>Item events are enabled via <code>enableEvents</code>.
diff --git a/jdk/src/share/classes/java/awt/CheckboxGroup.java b/jdk/src/share/classes/java/awt/CheckboxGroup.java
index 25b0697..90994f4 100644
--- a/jdk/src/share/classes/java/awt/CheckboxGroup.java
+++ b/jdk/src/share/classes/java/awt/CheckboxGroup.java
@@ -35,7 +35,7 @@
  * <p>
  * The following code example produces a new check box group,
  * with three check boxes:
- * <p>
+ *
  * <hr><blockquote><pre>
  * setLayout(new GridLayout(3, 1));
  * CheckboxGroup cbg = new CheckboxGroup();
diff --git a/jdk/src/share/classes/java/awt/CheckboxMenuItem.java b/jdk/src/share/classes/java/awt/CheckboxMenuItem.java
index 20265c7..424a531 100644
--- a/jdk/src/share/classes/java/awt/CheckboxMenuItem.java
+++ b/jdk/src/share/classes/java/awt/CheckboxMenuItem.java
@@ -367,7 +367,7 @@
      * This method is not called unless item events are
      * enabled for this menu item. Item events are enabled
      * when one of the following occurs:
-     * <p><ul>
+     * <ul>
      * <li>An <code>ItemListener</code> object is registered
      * via <code>addItemListener</code>.
      * <li>Item events are enabled via <code>enableEvents</code>.
diff --git a/jdk/src/share/classes/java/awt/Choice.java b/jdk/src/share/classes/java/awt/Choice.java
index b507462..1a75f90 100644
--- a/jdk/src/share/classes/java/awt/Choice.java
+++ b/jdk/src/share/classes/java/awt/Choice.java
@@ -40,7 +40,7 @@
  * The current choice is displayed as the title of the menu.
  * <p>
  * The following code example produces a pop-up menu:
- * <p>
+ *
  * <hr><blockquote><pre>
  * Choice ColorChooser = new Choice();
  * ColorChooser.add("Green");
@@ -609,7 +609,7 @@
      * This method is not called unless item events are
      * enabled for this component. Item events are enabled
      * when one of the following occurs:
-     * <p><ul>
+     * <ul>
      * <li>An <code>ItemListener</code> object is registered
      * via <code>addItemListener</code>.
      * <li>Item events are enabled via <code>enableEvents</code>.
diff --git a/jdk/src/share/classes/java/awt/Component.java b/jdk/src/share/classes/java/awt/Component.java
index bd913cb..87c8879 100644
--- a/jdk/src/share/classes/java/awt/Component.java
+++ b/jdk/src/share/classes/java/awt/Component.java
@@ -106,7 +106,7 @@
  * adding/removing components to/from containers, the whole hierarchy must be
  * validated afterwards by means of the {@link Container#validate()} method
  * invoked on the top-most invalid container of the hierarchy.
- * <p>
+ *
  * <h3>Serialization</h3>
  * It is important to note that only AWT listeners which conform
  * to the <code>Serializable</code> protocol will be saved when
@@ -3859,7 +3859,7 @@
      * This is a proxy capabilities class used when a FlipBufferStrategy
      * is created instead of the requested Blit strategy.
      *
-     * @see sun.awt.SunGraphicsEnvironment#isFlipStrategyPreferred(ComponentPeer)
+     * @see sun.java2d.SunGraphicsEnvironment#isFlipStrategyPreferred(ComponentPeer)
      */
     private class ProxyCapabilities extends ExtendedBufferCapabilities {
         private BufferCapabilities orig;
@@ -4515,7 +4515,7 @@
      * Private class to perform sub-region blitting.  Swing will use
      * this subclass via the SubRegionShowable interface in order to
      * copy only the area changed during a repaint.
-     * @see javax.swing.BufferStrategyPaintManager
+     * See javax.swing.BufferStrategyPaintManager.
      */
     private class BltSubRegionBufferStrategy extends BltBufferStrategy
         implements SubRegionShowable
@@ -6328,7 +6328,7 @@
      * This method is not called unless component events are
      * enabled for this component. Component events are enabled
      * when one of the following occurs:
-     * <p><ul>
+     * <ul>
      * <li>A <code>ComponentListener</code> object is registered
      * via <code>addComponentListener</code>.
      * <li>Component events are enabled via <code>enableEvents</code>.
@@ -6373,7 +6373,7 @@
      * This method is not called unless focus events are
      * enabled for this component. Focus events are enabled
      * when one of the following occurs:
-     * <p><ul>
+     * <ul>
      * <li>A <code>FocusListener</code> object is registered
      * via <code>addFocusListener</code>.
      * <li>Focus events are enabled via <code>enableEvents</code>.
@@ -6393,7 +6393,7 @@
      * with a <code>FocusEvent</code> as the argument will result in a
      * call to the <code>Component</code>'s <code>processFocusEvent</code>
      * method regardless of the current <code>KeyboardFocusManager</code>.
-     * <p>
+     *
      * <p>Note that if the event parameter is <code>null</code>
      * the behavior is unspecified and may result in an
      * exception.
@@ -6430,7 +6430,7 @@
      * This method is not called unless key events are
      * enabled for this component. Key events are enabled
      * when one of the following occurs:
-     * <p><ul>
+     * <ul>
      * <li>A <code>KeyListener</code> object is registered
      * via <code>addKeyListener</code>.
      * <li>Key events are enabled via <code>enableEvents</code>.
@@ -6499,7 +6499,7 @@
      * This method is not called unless mouse events are
      * enabled for this component. Mouse events are enabled
      * when one of the following occurs:
-     * <p><ul>
+     * <ul>
      * <li>A <code>MouseListener</code> object is registered
      * via <code>addMouseListener</code>.
      * <li>Mouse events are enabled via <code>enableEvents</code>.
@@ -6547,7 +6547,7 @@
      * This method is not called unless mouse motion events are
      * enabled for this component. Mouse motion events are enabled
      * when one of the following occurs:
-     * <p><ul>
+     * <ul>
      * <li>A <code>MouseMotionListener</code> object is registered
      * via <code>addMouseMotionListener</code>.
      * <li>Mouse motion events are enabled via <code>enableEvents</code>.
@@ -6586,7 +6586,7 @@
      * This method is not called unless mouse wheel events are
      * enabled for this component. Mouse wheel events are enabled
      * when one of the following occurs:
-     * <p><ul>
+     * <ul>
      * <li>A <code>MouseWheelListener</code> object is registered
      * via <code>addMouseWheelListener</code>.
      * <li>Mouse wheel events are enabled via <code>enableEvents</code>.
@@ -6630,7 +6630,7 @@
      * This method is not called unless input method events
      * are enabled for this component. Input method events are enabled
      * when one of the following occurs:
-     * <p><ul>
+     * <ul>
      * <li>An <code>InputMethodListener</code> object is registered
      * via <code>addInputMethodListener</code>.
      * <li>Input method events are enabled via <code>enableEvents</code>.
@@ -6669,7 +6669,7 @@
      * This method is not called unless hierarchy events
      * are enabled for this component. Hierarchy events are enabled
      * when one of the following occurs:
-     * <p><ul>
+     * <ul>
      * <li>An <code>HierarchyListener</code> object is registered
      * via <code>addHierarchyListener</code>.
      * <li>Hierarchy events are enabled via <code>enableEvents</code>.
@@ -6705,7 +6705,7 @@
      * This method is not called unless hierarchy bounds events
      * are enabled for this component. Hierarchy bounds events are enabled
      * when one of the following occurs:
-     * <p><ul>
+     * <ul>
      * <li>An <code>HierarchyBoundsListener</code> object is registered
      * via <code>addHierarchyBoundsListener</code>.
      * <li>Hierarchy bounds events are enabled via <code>enableEvents</code>.
diff --git a/jdk/src/share/classes/java/awt/Container.java b/jdk/src/share/classes/java/awt/Container.java
index 7bb4da9..deca54f 100644
--- a/jdk/src/share/classes/java/awt/Container.java
+++ b/jdk/src/share/classes/java/awt/Container.java
@@ -185,7 +185,7 @@
      * the method can return the Container on which it is originally called
      * in case if none of its children are the current mouse event targets.
      *
-     * @see #getMouseEventTarget(int, int, boolean, boolean, boolean)
+     * @see #getMouseEventTarget(int, int, boolean)
      */
     static final boolean INCLUDE_SELF = true;
 
@@ -194,7 +194,7 @@
      * of <code>getMouseEventTarget</code>. It is used to specify whether
      * the method should search only lightweight components.
      *
-     * @see #getMouseEventTarget(int, int, boolean, boolean, boolean)
+     * @see #getMouseEventTarget(int, int, boolean)
      */
     static final boolean SEARCH_HEAVYWEIGHTS = true;
 
@@ -1036,7 +1036,7 @@
      * every add request to a container as all other add methods defer
      * to this one. An overriding method should
      * usually include a call to the superclass's version of the method:
-     * <p>
+     *
      * <blockquote>
      * <code>super.addImpl(comp, constraints, index)</code>
      * </blockquote>
diff --git a/jdk/src/share/classes/java/awt/EventFilter.java b/jdk/src/share/classes/java/awt/EventFilter.java
index 56c69dd..1c38467 100644
--- a/jdk/src/share/classes/java/awt/EventFilter.java
+++ b/jdk/src/share/classes/java/awt/EventFilter.java
@@ -28,20 +28,20 @@
 
     /**
      * Enumeration for possible values for <code>acceptEvent(AWTEvent ev)</code> method.
-     * @see EventDispatchThread#pumpEventsForFilters(EventFilter)
+     * @see EventDispatchThread#pumpEventsForFilter
      */
     static enum FilterAction {
         /**
          * ACCEPT means that this filter do not filter the event and allowes other
          * active filters to proceed it. If all the active filters accept the event, it
          * is dispatched by the <code>EventDispatchThread</code>
-         * @see EventDispatchThread#pumpEventsForFilters(EventFilter)
+         * @see EventDispatchThread#pumpEventsForFilter
          */
         ACCEPT,
         /**
          * REJECT means that this filter filter the event. No other filters are queried,
          * and the event is not dispatched by the <code>EventDispatchedThread</code>
-         * @see EventDispatchThread#pumpEventsForFilters(EventFilter)
+         * @see EventDispatchThread#pumpEventsForFilter
          */
         REJECT,
         /**
@@ -51,7 +51,7 @@
          * It is not recommended to use ACCEPT_IMMEDIATELY as there may be some active
          * filters not queried yet that do not accept this event. It is primarily used
          * by modal filters.
-         * @see EventDispatchThread#pumpEventsForFilters(EventFilter)
+         * @see EventDispatchThread#pumpEventsForFilter
          * @see ModalEventFilter
          */
         ACCEPT_IMMEDIATELY
diff --git a/jdk/src/share/classes/java/awt/EventQueue.java b/jdk/src/share/classes/java/awt/EventQueue.java
index af9e1bf..efe0421 100644
--- a/jdk/src/share/classes/java/awt/EventQueue.java
+++ b/jdk/src/share/classes/java/awt/EventQueue.java
@@ -652,7 +652,7 @@
      * Dispatches an event. The manner in which the event is
      * dispatched depends upon the type of the event and the
      * type of the event's source object:
-     * <p>
+     *
      * <table border=1 summary="Event types, source types, and dispatch methods">
      * <tr>
      *     <th>Event Type</th>
diff --git a/jdk/src/share/classes/java/awt/FileDialog.java b/jdk/src/share/classes/java/awt/FileDialog.java
index 0fc63c7..b693b9b 100644
--- a/jdk/src/share/classes/java/awt/FileDialog.java
+++ b/jdk/src/share/classes/java/awt/FileDialog.java
@@ -439,7 +439,6 @@
      * Note that the method is private and it's intended to be used
      * by the peers through the AWTAccessor API.
      *
-     * @param directory the current directory
      * @param files     the array that contains the short names of
      *                  all the files that the user selects.
      *
diff --git a/jdk/src/share/classes/java/awt/FlowLayout.java b/jdk/src/share/classes/java/awt/FlowLayout.java
index 4675bbc..9961c9b 100644
--- a/jdk/src/share/classes/java/awt/FlowLayout.java
+++ b/jdk/src/share/classes/java/awt/FlowLayout.java
@@ -57,7 +57,7 @@
  * style="float:center; margin: 7px 10px;">
  * <p>
  * Here is the code for this applet:
- * <p>
+ *
  * <hr><blockquote><pre>
  * import java.awt.*;
  * import java.applet.Applet;
@@ -129,9 +129,9 @@
      * how each row distributes empty space.
      * It can be one of the following values:
      * <ul>
-     * <code>LEFT</code>
-     * <code>RIGHT</code>
-     * <code>CENTER</code>
+     * <li><code>LEFT</code>
+     * <li><code>RIGHT</code>
+     * <li><code>CENTER</code>
      * </ul>
      *
      * @serial
@@ -146,11 +146,11 @@
      * v1.2 and greater.
      * It can be one of the following three values:
      * <ul>
-     * <code>LEFT</code>
-     * <code>RIGHT</code>
-     * <code>CENTER</code>
-     * <code>LEADING</code>
-     * <code>TRAILING</code>
+     * <li><code>LEFT</code>
+     * <li><code>RIGHT</code>
+     * <li><code>CENTER</code>
+     * <li><code>LEADING</code>
+     * <li><code>TRAILING</code>
      * </ul>
      *
      * @serial
diff --git a/jdk/src/share/classes/java/awt/Font.java b/jdk/src/share/classes/java/awt/Font.java
index e6363c8..7f3657c 100644
--- a/jdk/src/share/classes/java/awt/Font.java
+++ b/jdk/src/share/classes/java/awt/Font.java
@@ -75,13 +75,13 @@
  *
  * A <em>character</em> is a symbol that represents an item such as a letter,
  * a digit, or punctuation in an abstract way. For example, <code>'g'</code>,
- * <font size=-1>LATIN SMALL LETTER G</font>, is a character.
+ * LATIN SMALL LETTER G, is a character.
  * <p>
  * A <em>glyph</em> is a shape used to render a character or a sequence of
  * characters. In simple writing systems, such as Latin, typically one glyph
  * represents one character. In general, however, characters and glyphs do not
  * have one-to-one correspondence. For example, the character '&aacute;'
- * <font size=-1>LATIN SMALL LETTER A WITH ACUTE</font>, can be represented by
+ * LATIN SMALL LETTER A WITH ACUTE, can be represented by
  * two glyphs: one for 'a' and one for '&acute;'. On the other hand, the
  * two-character string "fi" can be represented by a single glyph, an
  * "fi" ligature. In complex writing systems, such as Arabic or the South
@@ -93,7 +93,7 @@
  * of characters as well as the tables needed to map sequences of characters to
  * corresponding sequences of glyphs.
  *
- * <h4>Physical and Logical Fonts</h4>
+ * <h3>Physical and Logical Fonts</h3>
  *
  * The Java Platform distinguishes between two kinds of fonts:
  * <em>physical</em> fonts and <em>logical</em> fonts.
@@ -130,7 +130,7 @@
  * <a href="http://www.oracle.com/technetwork/java/javase/tech/faq-jsp-138165.html">Internationalization FAQ</a>
  * document.
  *
- * <h4>Font Faces and Names</h4>
+ * <h3>Font Faces and Names</h3>
  *
  * A <code>Font</code>
  * can have many faces, such as heavy, medium, oblique, gothic and
@@ -160,7 +160,7 @@
  * with varying sizes, styles, transforms and font features via the
  * <code>deriveFont</code> methods in this class.
  *
- * <h4>Font and TextAttribute</h4>
+ * <h3>Font and TextAttribute</h3>
  *
  * <p><code>Font</code> supports most
  * <code>TextAttribute</code>s.  This makes some operations, such as
@@ -197,7 +197,7 @@
  * avoid this problem.  Clients who use input method highlights can
  * convert these to the platform-specific attributes for that
  * highlight on the current platform and set them on the Font as
- * a workaround.</p>
+ * a workaround.
  *
  * <p>The <code>Map</code>-based constructor and
  * <code>deriveFont</code> APIs ignore the FONT attribute, and it is
@@ -1419,7 +1419,7 @@
      * To ensure that this method returns the desired Font,
      * format the <code>str</code> parameter in
      * one of these ways
-     * <p>
+     *
      * <ul>
      * <li><em>fontname-style-pointsize</em>
      * <li><em>fontname-pointsize</em>
diff --git a/jdk/src/share/classes/java/awt/Graphics.java b/jdk/src/share/classes/java/awt/Graphics.java
index 3e2dcb5..c440b0a 100644
--- a/jdk/src/share/classes/java/awt/Graphics.java
+++ b/jdk/src/share/classes/java/awt/Graphics.java
@@ -39,7 +39,7 @@
  * A <code>Graphics</code> object encapsulates state information needed
  * for the basic rendering operations that Java supports.  This
  * state information includes the following properties:
- * <p>
+ *
  * <ul>
  * <li>The <code>Component</code> object on which to draw.
  * <li>A translation origin for rendering and clipping coordinates.
@@ -63,7 +63,7 @@
  * <p>
  * The graphics pen hangs down and to the right from the path it traverses.
  * This has the following implications:
- * <p><ul>
+ * <ul>
  * <li>If you draw a figure that covers a given rectangle, that
  * figure occupies one extra row of pixels on the right and bottom edges
  * as compared to filling a figure that is bounded by that same rectangle.
@@ -136,7 +136,7 @@
      * interpreted in the coordinate system of the original
      * <code>Graphics</code> object. The new graphics context is
      * identical to the original, except in two respects:
-     * <p>
+     *
      * <ul>
      * <li>
      * The new graphics context is translated by (<i>x</i>,&nbsp;<i>y</i>).
diff --git a/jdk/src/share/classes/java/awt/GridBagConstraints.java b/jdk/src/share/classes/java/awt/GridBagConstraints.java
index 3651b39..bf53b39 100644
--- a/jdk/src/share/classes/java/awt/GridBagConstraints.java
+++ b/jdk/src/share/classes/java/awt/GridBagConstraints.java
@@ -457,7 +457,7 @@
      * resize the component, and if so, how.
      * <p>
      * The following values are valid for <code>fill</code>:
-     * <p>
+     *
      * <ul>
      * <li>
      * <code>NONE</code>: Do not resize the component.
diff --git a/jdk/src/share/classes/java/awt/GridBagLayout.java b/jdk/src/share/classes/java/awt/GridBagLayout.java
index 8ac290a..0b0f2bc 100644
--- a/jdk/src/share/classes/java/awt/GridBagLayout.java
+++ b/jdk/src/share/classes/java/awt/GridBagLayout.java
@@ -55,7 +55,7 @@
  * of the <code>GridBagConstraints</code> objects that are associated
  * with its components. You customize a <code>GridBagConstraints</code>
  * object by setting one or more of its instance variables:
- * <p>
+ *
  * <dl>
  * <dt>{@link GridBagConstraints#gridx},
  * {@link GridBagConstraints#gridy}
@@ -121,7 +121,7 @@
  * <code>ComponentOrientation</code> property while absolute values
  * are not.  Baseline relative values are calculated relative to the
  * baseline.  Valid values are:
- * <p>
+ *
  * <center><table BORDER=0 WIDTH=800
  *        SUMMARY="absolute, relative and baseline values as described above">
  * <tr>
@@ -251,7 +251,7 @@
  * managed by a grid bag layout.  Figure 2 shows the layout for a horizontal,
  * left-to-right container and Figure 3 shows the layout for a horizontal,
  * right-to-left container.
- * <p>
+ *
  * <center><table WIDTH=600 summary="layout">
  * <tr ALIGN=CENTER>
  * <td>
@@ -270,7 +270,7 @@
  * of its associated <code>GridBagConstraints</code> object
  * set to <code>GridBagConstraints.BOTH</code>.
  * In addition, the components have the following non-default constraints:
- * <p>
+ *
  * <ul>
  * <li>Button1, Button2, Button3: <code>weightx&nbsp;=&nbsp;1.0</code>
  * <li>Button4: <code>weightx&nbsp;=&nbsp;1.0</code>,
@@ -285,7 +285,7 @@
  * </ul>
  * <p>
  * Here is the code that implements the example shown above:
- * <p>
+ *
  * <hr><blockquote><pre>
  * import java.awt.*;
  * import java.util.*;
diff --git a/jdk/src/share/classes/java/awt/GridLayout.java b/jdk/src/share/classes/java/awt/GridLayout.java
index 596208c..ef506b0 100644
--- a/jdk/src/share/classes/java/awt/GridLayout.java
+++ b/jdk/src/share/classes/java/awt/GridLayout.java
@@ -32,7 +32,7 @@
  * and one component is placed in each rectangle.
  * For example, the following is an applet that lays out six buttons
  * into three rows and two columns:
- * <p>
+ *
  * <hr><blockquote>
  * <pre>
  * import java.awt.*;
@@ -54,7 +54,7 @@
  * and left-to-right, the above example produces the output shown in Figure 1.
  * If the container's <code>ComponentOrientation</code> property is horizontal
  * and right-to-left, the example produces the output shown in Figure 2.
- * <p>
+ *
  * <table style="float:center" WIDTH=600 summary="layout">
  * <tr ALIGN=CENTER>
  * <td><img SRC="doc-files/GridLayout-1.gif"
diff --git a/jdk/src/share/classes/java/awt/Label.java b/jdk/src/share/classes/java/awt/Label.java
index 1772875..090ef84 100644
--- a/jdk/src/share/classes/java/awt/Label.java
+++ b/jdk/src/share/classes/java/awt/Label.java
@@ -36,7 +36,7 @@
  * directly.
  * <p>
  * For example, the code&nbsp;.&nbsp;.&nbsp;.
- * <p>
+ *
  * <hr><blockquote><pre>
  * setLayout(new FlowLayout(FlowLayout.CENTER, 10, 10));
  * add(new Label("Hi There!"));
diff --git a/jdk/src/share/classes/java/awt/LinearGradientPaint.java b/jdk/src/share/classes/java/awt/LinearGradientPaint.java
index f4af602..eed1f34 100644
--- a/jdk/src/share/classes/java/awt/LinearGradientPaint.java
+++ b/jdk/src/share/classes/java/awt/LinearGradientPaint.java
@@ -75,7 +75,6 @@
  * <p>
  * The following code demonstrates typical usage of
  * {@code LinearGradientPaint}:
- * <p>
  * <pre>
  *     Point2D start = new Point2D.Float(0, 0);
  *     Point2D end = new Point2D.Float(50, 50);
@@ -92,7 +91,6 @@
  * <p>
  * This image demonstrates the example code above for each
  * of the three cycle methods:
- * <p>
  * <center>
  * <img src = "doc-files/LinearGradientPaint.png"
  * alt="image showing the output of the example code">
diff --git a/jdk/src/share/classes/java/awt/LinearGradientPaintContext.java b/jdk/src/share/classes/java/awt/LinearGradientPaintContext.java
index c0da02b..965e148 100644
--- a/jdk/src/share/classes/java/awt/LinearGradientPaintContext.java
+++ b/jdk/src/share/classes/java/awt/LinearGradientPaintContext.java
@@ -66,8 +66,8 @@
      *          concatenated with this)
      * @param hints the hints that the context object uses to choose
      *              between rendering alternatives
-     * @param dStart gradient start point, in user space
-     * @param dEnd gradient end point, in user space
+     * @param start gradient start point, in user space
+     * @param end gradient end point, in user space
      * @param fractions the fractions specifying the gradient distribution
      * @param colors the gradient colors
      * @param cycleMethod either NO_CYCLE, REFLECT, or REPEAT
diff --git a/jdk/src/share/classes/java/awt/List.java b/jdk/src/share/classes/java/awt/List.java
index b3be9ae..7542918 100644
--- a/jdk/src/share/classes/java/awt/List.java
+++ b/jdk/src/share/classes/java/awt/List.java
@@ -41,7 +41,7 @@
  * the user can choose either one item or multiple items.
  * <p>
  * For example, the code&nbsp;.&nbsp;.&nbsp;.
- * <p>
+ *
  * <hr><blockquote><pre>
  * List lst = new List(4, false);
  * lst.add("Mercury");
@@ -1082,7 +1082,7 @@
      * This method is not called unless item events are
      * enabled for this component. Item events are enabled
      * when one of the following occurs:
-     * <p><ul>
+     * <ul>
      * <li>An <code>ItemListener</code> object is registered
      * via <code>addItemListener</code>.
      * <li>Item events are enabled via <code>enableEvents</code>.
@@ -1113,7 +1113,7 @@
      * This method is not called unless action events are
      * enabled for this component. Action events are enabled
      * when one of the following occurs:
-     * <p><ul>
+     * <ul>
      * <li>An <code>ActionListener</code> object is registered
      * via <code>addActionListener</code>.
      * <li>Action events are enabled via <code>enableEvents</code>.
diff --git a/jdk/src/share/classes/java/awt/MenuItem.java b/jdk/src/share/classes/java/awt/MenuItem.java
index b660e20..1344691 100644
--- a/jdk/src/share/classes/java/awt/MenuItem.java
+++ b/jdk/src/share/classes/java/awt/MenuItem.java
@@ -648,7 +648,7 @@
      * This method is not called unless action events are
      * enabled for this component. Action events are enabled
      * when one of the following occurs:
-     * <p><ul>
+     * <ul>
      * <li>An <code>ActionListener</code> object is registered
      * via <code>addActionListener</code>.
      * <li>Action events are enabled via <code>enableEvents</code>.
diff --git a/jdk/src/share/classes/java/awt/RadialGradientPaint.java b/jdk/src/share/classes/java/awt/RadialGradientPaint.java
index 5fd0873..9f569f4f 100644
--- a/jdk/src/share/classes/java/awt/RadialGradientPaint.java
+++ b/jdk/src/share/classes/java/awt/RadialGradientPaint.java
@@ -104,7 +104,6 @@
  * The following code demonstrates typical usage of
  * {@code RadialGradientPaint}, where the center and focus points are
  * the same:
- * <p>
  * <pre>
  *     Point2D center = new Point2D.Float(50, 50);
  *     float radius = 25;
@@ -117,7 +116,6 @@
  * <p>
  * This image demonstrates the example code above, with default
  * (centered) focus for each of the three cycle methods:
- * <p>
  * <center>
  * <img src = "doc-files/RadialGradientPaint-1.png" alt="image showing the
  * output of the sameple code">
@@ -126,7 +124,6 @@
  * <p>
  * It is also possible to specify a non-centered focus point, as
  * in the following code:
- * <p>
  * <pre>
  *     Point2D center = new Point2D.Float(50, 50);
  *     float radius = 25;
@@ -142,7 +139,6 @@
  * <p>
  * This image demonstrates the previous example code, with non-centered
  * focus for each of the three cycle methods:
- * <p>
  * <center>
  * <img src = "doc-files/RadialGradientPaint-2.png" alt="image showing the
  * output of the sample code">
diff --git a/jdk/src/share/classes/java/awt/Scrollbar.java b/jdk/src/share/classes/java/awt/Scrollbar.java
index 9849480..0c980b3 100644
--- a/jdk/src/share/classes/java/awt/Scrollbar.java
+++ b/jdk/src/share/classes/java/awt/Scrollbar.java
@@ -46,7 +46,7 @@
  * <p>
  * Each scroll bar in this example could be created with
  * code similar to the following:
- * <p>
+ *
  * <hr><blockquote><pre>
  * redSlider=new Scrollbar(Scrollbar.VERTICAL, 0, 1, 0, 255);
  * add(redSlider);
@@ -65,7 +65,7 @@
  * The value range represented by the bubble in this example
  * is the <em>visible amount</em>. The horizontal scroll bar
  * in this example could be created with code like the following:
- * <p>
+ *
  * <hr><blockquote><pre>
  * ranger = new Scrollbar(Scrollbar.HORIZONTAL, 0, 60, 0, 300);
  * add(ranger);
@@ -103,7 +103,7 @@
  * <p>
  * The <code>AdjustmentEvent</code> class defines five types
  * of adjustment event, listed here:
- * <p>
+ *
  * <ul>
  * <li><code>AdjustmentEvent.TRACK</code> is sent out when the
  * user drags the scroll bar's bubble.
@@ -136,7 +136,7 @@
  * that are associated with scroll bars in previous platform versions.
  * The following list gives the adjustment event type,
  * and the corresponding JDK&nbsp;1.0 event type it replaces.
- * <p>
+ *
  * <ul>
  * <li><code>AdjustmentEvent.TRACK</code> replaces
  * <code>Event.SCROLL_ABSOLUTE</code>
@@ -295,7 +295,7 @@
      * Constructs a new vertical scroll bar.
      * The default properties of the scroll bar are listed in
      * the following table:
-     * <p>
+     *
      * <table border=1 summary="Scrollbar default properties">
      * <tr>
      *   <th>Property</th>
@@ -1104,11 +1104,11 @@
      * This method is not called unless adjustment events are
      * enabled for this component. Adjustment events are enabled
      * when one of the following occurs:
-     * <p><ul>
+     * <ul>
      * <li>An <code>AdjustmentListener</code> object is registered
      * via <code>addAdjustmentListener</code>.
      * <li>Adjustment events are enabled via <code>enableEvents</code>.
-     * </ul><p>
+     * </ul>
      * <p>Note that if the event parameter is <code>null</code>
      * the behavior is unspecified and may result in an
      * exception.
diff --git a/jdk/src/share/classes/java/awt/SystemColor.java b/jdk/src/share/classes/java/awt/SystemColor.java
index 931cf32..ed5a26b 100644
--- a/jdk/src/share/classes/java/awt/SystemColor.java
+++ b/jdk/src/share/classes/java/awt/SystemColor.java
@@ -463,7 +463,7 @@
     }
 
     /**
-     * Called from <init> & toolkit to update the above systemColors cache.
+     * Called from {@code <init>} and toolkit to update the above systemColors cache.
      */
     private static void updateSystemColors() {
         if (!GraphicsEnvironment.isHeadless()) {
diff --git a/jdk/src/share/classes/java/awt/SystemTray.java b/jdk/src/share/classes/java/awt/SystemTray.java
index 20ba912..58f3a0b 100644
--- a/jdk/src/share/classes/java/awt/SystemTray.java
+++ b/jdk/src/share/classes/java/awt/SystemTray.java
@@ -361,7 +361,7 @@
     /**
      * Adds a {@code PropertyChangeListener} to the list of listeners for the
      * specific property. The following properties are currently supported:
-     * <p>
+     *
      * <table border=1 summary="SystemTray properties">
      * <tr>
      *    <th>Property</th>
diff --git a/jdk/src/share/classes/java/awt/TextArea.java b/jdk/src/share/classes/java/awt/TextArea.java
index 6fc979f..0528c0a 100644
--- a/jdk/src/share/classes/java/awt/TextArea.java
+++ b/jdk/src/share/classes/java/awt/TextArea.java
@@ -45,7 +45,7 @@
  * style="float:center; margin: 7px 10px;">
  * <p>
  * This text area could be created by the following line of code:
- * <p>
+ *
  * <hr><blockquote><pre>
  * new TextArea("Hello", 5, 40);
  * </pre></blockquote><hr>
diff --git a/jdk/src/share/classes/java/awt/TextField.java b/jdk/src/share/classes/java/awt/TextField.java
index 85eaba2..e708821 100644
--- a/jdk/src/share/classes/java/awt/TextField.java
+++ b/jdk/src/share/classes/java/awt/TextField.java
@@ -45,7 +45,7 @@
  * style="float:center; margin: 7px 10px;">
  * <p>
  * Here is the code that produces these four text fields:
- * <p>
+ *
  * <hr><blockquote><pre>
  * TextField tf1, tf2, tf3, tf4;
  * // a blank text field
@@ -596,7 +596,7 @@
      * This method is not called unless action events are
      * enabled for this component. Action events are enabled
      * when one of the following occurs:
-     * <p><ul>
+     * <ul>
      * <li>An <code>ActionListener</code> object is registered
      * via <code>addActionListener</code>.
      * <li>Action events are enabled via <code>enableEvents</code>.
diff --git a/jdk/src/share/classes/java/awt/Toolkit.java b/jdk/src/share/classes/java/awt/Toolkit.java
index dcc1fa1..e1f86f2 100644
--- a/jdk/src/share/classes/java/awt/Toolkit.java
+++ b/jdk/src/share/classes/java/awt/Toolkit.java
@@ -80,19 +80,19 @@
  * <br>For example, calling <code>ScrollPane.setScrollPosition</code>
  *     and then <code>getScrollPosition</code> may return an incorrect
  *     value if the original request has not yet been processed.
- * <p>
+ *
  * <li>Moving the focus from one component to another.
  * <br>For more information, see
  * <a href="http://docs.oracle.com/javase/tutorial/uiswing/misc/focus.html#transferTiming">Timing
  * Focus Transfers</a>, a section in
  * <a href="http://java.sun.com/docs/books/tutorial/uiswing/">The Swing
  * Tutorial</a>.
- * <p>
+ *
  * <li>Making a top-level container visible.
  * <br>Calling <code>setVisible(true)</code> on a <code>Window</code>,
  *     <code>Frame</code> or <code>Dialog</code> may occur
  *     asynchronously.
- * <p>
+ *
  * <li>Setting the size or location of a top-level container.
  * <br>Calls to <code>setSize</code>, <code>setBounds</code> or
  *     <code>setLocation</code> on a <code>Window</code>,
diff --git a/jdk/src/share/classes/java/awt/WaitDispatchSupport.java b/jdk/src/share/classes/java/awt/WaitDispatchSupport.java
index c9a6718..ac59d77 100644
--- a/jdk/src/share/classes/java/awt/WaitDispatchSupport.java
+++ b/jdk/src/share/classes/java/awt/WaitDispatchSupport.java
@@ -91,7 +91,7 @@
      *
      * @param dispatchThread An event dispatch thread that
      *        should not stop dispatching events while waiting
-     * @param extCondition A conditional object used to determine
+     * @param extCond A conditional object used to determine
      *        if the loop should be terminated
      *
      * @since 1.7
@@ -161,7 +161,7 @@
     }
 
     /**
-     * @inheritDoc
+     * {@inheritDoc}
      */
     @Override
     public boolean enter() {
@@ -281,7 +281,7 @@
     }
 
     /**
-     * @inheritDoc
+     * {@inheritDoc}
      */
     public boolean exit() {
         if (log.isLoggable(PlatformLogger.Level.FINE)) {
diff --git a/jdk/src/share/classes/java/awt/Window.java b/jdk/src/share/classes/java/awt/Window.java
index ceb901a..13779fd 100644
--- a/jdk/src/share/classes/java/awt/Window.java
+++ b/jdk/src/share/classes/java/awt/Window.java
@@ -212,7 +212,7 @@
      *
      * @serial
      * @see #getIconImages
-     * @see #setIconImages(List<? extends Image>)
+     * @see #setIconImages
      */
     transient java.util.List<Image> icons;
 
diff --git a/jdk/src/share/classes/java/awt/color/CMMException.java b/jdk/src/share/classes/java/awt/color/CMMException.java
index 9aca938..04497f6 100644
--- a/jdk/src/share/classes/java/awt/color/CMMException.java
+++ b/jdk/src/share/classes/java/awt/color/CMMException.java
@@ -27,7 +27,8 @@
 
  *
  */
-/**********************************************************************
+/*
+ **********************************************************************
  **********************************************************************
  **********************************************************************
  *** COPYRIGHT (c) Eastman Kodak Company, 1997                      ***
diff --git a/jdk/src/share/classes/java/awt/color/ColorSpace.java b/jdk/src/share/classes/java/awt/color/ColorSpace.java
index c0bcb49..ac21273 100644
--- a/jdk/src/share/classes/java/awt/color/ColorSpace.java
+++ b/jdk/src/share/classes/java/awt/color/ColorSpace.java
@@ -23,7 +23,8 @@
  * questions.
  */
 
-/**********************************************************************
+/*
+ **********************************************************************
  **********************************************************************
  **********************************************************************
  *** COPYRIGHT (c) Eastman Kodak Company, 1997                      ***
@@ -91,7 +92,6 @@
 
 </pre>
  *
- * <p>
  * @see ICC_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 ace7f3d..53edefb 100644
--- a/jdk/src/share/classes/java/awt/color/ICC_ColorSpace.java
+++ b/jdk/src/share/classes/java/awt/color/ICC_ColorSpace.java
@@ -23,7 +23,8 @@
  * questions.
  */
 
-/**********************************************************************
+/*
+ **********************************************************************
  **********************************************************************
  **********************************************************************
  *** COPYRIGHT (c) Eastman Kodak Company, 1997                      ***
@@ -77,7 +78,6 @@
  * imported images with a known color space.  At most, such applets
  * would need to get one of the default color spaces via
  * ColorSpace.getInstance().
- * <p>
  * @see ColorSpace
  * @see ICC_Profile
  */
@@ -481,7 +481,6 @@
      * be the same as the media white point tag XYZ value in the ICC
      * profile for an sRGB device.
      * <p>
-     * <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_Profile.java b/jdk/src/share/classes/java/awt/color/ICC_Profile.java
index 7e44947..89abeca 100644
--- a/jdk/src/share/classes/java/awt/color/ICC_Profile.java
+++ b/jdk/src/share/classes/java/awt/color/ICC_Profile.java
@@ -23,7 +23,8 @@
  * questions.
  */
 
-/**********************************************************************
+/*
+ **********************************************************************
  **********************************************************************
  **********************************************************************
  *** COPYRIGHT (c) Eastman Kodak Company, 1997                      ***
@@ -86,7 +87,6 @@
  * ICC Profile Format Specification.  Most profiles of interest
  * either have invertible transformations or explicitly specify
  * transformations going both directions.
- * <p>
  * @see ICC_ColorSpace
  */
 
diff --git a/jdk/src/share/classes/java/awt/color/ICC_ProfileGray.java b/jdk/src/share/classes/java/awt/color/ICC_ProfileGray.java
index a868a6f..1b076a6 100644
--- a/jdk/src/share/classes/java/awt/color/ICC_ProfileGray.java
+++ b/jdk/src/share/classes/java/awt/color/ICC_ProfileGray.java
@@ -23,7 +23,8 @@
  * questions.
  */
 
-/**********************************************************************
+/*
+ **********************************************************************
  **********************************************************************
  **********************************************************************
  *** COPYRIGHT (c) Eastman Kodak Company, 1997                      ***
@@ -63,7 +64,6 @@
 </pre>
  * The inverse transform is done by converting the PCS Y components to
  * device Gray via the inverse of the grayTRC.
- * <p>
  */
 
 
diff --git a/jdk/src/share/classes/java/awt/color/ICC_ProfileRGB.java b/jdk/src/share/classes/java/awt/color/ICC_ProfileRGB.java
index dcf6582..c26697a 100644
--- a/jdk/src/share/classes/java/awt/color/ICC_ProfileRGB.java
+++ b/jdk/src/share/classes/java/awt/color/ICC_ProfileRGB.java
@@ -23,7 +23,8 @@
  * questions.
  */
 
-/**********************************************************************
+/*
+ **********************************************************************
  **********************************************************************
  **********************************************************************
  *** COPYRIGHT (c) Eastman Kodak Company, 1997                      ***
@@ -82,7 +83,6 @@
  * The inverse transform is performed by converting PCS XYZ components to linear
  * RGB components through the inverse of the above 3x3 matrix, and then converting
  * linear RGB to device RGB through inverses of the TRCs.
- * <p>
  */
 
 
@@ -111,7 +111,7 @@
     /**
      * Constructs an new <code>ICC_ProfileRGB</code> from a CMM ID.
      *
-     * @param ID The CMM ID for the profile.
+     * @param p The CMM ID for the profile.
      *
      */
     ICC_ProfileRGB(Profile p) {
diff --git a/jdk/src/share/classes/java/awt/dnd/DnDEventMulticaster.java b/jdk/src/share/classes/java/awt/dnd/DnDEventMulticaster.java
index 2e6c13a..a9d9e65 100644
--- a/jdk/src/share/classes/java/awt/dnd/DnDEventMulticaster.java
+++ b/jdk/src/share/classes/java/awt/dnd/DnDEventMulticaster.java
@@ -71,7 +71,7 @@
      * Handles the <code>DragSourceDragEvent</code> by invoking
      * <code>dragOver</code> on listener-a and listener-b.
      *
-     * @param e the <code>DragSourceDragEvent</code>
+     * @param dsde the <code>DragSourceDragEvent</code>
      */
     public void dragOver(DragSourceDragEvent dsde) {
         ((DragSourceListener)a).dragOver(dsde);
diff --git a/jdk/src/share/classes/java/awt/dnd/DragSourceDropEvent.java b/jdk/src/share/classes/java/awt/dnd/DragSourceDropEvent.java
index e1116bc..25f7630 100644
--- a/jdk/src/share/classes/java/awt/dnd/DragSourceDropEvent.java
+++ b/jdk/src/share/classes/java/awt/dnd/DragSourceDropEvent.java
@@ -37,7 +37,6 @@
  * to provide appropriate feedback to the end user
  * when the operation completes.
  * <P>
- * <P>
  * @since 1.2
  */
 
diff --git a/jdk/src/share/classes/java/awt/dnd/DropTarget.java b/jdk/src/share/classes/java/awt/dnd/DropTarget.java
index 0480ba5..ad67293 100644
--- a/jdk/src/share/classes/java/awt/dnd/DropTarget.java
+++ b/jdk/src/share/classes/java/awt/dnd/DropTarget.java
@@ -197,7 +197,7 @@
      * <P>
      * The Component will receive drops only if it is enabled.
      * @param c The new <code>Component</code> this <code>DropTarget</code>
-     * is to be associated with.<P>
+     * is to be associated with.
      */
 
     public synchronized void setComponent(Component c) {
@@ -246,7 +246,6 @@
      * Sets the default acceptable actions for this <code>DropTarget</code>
      * <P>
      * @param ops the default actions
-     * <P>
      * @see java.awt.dnd.DnDConstants
      */
 
diff --git a/jdk/src/share/classes/java/awt/event/MouseAdapter.java b/jdk/src/share/classes/java/awt/event/MouseAdapter.java
index b908a66..dfc16d9 100644
--- a/jdk/src/share/classes/java/awt/event/MouseAdapter.java
+++ b/jdk/src/share/classes/java/awt/event/MouseAdapter.java
@@ -49,7 +49,7 @@
  * methods.
  * The relevant method in the listener object is invoked  and the {@code MouseEvent}
  * or {@code MouseWheelEvent}  is passed to it in following cases:
- * <p><ul>
+ * <ul>
  * <li>when a mouse button is pressed, released, or clicked (pressed and  released)
  * <li>when the mouse cursor enters or exits the component
  * <li>when the mouse wheel rotated, or mouse moved or dragged
diff --git a/jdk/src/share/classes/java/awt/font/FontRenderContext.java b/jdk/src/share/classes/java/awt/font/FontRenderContext.java
index f9f5f1e..240ea89 100644
--- a/jdk/src/share/classes/java/awt/font/FontRenderContext.java
+++ b/jdk/src/share/classes/java/awt/font/FontRenderContext.java
@@ -57,7 +57,6 @@
 *   <code>FontRenderContext</code> which is directly constructed will
 *   most likely not represent any actual graphics device, and may lead
 *   to unexpected or incorrect results.
-*   <p>
 *   @see java.awt.RenderingHints#KEY_TEXT_ANTIALIASING
 *   @see java.awt.RenderingHints#KEY_FRACTIONALMETRICS
 *   @see java.awt.Graphics2D#getFontRenderContext()
diff --git a/jdk/src/share/classes/java/awt/font/StyledParagraph.java b/jdk/src/share/classes/java/awt/font/StyledParagraph.java
index df231bf..e0447df 100644
--- a/jdk/src/share/classes/java/awt/font/StyledParagraph.java
+++ b/jdk/src/share/classes/java/awt/font/StyledParagraph.java
@@ -322,7 +322,7 @@
     }
 
     /**
-     * Return i such that starts[i] <= index < starts[i+1].  starts
+     * Return i such that starts[i] &lt;= index &lt; starts[i+1].  starts
      * must be in increasing order, with at least one element greater
      * than index.
      */
diff --git a/jdk/src/share/classes/java/awt/geom/AffineTransform.java b/jdk/src/share/classes/java/awt/geom/AffineTransform.java
index d3c27ff..494e3c8 100644
--- a/jdk/src/share/classes/java/awt/geom/AffineTransform.java
+++ b/jdk/src/share/classes/java/awt/geom/AffineTransform.java
@@ -46,8 +46,7 @@
  *      [ y'] = [  m10  m11  m12  ] [ y ] = [ m10x + m11y + m12 ]
  *      [ 1 ]   [   0    0    1   ] [ 1 ]   [         1         ]
  * </pre>
- * <p>
- * <h4><a name="quadrantapproximation">Handling 90-Degree Rotations</a></h4>
+ * <h3><a name="quadrantapproximation">Handling 90-Degree Rotations</a></h3>
  * <p>
  * In some variations of the <code>rotate</code> methods in the
  * <code>AffineTransform</code> class, a double-precision argument
diff --git a/jdk/src/share/classes/java/awt/geom/QuadCurve2D.java b/jdk/src/share/classes/java/awt/geom/QuadCurve2D.java
index a2c41d9..56d435f 100644
--- a/jdk/src/share/classes/java/awt/geom/QuadCurve2D.java
+++ b/jdk/src/share/classes/java/awt/geom/QuadCurve2D.java
@@ -1047,7 +1047,7 @@
     /**
      * Evaluate the t values in the first num slots of the vals[] array
      * and place the evaluated values back into the same array.  Only
-     * evaluate t values that are within the range <0, 1>, including
+     * evaluate t values that are within the range &lt;0, 1&gt;, including
      * the 0 and 1 ends of the range iff the include0 or include1
      * booleans are true.  If an "inflection" equation is handed in,
      * then any points which represent a point of inflection for that
@@ -1081,7 +1081,7 @@
 
     /**
      * Determine where coord lies with respect to the range from
-     * low to high.  It is assumed that low <= high.  The return
+     * low to high.  It is assumed that low &lt;= high.  The return
      * value is one of the 5 values BELOW, LOWEDGE, INSIDE, HIGHEDGE,
      * or ABOVE.
      */
diff --git a/jdk/src/share/classes/java/awt/image/BufferStrategy.java b/jdk/src/share/classes/java/awt/image/BufferStrategy.java
index 7a4f793..1bd882c 100644
--- a/jdk/src/share/classes/java/awt/image/BufferStrategy.java
+++ b/jdk/src/share/classes/java/awt/image/BufferStrategy.java
@@ -54,7 +54,6 @@
  * <p>
  * Alternatively, the contents of the back buffer can be copied, or
  * <i>blitted</i> forward in a chain instead of moving the video pointer.
- * <p>
  * <pre>{@code
  * Double buffering:
  *
diff --git a/jdk/src/share/classes/java/awt/image/BufferedImage.java b/jdk/src/share/classes/java/awt/image/BufferedImage.java
index 811c209..df96883 100644
--- a/jdk/src/share/classes/java/awt/image/BufferedImage.java
+++ b/jdk/src/share/classes/java/awt/image/BufferedImage.java
@@ -927,7 +927,6 @@
      * each color component in the returned data when
      * using this method.  With a specified coordinate (x,&nbsp;y) in the
      * image, the ARGB pixel can be accessed in this way:
-     * <p>
      *
      * <pre>
      *    pixel   = rgbArray[offset + (y-startY)*scansize + (x-startX)]; </pre>
diff --git a/jdk/src/share/classes/java/awt/image/ColorConvertOp.java b/jdk/src/share/classes/java/awt/image/ColorConvertOp.java
index 7ba1158..712eae4 100644
--- a/jdk/src/share/classes/java/awt/image/ColorConvertOp.java
+++ b/jdk/src/share/classes/java/awt/image/ColorConvertOp.java
@@ -23,7 +23,8 @@
  * questions.
  */
 
-/**********************************************************************
+/*
+ **********************************************************************
  **********************************************************************
  **********************************************************************
  *** COPYRIGHT (c) Eastman Kodak Company, 1997                      ***
@@ -64,7 +65,6 @@
  * color conversion.
  * <p>
  * Note that Source and Destination may be the same object.
- * <p>
  * @see java.awt.RenderingHints#KEY_COLOR_RENDERING
  * @see java.awt.RenderingHints#KEY_DITHERING
  */
diff --git a/jdk/src/share/classes/java/awt/peer/CheckboxPeer.java b/jdk/src/share/classes/java/awt/peer/CheckboxPeer.java
index fb4c4e6..abdbec9 100644
--- a/jdk/src/share/classes/java/awt/peer/CheckboxPeer.java
+++ b/jdk/src/share/classes/java/awt/peer/CheckboxPeer.java
@@ -41,7 +41,7 @@
      * Sets the state of the checkbox to be checked ({@code true}) or
      * unchecked ({@code false}).
      *
-     * @param t the state to set on the checkbox
+     * @param state the state to set on the checkbox
      *
      * @see Checkbox#setState(boolean)
      */
diff --git a/jdk/src/share/classes/java/awt/peer/DesktopPeer.java b/jdk/src/share/classes/java/awt/peer/DesktopPeer.java
index 72a87ec..48603d6 100644
--- a/jdk/src/share/classes/java/awt/peer/DesktopPeer.java
+++ b/jdk/src/share/classes/java/awt/peer/DesktopPeer.java
@@ -87,7 +87,7 @@
      * filling the message fields including to, cc, etc, with the values
      * specified by the given mailto URL.
      *
-     * @param uri represents a mailto URL with specified values of the message.
+     * @param mailtoURL represents a mailto URL with specified values of the message.
      *        The syntax of mailto URL is defined by
      *        <a href="http://www.ietf.org/rfc/rfc2368.txt">RFC2368: The mailto
      *        URL scheme</a>
@@ -103,5 +103,5 @@
      * @throws IOException If the user default browser is not found,
      *         or it fails to be launched.
      */
-    void browse(URI url) throws IOException;
+    void browse(URI uri) throws IOException;
 }
diff --git a/jdk/src/share/classes/java/io/BufferedReader.java b/jdk/src/share/classes/java/io/BufferedReader.java
index 98fe47c..ee9f66a 100644
--- a/jdk/src/share/classes/java/io/BufferedReader.java
+++ b/jdk/src/share/classes/java/io/BufferedReader.java
@@ -533,7 +533,7 @@
     /**
      * Returns a {@code Stream}, the elements of which are lines read from
      * this {@code BufferedReader}.  The {@link Stream} is lazily populated,
-     * i.e, read only occurs during the
+     * i.e., read only occurs during the
      * <a href="../util/stream/package-summary.html#StreamOps">terminal
      * stream operation</a>.
      *
@@ -550,8 +550,8 @@
      * UncheckedIOException} which will be thrown from the {@code Stream}
      * method that caused the read to take place. This method will return a
      * Stream if invoked on a BufferedReader that is closed. Any operation on
-     * that stream requires reading from the BufferedReader after is it closed
-     * will cause an UncheckedIOException to be thrown.
+     * that stream that requires reading from the BufferedReader after it is
+     * closed, will cause an UncheckedIOException to be thrown.
      *
      * @return a {@code Stream<String>} providing the lines of text
      *         described by this {@code BufferedReader}
@@ -587,6 +587,7 @@
                 }
             }
         };
-        return StreamSupport.stream(Spliterators.spliteratorUnknownSize(iter, Spliterator.ORDERED), false);
+        return StreamSupport.stream(Spliterators.spliteratorUnknownSize(
+                iter, Spliterator.ORDERED | Spliterator.NONNULL), false);
     }
 }
diff --git a/jdk/src/share/classes/java/lang/CharSequence.java b/jdk/src/share/classes/java/lang/CharSequence.java
index a74a9d0..4d9ab3f 100644
--- a/jdk/src/share/classes/java/lang/CharSequence.java
+++ b/jdk/src/share/classes/java/lang/CharSequence.java
@@ -87,7 +87,7 @@
     char charAt(int index);
 
     /**
-     * Returns a new <code>CharSequence</code> that is a subsequence of this sequence.
+     * Returns a <code>CharSequence</code> that is a subsequence of this sequence.
      * The subsequence starts with the <code>char</code> value at the specified index and
      * ends with the <code>char</code> value at index <tt>end - 1</tt>.  The length
      * (in <code>char</code>s) of the
diff --git a/jdk/src/share/classes/java/lang/Class.java b/jdk/src/share/classes/java/lang/Class.java
index 45c0091..ea47cca 100644
--- a/jdk/src/share/classes/java/lang/Class.java
+++ b/jdk/src/share/classes/java/lang/Class.java
@@ -1565,8 +1565,12 @@
      * methods inherited by the array type from {@code Object}. It does not
      * contain a {@code Method} object for {@code clone()}.
      *
-     * <p> If this {@code Class} object represents a class or interface with no
-     * public methods, then the returned array has length 0.
+     * <p> If this {@code Class} object represents an interface then the
+     * returned array does not contain any implicitly declared methods from
+     * {@code Object}. Therefore, if no methods are explicitly declared in
+     * this interface or any of its superinterfaces then the returned array
+     * has length 0. (Note that a {@code Class} object which represents a class
+     * always has public methods, inherited from {@code Object}.)
      *
      * <p> If this {@code Class} object represents a primitive type or void,
      * then the returned array has length 0.
@@ -1699,25 +1703,29 @@
      * order. If {@code parameterTypes} is {@code null}, it is
      * treated as if it were an empty array.
      *
-     * <p> If the {@code name} is "{@code <init>};"or "{@code <clinit>}" a
+     * <p> If the {@code name} is "{@code <init>}" or "{@code <clinit>}" a
      * {@code NoSuchMethodException} is raised. Otherwise, the method to
      * be reflected is determined by the algorithm that follows.  Let C be the
-     * class represented by this object:
+     * class or interface represented by this object:
      * <OL>
-     * <LI> C is searched for any <I>matching methods</I>. If no matching
-     *      method is found, the algorithm of step 1 is invoked recursively on
-     *      the superclass of C.</LI>
-     * <LI> If no method was found in step 1 above, the superinterfaces of C
-     *      are searched for a matching method. If any such method is found, it
-     *      is reflected.</LI>
+     * <LI> C is searched for a <I>matching method</I>, as defined below. If a
+     *      matching method is found, it is reflected.</LI>
+     * <LI> If no matching method is found by step 1 then:
+     *   <OL TYPE="a">
+     *   <LI> If C is a class other than {@code Object}, then this algorithm is
+     *        invoked recursively on the superclass of C.</LI>
+     *   <LI> If C is the class {@code Object}, or if C is an interface, then
+     *        the superinterfaces of C (if any) are searched for a matching
+     *        method. If any such method is found, it is reflected.</LI>
+     *   </OL></LI>
      * </OL>
      *
-     * To find a matching method in a class C:&nbsp; If C declares exactly one
-     * public method with the specified name and exactly the same formal
-     * parameter types, that is the method reflected. If more than one such
-     * method is found in C, and one of these methods has a return type that is
-     * more specific than any of the others, that method is reflected;
-     * otherwise one of the methods is chosen arbitrarily.
+     * <p> To find a matching method in a class or interface C:&nbsp; If C
+     * declares exactly one public method with the specified name and exactly
+     * the same formal parameter types, that is the method reflected. If more
+     * than one such method is found in C, and one of these methods has a
+     * return type that is more specific than any of the others, that method is
+     * reflected; otherwise one of the methods is chosen arbitrarily.
      *
      * <p>Note that there may be more than one matching method in a
      * class because while the Java language forbids a class to
diff --git a/jdk/src/share/classes/java/lang/String.java b/jdk/src/share/classes/java/lang/String.java
index 4efec83..6565f64 100644
--- a/jdk/src/share/classes/java/lang/String.java
+++ b/jdk/src/share/classes/java/lang/String.java
@@ -1958,7 +1958,7 @@
     }
 
     /**
-     * Returns a new character sequence that is a subsequence of this sequence.
+     * Returns a character sequence that is a subsequence of this sequence.
      *
      * <p> An invocation of this method of the form
      *
diff --git a/jdk/src/share/classes/java/lang/doc-files/ValueBased.html b/jdk/src/share/classes/java/lang/doc-files/ValueBased.html
new file mode 100644
index 0000000..7e1ee8b
--- /dev/null
+++ b/jdk/src/share/classes/java/lang/doc-files/ValueBased.html
@@ -0,0 +1,42 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html lang="en">
+<head>
+  <title>Value-based Classes</title>
+  <link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
+</head>
+<body>
+<h2 id="ValueBased">Value-based Classes</h2>
+
+Some classes, such as <code>java.util.Optional</code> and
+<code>java.time.LocalDateTime</code>, are <em>value-based</em>.  Instances of a
+value-based class:
+<ul>
+    <li>are final and immutable (though may contain references to mutable
+        objects);</li>
+    <li>have implementations of <code>equals</code>,
+        <code>hashCode</code>, and <code>toString</code> which are computed
+        solely from the instance's state and not from its identity or the state
+        of any other object or variable;</li>
+    <li>make no use of identity-sensitive operations such as reference
+        equality (<code>==</code>) between instances, identity hash code of
+        instances, or synchronization on an instances's intrinsic lock;</li>
+    <li>are considered equal solely based on <code>equals()</code>, not
+        based on reference equality (<code>==</code>);</li>
+    <li>do not have accessible constructors, but are instead instantiated
+        through factory methods which make no committment as to the identity
+        of returned instances;</li>
+    <li>are <em>freely substitutable</em> when equal, meaning that interchanging
+        any two instances <code>x</code> and <code>y</code> that are equal
+        according to <code>equals()</code> in any computation or method
+        invocation should produce no visible change in behavior.
+    </li>
+</ul>
+
+<p>A program may produce unpredictable results if it attempts to distinguish two
+    references to equal values of a value-based class, whether directly via reference
+    equality or indirectly via an appeal to synchronization, identity hashing,
+    serialization, or any other identity-sensitive mechanism.  Use of such
+    identity-sensitive operations on instances of value-based classes may have
+    unpredictable effects and should be avoided.</p>
+</body>
+</html>
diff --git a/jdk/src/share/classes/java/math/BigInteger.java b/jdk/src/share/classes/java/math/BigInteger.java
index 5fab744..79291ee 100644
--- a/jdk/src/share/classes/java/math/BigInteger.java
+++ b/jdk/src/share/classes/java/math/BigInteger.java
@@ -215,7 +215,7 @@
      * Karatsuba multiplication will be used.   This value is found
      * experimentally to work well.
      */
-    private static final int KARATSUBA_THRESHOLD = 50;
+    private static final int KARATSUBA_THRESHOLD = 80;
 
     /**
      * The threshold value for using 3-way Toom-Cook multiplication.
@@ -224,7 +224,7 @@
      * the mag arrays is greater than this threshold, then Toom-Cook
      * multiplication will be used.
      */
-    private static final int TOOM_COOK_THRESHOLD = 75;
+    private static final int TOOM_COOK_THRESHOLD = 240;
 
     /**
      * The threshold value for using Karatsuba squaring.  If the number
@@ -232,7 +232,7 @@
      * Karatsuba squaring will be used.   This value is found
      * experimentally to work well.
      */
-    private static final int KARATSUBA_SQUARE_THRESHOLD = 90;
+    private static final int KARATSUBA_SQUARE_THRESHOLD = 128;
 
     /**
      * The threshold value for using Toom-Cook squaring.  If the number
@@ -240,15 +240,23 @@
      * Toom-Cook squaring will be used.   This value is found
      * experimentally to work well.
      */
-    private static final int TOOM_COOK_SQUARE_THRESHOLD = 140;
+    private static final int TOOM_COOK_SQUARE_THRESHOLD = 216;
 
     /**
      * The threshold value for using Burnikel-Ziegler division.  If the number
-     * of ints in the number are larger than this value,
-     * Burnikel-Ziegler division will be used.   This value is found
-     * experimentally to work well.
+     * of ints in the divisor are larger than this value, Burnikel-Ziegler
+     * division may be used.  This value is found experimentally to work well.
      */
-    static final int BURNIKEL_ZIEGLER_THRESHOLD = 50;
+    static final int BURNIKEL_ZIEGLER_THRESHOLD = 80;
+
+    /**
+     * The offset value for using Burnikel-Ziegler division.  If the number
+     * of ints in the divisor exceeds the Burnikel-Ziegler threshold, and the
+     * number of ints in the dividend is greater than the number of ints in the
+     * divisor plus this value, Burnikel-Ziegler division will be used.  This
+     * value is found experimentally to work well.
+     */
+    static final int BURNIKEL_ZIEGLER_OFFSET = 40;
 
     /**
      * The threshold value for using Schoenhage recursive base conversion. If
@@ -258,7 +266,7 @@
      * relatively flat for thresholds between 2-25, so this choice may be
      * varied within this range for very small effect.
      */
-    private static final int SCHOENHAGE_BASE_CONVERSION_THRESHOLD = 8;
+    private static final int SCHOENHAGE_BASE_CONVERSION_THRESHOLD = 20;
 
     //Constructors
 
@@ -1815,7 +1823,7 @@
         int len = mag.length;
 
         if (len <= n) {
-            return this;
+            return abs();
         }
 
         int lowerInts[] = new int[n];
@@ -2017,8 +2025,8 @@
      * @throws ArithmeticException if {@code val} is zero.
      */
     public BigInteger divide(BigInteger val) {
-        if (mag.length < BURNIKEL_ZIEGLER_THRESHOLD ||
-                val.mag.length < BURNIKEL_ZIEGLER_THRESHOLD) {
+        if (val.mag.length < BURNIKEL_ZIEGLER_THRESHOLD ||
+                mag.length - val.mag.length < BURNIKEL_ZIEGLER_OFFSET) {
             return divideKnuth(val);
         } else {
             return divideBurnikelZiegler(val);
@@ -2054,8 +2062,8 @@
      * @throws ArithmeticException if {@code val} is zero.
      */
     public BigInteger[] divideAndRemainder(BigInteger val) {
-        if (mag.length < BURNIKEL_ZIEGLER_THRESHOLD ||
-                val.mag.length < BURNIKEL_ZIEGLER_THRESHOLD) {
+        if (val.mag.length < BURNIKEL_ZIEGLER_THRESHOLD ||
+                mag.length - val.mag.length < BURNIKEL_ZIEGLER_OFFSET) {
             return divideAndRemainderKnuth(val);
         } else {
             return divideAndRemainderBurnikelZiegler(val);
@@ -2083,8 +2091,8 @@
      * @throws ArithmeticException if {@code val} is zero.
      */
     public BigInteger remainder(BigInteger val) {
-        if (mag.length < BURNIKEL_ZIEGLER_THRESHOLD ||
-                val.mag.length < BURNIKEL_ZIEGLER_THRESHOLD) {
+        if (val.mag.length < BURNIKEL_ZIEGLER_THRESHOLD ||
+                mag.length - val.mag.length < BURNIKEL_ZIEGLER_OFFSET) {
             return remainderKnuth(val);
         } else {
             return remainderBurnikelZiegler(val);
diff --git a/jdk/src/share/classes/java/math/MutableBigInteger.java b/jdk/src/share/classes/java/math/MutableBigInteger.java
index bc4e484..5bb5c37 100644
--- a/jdk/src/share/classes/java/math/MutableBigInteger.java
+++ b/jdk/src/share/classes/java/math/MutableBigInteger.java
@@ -1148,8 +1148,8 @@
     }
 
     MutableBigInteger divide(MutableBigInteger b, MutableBigInteger quotient, boolean needRemainder) {
-        if (intLen < BigInteger.BURNIKEL_ZIEGLER_THRESHOLD ||
-                b.intLen < BigInteger.BURNIKEL_ZIEGLER_THRESHOLD) {
+        if (b.intLen < BigInteger.BURNIKEL_ZIEGLER_THRESHOLD ||
+                intLen - b.intLen < BigInteger.BURNIKEL_ZIEGLER_OFFSET) {
             return divideKnuth(b, quotient, needRemainder);
         } else {
             return divideAndRemainderBurnikelZiegler(b, quotient);
diff --git a/jdk/src/share/classes/java/security/Provider.java b/jdk/src/share/classes/java/security/Provider.java
index 0d5309c..7e3def8 100644
--- a/jdk/src/share/classes/java/security/Provider.java
+++ b/jdk/src/share/classes/java/security/Provider.java
@@ -336,6 +336,8 @@
      *          if a security manager exists and its {@link
      *          java.lang.SecurityManager#checkSecurityAccess} method
      *          denies access to set property values.
+     *
+     * @since 1.8
      */
     @Override
     public synchronized Object putIfAbsent(Object key, Object value) {
@@ -385,6 +387,8 @@
      *          if a security manager exists and its {@link
      *          java.lang.SecurityManager#checkSecurityAccess} method
      *          denies access to remove this provider's properties.
+     *
+     * @since 1.8
      */
     @Override
     public synchronized boolean remove(Object key, Object value) {
@@ -408,6 +412,8 @@
      *          if a security manager exists and its {@link
      *          java.lang.SecurityManager#checkSecurityAccess} method
      *          denies access to set property values.
+     *
+     * @since 1.8
      */
     @Override
     public synchronized boolean replace(Object key, Object oldValue,
@@ -433,6 +439,8 @@
      *          if a security manager exists and its {@link
      *          java.lang.SecurityManager#checkSecurityAccess} method
      *          denies access to set property values.
+     *
+     * @since 1.8
      */
     @Override
     public synchronized Object replace(Object key, Object value) {
@@ -459,6 +467,8 @@
      *          if a security manager exists and its {@link
      *          java.lang.SecurityManager#checkSecurityAccess} method
      *          denies access to set property values.
+     *
+     * @since 1.8
      */
     @Override
     public synchronized void replaceAll(BiFunction<? super Object, ? super Object, ? extends Object> function) {
@@ -485,6 +495,8 @@
      *          if a security manager exists and its {@link
      *          java.lang.SecurityManager#checkSecurityAccess} method
      *          denies access to set property values or remove properties.
+     *
+     * @since 1.8
      */
     @Override
     public synchronized Object compute(Object key,
@@ -514,6 +526,8 @@
      *          if a security manager exists and its {@link
      *          java.lang.SecurityManager#checkSecurityAccess} method
      *          denies access to set property values and remove properties.
+     *
+     * @since 1.8
      */
     @Override
     public synchronized Object computeIfAbsent(Object key, Function<? super Object, ? extends Object> mappingFunction) {
@@ -541,6 +555,8 @@
      *          if a security manager exists and its {@link
      *          java.lang.SecurityManager#checkSecurityAccess} method
      *          denies access to set property values or remove properties.
+     *
+     * @since 1.8
      */
     @Override
     public synchronized Object computeIfPresent(Object key, BiFunction<? super Object, ? super Object, ? extends Object> remappingFunction) {
@@ -571,6 +587,8 @@
      *          if a security manager exists and its {@link
      *          java.lang.SecurityManager#checkSecurityAccess} method
      *          denies access to set property values or remove properties.
+     *
+     * @since 1.8
      */
     @Override
     public synchronized Object merge(Object key, Object value,  BiFunction<? super Object, ? super Object, ? extends Object>  remappingFunction) {
@@ -589,13 +607,18 @@
         checkInitialized();
         return super.get(key);
     }
-
+    /**
+     * @since 1.8
+     */
     @Override
     public synchronized Object getOrDefault(Object key, Object defaultValue) {
         checkInitialized();
         return super.getOrDefault(key, defaultValue);
     }
 
+    /**
+     * @since 1.8
+     */
     @Override
     public synchronized void forEach(BiConsumer<? super Object, ? super Object> action) {
         checkInitialized();
diff --git a/jdk/src/share/classes/java/sql/CallableStatement.java b/jdk/src/share/classes/java/sql/CallableStatement.java
index 9e593ae..a830b63 100644
--- a/jdk/src/share/classes/java/sql/CallableStatement.java
+++ b/jdk/src/share/classes/java/sql/CallableStatement.java
@@ -1108,7 +1108,7 @@
      * parameter; if a database access error occurs or
      * this method is called on a closed <code>CallableStatement</code>
      * @exception SQLFeatureNotSupportedException if
-     * the JDBC driver does not support this data type
+     * the JDBC driver does not support the specified targetSqlType
      * @see Types
      * @see #getObject
      * @since 1.4
@@ -1131,7 +1131,7 @@
      * parameter; if a database access error occurs or
      * this method is called on a closed <code>CallableStatement</code>
      * @exception SQLFeatureNotSupportedException if
-     * the JDBC driver does not support this data type
+     * the JDBC driver does not support the specified targetSqlType
      * @see #getObject
      * @since 1.4
      */
@@ -2536,7 +2536,7 @@
      *            or Reader object and the value of the scale parameter is less
      *            than zero
      * @exception SQLFeatureNotSupportedException if
-     * the JDBC driver does not support this data type
+     * the JDBC driver does not support the specified targetSqlType
      * @see JDBCType
      * @see SQLType
      *
@@ -2562,7 +2562,7 @@
      * parameter; if a database access error occurs
      * or this method is called on a closed {@code CallableStatement}
      * @exception SQLFeatureNotSupportedException if
-     * the JDBC driver does not support this data type
+     * the JDBC driver does not support the specified targetSqlType
      * @see JDBCType
      * @see SQLType
      * @since 1.8
@@ -2603,7 +2603,7 @@
      * if a database access error occurs or
      * this method is called on a closed {@code CallableStatement}
      * @exception SQLFeatureNotSupportedException if
-     * the JDBC driver does not support this data type
+     * the JDBC driver does not support the specified sqlType
      * @see JDBCType
      * @see SQLType
      * @since 1.8
@@ -2639,7 +2639,7 @@
      * if a database access error occurs or
      * this method is called on a closed {@code CallableStatement}
      * @exception SQLFeatureNotSupportedException if
-     * the JDBC driver does not support this data type
+     * the JDBC driver does not support the specified sqlType
      * @see JDBCType
      * @see SQLType
      * @since 1.8
@@ -2686,7 +2686,7 @@
      * if a database access error occurs or
      * this method is called on a closed {@code CallableStatement}
      * @exception SQLFeatureNotSupportedException if
-     * the JDBC driver does not support this data type
+     * the JDBC driver does not support the specified sqlType
      * @see JDBCType
      * @see SQLType
      * @since 1.8
@@ -2725,7 +2725,7 @@
      * parameter; if a database access error occurs or
      * this method is called on a closed {@code CallableStatement}
      * @exception SQLFeatureNotSupportedException if
-     * the JDBC driver does not support this data type
+     * the JDBC driver does not support the specified sqlType
      * or if the JDBC driver does not support
      * this method
      * @since 1.8
@@ -2762,7 +2762,7 @@
      * parameter; if a database access error occurs or
      * this method is called on a closed {@code CallableStatement}
      * @exception SQLFeatureNotSupportedException if
-     * the JDBC driver does not support this data type
+     * the JDBC driver does not support the specified sqlType
      * or if the JDBC driver does not support
      * this method
      * @since 1.8
@@ -2811,7 +2811,7 @@
      * parameter; if a database access error occurs or
      * this method is called on a closed {@code CallableStatement}
      * @exception SQLFeatureNotSupportedException if
-     * the JDBC driver does not support this data type
+     * the JDBC driver does not support the specified sqlType
      * or if the JDBC driver does not support this method
      * @see JDBCType
      * @see SQLType
diff --git a/jdk/src/share/classes/java/sql/DriverManager.java b/jdk/src/share/classes/java/sql/DriverManager.java
index 53b4762..a9190a4 100644
--- a/jdk/src/share/classes/java/sql/DriverManager.java
+++ b/jdk/src/share/classes/java/sql/DriverManager.java
@@ -213,8 +213,8 @@
      * The <code>DriverManager</code> attempts to select an appropriate driver from
      * the set of registered JDBC drivers.
      *<p>
-     * <B>Note:</B> If a property is specified as part of the {@code url} and
-     * is also specified in the {@code Properties} object, it is
+     * <B>Note:</B> If the {@code user} or {@code password} property are
+     * also specified as part of the {@code url}, it is
      * implementation-defined as to which value will take precedence.
      * For maximum portability, an application should only specify a
      * property once.
@@ -320,7 +320,7 @@
      * Registers the given driver with the {@code DriverManager}.
      * A newly-loaded driver class should call
      * the method {@code registerDriver} to make itself
-     * known to the {@code DriverManager}. If the driver had previously been
+     * known to the {@code DriverManager}. If the driver is currently
      * registered, no action is taken.
      *
      * @param driver the new JDBC Driver that is to be registered with the
@@ -338,7 +338,7 @@
      * Registers the given driver with the {@code DriverManager}.
      * A newly-loaded driver class should call
      * the method {@code registerDriver} to make itself
-     * known to the {@code DriverManager}. If the driver had previously been
+     * known to the {@code DriverManager}. If the driver is currently
      * registered, no action is taken.
      *
      * @param driver the new JDBC Driver that is to be registered with the
@@ -347,6 +347,7 @@
      *               {@code DriverManager#deregisterDriver} is called
      * @exception SQLException if a database access error occurs
      * @exception NullPointerException if {@code driver} is null
+     * @since 1.8
      */
     public static synchronized void registerDriver(java.sql.Driver driver,
             DriverAction da)
diff --git a/jdk/src/share/classes/java/sql/JDBCType.java b/jdk/src/share/classes/java/sql/JDBCType.java
index 74ee8e0..89db37b 100644
--- a/jdk/src/share/classes/java/sql/JDBCType.java
+++ b/jdk/src/share/classes/java/sql/JDBCType.java
@@ -218,8 +218,8 @@
     }
 
     /**
-     * Returns the name of the data type.
-     * @return The name of the data type.
+     *{@inheritDoc }
+     * @return The name of this {@code SQLType}.
      */
     public String getName() {
         return name();
diff --git a/jdk/src/share/classes/java/sql/PreparedStatement.java b/jdk/src/share/classes/java/sql/PreparedStatement.java
index 20cde7f..2b2e7f3 100644
--- a/jdk/src/share/classes/java/sql/PreparedStatement.java
+++ b/jdk/src/share/classes/java/sql/PreparedStatement.java
@@ -401,7 +401,7 @@
     * marker in the SQL statement; if a database access error occurs or this
     * method is called on a closed PreparedStatement
     * @exception SQLFeatureNotSupportedException if
-    * the JDBC driver does not support this data type
+    * the JDBC driver does not support the specified targetSqlType
     * @see Types
     */
     void setObject(int parameterIndex, Object x, int targetSqlType)
@@ -951,7 +951,7 @@
      *            or Reader object and the value of the scale parameter is less
      *            than zero
      * @exception SQLFeatureNotSupportedException if
-     * the JDBC driver does not support this data type
+     * the JDBC driver does not support the specified targetSqlType
      * @see Types
      *
      */
@@ -1255,7 +1255,7 @@
      *            or Reader object and the value of the scale parameter is less
      *            than zero
      * @exception SQLFeatureNotSupportedException if
-     * the JDBC driver does not support this data type
+     * the JDBC driver does not support the specified targetSqlType
      * @see JDBCType
      * @see SQLType
      * @since 1.8
@@ -1281,7 +1281,7 @@
      * parameter marker in the SQL statement; if a database access error occurs
      * or this method is called on a closed {@code PreparedStatement}
      * @exception SQLFeatureNotSupportedException if
-     * the JDBC driver does not support this data type
+     * the JDBC driver does not support the specified targetSqlType
      * @see JDBCType
      * @see SQLType
      * @since 1.8
diff --git a/jdk/src/share/classes/java/sql/ResultSet.java b/jdk/src/share/classes/java/sql/ResultSet.java
index 5ac61d1..d939a9a 100644
--- a/jdk/src/share/classes/java/sql/ResultSet.java
+++ b/jdk/src/share/classes/java/sql/ResultSet.java
@@ -4178,7 +4178,7 @@
      * the result set concurrency is {@code CONCUR_READ_ONLY}
      * or this method is called on a closed result set
      * @exception SQLFeatureNotSupportedException if the JDBC driver does not
-     * support this method; if the JDBC driver does not support this data type
+     * support this method; if the JDBC driver does not support the specified targetSqlType
      * @see JDBCType
      * @see SQLType
      * @since 1.8
@@ -4221,7 +4221,7 @@
      * the result set concurrency is {@code CONCUR_READ_ONLY}
      * or this method is called on a closed result set
      * @exception SQLFeatureNotSupportedException if the JDBC driver does not
-     * support this method; if the JDBC driver does not support this data type
+     * support this method; if the JDBC driver does not support the specified targetSqlType
      * @see JDBCType
      * @see SQLType
      * @since 1.8
@@ -4249,7 +4249,7 @@
      * the result set concurrency is {@code CONCUR_READ_ONLY}
      * or this method is called on a closed result set
      * @exception SQLFeatureNotSupportedException if the JDBC driver does not
-     * support this method; if the JDBC driver does not support this data type
+     * support this method; if the JDBC driver does not support the specified targetSqlType
      * @see JDBCType
      * @see SQLType
      * @since 1.8
@@ -4279,7 +4279,7 @@
      * the result set concurrency is {@code CONCUR_READ_ONLY}
      * or this method is called on a closed result set
      * @exception SQLFeatureNotSupportedException if the JDBC driver does not
-     * support this method; if the JDBC driver does not support this data type
+     * support this method; if the JDBC driver does not support the specified targetSqlType
      * @see JDBCType
      * @see SQLType
      * @since 1.8
diff --git a/jdk/src/share/classes/java/sql/SQLPermission.java b/jdk/src/share/classes/java/sql/SQLPermission.java
index e3a2422..951430d 100644
--- a/jdk/src/share/classes/java/sql/SQLPermission.java
+++ b/jdk/src/share/classes/java/sql/SQLPermission.java
@@ -122,7 +122,7 @@
      *
      * @param name the name of this <code>SQLPermission</code> object, which must
      * be either {@code  setLog}, {@code callAbort}, {@code setSyncFactory},
-     *  or {@code setNetworkTimeout}
+     *  {@code deregisterDriver}, or {@code setNetworkTimeout}
      * @throws NullPointerException if <code>name</code> is <code>null</code>.
      * @throws IllegalArgumentException if <code>name</code> is empty.
 
@@ -140,7 +140,7 @@
      *
      * @param name the name of this <code>SQLPermission</code> object, which must
      * be either {@code  setLog}, {@code callAbort}, {@code setSyncFactory},
-     *  or {@code setNetworkTimeout}
+     *  {@code deregisterDriver}, or {@code setNetworkTimeout}
      * @param actions should be <code>null</code>
      * @throws NullPointerException if <code>name</code> is <code>null</code>.
      * @throws IllegalArgumentException if <code>name</code> is empty.
diff --git a/jdk/src/share/classes/java/util/Base64.java b/jdk/src/share/classes/java/util/Base64.java
index ac5a5d6..172acbe 100644
--- a/jdk/src/share/classes/java/util/Base64.java
+++ b/jdk/src/share/classes/java/util/Base64.java
@@ -351,62 +351,6 @@
         }
 
         /**
-         * Encodes as many bytes as possible from the input byte buffer
-         * using the {@link Base64} encoding scheme, writing the resulting
-         * bytes to the given output byte buffer.
-         *
-         * <p>The buffers are read from, and written to, starting at their
-         * current positions. Upon return, the input and output buffers'
-         * positions will be advanced to reflect the bytes read and written,
-         * but their limits will not be modified.
-         *
-         * <p>The encoding operation will stop and return if either all
-         * remaining bytes in the input buffer have been encoded and written
-         * to the output buffer, or the output buffer has insufficient space
-         * to encode any more input bytes. The encoding operation can be
-         * continued, if there is more bytes in input buffer to be encoded,
-         * by invoking this method again with an output buffer that has more
-         * {@linkplain java.nio.Buffer#remaining remaining} bytes. This is
-         * typically done by draining any encoded bytes from the output buffer.
-         * The value returned from last invocation needs to be passed in as the
-         * third parameter {@code bytesOut} if it is to continue an unfinished
-         * encoding, 0 otherwise.
-         *
-         * <p><b>Recommended Usage Example</b>
-         * <pre>
-         *    ByteBuffer src = ...;
-         *    ByteBuffer dst = ...;
-         *    Base64.Encoder enc = Base64.getMimeDecoder();
-         *
-         *    int bytesOut = 0;
-         *    while (src.hasRemaining()) {
-         *        // clear output buffer for decoding
-         *        dst.clear();
-         *        bytesOut = enc.encode(src, dst, bytesOut);
-         *
-         *        // read encoded bytes out of "dst"
-         *        dst.flip();
-         *        ...
-         *    }
-         * </pre>
-         *
-         * @param   src
-         *          the input byte buffer to encode
-         * @param   dst
-         *          the output byte buffer
-         * @param   bytesOut
-         *          the return value of last invocation if this is to continue
-         *          an unfinished encoding operation, 0 otherwise
-         * @return  The sum total of {@code bytesOut} and the number of bytes
-         *          written to the output ByteBuffer during this invocation.
-         */
-        public int encode(ByteBuffer src, ByteBuffer dst, int bytesOut) {
-            if (src.hasArray() && dst.hasArray())
-                return encodeArray(src, dst, bytesOut);
-            return encodeBuffer(src, dst, bytesOut);
-        }
-
-        /**
          * Wraps an output stream for encoding byte data using the {@link Base64}
          * encoding scheme.
          *
@@ -444,160 +388,6 @@
             return new Encoder(isURL, newline, linemax, false);
         }
 
-        private int encodeArray(ByteBuffer src, ByteBuffer dst, int bytesOut) {
-            char[] base64 = isURL? toBase64URL : toBase64;
-            byte[] sa = src.array();
-            int    sp = src.arrayOffset() + src.position();
-            int    sl = src.arrayOffset() + src.limit();
-            byte[] da = dst.array();
-            int    dp = dst.arrayOffset() + dst.position();
-            int    dl = dst.arrayOffset() + dst.limit();
-            int    dp00 = dp;
-            int    dpos = 0;        // dp of each line
-            if (linemax > 0 && bytesOut > 0)
-                dpos = bytesOut % (linemax + newline.length);
-            try {
-                if (dpos == linemax && sp < src.limit()) {
-                    if (dp + newline.length > dl)
-                        return  dp - dp00 + bytesOut;
-                    for (byte b : newline){
-                        dst.put(dp++, b);
-                    }
-                    dpos = 0;
-                }
-                sl = sp + (sl - sp) / 3 * 3;
-                while (sp < sl) {
-                    int slen = (linemax > 0) ? (linemax - dpos) / 4 * 3
-                                             : sl - sp;
-                    int sl0 = Math.min(sp + slen, sl);
-                    for (int sp0 = sp, dp0 = dp ; sp0 < sl0; ) {
-                        if (dp0 + 4 > dl) {
-                            sp = sp0; dp = dp0;
-                            return  dp0 - dp00 + bytesOut;
-                        }
-                        int bits = (sa[sp0++] & 0xff) << 16 |
-                                   (sa[sp0++] & 0xff) <<  8 |
-                                   (sa[sp0++] & 0xff);
-                        da[dp0++] = (byte)base64[(bits >>> 18) & 0x3f];
-                        da[dp0++] = (byte)base64[(bits >>> 12) & 0x3f];
-                        da[dp0++] = (byte)base64[(bits >>> 6)  & 0x3f];
-                        da[dp0++] = (byte)base64[bits & 0x3f];
-                    }
-                    int n = (sl0 - sp) / 3 * 4;
-                    dpos += n;
-                    dp += n;
-                    sp = sl0;
-                    if (dpos == linemax && sp < src.limit()) {
-                        if (dp + newline.length > dl)
-                            return  dp - dp00 + bytesOut;
-                        for (byte b : newline){
-                            da[dp++] = b;
-                        }
-                        dpos = 0;
-                    }
-                }
-                sl = src.arrayOffset() + src.limit();
-                if (sp < sl && dl >= dp + 4) {       // 1 or 2 leftover bytes
-                    int b0 = sa[sp++] & 0xff;
-                    da[dp++] = (byte)base64[b0 >> 2];
-                    if (sp == sl) {
-                        da[dp++] = (byte)base64[(b0 << 4) & 0x3f];
-                        if (doPadding) {
-                            da[dp++] = '=';
-                            da[dp++] = '=';
-                        }
-                    } else {
-                        int b1 = sa[sp++] & 0xff;
-                        da[dp++] = (byte)base64[(b0 << 4) & 0x3f | (b1 >> 4)];
-                        da[dp++] = (byte)base64[(b1 << 2) & 0x3f];
-                        if (doPadding) {
-                            da[dp++] = '=';
-                        }
-                    }
-                }
-                return dp - dp00 + bytesOut;
-            } finally {
-                src.position(sp - src.arrayOffset());
-                dst.position(dp - dst.arrayOffset());
-            }
-        }
-
-        private int encodeBuffer(ByteBuffer src, ByteBuffer dst, int bytesOut) {
-            char[] base64 = isURL? toBase64URL : toBase64;
-            int sp = src.position();
-            int sl = src.limit();
-            int dp = dst.position();
-            int dl = dst.limit();
-            int dp00 = dp;
-
-            int dpos = 0;        // dp of each line
-            if (linemax > 0 && bytesOut > 0)
-                dpos = bytesOut % (linemax + newline.length);
-            try {
-                if (dpos == linemax && sp < src.limit()) {
-                    if (dp + newline.length > dl)
-                        return  dp - dp00 + bytesOut;
-                    for (byte b : newline){
-                        dst.put(dp++, b);
-                    }
-                    dpos = 0;
-                }
-                sl = sp + (sl - sp) / 3 * 3;
-                while (sp < sl) {
-                    int slen = (linemax > 0) ? (linemax - dpos) / 4 * 3
-                                             : sl - sp;
-                    int sl0 = Math.min(sp + slen, sl);
-                    for (int sp0 = sp, dp0 = dp ; sp0 < sl0; ) {
-                        if (dp0 + 4 > dl) {
-                            sp = sp0; dp = dp0;
-                            return  dp0 - dp00 + bytesOut;
-                        }
-                        int bits = (src.get(sp0++) & 0xff) << 16 |
-                                   (src.get(sp0++) & 0xff) <<  8 |
-                                   (src.get(sp0++) & 0xff);
-                        dst.put(dp0++, (byte)base64[(bits >>> 18) & 0x3f]);
-                        dst.put(dp0++, (byte)base64[(bits >>> 12) & 0x3f]);
-                        dst.put(dp0++, (byte)base64[(bits >>> 6)  & 0x3f]);
-                        dst.put(dp0++, (byte)base64[bits & 0x3f]);
-                    }
-                    int n = (sl0 - sp) / 3 * 4;
-                    dpos += n;
-                    dp += n;
-                    sp = sl0;
-                    if (dpos == linemax && sp < src.limit()) {
-                        if (dp + newline.length > dl)
-                            return  dp - dp00 + bytesOut;
-                        for (byte b : newline){
-                            dst.put(dp++, b);
-                        }
-                        dpos = 0;
-                    }
-                }
-                if (sp < src.limit() && dl >= dp + 4) {       // 1 or 2 leftover bytes
-                    int b0 = src.get(sp++) & 0xff;
-                    dst.put(dp++, (byte)base64[b0 >> 2]);
-                    if (sp == src.limit()) {
-                        dst.put(dp++, (byte)base64[(b0 << 4) & 0x3f]);
-                        if (doPadding) {
-                            dst.put(dp++, (byte)'=');
-                            dst.put(dp++, (byte)'=');
-                        }
-                    } else {
-                        int b1 = src.get(sp++) & 0xff;
-                        dst.put(dp++, (byte)base64[(b0 << 4) & 0x3f | (b1 >> 4)]);
-                        dst.put(dp++, (byte)base64[(b1 << 2) & 0x3f]);
-                        if (doPadding) {
-                            dst.put(dp++, (byte)'=');
-                        }
-                    }
-                }
-                return dp - dp00 + bytesOut;
-            } finally {
-                src.position(sp);
-                dst.position(dp);
-            }
-        }
-
         private int encode0(byte[] src, int off, int end, byte[] dst) {
             char[] base64 = isURL ? toBase64URL : toBase64;
             int sp = off;
@@ -657,20 +447,11 @@
      * required. So if the final unit of the encoded byte data only has
      * two or three Base64 characters (without the corresponding padding
      * character(s) padded), they are decoded as if followed by padding
-     * character(s).
-     * <p>
-     * For decoders that use the <a href="#basic">Basic</a> and
-     * <a href="#url">URL and Filename safe</a> type base64 scheme, and
-     * if there is padding character present in the final unit, the
-     * correct number of padding character(s) must be present, otherwise
-     * {@code IllegalArgumentException} ({@code IOException} when reading
-     * from a Base64 stream) is thrown during decoding.
-     * <p>
-     * Decoders that use the <a href="#mime">MIME</a> type base64 scheme
-     * are more lenient when decoding the padding character(s). If the
-     * padding character(s) is incorrectly encoded, the first padding
-     * character encountered is interpreted as the end of the encoded byte
-     * data, the decoding operation will then end and return normally.
+     * character(s). If there is a padding character present in the
+     * final unit, the correct number of padding character(s) must be
+     * present, otherwise {@code IllegalArgumentException} (
+     * {@code IOException} when reading from a Base64 stream) is thrown
+     * during decoding.
      *
      * <p> Instances of {@link Decoder} class are safe for use by
      * multiple concurrent threads.
@@ -810,6 +591,10 @@
          * output buffer's position will be zero and its limit will be the
          * number of resulting decoded bytes
          *
+         * <p> {@code IllegalArgumentException} is thrown if the input buffer
+         * is not in valid Base64 encoding scheme. The position of the input
+         * buffer will not be advanced in this case.
+         *
          * @param   buffer
          *          the ByteBuffer to decode
          *
@@ -843,76 +628,6 @@
         }
 
         /**
-         * Decodes as many bytes as possible from the input byte buffer
-         * using the {@link Base64} encoding scheme, writing the resulting
-         * bytes to the given output byte buffer.
-         *
-         * <p>The buffers are read from, and written to, starting at their
-         * current positions. Upon return, the input and output buffers'
-         * positions will be advanced to reflect the bytes read and written,
-         * but their limits will not be modified.
-         *
-         * <p> If the input buffer is not in valid Base64 encoding scheme
-         * then some bytes may have been written to the output buffer
-         * before IllegalArgumentException is thrown. The positions of
-         * both input and output buffer will not be advanced in this case.
-         *
-         * <p>The decoding operation will end and return if all remaining
-         * bytes in the input buffer have been decoded and written to the
-         * output buffer.
-         *
-         * <p> The decoding operation will stop and return if the output
-         * buffer has insufficient space to decode any more input bytes.
-         * The decoding operation can be continued, if there is more bytes
-         * in input buffer to be decoded, by invoking this method again with
-         * an output buffer that has more {@linkplain java.nio.Buffer#remaining
-         * remaining} bytes. This is typically done by draining any decoded
-         * bytes from the output buffer.
-         *
-         * <p><b>Recommended Usage Example</b>
-         * <pre>
-         *    ByteBuffer src = ...;
-         *    ByteBuffer dst = ...;
-         *    Base64.Decoder dec = Base64.getDecoder();
-         *
-         *    while (src.hasRemaining()) {
-         *
-         *        // prepare the output byte buffer
-         *        dst.clear();
-         *        dec.decode(src, dst);
-         *
-         *        // read bytes from the output buffer
-         *        dst.flip();
-         *        ...
-         *    }
-         * </pre>
-         *
-         * @param   src
-         *          the input byte buffer to decode
-         * @param   dst
-         *          the output byte buffer
-         *
-         * @return  The number of bytes written to the output byte buffer during
-         *          this decoding invocation
-         *
-         * @throws  IllegalArgumentException
-         *          if {@code src} is not in valid Base64 scheme.
-         */
-        public int decode(ByteBuffer src, ByteBuffer dst) {
-            int sp0 = src.position();
-            int dp0 = dst.position();
-            try {
-                if (src.hasArray() && dst.hasArray())
-                    return decodeArray(src, dst);
-                return decodeBuffer(src, dst);
-            } catch (IllegalArgumentException iae) {
-                src.position(sp0);
-                dst.position(dp0);
-                throw iae;
-            }
-        }
-
-        /**
          * Returns an input stream for decoding {@link Base64} encoded byte stream.
          *
          * <p> The {@code read}  methods of the returned {@code InputStream} will
@@ -932,150 +647,6 @@
             return new DecInputStream(is, isURL ? fromBase64URL : fromBase64, isMIME);
         }
 
-        private int decodeArray(ByteBuffer src, ByteBuffer dst) {
-            int[] base64 = isURL ? fromBase64URL : fromBase64;
-            int   bits = 0;
-            int   shiftto = 18;       // pos of first byte of 4-byte atom
-            byte[] sa = src.array();
-            int    sp = src.arrayOffset() + src.position();
-            int    sl = src.arrayOffset() + src.limit();
-            byte[] da = dst.array();
-            int    dp = dst.arrayOffset() + dst.position();
-            int    dl = dst.arrayOffset() + dst.limit();
-            int    dp0 = dp;
-            int    mark = sp;
-            try {
-                while (sp < sl) {
-                    int b = sa[sp++] & 0xff;
-                    if ((b = base64[b]) < 0) {
-                        if (b == -2) {   // padding byte
-                            if (!isMIME &&
-                                (shiftto == 6 && (sp == sl || sa[sp++] != '=') ||
-                                 shiftto == 18)) {
-                                throw new IllegalArgumentException(
-                                     "Input byte array has wrong 4-byte ending unit");
-                            }
-                            break;
-                        }
-                        if (isMIME)     // skip if for rfc2045
-                            continue;
-                        else
-                            throw new IllegalArgumentException(
-                                "Illegal base64 character " +
-                                Integer.toString(sa[sp - 1], 16));
-                    }
-                    bits |= (b << shiftto);
-                    shiftto -= 6;
-                    if (shiftto < 0) {
-                        if (dl < dp + 3)
-                            return dp - dp0;
-                        da[dp++] = (byte)(bits >> 16);
-                        da[dp++] = (byte)(bits >>  8);
-                        da[dp++] = (byte)(bits);
-                        shiftto = 18;
-                        bits = 0;
-                        mark = sp;
-                    }
-                }
-                if (shiftto == 6) {
-                    if (dl - dp < 1)
-                        return dp - dp0;
-                    da[dp++] = (byte)(bits >> 16);
-                } else if (shiftto == 0) {
-                    if (dl - dp < 2)
-                        return dp - dp0;
-                    da[dp++] = (byte)(bits >> 16);
-                    da[dp++] = (byte)(bits >>  8);
-                } else if (shiftto == 12) {
-                    throw new IllegalArgumentException(
-                        "Last unit does not have enough valid bits");
-                }
-                if (sp < sl) {
-                    if (isMIME)
-                        sp = sl;
-                    else
-                        throw new IllegalArgumentException(
-                            "Input byte array has incorrect ending byte at " + sp);
-                }
-                mark = sp;
-                return dp - dp0;
-            } finally {
-                src.position(mark);
-                dst.position(dp);
-            }
-        }
-
-        private int decodeBuffer(ByteBuffer src, ByteBuffer dst) {
-            int[] base64 = isURL ? fromBase64URL : fromBase64;
-            int   bits = 0;
-            int   shiftto = 18;       // pos of first byte of 4-byte atom
-            int    sp = src.position();
-            int    sl = src.limit();
-            int    dp = dst.position();
-            int    dl = dst.limit();
-            int    dp0 = dp;
-            int    mark = sp;
-            try {
-                while (sp < sl) {
-                    int b = src.get(sp++) & 0xff;
-                    if ((b = base64[b]) < 0) {
-                        if (b == -2) {  // padding byte
-                            if (!isMIME &&
-                                (shiftto == 6 && (sp == sl || src.get(sp++) != '=') ||
-                                 shiftto == 18)) {
-                                throw new IllegalArgumentException(
-                                     "Input byte array has wrong 4-byte ending unit");
-                            }
-                            break;
-                        }
-                        if (isMIME)     // skip if for rfc2045
-                            continue;
-                        else
-                            throw new IllegalArgumentException(
-                                "Illegal base64 character " +
-                                Integer.toString(src.get(sp - 1), 16));
-                    }
-                    bits |= (b << shiftto);
-                    shiftto -= 6;
-                    if (shiftto < 0) {
-                        if (dl < dp + 3)
-                            return dp - dp0;
-                        dst.put(dp++, (byte)(bits >> 16));
-                        dst.put(dp++, (byte)(bits >>  8));
-                        dst.put(dp++, (byte)(bits));
-                        shiftto = 18;
-                        bits = 0;
-                        mark = sp;
-                    }
-                }
-                if (shiftto == 6) {
-                    if (dl - dp < 1)
-                        return dp - dp0;
-                     dst.put(dp++, (byte)(bits >> 16));
-                } else if (shiftto == 0) {
-                    if (dl - dp < 2)
-                        return dp - dp0;
-                    dst.put(dp++, (byte)(bits >> 16));
-                    dst.put(dp++, (byte)(bits >>  8));
-                } else if (shiftto == 12) {
-                    throw new IllegalArgumentException(
-                        "Last unit does not have enough valid bits");
-                }
-                if (sp < sl) {
-                    if (isMIME)
-                        sp = sl;
-                    else
-                        throw new IllegalArgumentException(
-                            "Input byte array has incorrect ending byte at " + sp);
-                }
-                mark = sp;
-                return dp - dp0;
-            } finally {
-                src.position(mark);
-                dst.position(dp);
-            }
-        }
-
         private int outLength(byte[] src, int sp, int sl) {
             int[] base64 = isURL ? fromBase64URL : fromBase64;
             int paddings = 0;
@@ -1123,14 +694,13 @@
                 int b = src[sp++] & 0xff;
                 if ((b = base64[b]) < 0) {
                     if (b == -2) {         // padding byte '='
-                        if (!isMIME  &&    // be lenient for rfc2045
-                            // =     shiftto==18 unnecessary padding
-                            // x=    shiftto==12 a dangling single x
-                            // x     to be handled together with non-padding case
-                            // xx=   shiftto==6&&sp==sl missing last =
-                            // xx=y  shiftto==6 last is not =
-                            (shiftto == 6 && (sp == sl || src[sp++] != '=') ||
-                            shiftto == 18)) {
+                        // =     shiftto==18 unnecessary padding
+                        // x=    shiftto==12 a dangling single x
+                        // x     to be handled together with non-padding case
+                        // xx=   shiftto==6&&sp==sl missing last =
+                        // xx=y  shiftto==6 last is not =
+                        if (shiftto == 6 && (sp == sl || src[sp++] != '=') ||
+                            shiftto == 18) {
                             throw new IllegalArgumentException(
                                 "Input byte array has wrong 4-byte ending unit");
                         }
@@ -1160,14 +730,15 @@
                 dst[dp++] = (byte)(bits >> 16);
                 dst[dp++] = (byte)(bits >>  8);
             } else if (shiftto == 12) {
-                // dangling single "x", throw exception even in lenient mode,
-                // it's incorrectly encoded.
+                // dangling single "x", incorrectly encoded.
                 throw new IllegalArgumentException(
                     "Last unit does not have enough valid bits");
             }
             // anything left is invalid, if is not MIME.
-            // if MIME (lenient), just ignore all leftover
-            if (sp < sl && !isMIME) {
+            // if MIME, ignore all non-base64 character
+            while (sp < sl) {
+                if (isMIME && base64[src[sp++]] < 0)
+                    continue;
                 throw new IllegalArgumentException(
                     "Input byte array has incorrect ending byte at " + sp);
             }
@@ -1367,26 +938,16 @@
                     // xx=y  or last is not '='
                     if (nextin == 18 || nextin == 12 ||
                         nextin == 6 && is.read() != '=') {
-                        if (!isMIME || nextin == 12) {
-                            throw new IOException("Illegal base64 ending sequence:" + nextin);
-                        } else if (nextin != 18) {
-                            // lenient mode for mime
-                            // (1) handle the "unnecessary padding in "xxxx ="
-                            //     case as the eof (nextin == 18)
-                            // (2) decode "xx=" and "xx=y" normally
-                            b[off++] = (byte)(bits >> (16));
-                            len--;
-                        }
-                    } else {
-                        b[off++] = (byte)(bits >> (16));
-                        len--;
-                        if (nextin == 0) {           // only one padding byte
-                            if (len == 0) {          // no enough output space
-                                bits >>= 8;          // shift to lowest byte
-                                nextout = 0;
-                            } else {
-                                b[off++] = (byte) (bits >>  8);
-                            }
+                        throw new IOException("Illegal base64 ending sequence:" + nextin);
+                    }
+                    b[off++] = (byte)(bits >> (16));
+                    len--;
+                    if (nextin == 0) {           // only one padding byte
+                        if (len == 0) {          // no enough output space
+                            bits >>= 8;          // shift to lowest byte
+                            nextout = 0;
+                        } else {
+                            b[off++] = (byte) (bits >>  8);
                         }
                     }
                     eof = true;
diff --git a/jdk/src/share/classes/java/util/DoubleSummaryStatistics.java b/jdk/src/share/classes/java/util/DoubleSummaryStatistics.java
index be9d4b5..8a4a0f4 100644
--- a/jdk/src/share/classes/java/util/DoubleSummaryStatistics.java
+++ b/jdk/src/share/classes/java/util/DoubleSummaryStatistics.java
@@ -63,6 +63,7 @@
 public class DoubleSummaryStatistics implements DoubleConsumer {
     private long count;
     private double sum;
+    private double sumCompensation; // Low order bits of sum
     private double min = Double.POSITIVE_INFINITY;
     private double max = Double.NEGATIVE_INFINITY;
 
@@ -81,7 +82,7 @@
     @Override
     public void accept(double value) {
         ++count;
-        sum += value;
+        sumWithCompensation(value);
         min = Math.min(min, value);
         max = Math.max(max, value);
     }
@@ -95,12 +96,24 @@
      */
     public void combine(DoubleSummaryStatistics other) {
         count += other.count;
-        sum += other.sum;
+        sumWithCompensation(other.sum);
+        sumWithCompensation(other.sumCompensation);
         min = Math.min(min, other.min);
         max = Math.max(max, other.max);
     }
 
     /**
+     * Incorporate a new double value using Kahan summation /
+     * compensated summation.
+     */
+    private void sumWithCompensation(double value) {
+        double tmp = value - sumCompensation;
+        double velvel = sum + tmp; // Little wolf of rounding error
+        sumCompensation = (velvel - sum) - tmp;
+        sum = velvel;
+    }
+
+    /**
      * Return the count of values recorded.
      *
      * @return the count of values
@@ -133,7 +146,8 @@
      * @return the sum of values, or zero if none
      */
     public final double getSum() {
-        return sum;
+        // Better error bounds to add both terms as the final sum
+        return sum + sumCompensation;
     }
 
     /**
diff --git a/jdk/src/share/classes/java/util/ListResourceBundle.java b/jdk/src/share/classes/java/util/ListResourceBundle.java
index 9aa7fdb..1c1e5f0 100644
--- a/jdk/src/share/classes/java/util/ListResourceBundle.java
+++ b/jdk/src/share/classes/java/util/ListResourceBundle.java
@@ -105,6 +105,12 @@
  * }
  * </pre>
  * </blockquote>
+ *
+ * <p>
+ * The implementation of a {@code ListResourceBundle} subclass must be thread-safe
+ * if it's simultaneously used by multiple threads. The default implementations
+ * of the methods in this class are thread-safe.
+ *
  * @see ResourceBundle
  * @see PropertyResourceBundle
  * @since JDK1.1
diff --git a/jdk/src/share/classes/java/util/Optional.java b/jdk/src/share/classes/java/util/Optional.java
index 10b7923..d471058 100644
--- a/jdk/src/share/classes/java/util/Optional.java
+++ b/jdk/src/share/classes/java/util/Optional.java
@@ -40,6 +40,11 @@
  * {@link #ifPresent(java.util.function.Consumer) ifPresent()} (execute a block
  * of code if the value is present).
  *
+ * <p>This is a <a href="../lang/doc-files/ValueBased.html">value-based</a>
+ * class; use of identity-sensitive operations (including reference equality
+ * ({@code ==}), identity hash code, or synchronization) on instances of
+ * {@code Optional} may have unpredictable results and should be avoided.
+ *
  * @since 1.8
  */
 public final class Optional<T> {
diff --git a/jdk/src/share/classes/java/util/OptionalDouble.java b/jdk/src/share/classes/java/util/OptionalDouble.java
index eda306c..0efc770 100644
--- a/jdk/src/share/classes/java/util/OptionalDouble.java
+++ b/jdk/src/share/classes/java/util/OptionalDouble.java
@@ -31,7 +31,7 @@
 /**
  * A container object which may or may not contain a {@code double} value.
  * If a value is present, {@code isPresent()} will return {@code true} and
- * {@code get()} will return the value.
+ * {@code getAsDouble()} will return the value.
  *
  * <p>Additional methods that depend on the presence or absence of a contained
  * value are provided, such as {@link #orElse(double) orElse()}
@@ -39,6 +39,11 @@
  * {@link #ifPresent(java.util.function.DoubleConsumer) ifPresent()} (execute a block
  * of code if the value is present).
  *
+ * <p>This is a <a href="../lang/doc-files/ValueBased.html">value-based</a>
+ * class; use of identity-sensitive operations (including reference equality
+ * ({@code ==}), identity hash code, or synchronization) on instances of
+ * {@code OptionalDouble} may have unpredictable results and should be avoided.
+ *
  * @since 1.8
  */
 public final class OptionalDouble {
diff --git a/jdk/src/share/classes/java/util/OptionalInt.java b/jdk/src/share/classes/java/util/OptionalInt.java
index 66478ce..5cb9275 100644
--- a/jdk/src/share/classes/java/util/OptionalInt.java
+++ b/jdk/src/share/classes/java/util/OptionalInt.java
@@ -31,7 +31,7 @@
 /**
  * A container object which may or may not contain a {@code int} value.
  * If a value is present, {@code isPresent()} will return {@code true} and
- * {@code get()} will return the value.
+ * {@code getAsInt()} will return the value.
  *
  * <p>Additional methods that depend on the presence or absence of a contained
  * value are provided, such as {@link #orElse(int) orElse()}
@@ -39,6 +39,11 @@
  * {@link #ifPresent(java.util.function.IntConsumer) ifPresent()} (execute a block
  * of code if the value is present).
  *
+ * <p>This is a <a href="../lang/doc-files/ValueBased.html">value-based</a>
+ * class; use of identity-sensitive operations (including reference equality
+ * ({@code ==}), identity hash code, or synchronization) on instances of
+ * {@code OptionalInt} may have unpredictable results and should be avoided.
+ *
  * @since 1.8
  */
 public final class OptionalInt {
diff --git a/jdk/src/share/classes/java/util/OptionalLong.java b/jdk/src/share/classes/java/util/OptionalLong.java
index f07cc0d..589a59f 100644
--- a/jdk/src/share/classes/java/util/OptionalLong.java
+++ b/jdk/src/share/classes/java/util/OptionalLong.java
@@ -31,7 +31,7 @@
 /**
  * A container object which may or may not contain a {@code long} value.
  * If a value is present, {@code isPresent()} will return {@code true} and
- * {@code get()} will return the value.
+ * {@code getAsLong()} will return the value.
  *
  * <p>Additional methods that depend on the presence or absence of a contained
  * value are provided, such as {@link #orElse(long) orElse()}
@@ -39,6 +39,11 @@
  * {@link #ifPresent(java.util.function.LongConsumer) ifPresent()} (execute a block
  * of code if the value is present).
  *
+ * <p>This is a <a href="../lang/doc-files/ValueBased.html">value-based</a>
+ * class; use of identity-sensitive operations (including reference equality
+ * ({@code ==}), identity hash code, or synchronization) on instances of
+ * {@code OptionalLong} may have unpredictable results and should be avoided.
+ *
  * @since 1.8
  */
 public final class OptionalLong {
diff --git a/jdk/src/share/classes/java/util/PropertyResourceBundle.java b/jdk/src/share/classes/java/util/PropertyResourceBundle.java
index 841d7d7..3d784d3 100644
--- a/jdk/src/share/classes/java/util/PropertyResourceBundle.java
+++ b/jdk/src/share/classes/java/util/PropertyResourceBundle.java
@@ -100,6 +100,11 @@
  * </blockquote>
  *
  * <p>
+ * The implementation of a {@code PropertyResourceBundle} subclass must be
+ * thread-safe if it's simultaneously used by multiple threads. The default
+ * implementations of the non-abstract methods in this class are thread-safe.
+ *
+ * <p>
  * <strong>Note:</strong> PropertyResourceBundle can be constructed either
  * from an InputStream or a Reader, which represents a property file.
  * Constructing a PropertyResourceBundle instance from an InputStream requires
diff --git a/jdk/src/share/classes/java/util/ResourceBundle.java b/jdk/src/share/classes/java/util/ResourceBundle.java
index 95948c5..9e041f2 100644
--- a/jdk/src/share/classes/java/util/ResourceBundle.java
+++ b/jdk/src/share/classes/java/util/ResourceBundle.java
@@ -184,6 +184,13 @@
  * subclass.  Your subclasses must override two methods: <code>handleGetObject</code>
  * and <code>getKeys()</code>.
  *
+ * <p>
+ * The implementation of a {@code ResourceBundle} subclass must be thread-safe
+ * if it's simultaneously used by multiple threads. The default implementations
+ * of the non-abstract methods in this class, and the methods in the direct
+ * known concrete subclasses {@code ListResourceBundle} and
+ * {@code PropertyResourceBundle} are thread-safe.
+ *
  * <h3>ResourceBundle.Control</h3>
  *
  * The {@link ResourceBundle.Control} class provides information necessary
diff --git a/jdk/src/share/classes/java/util/StringJoiner.java b/jdk/src/share/classes/java/util/StringJoiner.java
index d4050a4..b6ba84c 100644
--- a/jdk/src/share/classes/java/util/StringJoiner.java
+++ b/jdk/src/share/classes/java/util/StringJoiner.java
@@ -131,7 +131,7 @@
     /**
      * Sets the sequence of characters to be used when determining the string
      * representation of this {@code StringJoiner} and no elements have been
-     * added yet, i.e. when it is empty.  A copy of the {@code emptyValue}
+     * added yet, that is, when it is empty.  A copy of the {@code emptyValue}
      * parameter is made for this purpose. Note that once an add method has been
      * called, the {@code StringJoiner} is no longer considered empty, even if
      * the element(s) added correspond to the empty {@code String}.
@@ -228,8 +228,8 @@
     }
 
     /**
-     * The length of the {@code StringJoiner} value, i.e. the length of
-     * {@code String} representation of the {@code StringJoiner}. Note that if
+     * Returns the length of the {@code String} representation
+     * of this {@code StringJoiner}. Note that if
      * no add methods have been called, then the length of the {@code String}
      * representation (either {@code prefix + suffix} or {@code emptyValue})
      * will be returned. The value should be equivalent to
diff --git a/jdk/src/share/classes/java/util/concurrent/Callable.java b/jdk/src/share/classes/java/util/concurrent/Callable.java
index 53bde82..04bc607 100644
--- a/jdk/src/share/classes/java/util/concurrent/Callable.java
+++ b/jdk/src/share/classes/java/util/concurrent/Callable.java
@@ -54,6 +54,7 @@
  * @author Doug Lea
  * @param <V> the result type of method {@code call}
  */
+@FunctionalInterface
 public interface Callable<V> {
     /**
      * Computes a result, or throws an exception if unable to do so.
diff --git a/jdk/src/share/classes/java/util/concurrent/CompletableFuture.java b/jdk/src/share/classes/java/util/concurrent/CompletableFuture.java
index 8f2354c..9e89169 100644
--- a/jdk/src/share/classes/java/util/concurrent/CompletableFuture.java
+++ b/jdk/src/share/classes/java/util/concurrent/CompletableFuture.java
@@ -2004,7 +2004,7 @@
             }
             if (dst == null)
                 dst = new CompletableFuture<U>();
-            if (e == null || ex != null)
+            if (ex != null)
                 dst.internalComplete(null, ex);
         }
         helpPostComplete();
diff --git a/jdk/src/share/classes/java/util/concurrent/ConcurrentHashMap.java b/jdk/src/share/classes/java/util/concurrent/ConcurrentHashMap.java
index c8c52a7..880ecb2 100644
--- a/jdk/src/share/classes/java/util/concurrent/ConcurrentHashMap.java
+++ b/jdk/src/share/classes/java/util/concurrent/ConcurrentHashMap.java
@@ -49,7 +49,6 @@
 import java.util.Iterator;
 import java.util.Map;
 import java.util.NoSuchElementException;
-import java.util.Objects;
 import java.util.Set;
 import java.util.Spliterator;
 import java.util.concurrent.ConcurrentMap;
@@ -381,19 +380,21 @@
      * progress.  Resizing proceeds by transferring bins, one by one,
      * from the table to the next table. However, threads claim small
      * blocks of indices to transfer (via field transferIndex) before
-     * doing so, reducing contention.  Because we are using
-     * power-of-two expansion, the elements from each bin must either
-     * stay at same index, or move with a power of two offset. We
-     * eliminate unnecessary node creation by catching cases where old
-     * nodes can be reused because their next fields won't change.  On
-     * average, only about one-sixth of them need cloning when a table
-     * doubles. The nodes they replace will be garbage collectable as
-     * soon as they are no longer referenced by any reader thread that
-     * may be in the midst of concurrently traversing table.  Upon
-     * transfer, the old table bin contains only a special forwarding
-     * node (with hash field "MOVED") that contains the next table as
-     * its key. On encountering a forwarding node, access and update
-     * operations restart, using the new table.
+     * doing so, reducing contention.  A generation stamp in field
+     * sizeCtl ensures that resizings do not overlap. Because we are
+     * using power-of-two expansion, the elements from each bin must
+     * either stay at same index, or move with a power of two
+     * offset. We eliminate unnecessary node creation by catching
+     * cases where old nodes can be reused because their next fields
+     * won't change.  On average, only about one-sixth of them need
+     * cloning when a table doubles. The nodes they replace will be
+     * garbage collectable as soon as they are no longer referenced by
+     * any reader thread that may be in the midst of concurrently
+     * traversing table.  Upon transfer, the old table bin contains
+     * only a special forwarding node (with hash field "MOVED") that
+     * contains the next table as its key. On encountering a
+     * forwarding node, access and update operations restart, using
+     * the new table.
      *
      * Each bin transfer requires its bin lock, which can stall
      * waiting for locks while resizing. However, because other
@@ -570,6 +571,23 @@
      */
     private static final int MIN_TRANSFER_STRIDE = 16;
 
+    /**
+     * The number of bits used for generation stamp in sizeCtl.
+     * Must be at least 6 for 32bit arrays.
+     */
+    private static int RESIZE_STAMP_BITS = 16;
+
+    /**
+     * The maximum number of threads that can help resize.
+     * Must fit in 32 - RESIZE_STAMP_BITS bits.
+     */
+    private static final int MAX_RESIZERS = (1 << (32 - RESIZE_STAMP_BITS)) - 1;
+
+    /**
+     * The bit shift for recording size stamp in sizeCtl.
+     */
+    private static final int RESIZE_STAMP_SHIFT = 32 - RESIZE_STAMP_BITS;
+
     /*
      * Encodings for Node hash fields. See above for explanation.
      */
@@ -727,7 +745,7 @@
      * errors by users, these checks must operate on local variables,
      * which accounts for some odd-looking inline assignments below.
      * Note that calls to setTabAt always occur within locked regions,
-     * and so in principle require only release ordering, not need
+     * and so in principle require only release ordering, not
      * full volatile semantics, but are currently coded as volatile
      * writes to be conservative.
      */
@@ -2192,6 +2210,14 @@
     /* ---------------- Table Initialization and Resizing -------------- */
 
     /**
+     * Returns the stamp bits for resizing a table of size n.
+     * Must be negative when shifted left by RESIZE_STAMP_SHIFT.
+     */
+    static final int resizeStamp(int n) {
+        return Integer.numberOfLeadingZeros(n) | (1 << (RESIZE_STAMP_BITS - 1));
+    }
+
+    /**
      * Initializes table, using the size recorded in sizeCtl.
      */
     private final Node<K,V>[] initTable() {
@@ -2245,17 +2271,20 @@
             s = sumCount();
         }
         if (check >= 0) {
-            Node<K,V>[] tab, nt; int sc;
+            Node<K,V>[] tab, nt; int n, sc;
             while (s >= (long)(sc = sizeCtl) && (tab = table) != null &&
-                   tab.length < MAXIMUM_CAPACITY) {
+                   (n = tab.length) < MAXIMUM_CAPACITY) {
+                int rs = resizeStamp(n);
                 if (sc < 0) {
-                    if (sc == -1 || transferIndex <= 0 ||
-                        (nt = nextTable) == null)
+                    if ((sc >>> RESIZE_STAMP_SHIFT) != rs || sc == rs + 1 ||
+                        sc == rs + MAX_RESIZERS || (nt = nextTable) == null ||
+                        transferIndex <= 0)
                         break;
-                    if (U.compareAndSwapInt(this, SIZECTL, sc, sc - 1))
+                    if (U.compareAndSwapInt(this, SIZECTL, sc, sc + 1))
                         transfer(tab, nt);
                 }
-                else if (U.compareAndSwapInt(this, SIZECTL, sc, -2))
+                else if (U.compareAndSwapInt(this, SIZECTL, sc,
+                                             (rs << RESIZE_STAMP_SHIFT) + 2))
                     transfer(tab, null);
                 s = sumCount();
             }
@@ -2267,11 +2296,15 @@
      */
     final Node<K,V>[] helpTransfer(Node<K,V>[] tab, Node<K,V> f) {
         Node<K,V>[] nextTab; int sc;
-        if ((f instanceof ForwardingNode) &&
+        if (tab != null && (f instanceof ForwardingNode) &&
             (nextTab = ((ForwardingNode<K,V>)f).nextTable) != null) {
-            while (transferIndex > 0 && nextTab == nextTable &&
-                   (sc = sizeCtl) < -1) {
-                if (U.compareAndSwapInt(this, SIZECTL, sc, sc - 1)) {
+            int rs = resizeStamp(tab.length);
+            while (nextTab == nextTable && table == tab &&
+                   (sc = sizeCtl) < 0) {
+                if ((sc >>> RESIZE_STAMP_SHIFT) != rs || sc == rs + 1 ||
+                    sc == rs + MAX_RESIZERS || transferIndex <= 0)
+                    break;
+                if (U.compareAndSwapInt(this, SIZECTL, sc, sc + 1)) {
                     transfer(tab, nextTab);
                     break;
                 }
@@ -2309,9 +2342,21 @@
             }
             else if (c <= sc || n >= MAXIMUM_CAPACITY)
                 break;
-            else if (tab == table &&
-                     U.compareAndSwapInt(this, SIZECTL, sc, -2))
-                transfer(tab, null);
+            else if (tab == table) {
+                int rs = resizeStamp(n);
+                if (sc < 0) {
+                    Node<K,V>[] nt;
+                    if ((sc >>> RESIZE_STAMP_SHIFT) != rs || sc == rs + 1 ||
+                        sc == rs + MAX_RESIZERS || (nt = nextTable) == null ||
+                        transferIndex <= 0)
+                        break;
+                    if (U.compareAndSwapInt(this, SIZECTL, sc, sc + 1))
+                        transfer(tab, nt);
+                }
+                else if (U.compareAndSwapInt(this, SIZECTL, sc,
+                                             (rs << RESIZE_STAMP_SHIFT) + 2))
+                    transfer(tab, null);
+            }
         }
     }
 
@@ -2366,8 +2411,8 @@
                     sizeCtl = (n << 1) - (n >>> 1);
                     return;
                 }
-                if (U.compareAndSwapInt(this, SIZECTL, sc = sizeCtl, ++sc)) {
-                    if (sc != -1)
+                if (U.compareAndSwapInt(this, SIZECTL, sc = sizeCtl, sc - 1)) {
+                    if ((sc - 2) != resizeStamp(n) << RESIZE_STAMP_SHIFT)
                         return;
                     finishing = advance = true;
                     i = n; // recheck before commit
@@ -2566,11 +2611,8 @@
     private final void treeifyBin(Node<K,V>[] tab, int index) {
         Node<K,V> b; int n, sc;
         if (tab != null) {
-            if ((n = tab.length) < MIN_TREEIFY_CAPACITY) {
-                if (tab == table && (sc = sizeCtl) >= 0 &&
-                    U.compareAndSwapInt(this, SIZECTL, sc, -2))
-                    transfer(tab, null);
-            }
+            if ((n = tab.length) < MIN_TREEIFY_CAPACITY)
+                tryPresize(n << 1);
             else if ((b = tabAt(tab, index)) != null && b.hash >= 0) {
                 synchronized (b) {
                     if (tabAt(tab, index) == b) {
@@ -2768,7 +2810,7 @@
         private final void contendedLock() {
             boolean waiting = false;
             for (int s;;) {
-                if (((s = lockState) & WRITER) == 0) {
+                if (((s = lockState) & ~WAITER) == 0) {
                     if (U.compareAndSwapInt(this, LOCKSTATE, s, WRITER)) {
                         if (waiting)
                             waiter = null;
@@ -2793,12 +2835,13 @@
          */
         final Node<K,V> find(int h, Object k) {
             if (k != null) {
-                for (Node<K,V> e = first; e != null; e = e.next) {
+                for (Node<K,V> e = first; e != null; ) {
                     int s; K ek;
                     if (((s = lockState) & (WAITER|WRITER)) != 0) {
                         if (e.hash == h &&
                             ((ek = e.key) == k || (ek != null && k.equals(ek))))
                             return e;
+                        e = e.next;
                     }
                     else if (U.compareAndSwapInt(this, LOCKSTATE, s,
                                                  s + READER)) {
@@ -4454,7 +4497,7 @@
         }
 
         public final boolean removeAll(Collection<?> c) {
-            Objects.requireNonNull(c);
+            if (c == null) throw new NullPointerException();
             boolean modified = false;
             for (Iterator<E> it = iterator(); it.hasNext();) {
                 if (c.contains(it.next())) {
@@ -4466,7 +4509,7 @@
         }
 
         public final boolean retainAll(Collection<?> c) {
-            Objects.requireNonNull(c);
+            if (c == null) throw new NullPointerException();
             boolean modified = false;
             for (Iterator<E> it = iterator(); it.hasNext();) {
                 if (!c.contains(it.next())) {
diff --git a/jdk/src/share/classes/java/util/logging/LogManager.java b/jdk/src/share/classes/java/util/logging/LogManager.java
index 9a5e951..733eeef 100644
--- a/jdk/src/share/classes/java/util/logging/LogManager.java
+++ b/jdk/src/share/classes/java/util/logging/LogManager.java
@@ -146,7 +146,14 @@
     // The global LogManager object
     private static final LogManager manager;
 
-    private Properties props = new Properties();
+    // 'props' is assigned within a lock but accessed without it.
+    // Declaring it volatile makes sure that another thread will not
+    // be able to see a partially constructed 'props' object.
+    // (seeing a partially constructed 'props' object can result in
+    // NPE being thrown in Hashtable.get(), because it leaves the door
+    // open for props.getProperties() to be called before the construcor
+    // of Hashtable is actually completed).
+    private volatile Properties props = new Properties();
     private final static Level defaultLevel = Level.INFO;
 
     // The map of the registered listeners. The map value is the registration
@@ -670,7 +677,7 @@
             if (logger == null) {
                 // Hashtable holds stale weak reference
                 // to a logger which has been GC-ed.
-                removeLogger(name);
+                ref.dispose();
             }
             return logger;
         }
@@ -756,7 +763,7 @@
                     // It's possible that the Logger was GC'ed after a
                     // drainLoggerRefQueueBounded() call above so allow
                     // a new one to be registered.
-                    removeLogger(name);
+                    ref.dispose();
                 } else {
                     // We already have a registered logger with the given name.
                     return false;
@@ -808,10 +815,8 @@
             return true;
         }
 
-        // note: all calls to removeLogger are synchronized on LogManager's
-        // intrinsic lock
-        void removeLogger(String name) {
-            namedLoggers.remove(name);
+        synchronized void removeLoggerRef(String name, LoggerWeakRef ref) {
+            namedLoggers.remove(name, ref);
         }
 
         synchronized Enumeration<String> getLoggerNames() {
@@ -993,6 +998,7 @@
         private String                name;       // for namedLoggers cleanup
         private LogNode               node;       // for loggerRef cleanup
         private WeakReference<Logger> parentRef;  // for kids cleanup
+        private boolean disposed = false;         // avoid calling dispose twice
 
         LoggerWeakRef(Logger logger) {
             super(logger, loggerRefQueue);
@@ -1002,14 +1008,45 @@
 
         // dispose of this LoggerWeakRef object
         void dispose() {
-            if (node != null) {
-                // if we have a LogNode, then we were a named Logger
-                // so clear namedLoggers weak ref to us
-                node.context.removeLogger(name);
-                name = null;  // clear our ref to the Logger's name
+            // Avoid calling dispose twice. When a Logger is gc'ed, its
+            // LoggerWeakRef will be enqueued.
+            // However, a new logger of the same name may be added (or looked
+            // up) before the queue is drained. When that happens, dispose()
+            // will be called by addLocalLogger() or findLogger().
+            // Later when the queue is drained, dispose() will be called again
+            // for the same LoggerWeakRef. Marking LoggerWeakRef as disposed
+            // avoids processing the data twice (even though the code should
+            // now be reentrant).
+            synchronized(this) {
+                // Note to maintainers:
+                // Be careful not to call any method that tries to acquire
+                // another lock from within this block - as this would surely
+                // lead to deadlocks, given that dispose() can be called by
+                // multiple threads, and from within different synchronized
+                // methods/blocks.
+                if (disposed) return;
+                disposed = true;
+            }
 
-                node.loggerRef = null;  // clear LogNode's weak ref to us
-                node = null;            // clear our ref to LogNode
+            final LogNode n = node;
+            if (n != null) {
+                // n.loggerRef can only be safely modified from within
+                // a lock on LoggerContext. removeLoggerRef is already
+                // synchronized on LoggerContext so calling
+                // n.context.removeLoggerRef from within this lock is safe.
+                synchronized (n.context) {
+                    // if we have a LogNode, then we were a named Logger
+                    // so clear namedLoggers weak ref to us
+                    n.context.removeLoggerRef(name, this);
+                    name = null;  // clear our ref to the Logger's name
+
+                    // LogNode may have been reused - so only clear
+                    // LogNode.loggerRef if LogNode.loggerRef == this
+                    if (n.loggerRef == this) {
+                        n.loggerRef = null;  // clear LogNode's weak ref to us
+                    }
+                    node = null;            // clear our ref to LogNode
+                }
             }
 
             if (parentRef != null) {
@@ -1062,7 +1099,7 @@
     //   - maximum: 10.9 ms
     //
     private final static int MAX_ITERATIONS = 400;
-    final synchronized void drainLoggerRefQueueBounded() {
+    final void drainLoggerRefQueueBounded() {
         for (int i = 0; i < MAX_ITERATIONS; i++) {
             if (loggerRefQueue == null) {
                 // haven't finished loading LogManager yet
diff --git a/jdk/src/share/classes/java/util/logging/Logger.java b/jdk/src/share/classes/java/util/logging/Logger.java
index 1976512..21d6e39 100644
--- a/jdk/src/share/classes/java/util/logging/Logger.java
+++ b/jdk/src/share/classes/java/util/logging/Logger.java
@@ -218,12 +218,46 @@
 public class Logger {
     private static final Handler emptyHandlers[] = new Handler[0];
     private static final int offValue = Level.OFF.intValue();
-    private LogManager manager;
+
+    static final String SYSTEM_LOGGER_RB_NAME = "sun.util.logging.resources.logging";
+
+    // This class is immutable and it is important that it remains so.
+    private static final class LoggerBundle {
+        final String resourceBundleName; // Base name of the bundle.
+        final ResourceBundle userBundle; // Bundle set through setResourceBundle.
+        private LoggerBundle(String resourceBundleName, ResourceBundle bundle) {
+            this.resourceBundleName = resourceBundleName;
+            this.userBundle = bundle;
+        }
+        boolean isSystemBundle() {
+            return SYSTEM_LOGGER_RB_NAME.equals(resourceBundleName);
+        }
+        static LoggerBundle get(String name, ResourceBundle bundle) {
+            if (name == null && bundle == null) {
+                return NO_RESOURCE_BUNDLE;
+            } else if (SYSTEM_LOGGER_RB_NAME.equals(name) && bundle == null) {
+                return SYSTEM_BUNDLE;
+            } else {
+                return new LoggerBundle(name, bundle);
+            }
+        }
+    }
+
+    // This instance will be shared by all loggers created by the system
+    // code
+    private static final LoggerBundle SYSTEM_BUNDLE =
+            new LoggerBundle(SYSTEM_LOGGER_RB_NAME, null);
+
+    // This instance indicates that no resource bundle has been specified yet,
+    // and it will be shared by all loggers which have no resource bundle.
+    private static final LoggerBundle NO_RESOURCE_BUNDLE =
+            new LoggerBundle(null, null);
+
+    private volatile LogManager manager;
     private String name;
     private final CopyOnWriteArrayList<Handler> handlers =
         new CopyOnWriteArrayList<>();
-    private String resourceBundleName;  // Base name of the bundle.
-    private ResourceBundle userBundle;  // Bundle set through setResourceBundle.
+    private volatile LoggerBundle loggerBundle = NO_RESOURCE_BUNDLE;
     private volatile boolean useParentHandlers = true;
     private volatile Filter filter;
     private boolean anonymous;
@@ -641,7 +675,7 @@
      * @return localization bundle name (may be {@code null})
      */
     public String getResourceBundleName() {
-        return resourceBundleName;
+        return loggerBundle.resourceBundleName;
     }
 
     /**
@@ -710,8 +744,9 @@
     // resource bundle and then call "void log(LogRecord)".
     private void doLog(LogRecord lr) {
         lr.setLoggerName(name);
-        final ResourceBundle bundle = getEffectiveResourceBundle();
-        final String ebname = getEffectiveResourceBundleName();
+        final LoggerBundle lb = getEffectiveLoggerBundle();
+        final ResourceBundle  bundle = lb.userBundle;
+        final String ebname = lb.resourceBundleName;
         if (ebname != null && bundle != null) {
             lr.setResourceBundleName(ebname);
             lr.setResourceBundle(bundle);
@@ -1757,8 +1792,6 @@
         return useParentHandlers;
     }
 
-    static final String SYSTEM_LOGGER_RB_NAME = "sun.util.logging.resources.logging";
-
     private static ResourceBundle findSystemResourceBundle(final Locale locale) {
         // the resource bundle is in a restricted package
         return AccessController.doPrivileged(new PrivilegedAction<ResourceBundle>() {
@@ -1801,11 +1834,12 @@
         }
 
         Locale currentLocale = Locale.getDefault();
+        final LoggerBundle lb = loggerBundle;
 
         // Normally we should hit on our simple one entry cache.
-        if (userBundle != null &&
-                name.equals(resourceBundleName)) {
-            return userBundle;
+        if (lb.userBundle != null &&
+                name.equals(lb.resourceBundleName)) {
+            return lb.userBundle;
         } else if (catalog != null && currentLocale.equals(catalogLocale)
                 && name.equals(catalogName)) {
             return catalog;
@@ -1864,17 +1898,18 @@
     // Synchronized to prevent races in setting the fields.
     private synchronized void setupResourceInfo(String name,
                                                 Class<?> callersClass) {
-        if (resourceBundleName != null) {
+        final LoggerBundle lb = loggerBundle;
+        if (lb.resourceBundleName != null) {
             // this Logger already has a ResourceBundle
 
-            if (resourceBundleName.equals(name)) {
+            if (lb.resourceBundleName.equals(name)) {
                 // the names match so there is nothing more to do
                 return;
             }
 
             // cannot change ResourceBundles once they are set
             throw new IllegalArgumentException(
-                resourceBundleName + " != " + name);
+                lb.resourceBundleName + " != " + name);
         }
 
         if (name == null) {
@@ -1890,7 +1925,10 @@
             throw new MissingResourceException("Can't find " + name + " bundle",
                                                 name, "");
         }
-        resourceBundleName = name;
+
+        // if lb.userBundle is not null we won't reach this line.
+        assert lb.userBundle == null;
+        loggerBundle = LoggerBundle.get(name, null);
     }
 
     /**
@@ -1920,16 +1958,16 @@
         }
 
         synchronized (this) {
-            final boolean canReplaceResourceBundle = resourceBundleName == null
-                    || resourceBundleName.equals(baseName);
+            LoggerBundle lb = loggerBundle;
+            final boolean canReplaceResourceBundle = lb.resourceBundleName == null
+                    || lb.resourceBundleName.equals(baseName);
 
             if (!canReplaceResourceBundle) {
                 throw new IllegalArgumentException("can't replace resource bundle");
             }
 
 
-            userBundle = bundle;
-            resourceBundleName = baseName;
+            loggerBundle = LoggerBundle.get(baseName, bundle);
         }
     }
 
@@ -2082,45 +2120,44 @@
 
 
     // Private method to get the potentially inherited
-    // resource bundle name for this Logger.
-    // May return null
-    private String getEffectiveResourceBundleName() {
-        Logger target = this;
+    // resource bundle and resource bundle name for this Logger.
+    // This method never returns null.
+    private LoggerBundle getEffectiveLoggerBundle() {
+        final LoggerBundle lb = loggerBundle;
+        if (lb.isSystemBundle()) {
+            return SYSTEM_BUNDLE;
+        }
+
+        // first take care of this logger
+        final ResourceBundle b = getResourceBundle();
+        if (b != null && b == lb.userBundle) {
+            return lb;
+        } else if (b != null) {
+            // either lb.userBundle is null or getResourceBundle() is
+            // overriden
+            final String rbName = getResourceBundleName();
+            return LoggerBundle.get(rbName, b);
+        }
+
+        // no resource bundle was specified on this logger, look up the
+        // parent stack.
+        Logger target = this.parent;
         while (target != null) {
-            String rbn = target.getResourceBundleName();
-            if (rbn != null) {
-                return rbn;
+            final LoggerBundle trb = target.loggerBundle;
+            if (trb.isSystemBundle()) {
+                return SYSTEM_BUNDLE;
+            }
+            if (trb.userBundle != null) {
+                return trb;
+            }
+            final String rbName = target.getResourceBundleName();
+            if (rbName != null) {
+                return LoggerBundle.get(rbName,
+                            findResourceBundle(rbName, true));
             }
             target = target.getParent();
         }
-        return null;
-    }
-
-
-    private ResourceBundle getEffectiveResourceBundle() {
-        Logger target = this;
-        if (SYSTEM_LOGGER_RB_NAME.equals(resourceBundleName)) return null;
-        ResourceBundle localRB = getResourceBundle();
-        if (localRB != null) {
-            return localRB;
-        }
-
-        while (target != null) {
-            final ResourceBundle rb = target.userBundle;
-            if (rb != null) {
-                return rb;
-            }
-            final String rbn = target.getResourceBundleName();
-            if (rbn != null) {
-                if (!SYSTEM_LOGGER_RB_NAME.equals(rbn)) {
-                    return findResourceBundle(rbn, true);
-                } else {
-                    return null;
-                }
-            }
-            target = target.getParent();
-        }
-        return null;
+        return NO_RESOURCE_BUNDLE;
     }
 
 }
diff --git a/jdk/src/share/classes/java/util/stream/Collectors.java b/jdk/src/share/classes/java/util/stream/Collectors.java
index 93ffb01..f52ccba 100644
--- a/jdk/src/share/classes/java/util/stream/Collectors.java
+++ b/jdk/src/share/classes/java/util/stream/Collectors.java
@@ -505,14 +505,43 @@
      */
     public static <T> Collector<T, ?, Double>
     summingDouble(ToDoubleFunction<? super T> mapper) {
+        /*
+         * In the arrays allocated for the collect operation, index 0
+         * holds the high-order bits of the running sum and index 1
+         * holds the low-order bits of the sum computed via
+         * compensated summation.
+         */
         return new CollectorImpl<>(
-                () -> new double[1],
-                (a, t) -> { a[0] += mapper.applyAsDouble(t); },
-                (a, b) -> { a[0] += b[0]; return a; },
-                a -> a[0], CH_NOID);
+                () -> new double[2],
+                (a, t) -> { sumWithCompensation(a, mapper.applyAsDouble(t)); },
+                (a, b) -> { sumWithCompensation(a, b[0]); return sumWithCompensation(a, b[1]); },
+                // Better error bounds to add both terms as the final sum
+                a -> a[0] + a[1],
+                CH_NOID);
     }
 
     /**
+     * Incorporate a new double value using Kahan summation /
+     * compensation summation.
+     *
+     * High-order bits of the sum are in intermediateSum[0], low-order
+     * bits of the sum are in intermediateSum[1], any additional
+     * elements are application-specific.
+     *
+     * @param intermediateSum the high-order and low-order words of the intermediate sum
+     * @param value the name value to be included in the running sum
+     */
+    static double[] sumWithCompensation(double[] intermediateSum, double value) {
+        double tmp = value - intermediateSum[1];
+        double sum = intermediateSum[0];
+        double velvel = sum + tmp; // Little wolf of rounding error
+        intermediateSum[1] = (velvel - sum) - tmp;
+        intermediateSum[0] = velvel;
+        return intermediateSum;
+    }
+
+
+    /**
      * Returns a {@code Collector} that produces the arithmetic mean of an integer-valued
      * function applied to the input elements.  If no elements are present,
      * the result is 0.
@@ -560,17 +589,31 @@
      * value is a {@code NaN} or the sum is at any point a {@code NaN} then the
      * average will be {@code NaN}.
      *
+     * @implNote The {@code double} format can represent all
+     * consecutive integers in the range -2<sup>53</sup> to
+     * 2<sup>53</sup>. If the pipeline has more than 2<sup>53</sup>
+     * values, the divisor in the average computation will saturate at
+     * 2<sup>53</sup>, leading to additional numerical errors.
+     *
      * @param <T> the type of the input elements
      * @param mapper a function extracting the property to be summed
      * @return a {@code Collector} that produces the sum of a derived property
      */
     public static <T> Collector<T, ?, Double>
     averagingDouble(ToDoubleFunction<? super T> mapper) {
+        /*
+         * In the arrays allocated for the collect operation, index 0
+         * holds the high-order bits of the running sum, index 1 holds
+         * the low-order bits of the sum computed via compensated
+         * summation, and index 2 holds the number of values seen.
+         */
         return new CollectorImpl<>(
-                () -> new double[2],
-                (a, t) -> { a[0] += mapper.applyAsDouble(t); a[1]++; },
-                (a, b) -> { a[0] += b[0]; a[1] += b[1]; return a; },
-                a -> (a[1] == 0) ? 0.0d : a[0] / a[1], CH_NOID);
+                () -> new double[3],
+                (a, t) -> { sumWithCompensation(a, mapper.applyAsDouble(t)); a[2]++; },
+                (a, b) -> { sumWithCompensation(a, b[0]); sumWithCompensation(a, b[1]); a[2] += b[2]; return a; },
+                // Better error bounds to add both terms as the final sum to compute average
+                a -> (a[2] == 0) ? 0.0d : ((a[0] + a[1]) / a[2]),
+                CH_NOID);
     }
 
     /**
diff --git a/jdk/src/share/classes/java/util/stream/DoublePipeline.java b/jdk/src/share/classes/java/util/stream/DoublePipeline.java
index 6af346c..ad9c056 100644
--- a/jdk/src/share/classes/java/util/stream/DoublePipeline.java
+++ b/jdk/src/share/classes/java/util/stream/DoublePipeline.java
@@ -377,8 +377,23 @@
 
     @Override
     public final double sum() {
-        // TODO: better algorithm to compensate for errors
-        return reduce(0.0, Double::sum);
+        /*
+         * In the arrays allocated for the collect operation, index 0
+         * holds the high-order bits of the running sum and index 1
+         * holds the low-order bits of the sum computed via
+         * compensated summation.
+         */
+        double[] summation = collect(() -> new double[2],
+                               (ll, d) -> {
+                                   Collectors.sumWithCompensation(ll, d);
+                               },
+                               (ll, rr) -> {
+                                   Collectors.sumWithCompensation(ll, rr[0]);
+                                   Collectors.sumWithCompensation(ll, rr[1]);
+                               });
+
+        // Better error bounds to add both terms as the final sum
+        return summation[0] + summation[1];
     }
 
     @Override
@@ -391,20 +406,37 @@
         return reduce(Math::max);
     }
 
+    /**
+     * {@inheritDoc}
+     *
+     * @implNote The {@code double} format can represent all
+     * consecutive integers in the range -2<sup>53</sup> to
+     * 2<sup>53</sup>. If the pipeline has more than 2<sup>53</sup>
+     * values, the divisor in the average computation will saturate at
+     * 2<sup>53</sup>, leading to additional numerical errors.
+     */
     @Override
     public final OptionalDouble average() {
-        double[] avg = collect(() -> new double[2],
-                               (ll, i) -> {
-                                   ll[0]++;
-                                   ll[1] += i;
+        /*
+         * In the arrays allocated for the collect operation, index 0
+         * holds the high-order bits of the running sum, index 1 holds
+         * the low-order bits of the sum computed via compensated
+         * summation, and index 2 holds the number of values seen.
+         */
+        double[] avg = collect(() -> new double[3],
+                               (ll, d) -> {
+                                   ll[2]++;
+                                   Collectors.sumWithCompensation(ll, d);
                                },
                                (ll, rr) -> {
-                                   ll[0] += rr[0];
-                                   ll[1] += rr[1];
+                                   Collectors.sumWithCompensation(ll, rr[0]);
+                                   Collectors.sumWithCompensation(ll, rr[1]);
+                                   ll[2] += rr[2];
                                });
-        return avg[0] > 0
-               ? OptionalDouble.of(avg[1] / avg[0])
-               : OptionalDouble.empty();
+        return avg[2] > 0
+            // Better error bounds to add both terms as the final sum to compute average
+            ? OptionalDouble.of((avg[0] + avg[1]) / avg[2])
+            : OptionalDouble.empty();
     }
 
     @Override
diff --git a/jdk/src/share/classes/javax/crypto/Cipher.java b/jdk/src/share/classes/javax/crypto/Cipher.java
index d16c579..ffcc7cf 100644
--- a/jdk/src/share/classes/javax/crypto/Cipher.java
+++ b/jdk/src/share/classes/javax/crypto/Cipher.java
@@ -62,17 +62,17 @@
  * algorithm (e.g., <i>DES</i>), and may be followed by a feedback mode and
  * padding scheme.
  *
- * <p> A transformation is of the form:<p>
+ * <p> A transformation is of the form:
  *
  * <ul>
  * <li>"<i>algorithm/mode/padding</i>" or
- * <p>
+ *
  * <li>"<i>algorithm</i>"
  * </ul>
  *
  * <P> (in the latter case,
  * provider-specific default values for the mode and padding scheme are used).
- * For example, the following is a valid transformation:<p>
+ * For example, the following is a valid transformation:
  *
  * <pre>
  *     Cipher c = Cipher.getInstance("<i>DES/CBC/PKCS5Padding</i>");
diff --git a/jdk/src/share/classes/javax/crypto/CipherSpi.java b/jdk/src/share/classes/javax/crypto/CipherSpi.java
index aae3331..ce72581 100644
--- a/jdk/src/share/classes/javax/crypto/CipherSpi.java
+++ b/jdk/src/share/classes/javax/crypto/CipherSpi.java
@@ -62,17 +62,17 @@
  * algorithm (e.g., <i>DES</i>), and may be followed by a feedback mode and
  * padding scheme.
  *
- * <p> A transformation is of the form:<p>
+ * <p> A transformation is of the form:
  *
  * <ul>
  * <li>"<i>algorithm/mode/padding</i>" or
- * <p>
+ *
  * <li>"<i>algorithm</i>"
  * </ul>
  *
  * <P> (in the latter case,
  * provider-specific default values for the mode and padding scheme are used).
- * For example, the following is a valid transformation:<p>
+ * For example, the following is a valid transformation:
  *
  * <pre>
  *     Cipher c = Cipher.getInstance("<i>DES/CBC/PKCS5Padding</i>");
@@ -129,7 +129,7 @@
  * <i>DES/CBC/PKCS5Padding</i>, one that implements
  * <i>DES/CFB/PKCS5Padding</i>, and yet another one that implements
  * <i>DES/OFB/PKCS5Padding</i>. That provider would have the following
- * <code>Cipher</code> properties in its master class:<p>
+ * <code>Cipher</code> properties in its master class:
  *
  * <ul>
  *
@@ -160,7 +160,7 @@
  * and one for <i>OFB</i>), one class for <i>PKCS5Padding</i>,
  * and a generic <i>DES</i> class that subclasses from <code>CipherSpi</code>.
  * That provider would have the following
- * <code>Cipher</code> properties in its master class:<p>
+ * <code>Cipher</code> properties in its master class:
  *
  * <ul>
  *
@@ -197,20 +197,20 @@
  * Check if the provider has registered a subclass of <code>CipherSpi</code>
  * for the specified "<i>algorithm/mode/padding</i>" transformation.
  * <p>If the answer is YES, instantiate it.
- * <p>If the answer is NO, go to the next step.<p>
+ * <p>If the answer is NO, go to the next step.
  * <li>
  * Check if the provider has registered a subclass of <code>CipherSpi</code>
  * for the sub-transformation "<i>algorithm/mode</i>".
  * <p>If the answer is YES, instantiate it, and call
  * <code>engineSetPadding(<i>padding</i>)</code> on the new instance.
- * <p>If the answer is NO, go to the next step.<p>
+ * <p>If the answer is NO, go to the next step.
  * <li>
  * Check if the provider has registered a subclass of <code>CipherSpi</code>
  * for the sub-transformation "<i>algorithm//padding</i>" (note the double
  * slashes).
  * <p>If the answer is YES, instantiate it, and call
  * <code>engineSetMode(<i>mode</i>)</code> on the new instance.
- * <p>If the answer is NO, go to the next step.<p>
+ * <p>If the answer is NO, go to the next step.
  * <li>
  * Check if the provider has registered a subclass of <code>CipherSpi</code>
  * for the sub-transformation "<i>algorithm</i>".
diff --git a/jdk/src/share/classes/javax/crypto/KeyGenerator.java b/jdk/src/share/classes/javax/crypto/KeyGenerator.java
index 961f0ea..030207e 100644
--- a/jdk/src/share/classes/javax/crypto/KeyGenerator.java
+++ b/jdk/src/share/classes/javax/crypto/KeyGenerator.java
@@ -66,7 +66,6 @@
  * algorithm-independent <code>init</code> methods, it is up to the
  * provider what to do about the algorithm-specific parameters (if any) to be
  * associated with each of the keys.
- * <p>
  *
  * <li><b>Algorithm-Specific Initialization</b>
  * <p>For situations where a set of algorithm-specific parameters already
diff --git a/jdk/src/share/classes/javax/crypto/SealedObject.java b/jdk/src/share/classes/javax/crypto/SealedObject.java
index 9166c28..9cee4d0 100644
--- a/jdk/src/share/classes/javax/crypto/SealedObject.java
+++ b/jdk/src/share/classes/javax/crypto/SealedObject.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -50,7 +50,7 @@
  * to a SealedObject.
  *
  * <p> The original object that was sealed can be recovered in two different
- * ways: <p>
+ * ways:
  *
  * <ul>
  *
@@ -68,8 +68,6 @@
  * decryption key, it could hand over the cipher object to
  * another party who then unseals the sealed object.
  *
- * <p>
- *
  * <li>by using one of the
  * {@link #getObject(java.security.Key) getObject} methods
  * that take a <code>Key</code> object.
diff --git a/jdk/src/share/classes/javax/net/ssl/SSLEngine.java b/jdk/src/share/classes/javax/net/ssl/SSLEngine.java
index 92e8386..6411088 100644
--- a/jdk/src/share/classes/javax/net/ssl/SSLEngine.java
+++ b/jdk/src/share/classes/javax/net/ssl/SSLEngine.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -329,7 +329,7 @@
  * is saved.  All future delegated tasks will be processed using this
  * context:  that is, all access control decisions will be made using the
  * context captured at engine creation.
- * <P>
+ *
  * <HR>
  *
  * <B>Concurrency Notes</B>:
@@ -345,7 +345,7 @@
  *      out-of-order, unexpected or fatal results may occur.
  * <P>
  *      For example:
- * <P>
+ *
  *      <pre>
  *              synchronized (outboundLock) {
  *                  sslEngine.wrap(src, dst);
diff --git a/jdk/src/share/classes/javax/net/ssl/SSLPermission.java b/jdk/src/share/classes/javax/net/ssl/SSLPermission.java
index bac011d..b271421 100644
--- a/jdk/src/share/classes/javax/net/ssl/SSLPermission.java
+++ b/jdk/src/share/classes/javax/net/ssl/SSLPermission.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -43,7 +43,6 @@
  * The following table lists all the possible SSLPermission target names,
  * and for each provides a description of what the permission allows
  * and a discussion of the risks of granting code the permission.
- * <P>
  *
  * <table border=1 cellpadding=5
  *  summary="permission name, what it allows, and associated risks">
diff --git a/jdk/src/share/classes/javax/script/ScriptEngineFactory.java b/jdk/src/share/classes/javax/script/ScriptEngineFactory.java
index 38c665d..87d9315 100644
--- a/jdk/src/share/classes/javax/script/ScriptEngineFactory.java
+++ b/jdk/src/share/classes/javax/script/ScriptEngineFactory.java
@@ -144,7 +144,7 @@
      * Returns a String which can be used to invoke a method of a  Java object using the syntax
      * of the supported scripting language.  For instance, an implementation for a Javascript
      * engine might be;
-     * <p>
+     *
      * <pre>{@code
      * public String getMethodCallSyntax(String obj,
      *                                   String m, String... args) {
@@ -180,7 +180,7 @@
      * Returns a String that can be used as a statement to display the specified String  using
      * the syntax of the supported scripting language.  For instance, the implementation for a Perl
      * engine might be;
-     * <p>
+     *
      * <pre><code>
      * public String getOutputStatement(String toDisplay) {
      *      return "print(" + toDisplay + ")";
@@ -198,7 +198,7 @@
     /**
      * Returns a valid scripting language executable program with given statements.
      * For instance an implementation for a PHP engine might be:
-     * <p>
+     *
      * <pre>{@code
      * public String getProgram(String... statements) {
      *      String retval = "<?\n";
diff --git a/jdk/src/share/classes/javax/security/auth/PrivateCredentialPermission.java b/jdk/src/share/classes/javax/security/auth/PrivateCredentialPermission.java
index 810cff2..37a2660 100644
--- a/jdk/src/share/classes/javax/security/auth/PrivateCredentialPermission.java
+++ b/jdk/src/share/classes/javax/security/auth/PrivateCredentialPermission.java
@@ -228,8 +228,8 @@
      * <p>
      *
      * This method returns true if:
-     * <p><ul>
-     * <li> <i>p</i> is an instanceof PrivateCredentialPermission and <p>
+     * <ul>
+     * <li> <i>p</i> is an instanceof PrivateCredentialPermission and
      * <li> the target name for <i>p</i> is implied by this object's
      *          target name.  For example:
      * <pre>
diff --git a/jdk/src/share/classes/javax/security/auth/kerberos/DelegationPermission.java b/jdk/src/share/classes/javax/security/auth/kerberos/DelegationPermission.java
index 77aabb8..bdd3ff9 100644
--- a/jdk/src/share/classes/javax/security/auth/kerberos/DelegationPermission.java
+++ b/jdk/src/share/classes/javax/security/auth/kerberos/DelegationPermission.java
@@ -48,14 +48,14 @@
  * <p>
  * For example, to specify the "host" service use of a forwardable TGT the
  * target permission is specified as follows:
- * <p>
+ *
  * <pre>
  *  DelegationPermission("\"host/foo.example.com@EXAMPLE.COM\" \"krbtgt/EXAMPLE.COM@EXAMPLE.COM\"");
  * </pre>
  * <p>
  * To give the "backup" service a proxiable nfs service ticket the target permission
  * might be specified:
- * <p>
+ *
  * <pre>
  *  DelegationPermission("\"backup/bar.example.com@EXAMPLE.COM\" \"nfs/home.EXAMPLE.COM@EXAMPLE.COM\"");
  * </pre>
diff --git a/jdk/src/share/classes/javax/security/auth/kerberos/ServicePermission.java b/jdk/src/share/classes/javax/security/auth/kerberos/ServicePermission.java
index 50a0517..893284e 100644
--- a/jdk/src/share/classes/javax/security/auth/kerberos/ServicePermission.java
+++ b/jdk/src/share/classes/javax/security/auth/kerberos/ServicePermission.java
@@ -62,7 +62,7 @@
  * Authentication Service exchange.
  * <p>
  * The possible actions are:
- * <p>
+ *
  * <pre>
  *    initiate -              allow the caller to use the credential to
  *                            initiate a security context with a service
@@ -75,7 +75,7 @@
  *
  * For example, to specify the permission to access to the TGT to
  * initiate a security context the permission is constructed as follows:
- * <p>
+ *
  * <pre>
  *     ServicePermission("krbtgt/EXAMPLE.COM@EXAMPLE.COM", "initiate");
  * </pre>
@@ -89,7 +89,7 @@
  * For a Kerberized server the action is "accept". For example, the permission
  * necessary to access and use the secret key of the  Kerberized "host"
  * service (telnet and the likes)  would be constructed as follows:
- * <p>
+ *
  * <pre>
  *     ServicePermission("host/foo.example.com@EXAMPLE.COM", "accept");
  * </pre>
diff --git a/jdk/src/share/classes/javax/security/auth/login/LoginContext.java b/jdk/src/share/classes/javax/security/auth/login/LoginContext.java
index a9685bc..ba18e5c 100644
--- a/jdk/src/share/classes/javax/security/auth/login/LoginContext.java
+++ b/jdk/src/share/classes/javax/security/auth/login/LoginContext.java
@@ -101,11 +101,11 @@
  * <li> If the constructor has a Subject
  * input parameter, the LoginContext uses the caller-specified
  * Subject object.
- * <p>
+ *
  * <li> If the caller specifies a {@code null} Subject
  * and a {@code null} value is permitted,
  * the LoginContext instantiates a new Subject.
- * <p>
+ *
  * <li> If the constructor does <b>not</b> have a Subject
  * input parameter, the LoginContext instantiates a new Subject.
  * <p>
@@ -132,7 +132,7 @@
  * {@code getAppConfigurationEntry} with the name, "<i>other</i>"
  * (the default entry name).  If there is no entry for "<i>other</i>",
  * then a {@code LoginException} is thrown.
- * <p>
+ *
  * <li> When LoginContext uses the installed Configuration, the caller
  * requires the createLoginContext.<em>name</em> and possibly
  * createLoginContext.other AuthPermissions. Furthermore, the
@@ -141,7 +141,7 @@
  * perform security-sensitive tasks (such as connecting to remote hosts,
  * and updating the Subject) will require the respective permissions, but
  * the callers of the LoginContext will not require those permissions.
- * <p>
+ *
  * <li> When LoginContext uses a caller-specified Configuration, the caller
  * does not require any createLoginContext AuthPermission.  The LoginContext
  * saves the {@code AccessControlContext} for the caller,
@@ -158,7 +158,7 @@
  * <li> If the constructor has a CallbackHandler
  * input parameter, the LoginContext uses the caller-specified
  * CallbackHandler object.
- * <p>
+ *
  * <li> If the constructor does <b>not</b> have a CallbackHandler
  * input parameter, or if the caller specifies a {@code null}
  * CallbackHandler object (and a {@code null} value is permitted),
@@ -171,7 +171,7 @@
  * with users.  The caller thus assumes that the configured
  * modules have alternative means for authenticating the user.
  *
- * <p>
+ *
  * <li> When the LoginContext uses the installed Configuration (instead of
  * a caller-specified Configuration, see above),
  * then this LoginContext must wrap any
diff --git a/jdk/src/share/classes/javax/security/auth/x500/X500Principal.java b/jdk/src/share/classes/javax/security/auth/x500/X500Principal.java
index 5c0a562..77292b0 100644
--- a/jdk/src/share/classes/javax/security/auth/x500/X500Principal.java
+++ b/jdk/src/share/classes/javax/security/auth/x500/X500Principal.java
@@ -314,7 +314,7 @@
      * this method returns an RFC 2253 conformant string representation
      * with the following additional canonicalizations:
      *
-     * <p><ol>
+     * <ol>
      * <li> Leading zeros are removed from attribute types
      *          that are encoded as dotted decimal OIDs
      * <li> DirectoryString attribute values of type
diff --git a/jdk/src/share/classes/javax/swing/Action.java b/jdk/src/share/classes/javax/swing/Action.java
index 7223d81..66fcf83 100644
--- a/jdk/src/share/classes/javax/swing/Action.java
+++ b/jdk/src/share/classes/javax/swing/Action.java
@@ -67,7 +67,7 @@
  * functionality and broadcast of property changes.  For this reason,
  * you should take care to only use <code>Action</code>s where their benefits
  * are desired, and use simple <code>ActionListener</code>s elsewhere.
- * <p>
+ * <br>
  *
  * <h3><a name="buttonActions"></a>Swing Components Supporting <code>Action</code></h3>
  * <p>
@@ -93,7 +93,7 @@
  * <code>null</code> property value in an <code>Action</code> (or a
  * <code>Action</code> that is <code>null</code>) results in the
  * button's corresponding property being set to <code>null</code>.
- * <p>
+ *
  * <table border="1" cellpadding="1" cellspacing="0"
  *         summary="Supported Action properties">
  *  <tr valign="top"  align="left">
diff --git a/jdk/src/share/classes/javax/swing/DefaultComboBoxModel.java b/jdk/src/share/classes/javax/swing/DefaultComboBoxModel.java
index 6e35b61..3cb3c6f 100644
--- a/jdk/src/share/classes/javax/swing/DefaultComboBoxModel.java
+++ b/jdk/src/share/classes/javax/swing/DefaultComboBoxModel.java
@@ -83,7 +83,7 @@
     // implements javax.swing.ComboBoxModel
     /**
      * Set the value of the selected item. The selected item may be null.
-     * <p>
+     *
      * @param anObject The combo box value or null for no selection.
      */
     public void setSelectedItem(Object anObject) {
diff --git a/jdk/src/share/classes/javax/swing/GroupLayout.java b/jdk/src/share/classes/javax/swing/GroupLayout.java
index e3be1dd..582c961 100644
--- a/jdk/src/share/classes/javax/swing/GroupLayout.java
+++ b/jdk/src/share/classes/javax/swing/GroupLayout.java
@@ -100,7 +100,7 @@
  * The following diagram shows the same three components, but with the
  * parallel group along the horizontal axis and the sequential group along
  * the vertical axis.
- * <p>
+ *
  * <p style="text-align:center">
  * <img src="doc-files/groupLayout.2.gif" alt="Sequential group along the vertical axis in three components">
  * <p>
diff --git a/jdk/src/share/classes/javax/swing/InputVerifier.java b/jdk/src/share/classes/javax/swing/InputVerifier.java
index aa2a0ee..2cf4ddc 100644
--- a/jdk/src/share/classes/javax/swing/InputVerifier.java
+++ b/jdk/src/share/classes/javax/swing/InputVerifier.java
@@ -47,7 +47,7 @@
  * either by clicking in it or by pressing TAB. However, if another string
  * is entered in the first text field, then the user will be unable to
  * transfer focus to the second text field.
- * <p>
+ *
  * <pre>
  * import java.awt.*;
  * import java.util.*;
diff --git a/jdk/src/share/classes/javax/swing/JComponent.java b/jdk/src/share/classes/javax/swing/JComponent.java
index 3f4d3f2..d6f35ac 100644
--- a/jdk/src/share/classes/javax/swing/JComponent.java
+++ b/jdk/src/share/classes/javax/swing/JComponent.java
@@ -4827,7 +4827,6 @@
      * updating differs from the AWT because programs generally no
      * longer need to invoke <code>validate</code> to get the contents of the
      * GUI to update.
-     * <p>
      *
      * @see java.awt.Component#invalidate
      * @see java.awt.Container#validate
diff --git a/jdk/src/share/classes/javax/swing/JDialog.java b/jdk/src/share/classes/javax/swing/JDialog.java
index 92febed..2d8980e 100644
--- a/jdk/src/share/classes/javax/swing/JDialog.java
+++ b/jdk/src/share/classes/javax/swing/JDialog.java
@@ -701,7 +701,7 @@
      * Sets the operation that will happen by default when
      * the user initiates a "close" on this dialog.
      * You must specify one of the following choices:
-     * <p>
+     * <br><br>
      * <ul>
      * <li>{@code DO_NOTHING_ON_CLOSE}
      * (defined in {@code WindowConstants}):
diff --git a/jdk/src/share/classes/javax/swing/JFrame.java b/jdk/src/share/classes/javax/swing/JFrame.java
index 27a5a04..308320c 100644
--- a/jdk/src/share/classes/javax/swing/JFrame.java
+++ b/jdk/src/share/classes/javax/swing/JFrame.java
@@ -324,7 +324,7 @@
      * Sets the operation that will happen by default when
      * the user initiates a "close" on this frame.
      * You must specify one of the following choices:
-     * <p>
+     * <br><br>
      * <ul>
      * <li><code>DO_NOTHING_ON_CLOSE</code>
      * (defined in <code>WindowConstants</code>):
diff --git a/jdk/src/share/classes/javax/swing/JInternalFrame.java b/jdk/src/share/classes/javax/swing/JInternalFrame.java
index 901f137..3183d5c 100644
--- a/jdk/src/share/classes/javax/swing/JInternalFrame.java
+++ b/jdk/src/share/classes/javax/swing/JInternalFrame.java
@@ -1645,7 +1645,7 @@
      * Sets the operation that will happen by default when
      * the user initiates a "close" on this internal frame.
      * The possible choices are:
-     * <p>
+     * <br><br>
      * <dl>
      * <dt><code>DO_NOTHING_ON_CLOSE</code>
      * <dd> Do nothing.
diff --git a/jdk/src/share/classes/javax/swing/JLayeredPane.java b/jdk/src/share/classes/javax/swing/JLayeredPane.java
index 052fcf3..71d57bd 100644
--- a/jdk/src/share/classes/javax/swing/JLayeredPane.java
+++ b/jdk/src/share/classes/javax/swing/JLayeredPane.java
@@ -43,7 +43,7 @@
  * For task-oriented documentation and examples of using layered panes see
  * <a href="http://docs.oracle.com/javase/tutorial/uiswing/components/layeredpane.html">How to Use a Layered Pane</a>,
  * a section in <em>The Java Tutorial</em>.
- * <P>
+ *
  * <TABLE STYLE="FLOAT:RIGHT" BORDER="0" SUMMARY="layout">
  * <TR>
  *   <TD ALIGN="CENTER">
diff --git a/jdk/src/share/classes/javax/swing/JList.java b/jdk/src/share/classes/javax/swing/JList.java
index e62bc80..1aae62e 100644
--- a/jdk/src/share/classes/javax/swing/JList.java
+++ b/jdk/src/share/classes/javax/swing/JList.java
@@ -950,7 +950,7 @@
     /**
      * Defines the way list cells are layed out. Consider a {@code JList}
      * with five cells. Cells can be layed out in one of the following ways:
-     * <p>
+     *
      * <pre>
      * VERTICAL:          0
      *                    1
diff --git a/jdk/src/share/classes/javax/swing/JOptionPane.java b/jdk/src/share/classes/javax/swing/JOptionPane.java
index 8bbd49d..a2dbf81 100644
--- a/jdk/src/share/classes/javax/swing/JOptionPane.java
+++ b/jdk/src/share/classes/javax/swing/JOptionPane.java
@@ -106,7 +106,6 @@
  * <p>
  * All dialogs are modal. Each <code>showXxxDialog</code> method blocks
  * the caller until the user's interaction is complete.
- * <p>
  *
  * <table cellspacing=6 cellpadding=4 border=0 style="float:right" summary="layout">
  * <tr>
@@ -143,7 +142,7 @@
  * just below the component. This parameter may be <code>null</code>,
  * in which case a default <code>Frame</code> is used as the parent,
  * and the dialog will be
- * centered on the screen (depending on the L&F).
+ * centered on the screen (depending on the {@literal L&F}).
  * <dt><a name=message>message</a><dd>
  * A descriptive message to be placed in the dialog box.
  * In the most common usage, message is just a <code>String</code> or
@@ -225,42 +224,42 @@
  * <dt>Show an error dialog that displays the message, 'alert':
  * <dd><code>
  * JOptionPane.showMessageDialog(null, "alert", "alert", JOptionPane.ERROR_MESSAGE);
- * </code><p>
+ * </code>
  * <dt>Show an internal information dialog with the message, 'information':
- * <dd><code>
- * JOptionPane.showInternalMessageDialog(frame, "information",<br>
- *             <ul><ul>"information", JOptionPane.INFORMATION_MESSAGE);</ul></ul>
- * </code><p>
+ * <dd><pre>
+ * JOptionPane.showInternalMessageDialog(frame, "information",
+ *             "information", JOptionPane.INFORMATION_MESSAGE);
+ * </pre>
  * <dt>Show an information panel with the options yes/no and message 'choose one':
- * <dd><code>JOptionPane.showConfirmDialog(null,
- *             <ul><ul>"choose one", "choose one", JOptionPane.YES_NO_OPTION);</ul></ul>
- * </code><p>
+ * <dd><pre>JOptionPane.showConfirmDialog(null,
+ *             "choose one", "choose one", JOptionPane.YES_NO_OPTION);
+ * </pre>
  * <dt>Show an internal information dialog with the options yes/no/cancel and
  * message 'please choose one' and title information:
- * <dd><code>JOptionPane.showInternalConfirmDialog(frame,
- *             <ul><ul>"please choose one", "information",</ul></ul>
- *             <ul><ul>JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE);</ul></ul>
- * </code><p>
+ * <dd><pre>JOptionPane.showInternalConfirmDialog(frame,
+ *             "please choose one", "information",
+ *             JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE);
+ * </pre>
  * <dt>Show a warning dialog with the options OK, CANCEL, title 'Warning', and
  * message 'Click OK to continue':
- * <dd><code>
- * Object[] options = { "OK", "CANCEL" };<br>
+ * <dd><pre>
+ * Object[] options = { "OK", "CANCEL" };
  * JOptionPane.showOptionDialog(null, "Click OK to continue", "Warning",
- *             <ul><ul>JOptionPane.DEFAULT_OPTION, JOptionPane.WARNING_MESSAGE,</ul></ul>
- *             <ul><ul>null, options, options[0]);</ul></ul>
- * </code><p>
+ *             JOptionPane.DEFAULT_OPTION, JOptionPane.WARNING_MESSAGE,
+ *             null, options, options[0]);
+ * </pre>
  * <dt>Show a dialog asking the user to type in a String:
  * <dd><code>
  * String inputValue = JOptionPane.showInputDialog("Please input a value");
- * </code><p>
+ * </code>
  * <dt>Show a dialog asking the user to select a String:
- * <dd><code>
+ * <dd><pre>
  * Object[] possibleValues = { "First", "Second", "Third" };<br>
  * Object selectedValue = JOptionPane.showInputDialog(null,
- *             <ul><ul>"Choose one", "Input",</ul></ul>
- *             <ul><ul>JOptionPane.INFORMATION_MESSAGE, null,</ul></ul>
- *             <ul><ul>possibleValues, possibleValues[0]);</ul></ul>
- * </code><p>
+ *             "Choose one", "Input",
+ *             JOptionPane.INFORMATION_MESSAGE, null,
+ *             possibleValues, possibleValues[0]);
+ * </pre><p>
  * </dl>
  * <b>Direct Use:</b><br>
  * To create and use an <code>JOptionPane</code> directly, the
@@ -281,7 +280,7 @@
  *     }
  *     <i>//If there is an array of option buttons:</i>
  *     for(int counter = 0, maxCounter = options.length;
- *        counter < maxCounter; counter++) {
+ *        counter &lt; maxCounter; counter++) {
  *        if(options[counter].equals(selectedValue))
  *        return counter;
  *     }
@@ -1847,9 +1846,9 @@
     }
 
     /**
-     * Sets the UI object which implements the L&F for this component.
+     * Sets the UI object which implements the {@literal L&F} for this component.
      *
-     * @param ui  the <code>OptionPaneUI</code> L&F object
+     * @param ui  the <code>OptionPaneUI</code> {@literal L&F} object
      * @see UIDefaults#getUI
      * @beaninfo
      *       bound: true
@@ -1864,7 +1863,7 @@
     }
 
     /**
-     * Returns the UI object which implements the L&F for this component.
+     * Returns the UI object which implements the {@literal L&F} for this component.
      *
      * @return the <code>OptionPaneUI</code> object
      */
@@ -1873,7 +1872,7 @@
     }
 
     /**
-     * Notification from the <code>UIManager</code> that the L&F has changed.
+     * Notification from the <code>UIManager</code> that the {@literal L&F} has changed.
      * Replaces the current UI object with the latest version from the
      * <code>UIManager</code>.
      *
@@ -1886,7 +1885,7 @@
 
     /**
      * Returns the name of the UI class that implements the
-     * L&F for this component.
+     * {@literal L&F} for this component.
      *
      * @return the string "OptionPaneUI"
      * @see JComponent#getUIClassID
@@ -2103,7 +2102,7 @@
      * Sets the options to display.
      * The option type is used by the Look and Feel to
      * determine what buttons to show (unless options are supplied).
-     * @param newType an integer specifying the options the L&F is to display:
+     * @param newType an integer specifying the options the {@literal L&F} is to display:
      *                  <code>DEFAULT_OPTION</code>,
      *                  <code>YES_NO_OPTION</code>,
      *                  <code>YES_NO_CANCEL_OPTION</code>,
diff --git a/jdk/src/share/classes/javax/swing/JScrollBar.java b/jdk/src/share/classes/javax/swing/JScrollBar.java
index efcac81..1c0eac1 100644
--- a/jdk/src/share/classes/javax/swing/JScrollBar.java
+++ b/jdk/src/share/classes/javax/swing/JScrollBar.java
@@ -192,9 +192,9 @@
 
 
     /**
-     * Sets the L&F object that renders this component.
+     * Sets the {@literal L&F} object that renders this component.
      *
-     * @param ui  the <code>ScrollBarUI</code> L&F object
+     * @param ui  the <code>ScrollBarUI</code> {@literal L&F} object
      * @see UIDefaults#getUI
      * @since 1.4
      * @beaninfo
@@ -606,9 +606,9 @@
      * Sets the four BoundedRangeModel properties after forcing
      * the arguments to obey the usual constraints:
      * <pre>
-     * minimum <= value <= value+extent <= maximum
+     * minimum &le; value &le; value+extent &le; maximum
      * </pre>
-     * <p>
+     *
      *
      * @see BoundedRangeModel#setRangeProperties
      * @see #setValue
diff --git a/jdk/src/share/classes/javax/swing/JScrollPane.java b/jdk/src/share/classes/javax/swing/JScrollPane.java
index 4c5f1e8..ecb3d8f 100644
--- a/jdk/src/share/classes/javax/swing/JScrollPane.java
+++ b/jdk/src/share/classes/javax/swing/JScrollPane.java
@@ -53,7 +53,7 @@
  *  <a href="http://docs.oracle.com/javase/tutorial/uiswing/components/scrollpane.html">How to Use Scroll Panes</a>,
  * a section in <em>The Java Tutorial</em>.  Note that
  * <code>JScrollPane</code> does not support heavyweight components.
- * <p>
+ *
  * <TABLE STYLE="FLOAT:RIGHT" BORDER="0" SUMMARY="layout">
  *    <TR>
  *    <TD ALIGN="CENTER">
diff --git a/jdk/src/share/classes/javax/swing/JTable.java b/jdk/src/share/classes/javax/swing/JTable.java
index bdcb27b..526afcf 100644
--- a/jdk/src/share/classes/javax/swing/JTable.java
+++ b/jdk/src/share/classes/javax/swing/JTable.java
@@ -73,7 +73,7 @@
  * but provides defaults for these features so that simple tables can be
  * set up easily.  For example, to set up a table with 10 rows and 10
  * columns of numbers:
- * <p>
+ *
  * <pre>
  *      TableModel dataModel = new AbstractTableModel() {
  *          public int getColumnCount() { return 10; }
@@ -659,7 +659,7 @@
      * should contain the values for that row. In other words,
      * the value of the cell at row 1, column 5 can be obtained
      * with the following code:
-     * <p>
+     *
      * <pre>((Vector)rowData.elementAt(1)).elementAt(5);</pre>
      * <p>
      * @param rowData           the data for the new table
@@ -674,7 +674,7 @@
      * <code>rowData</code>, with column names, <code>columnNames</code>.
      * <code>rowData</code> is an array of rows, so the value of the cell at row 1,
      * column 5 can be obtained with the following code:
-     * <p>
+     *
      * <pre> rowData[1][5]; </pre>
      * <p>
      * All rows must be of the same length as <code>columnNames</code>.
@@ -3062,9 +3062,9 @@
      *   interface that allows any data structure containing a collection
      *   of elements with a size, preferred size, maximum size and minimum size
      *   to have its elements manipulated by the algorithm.
-     * <p>
+     *
      * <H3> Distributing the delta </H3>
-     * <p>
+     *
      * <H4> Overview </H4>
      * <P>
      * Call "DELTA" the difference between the target size and the
@@ -3073,7 +3073,7 @@
      * sizes and adding a share of the DELTA - that share being based on
      * how far each preferred size is from its limiting bound (minimum or
      * maximum).
-     * <p>
+     *
      * <H4>Definition</H4>
      * <P>
      * Call the individual constraints min[i], max[i], and pref[i].
@@ -3081,21 +3081,21 @@
      * Call their respective sums: MIN, MAX, and PREF.
      * <p>
      * Each new size will be calculated using:
-     * <p>
+     *
      * <pre>
      *          size[i] = pref[i] + delta[i]
      * </pre>
      * where each individual delta[i] is calculated according to:
      * <p>
      * If (DELTA &lt; 0) we are in shrink mode where:
-     * <p>
+     *
      * <PRE>
      *                        DELTA
      *          delta[i] = ------------ * (pref[i] - min[i])
      *                     (PREF - MIN)
      * </PRE>
      * If (DELTA &gt; 0) we are in expand mode where:
-     * <p>
+     *
      * <PRE>
      *                        DELTA
      *          delta[i] = ------------ * (max[i] - pref[i])
@@ -6373,7 +6373,7 @@
      * <p>
      * Here's an example of creating a <code>MessageFormat</code> that can be
      * used to print "Duke's Table: Page - " and the current page number:
-     * <p>
+     *
      * <pre>
      *     // notice the escaping of the single quote
      *     // notice how the page number is included with "{0}"
@@ -7686,7 +7686,7 @@
              * Returns a boolean value indicating whether the specified column
              * is selected.
              *
-             * @param r zero-based column of the table
+             * @param c zero-based column of the table
              * @return the boolean value true if the specified column is selected.
              * Otherwise, false.
              * @since 1.3
diff --git a/jdk/src/share/classes/javax/swing/JTextArea.java b/jdk/src/share/classes/javax/swing/JTextArea.java
index 80b2bb7..06b6ea5 100644
--- a/jdk/src/share/classes/javax/swing/JTextArea.java
+++ b/jdk/src/share/classes/javax/swing/JTextArea.java
@@ -93,7 +93,7 @@
  *    JTextArea myArea = ??;
  *    myArea.getDocument().addDocumentListener(myListener);
  * </pre>
- * <p>
+ *
  * <dl>
  * <dt><b><font size=+1>Newlines</font></b>
  * <dd>
diff --git a/jdk/src/share/classes/javax/swing/JTextPane.java b/jdk/src/share/classes/javax/swing/JTextPane.java
index a6a76ed..b2ca7fc 100644
--- a/jdk/src/share/classes/javax/swing/JTextPane.java
+++ b/jdk/src/share/classes/javax/swing/JTextPane.java
@@ -49,7 +49,7 @@
  * the default attributes to use if not overridden by attributes set
  * on the paragraph or character run.  Components and images may
  * be embedded in the flow of text.
- * <p>
+ *
  * <dl>
  * <dt><b><font size=+1>Newlines</font></b>
  * <dd>
diff --git a/jdk/src/share/classes/javax/swing/JTree.java b/jdk/src/share/classes/javax/swing/JTree.java
index fdacb72..196cde4 100644
--- a/jdk/src/share/classes/javax/swing/JTree.java
+++ b/jdk/src/share/classes/javax/swing/JTree.java
@@ -3956,7 +3956,7 @@
          * allows children depends on how it was created.
          *
          * @return true if this node allows children, false otherwise
-         * @see #JTree.DynamicUtilTreeNode
+         * @see JTree.DynamicUtilTreeNode
          */
         public boolean isLeaf() {
             return !getAllowsChildren();
diff --git a/jdk/src/share/classes/javax/swing/LookAndFeel.java b/jdk/src/share/classes/javax/swing/LookAndFeel.java
index 024162c..2aad929 100644
--- a/jdk/src/share/classes/javax/swing/LookAndFeel.java
+++ b/jdk/src/share/classes/javax/swing/LookAndFeel.java
@@ -91,7 +91,7 @@
  * to provide a specific set of defaults. These are documented in the
  * classes that require the specific default.
  *
- * <h3><a name="#defaultRecommendation">ComponentUIs and defaults</a></h3>
+ * <h3><a name="defaultRecommendation">ComponentUIs and defaults</a></h3>
  *
  * All {@code ComponentUIs} typically need to set various properties
  * on the {@code JComponent} the {@code ComponentUI} is providing the
@@ -120,7 +120,7 @@
  * {@code ComponentUI} implementations should use the various install methods
  * provided by this class as they handle the necessary checking and install
  * the property using the recommended guidelines.
- * <p>
+ *
  * <h3><a name="exceptions"></a>Exceptions</h3>
  *
  * All of the install methods provided by {@code LookAndFeel} need to
diff --git a/jdk/src/share/classes/javax/swing/Painter.java b/jdk/src/share/classes/javax/swing/Painter.java
index 7b2e3ef..57ac21f 100644
--- a/jdk/src/share/classes/javax/swing/Painter.java
+++ b/jdk/src/share/classes/javax/swing/Painter.java
@@ -54,7 +54,7 @@
  *     }
  * }
  * }
- * </pre></p>
+ * </pre>
  *
  * <p>This interface makes no guarantees of threadsafety.</p>
  *
diff --git a/jdk/src/share/classes/javax/swing/RowFilter.java b/jdk/src/share/classes/javax/swing/RowFilter.java
index 6d9fc7f..ccf779c 100644
--- a/jdk/src/share/classes/javax/swing/RowFilter.java
+++ b/jdk/src/share/classes/javax/swing/RowFilter.java
@@ -31,6 +31,7 @@
 import java.util.List;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
+import java.util.regex.PatternSyntaxException;
 
 /**
  * <code>RowFilter</code> is used to filter out entries from the
@@ -129,7 +130,7 @@
 
     /**
      * Throws an IllegalArgumentException if any of the values in
-     * columns are < 0.
+     * columns are {@literal <} 0.
      */
     private static void checkIndices(int[] columns) {
         for (int i = columns.length - 1; i >= 0; i--) {
diff --git a/jdk/src/share/classes/javax/swing/SizeSequence.java b/jdk/src/share/classes/javax/swing/SizeSequence.java
index a04fe2c..4d8d65e1 100644
--- a/jdk/src/share/classes/javax/swing/SizeSequence.java
+++ b/jdk/src/share/classes/javax/swing/SizeSequence.java
@@ -52,7 +52,7 @@
  * <p>
  * The following figure shows the relationship between size and position data
  * for a multi-column component.
- * <p>
+ *
  * <center>
  * <img src="doc-files/SizeSequence-1.gif" width=384 height = 100
  * alt="The first item begins at position 0, the second at the position equal
@@ -76,7 +76,6 @@
  * However, any other unit of measure (for example, time in days)
  * could be just as valid.
  *
- * <p>
  *
  * <h3>Implementation Notes</h3>
  *
diff --git a/jdk/src/share/classes/javax/swing/Spring.java b/jdk/src/share/classes/javax/swing/Spring.java
index 2b18313..4032073 100644
--- a/jdk/src/share/classes/javax/swing/Spring.java
+++ b/jdk/src/share/classes/javax/swing/Spring.java
@@ -65,7 +65,7 @@
  *  from <code>a</code>
  *  to <code>b</code>,
  *  where <code>a &lt;= b</code>).
- *  <p>
+ *
  *  <pre>
  *          [a1, b1] + [a2, b2] = [a1 + a2, b1 + b2]
  *
@@ -78,7 +78,7 @@
  *  If we denote <code>Spring</code>s as <code>[a, b, c]</code>,
  *  where <code>a &lt;= b &lt;= c</code>, we can define the same
  *  arithmetic operators on <code>Spring</code>s:
- *  <p>
+ *
  *  <pre>
  *          [a1, b1, c1] + [a2, b2, c2] = [a1 + a2, b1 + b2, c1 + c2]
  *
@@ -89,7 +89,7 @@
  *  <p>
  *  With both intervals and <code>Spring</code>s we can define "-" and <em>min</em>
  *  in terms of negation:
- *  <p>
+ *
  *  <pre>
  *      X - Y = X + (-Y)
  *
diff --git a/jdk/src/share/classes/javax/swing/SpringLayout.java b/jdk/src/share/classes/javax/swing/SpringLayout.java
index dc85b2c..95444bf 100644
--- a/jdk/src/share/classes/javax/swing/SpringLayout.java
+++ b/jdk/src/share/classes/javax/swing/SpringLayout.java
@@ -297,7 +297,7 @@
      * and "a - b" is equal to
      * <code>Spring.sum(a, Spring.minus(b))</code>.
      * See the
-     * {@link Spring <code>Spring</code> API documentation}
+     * {@link Spring Spring API documentation}
      * for further details
      * of spring arithmetic.
      *
diff --git a/jdk/src/share/classes/javax/swing/SwingWorker.java b/jdk/src/share/classes/javax/swing/SwingWorker.java
index 5775bcb..746b78a 100644
--- a/jdk/src/share/classes/javax/swing/SwingWorker.java
+++ b/jdk/src/share/classes/javax/swing/SwingWorker.java
@@ -62,7 +62,6 @@
  *   </li>
  * </ul>
  *
- * <p>
  *
  * <p>
  * These constraints mean that a GUI application with time intensive
diff --git a/jdk/src/share/classes/javax/swing/border/CompoundBorder.java b/jdk/src/share/classes/javax/swing/border/CompoundBorder.java
index f1a6d85..6a28c1a 100644
--- a/jdk/src/share/classes/javax/swing/border/CompoundBorder.java
+++ b/jdk/src/share/classes/javax/swing/border/CompoundBorder.java
@@ -36,7 +36,7 @@
  *
  * For example, this class may be used to add blank margin space
  * to a component with an existing decorative border:
- * <p>
+ *
  * <pre>
  *    Border border = comp.getBorder();
  *    Border margin = new EmptyBorder(10,10,10,10);
diff --git a/jdk/src/share/classes/javax/swing/event/TableModelEvent.java b/jdk/src/share/classes/javax/swing/event/TableModelEvent.java
index 05c5c7b..ab450cb 100644
--- a/jdk/src/share/classes/javax/swing/event/TableModelEvent.java
+++ b/jdk/src/share/classes/javax/swing/event/TableModelEvent.java
@@ -34,7 +34,7 @@
  * and all references to rows and columns are in the co-ordinate
  * system of the model.
  * Depending on the parameters used in the constructors, the TableModelevent
- * can be used to specify the following types of changes: <p>
+ * can be used to specify the following types of changes:
  *
  * <pre>
  * TableModelEvent(source);              //  The data, ie. all rows changed
diff --git a/jdk/src/share/classes/javax/swing/event/TreeModelListener.java b/jdk/src/share/classes/javax/swing/event/TreeModelListener.java
index b48fdfb..48a945f 100644
--- a/jdk/src/share/classes/javax/swing/event/TreeModelListener.java
+++ b/jdk/src/share/classes/javax/swing/event/TreeModelListener.java
@@ -86,7 +86,7 @@
      * <p>Invoked after the tree has drastically changed structure from a
      * given node down.  If the path returned by e.getPath() is of length
      * one and the first element does not identify the current root node
-     * the first element should become the new root of the tree.<p>
+     * the first element should become the new root of the tree.
      *
      * <p>Use <code>e.getPath()</code>
      * to get the path to the node.
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 28b1d0a..b55f8ab 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java
@@ -48,7 +48,7 @@
  * Provides the basic look and feel for a <code>JOptionPane</code>.
  * <code>BasicMessagePaneUI</code> provides a means to place an icon,
  * message and buttons into a <code>Container</code>.
- * Generally, the layout will look like:<p>
+ * Generally, the layout will look like:
  * <pre>
  *        ------------------
  *        | i | message    |
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 9a56bd7..9704705 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneDivider.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneDivider.java
@@ -521,7 +521,7 @@
      * MouseHandler is responsible for converting mouse events
      * (released, dragged...) into the appropriate DragController
      * methods.
-     * <p>
+     *
      */
     protected class MouseHandler extends MouseAdapter
             implements MouseMotionListener
@@ -890,7 +890,7 @@
      * Used to layout a <code>BasicSplitPaneDivider</code>.
      * Layout for the divider
      * involves appropriately moving the left/right buttons around.
-     * <p>
+     *
      */
     protected class DividerLayout implements LayoutManager
     {
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 0f47e89..1ec9921 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java
@@ -2015,7 +2015,7 @@
     /**
      * LayoutManager used for JSplitPanes with an orientation of
      * VERTICAL_SPLIT.
-     * <p>
+     *
      */
     public class BasicVerticalLayoutManager extends
             BasicHorizontalLayoutManager
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 8214830..cd41f85 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java
@@ -1398,7 +1398,7 @@
 
     /**
      * Paints the vertical part of the leg. The receiver should
-     * NOT modify <code>clipBounds</code>, <code>insets</code>.<p>
+     * NOT modify <code>clipBounds</code>, <code>insets</code>.
      */
     protected void paintVerticalPartOfLeg(Graphics g, Rectangle clipBounds,
                                           Insets insets, TreePath path) {
diff --git a/jdk/src/share/classes/javax/swing/table/DefaultTableModel.java b/jdk/src/share/classes/javax/swing/table/DefaultTableModel.java
index 5abf1e8..6bf3998 100644
--- a/jdk/src/share/classes/javax/swing/table/DefaultTableModel.java
+++ b/jdk/src/share/classes/javax/swing/table/DefaultTableModel.java
@@ -182,7 +182,7 @@
      *  each a single row of values.  In other words, to get to the cell
      *  at row 1, column 5: <p>
      *
-     *  <code>((Vector)getDataVector().elementAt(1)).elementAt(5);</code><p>
+     *  <code>((Vector)getDataVector().elementAt(1)).elementAt(5);</code>
      *
      * @return  the vector of vectors containing the tables data values
      *
@@ -306,7 +306,7 @@
      *  Sets the number of rows in the model.  If the new size is greater
      *  than the current size, new rows are added to the end of the model
      *  If the new size is less than the current size, all
-     *  rows at index <code>rowCount</code> and greater are discarded. <p>
+     *  rows at index <code>rowCount</code> and greater are discarded.
      *
      * @param   rowCount   the new number of rows
      * @see #setRowCount
@@ -330,7 +330,7 @@
      *  Sets the number of rows in the model.  If the new size is greater
      *  than the current size, new rows are added to the end of the model
      *  If the new size is less than the current size, all
-     *  rows at index <code>rowCount</code> and greater are discarded. <p>
+     *  rows at index <code>rowCount</code> and greater are discarded.
      *
      *  @see #setColumnCount
      * @since 1.3
@@ -414,7 +414,7 @@
      *  After the move, the row that was at index <code>start</code>
      *  will be at index <code>to</code>.
      *  This method will send a <code>tableChanged</code> notification
-     *  message to all the listeners. <p>
+       message to all the listeners.
      *
      *  <pre>
      *  Examples of moves:
@@ -473,7 +473,7 @@
      * of columns, new columns are added to the end of each row in the model.
      * If the number of <code>newIdentifier</code>s is less than the current
      * number of columns, all the extra columns at the end of a row are
-     * discarded. <p>
+     * discarded.
      *
      * @param   columnIdentifiers  vector of column identifiers.  If
      *                          <code>null</code>, set the model
@@ -490,7 +490,7 @@
      * of columns, new columns are added to the end of each row in the model.
      * If the number of <code>newIdentifier</code>s is less than the current
      * number of columns, all the extra columns at the end of a row are
-     * discarded. <p>
+     * discarded.
      *
      * @param   newIdentifiers  array of column identifiers.
      *                          If <code>null</code>, set
diff --git a/jdk/src/share/classes/javax/swing/table/TableModel.java b/jdk/src/share/classes/javax/swing/table/TableModel.java
index 2c4794b..5b13fc1 100644
--- a/jdk/src/share/classes/javax/swing/table/TableModel.java
+++ b/jdk/src/share/classes/javax/swing/table/TableModel.java
@@ -34,7 +34,7 @@
  *
  *  The <code>JTable</code> can be set up to display any data
  *  model which implements the
- *  <code>TableModel</code> interface with a couple of lines of code:  <p>
+ *  <code>TableModel</code> interface with a couple of lines of code:
  *  <pre>
  *      TableModel myData = new MyTableModel();
  *      JTable table = new JTable(myData);
@@ -42,7 +42,7 @@
  *
  * For further documentation, see <a href="http://docs.oracle.com/javase/tutorial/uiswing/components/table.html#data">Creating a Table Model</a>
  * in <em>The Java Tutorial</em>.
- * <p>
+ *
  * @author Philip Milne
  * @see JTable
  */
diff --git a/jdk/src/share/classes/javax/swing/text/AbstractDocument.java b/jdk/src/share/classes/javax/swing/text/AbstractDocument.java
index 71e9d5d..f8a4332 100644
--- a/jdk/src/share/classes/javax/swing/text/AbstractDocument.java
+++ b/jdk/src/share/classes/javax/swing/text/AbstractDocument.java
@@ -804,7 +804,7 @@
      * returns will give better performance for situations where large
      * parts of the document are being scanned.  The following is an example
      * of using the partial return to access the entire document:
-     * <p>
+     *
      * <pre>
      * &nbsp; int nleft = doc.getDocumentLength();
      * &nbsp; Segment text = new Segment();
diff --git a/jdk/src/share/classes/javax/swing/text/DefaultEditorKit.java b/jdk/src/share/classes/javax/swing/text/DefaultEditorKit.java
index f47a1c6..139615bd 100644
--- a/jdk/src/share/classes/javax/swing/text/DefaultEditorKit.java
+++ b/jdk/src/share/classes/javax/swing/text/DefaultEditorKit.java
@@ -41,7 +41,7 @@
  * of text document.  This implementation provides a default
  * implementation which treats text as plain text and
  * provides a minimal set of actions for a simple editor.
- * <p>
+ *
  * <dl>
  * <dt><b><font size=+1>Newlines</font></b>
  * <dd>
diff --git a/jdk/src/share/classes/javax/swing/text/Document.java b/jdk/src/share/classes/javax/swing/text/Document.java
index 5b79ac41..946e18a 100644
--- a/jdk/src/share/classes/javax/swing/text/Document.java
+++ b/jdk/src/share/classes/javax/swing/text/Document.java
@@ -354,7 +354,7 @@
      * returns will give better performance for situations where large
      * parts of the document are being scanned.  The following is an example
      * of using the partial return to access the entire document:
-     * <p>
+     *
      * <pre><code>
      *
      * &nbsp; int nleft = doc.getDocumentLength();
diff --git a/jdk/src/share/classes/javax/swing/text/JTextComponent.java b/jdk/src/share/classes/javax/swing/text/JTextComponent.java
index 2ec1263..5f4fd20 100644
--- a/jdk/src/share/classes/javax/swing/text/JTextComponent.java
+++ b/jdk/src/share/classes/javax/swing/text/JTextComponent.java
@@ -87,7 +87,6 @@
  * <a href="http://docs.oracle.com/javase/tutorial/uiswing/components/generaltext.html">General Rules for Using Text Components</a>,
  * a section in <em>The Java Tutorial.</em>
  *
- * <p>
  * <dl>
  * <dt><b><font size=+1>Caret Changes</font></b>
  * <dd>
@@ -108,7 +107,6 @@
  * <b>Note</b>: Non-editable text components also have a caret though
  * it may not be painted.
  *
- * <p>
  * <dt><b><font size=+1>Commands</font></b>
  * <dd>
  * Text components provide a number of commands that can be used
@@ -120,7 +118,6 @@
  * found with the {@link #getActions} method.  These actions
  * can be bound to key events, fired from buttons, etc.
  *
- * <p>
  * <dt><b><font size=+1>Text Input</font></b>
  * <dd>
  * The text components support flexible and internationalized text input, using
@@ -206,7 +203,6 @@
  * <li>caret movement forward and backward
  * </ul>
  *
- * <p>
  * <dt><b><font size=+1>Model/View Split</font></b>
  * <dd>
  * The text components have a model-view split.  A text component pulls
@@ -231,14 +227,12 @@
  * {@link DocumentListener}
  * interface and registered interest with the model being observed.
  *
- * <p>
  * <dt><b><font size=+1>Location Information</font></b>
  * <dd>
  * The capability of determining the location of text in
  * the view is provided.  There are two methods, {@link #modelToView}
  * and {@link #viewToModel} for determining this information.
  *
- * <p>
  * <dt><b><font size=+1>Undo/Redo support</font></b>
  * <dd>
  * Support for an edit history mechanism is provided to allow
@@ -249,7 +243,6 @@
  * The support is provided by the Document model, which allows
  * one to attach UndoableEditListener implementations.
  *
- * <p>
  * <dt><b><font size=+1>Thread Safety</font></b>
  * <dd>
  * The swing text components provide some support of thread
@@ -261,13 +254,12 @@
  * The methods that are safe to call asynchronously are marked
  * with comments.
  *
- * <p>
  * <dt><b><font size=+1>Newlines</font></b>
  * <dd>
  * For a discussion on how newlines are handled, see
  * <a href="DefaultEditorKit.html">DefaultEditorKit</a>.
  *
- * <p>
+ *
  * <dt><b><font size=+1>Printing support</font></b>
  * <dd>
  * Several {@link #print print} methods are provided for basic
diff --git a/jdk/src/share/classes/javax/swing/text/View.java b/jdk/src/share/classes/javax/swing/text/View.java
index 675aad5..2b49055 100644
--- a/jdk/src/share/classes/javax/swing/text/View.java
+++ b/jdk/src/share/classes/javax/swing/text/View.java
@@ -144,7 +144,6 @@
     <ul>
     <li>{@link #paint(java.awt.Graphics, java.awt.Shape) paint}
     </ul>
-    <p>
 
     <dt><b>Translate between the model and view coordinate systems.</b>
     <dd>
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 8b84bf7..852776e 100644
--- a/jdk/src/share/classes/javax/swing/text/html/HTMLDocument.java
+++ b/jdk/src/share/classes/javax/swing/text/html/HTMLDocument.java
@@ -2089,7 +2089,7 @@
      *
      * <p>
      * The assignment of the actions described is shown in the
-     * following table for the tags defined in <code>HTML.Tag</code>.<P>
+     * following table for the tags defined in <code>HTML.Tag</code>.
      * <table border=1 summary="HTML tags and assigned actions">
      * <tr><th>Tag</th><th>Action</th></tr>
      * <tr><td><code>HTML.Tag.A</code>         <td>CharacterAction
@@ -3968,7 +3968,7 @@
         }
 
         /**
-         * This is set to true when and end is invoked for <html>.
+         * This is set to true when and end is invoked for {@literal <html>}.
          */
         private boolean receivedEndHTML;
         /** Number of times <code>flushBuffer</code> has been invoked. */
@@ -3990,7 +3990,7 @@
         boolean inTitle = false;
         boolean lastWasNewline = true;
         boolean emptyAnchor;
-        /** True if (!emptyDocument && insertTag == null), this is used so
+        /** True if (!emptyDocument &amp;&amp; insertTag == null), this is used so
          * much it is cached. */
         boolean midInsert;
         /** True when the body has been encountered. */
diff --git a/jdk/src/share/classes/javax/swing/text/html/HTMLEditorKit.java b/jdk/src/share/classes/javax/swing/text/html/HTMLEditorKit.java
index 9cca8f9..468f862 100644
--- a/jdk/src/share/classes/javax/swing/text/html/HTMLEditorKit.java
+++ b/jdk/src/share/classes/javax/swing/text/html/HTMLEditorKit.java
@@ -71,7 +71,7 @@
  * The modeling of HTML is provided by the class <code>HTMLDocument</code>.
  * Its documentation describes the details of how the HTML is modeled.
  * The editing support leverages heavily off of the text package.
- * <p>
+ *
  * <dt>
  * Extendable/Scalable
  * <dd>
@@ -114,7 +114,7 @@
  *   attributes for display.  This helps make the View implementations
  *   more general purpose
  * </ol>
- * <p>
+ *
  * <dt>
  * Asynchronous Loading
  * <dd>
@@ -127,7 +127,7 @@
  * by the <code>HTMLDocument.HTMLReader</code> class.  The actual
  * work is done by the <code>DefaultStyledDocument</code> and
  * <code>AbstractDocument</code> classes in the text package.
- * <p>
+ *
  * <dt>
  * Customization from current LAF
  * <dd>
@@ -141,7 +141,7 @@
  * The support for this is provided by the <code>StyleSheet</code>
  * class.  The presentation of the HTML can be heavily influenced
  * by the setting of the StyleSheet property on the EditorKit.
- * <p>
+ *
  * <dt>
  * Not lossy
  * <dd>
@@ -839,7 +839,7 @@
          * if the given position represents a link. If this was the result
          * of a mouse click, <code>x</code> and
          * <code>y</code> will give the location of the mouse, otherwise
-         * they will be < 0.
+         * they will be {@literal <} 0.
          *
          * @param pos the position
          * @param html the editor pane
@@ -2027,8 +2027,8 @@
              * Paints a portion of a highlight.
              *
              * @param g the graphics context
-             * @param offs0 the starting model offset >= 0
-             * @param offs1 the ending model offset >= offs1
+             * @param offs0 the starting model offset &ge; 0
+             * @param offs1 the ending model offset &ge; offs1
              * @param bounds the bounding box of the view, which is not
              *        necessarily the region to paint.
              * @param c the editor
diff --git a/jdk/src/share/classes/javax/swing/tree/FixedHeightLayoutCache.java b/jdk/src/share/classes/javax/swing/tree/FixedHeightLayoutCache.java
index c31a96e..0cd55cb 100644
--- a/jdk/src/share/classes/javax/swing/tree/FixedHeightLayoutCache.java
+++ b/jdk/src/share/classes/javax/swing/tree/FixedHeightLayoutCache.java
@@ -469,7 +469,7 @@
      * <p>Invoked after the tree has drastically changed structure from a
      * given node down.  If the path returned by e.getPath() is of length
      * one and the first element does not identify the current root node
-     * the first element should become the new root of the tree.<p>
+     * the first element should become the new root of the tree.
      *
      * <p>e.path() holds the path to the node.</p>
      * <p>e.childIndices() returns null.</p>
@@ -677,7 +677,7 @@
 
     /**
      * Messages getTreeNodeForPage(path, onlyIfVisible, shouldCreate,
-     * path.length) as long as path is non-null and the length is > 0.
+     * path.length) as long as path is non-null and the length is {@literal >} 0.
      * Otherwise returns null.
      */
     private FHTreeStateNode getNodeForPath(TreePath path,
@@ -1283,7 +1283,7 @@
 
         /**
          * Messaged when a child has been inserted at index. For all the
-         * children that have a childIndex >= index their index is incremented
+         * children that have a childIndex &ge; index their index is incremented
          * by one.
          */
         protected void childInsertedAtModelIndex(int index,
diff --git a/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java b/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java
index e12abb1..5b33224 100644
--- a/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java
+++ b/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java
@@ -2594,7 +2594,7 @@
 
                 requests = new MessageHeader();
                 setRequests = false;
-                setRequestMethod("GET");
+                super.setRequestMethod("GET"); // avoid the connecting check
                 poster = null;
                 if (!checkReuseConnection())
                     connect();
diff --git a/jdk/src/share/classes/sun/tools/jar/resources/jar_de.properties b/jdk/src/share/classes/sun/tools/jar/resources/jar_de.properties
index 4dd5d5f..23f986c 100644
--- a/jdk/src/share/classes/sun/tools/jar/resources/jar_de.properties
+++ b/jdk/src/share/classes/sun/tools/jar/resources/jar_de.properties
@@ -33,6 +33,7 @@
 error.write.file=Fehler beim Schreiben in vorhandener JAR-Datei
 error.create.dir={0}: Verzeichnis konnte nicht erstellt werden
 error.incorrect.length=Falsche L\u00E4nge bei der Verarbeitung: {0}
+error.create.tempfile=Es konnte keine tempor\u00E4re Datei erstellt werden
 out.added.manifest=Manifest wurde hinzugef\u00FCgt
 out.update.manifest=Manifest wurde aktualisiert
 out.ignore.entry=Eintrag {0} wird ignoriert
@@ -44,4 +45,4 @@
 out.inflated=\ vergr\u00F6\u00DFert: {0}
 out.size=(ein = {0}) (aus = {1})
 
-usage=Verwendung: jar {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] Dateien...\nOptionen:\n    -c  Neues Archiv erstellen\n    -t  Inhaltsverzeichnis f\u00FCr Archiv auflisten\n    -x  Genannte (oder alle) Dateien aus Archiv extrahieren\n    -u  Vorhandenes Archiv aktualisieren\n    -v  Verbose-Ausgabe f\u00FCr Standardausgabe generieren\n    -f  Namen der Archivdatei angeben\n    -m  Manifest-Informationen von angegebener Manifest-Datei einschlie\u00DFen\n    -e  Anwendungs-Einstiegspunkt f\u00FCr die \n        in einer ausf\u00FChrbaren JAR-Datei geb\u00FCndelte Standalone-Anwendung angeben\n    -0  Nur speichern (keine ZIP-Komprimierung)\n    -M  Keine Manifest-Datei f\u00FCr die Eintr\u00E4ge erstellen\n    -i  Indexinformationen f\u00FCr angegebenen JAR-Dateien erstellen\n    -C  zum angegebenen Verzeichnis wechseln und folgende Datei einschlie\u00DFen\nFalls eine Datei ein Verzeichnis ist, wird dieses rekursiv verarbeitet.\nDer Name der Manifest-Datei, der Name der Archivdatei und der Name des Einstiegspunkts werden\nin derselben Reihenfolge wie die Kennzeichen "m", "f" und "e" angegeben.\n\nBeispiel 1: Archivieren Sie zwei Klassendateien in ein Archiv mit Namen "classes.jar": \n       jar cvf classes.jar Foo.class Bar.class \nBeispiel 2: Verwenden Sie die vorhandenen Manifest-Datei "mymanifest", und archivieren Sie\n           alle Dateien im Verzeichnis foo/ in "classes.jar": \n       jar cvfm classes.jar mymanifest -C foo/ .\n
+usage=Verwendung: jar {ctxui}[vfmn0Me] [jar-file] [manifest-file] [entry-point] [-C dir] Dateien ...\nOptionen:\n    -c  Neues Archiv erstellen\n    -t  Inhaltsverzeichnis f\u00FCr Archiv anzeigen\n    -x  Benannte (oder alle) Dateien aus dem Archiv extrahieren\n    -u  Vorhandenes Archiv aktualisieren\n    -v  Ausgabe im Verbose-Modus aus Standard-Ausgabe generieren\n    -f  Dateinamen f\u00FCr Archiv angeben\n    -m  Manifest-Informationen aus angegebener Manifest-Datei einschlie\u00DFen\n    -n  Pack200-Normalisierung nach Erstellung eines neuen Archivs ausf\u00FChren\n    -e  Anwendungs-Einstiegspunkt f\u00FCr alleinstehende Anwendung angeben\n        in einer ausf\u00FChrbaren JAR-Datei geb\u00FCndelt\n    -0  nur speichern; keine ZIP-Komprimierung verwenden\n    -M  keine Manifest-Datei f\u00FCr die Eintr\u00E4ge erstellen\n    -i  Index-Informationen f\u00FCr die angegebenen JAR-Dateien generieren\n    -C  zu angegebenem Verzeichnis wechseln und die folgende Datei einschlie\u00DFen\nDateien, die Verzeichnisse sind, werden rekursiv verarbeitet.\nDie Namen der Manifest-Datei, der Archiv-Datei und des Einstiegspunkts sind\nin derselben Reihenfolge wie die Kennzeichen f\u00FCr "m", "f" und "e" angegeben.\n\nBeispiel 1: Archivieren von zwei Klassendateien in einem Archiv mit dem Namen "classes.jar": \n       jar cvf classes.jar Foo.class Bar.class \nBeispiel 2: Verwenden einer vorhandenen Manifest-Datei mit dem Namen "mymanifest" und Archivieren aller\n           Dateien im Verzeichnis mit dem Namen "foo/" in die Archiv-Datei "classes.jar": \n       jar cvfm classes.jar mymanifest -C foo/ .\n
diff --git a/jdk/src/share/classes/sun/tools/jar/resources/jar_es.properties b/jdk/src/share/classes/sun/tools/jar/resources/jar_es.properties
index 39e71f8..7a86450 100644
--- a/jdk/src/share/classes/sun/tools/jar/resources/jar_es.properties
+++ b/jdk/src/share/classes/sun/tools/jar/resources/jar_es.properties
@@ -33,6 +33,7 @@
 error.write.file=Error al escribir un archivo jar existente
 error.create.dir={0} : no se ha podido crear el directorio
 error.incorrect.length=longitud incorrecta al procesar: {0}
+error.create.tempfile=No se ha podido crear el archivo temporal
 out.added.manifest=manifiesto agregado
 out.update.manifest=manifiesto actualizado
 out.ignore.entry=ignorando entrada {0}
@@ -44,4 +45,4 @@
 out.inflated=\ inflado: {0}
 out.size=(entrada = {0}) (salida = {1})
 
-usage=Sintaxis: jar {ctxui}[vfm0Me] [archive-jar] [archive-manifiesto] [punto-entrada] [-C dir] archivos...\nOpciones:\n    -c  crear nuevo archivo\n    -t  crear la tabla de contenido del archivo\n    -x  extraer el archive mencionado (o todos) del archivo\n    -u  actualizar archive existente\n    -v  generar salida detallada de los datos de salida est\u00E1ndar\n    -f  especificar nombre de archive de almacenamiento\n    -m  incluir informaci\u00F3n de manifiesto del archive de manifiesto especificado\n    -e  especificar punto de entrada de la aplicaci\u00F3n para la aplicaci\u00F3n aut\u00F3noma \n        que se incluye dentro de un archive jar ejecutable\n    -0  s\u00F3lo almacenar; no utilizar compresi\u00F3n ZIP\n    -M  no crear un archive de manifiesto para las entradas\n    -i  generar informaci\u00F3n de \u00EDndice para los archives jar especificados\n    -C  cambiar al directorio especificado e incluir el archivo siguiente\nSi alg\u00FAn archivo es un directorio, se procesar\u00E1 de forma recurrente.\nEl nombre del archivo de manifiesto, el nombre del archivo de almacenamiento y el nombre del punto de entrada se\nespecifican en el mismo orden que los indicadores 'm', 'f' y 'e'.\n\nEjemplo 1: para archivar archivos de dos clases en un archivo llamado classes.jar: \n       jar cvf classes.jar Foo.class Bar.class \nEjemplo 2: utilice un archivo de manifiesto existente 'mymanifest' y archive todos los\n           archivos del directorio foo/ en 'classes.jar': \n       jar cvfm classes.jar mymanifest -C foo/ .\n
+usage=Sintaxis: jar {ctxui}[vfmn0Me] [jar-file] [manifest-file] [entry-point] [-C dir] archivos...\nOpciones:\n    -c  crear nuevo archivo\n    -t  crear la tabla de contenido del archivo\n    -x   extraer el archive mencionado (o todos) del archivo\n    -u  actualizar archive existente\n    -v  generar salida detallada de los datos de salida est\u00E1ndar\n    -f  especificar nombre de archive de almacenamiento\n    -m  incluir informaci\u00F3n de manifiesto del archive de manifiesto especificado\n    -n  realizar normalizaci\u00F3n de Pack200 despu\u00E9s de crear un nuevo archivo\n    -e  especificar punto de entrada de la aplicaci\u00F3n para la aplicaci\u00F3n aut\u00F3noma \n        que se incluye dentro de un archive jar ejecutable\n    -0  s\u00F3lo almacenar; no utilizar compresi\u00F3n ZIP\n    -M  no crear un archive de manifiesto para las entradas\n    -i  generar informaci\u00F3n de \u00EDndice para los archives jar especificados\n    -C  cambiar al directorio especificado e incluir el archivo siguiente\nSi alg\u00FAn archivo es un directorio, se procesar\u00E1 de forma recurrente.\nEl nombre del archivo de manifiesto, el nombre del archivo de almacenamiento y el nombre del punto de entrada se\nespecifican en el mismo orden que los indicadores 'm', 'f' y 'e'.\n\nEjemplo 1: para archivar archivos de dos clases en un archivo llamado classes.jar: \n       jar cvf classes.jar Foo.class Bar.class \nEjemplo 2: utilice un archivo de manifiesto existente 'mymanifest' y archive todos los\n           archivos del directorio foo/ en 'classes.jar': \n       jar cvfm classes.jar mymanifest -C foo/ .\n
diff --git a/jdk/src/share/classes/sun/tools/jar/resources/jar_fr.properties b/jdk/src/share/classes/sun/tools/jar/resources/jar_fr.properties
index c7cae81..8f41319 100644
--- a/jdk/src/share/classes/sun/tools/jar/resources/jar_fr.properties
+++ b/jdk/src/share/classes/sun/tools/jar/resources/jar_fr.properties
@@ -33,6 +33,7 @@
 error.write.file=Erreur lors de l'\u00E9criture d'un fichier JAR existant
 error.create.dir={0} : impossible de cr\u00E9er le r\u00E9pertoire
 error.incorrect.length=longueur incorrecte lors du traitement de : {0}
+error.create.tempfile=Impossible de cr\u00E9er un fichier temporaire
 out.added.manifest=manifeste ajout\u00E9
 out.update.manifest=manifeste mis \u00E0 jour
 out.ignore.entry=entr\u00E9e {0} ignor\u00E9e
@@ -44,4 +45,4 @@
 out.inflated=\ d\u00E9compress\u00E9 : {0}
 out.size=(entr\u00E9e = {0}) (sortie = {1})
 
-usage=Syntaxe : jar {ctxui}[vfm0Me] [fichier-jar] [fichier-manifeste] [point-entr\u00E9e] [-C r\u00E9p] fichiers...\nOptions :\n    -c  cr\u00E9e une archive\n    -t  affiche la table des mati\u00E8res de l'archive\n    -x  extrait les fichiers nomm\u00E9s (ou tous les fichiers) de l'archive\n    -u  met \u00E0 jour l'archive existante\n    -v  g\u00E9n\u00E8re une version d\u00E9taill\u00E9e d'une sortie standard\n    -f  sp\u00E9cifie le nom du fichier archive\n    -m  inclut les informations de manifeste \u00E0 partir du fichier de manifeste sp\u00E9cifi\u00E9\n    -e  sp\u00E9cifie le point d'entr\u00E9e d'une application en mode autonome \n        int\u00E9gr\u00E9e \u00E0 un fichier JAR ex\u00E9cutable\n    -0  stockage uniquement, pas de compression ZIP\n    -M  ne cr\u00E9e pas de fichier manifeste pour les entr\u00E9es\n    -i  g\u00E9n\u00E8re les informations d'index des fichiers JAR sp\u00E9cifi\u00E9s\n    -C  passe au r\u00E9pertoire sp\u00E9cifi\u00E9 et inclut le fichier suivant\nSi l'un des fichiers est un r\u00E9pertoire, celui-ci est trait\u00E9 r\u00E9cursivement.\nLes noms du fichier manifeste, du fichier archive et du point d'entr\u00E9e sont\nsp\u00E9cifi\u00E9s dans le m\u00EAme ordre que celui des indicateurs m, f et e.\n\nExemple 1 : pour archiver deux fichiers de classe dans une archive intitul\u00E9e classes.jar : \n       jar cvf classes.jar Foo.class Bar.class \nExemple 2 : pour utiliser un fichier manifeste existant 'monmanifeste', puis archiver tous les\n           fichiers du r\u00E9pertoire foo/ dans 'classes.jar' : \n       jar cvfm classes.jar monmanifeste -C foo/ .\n
+usage=Syntaxe : jar {ctxui}[vfmn0Me] [fichier-jar] [fichier-manifeste] [point-entr\u00E9e] [-C r\u00E9p] fichiers...\nOptions :\n    -c  cr\u00E9e une archive\n    -t  affiche la table des mati\u00E8res de l'archive\n    -x  extrait les fichiers nomm\u00E9s (ou tous les fichiers) de l'archive\n    -u  met \u00E0 jour l'archive existante\n    -v  g\u00E9n\u00E8re une version d\u00E9taill\u00E9e d'une sortie standard\n    -f  sp\u00E9cifie le nom du fichier archive\n    -m  inclut les informations de manifeste \u00E0 partir du fichier manifeste sp\u00E9cifi\u00E9\n    -n  effectue une normalisation Pack200 apr\u00E8s la cr\u00E9ation d'une archive\n    -e  sp\u00E9cifie le point d'entr\u00E9e d'une application en mode autonome \n        int\u00E9gr\u00E9e \u00E0 un fichier JAR ex\u00E9cutable\n    -0  stockage uniquement, pas de compression ZIP\n    -M  ne cr\u00E9e pas de fichier manifeste pour les entr\u00E9es\n    -i  g\u00E9n\u00E8re les informations d'index des fichiers JAR sp\u00E9cifi\u00E9s\n    -C  passe au r\u00E9pertoire sp\u00E9cifi\u00E9 et inclut le fichier suivant\nSi l'un des fichiers est un r\u00E9pertoire, celui-ci est trait\u00E9 r\u00E9cursivement.\nLes noms du fichier manifeste, du fichier d'archive et du point d'entr\u00E9e sont\nsp\u00E9cifi\u00E9s dans le m\u00EAme ordre que celui des indicateurs m, f et e.\n\nExemple 1 : pour archiver deux fichiers de classe dans une archive intitul\u00E9e classes.jar : \n       jar cvf classes.jar Foo.class Bar.class \nExemple 2 : pour utiliser un fichier manifeste existant 'monmanifeste', puis archiver tous les\n           fichiers du r\u00E9pertoire foo/ dans 'classes.jar' : \n       jar cvfm classes.jar monmanifeste -C foo/ .\n
diff --git a/jdk/src/share/classes/sun/tools/jar/resources/jar_it.properties b/jdk/src/share/classes/sun/tools/jar/resources/jar_it.properties
index 54099b7..74bc9b7 100644
--- a/jdk/src/share/classes/sun/tools/jar/resources/jar_it.properties
+++ b/jdk/src/share/classes/sun/tools/jar/resources/jar_it.properties
@@ -33,6 +33,7 @@
 error.write.file=Errore durante la scrittura del file jar esistente
 error.create.dir={0} : impossibile creare la directory
 error.incorrect.length=lunghezza non valida durante l''elaborazione: {0}
+error.create.tempfile=Impossibile creare il file temporaneo.
 out.added.manifest=aggiunto manifest
 out.update.manifest=aggiornato manifest
 out.ignore.entry=la voce {0} sar\u00E0 ignorata
@@ -44,4 +45,4 @@
 out.inflated=\ decompresso: {0}
 out.size=(in = {0}) (out = {1})
 
-usage=Uso: jar {ctxui}[vfm0Me] [file-jar] [file-manifest] [punto di ingresso] [-C dir] file ...\nOpzioni:\n    -c  crea un nuovo archivio\n    -t  visualizza l'indice dell'archivio\n    -x  estrae i file con nome (o tutti i file) dall'archivio\n    -u  aggiorna l'archivio esistente\n    -v  genera output commentato dall'output standard\n    -f  specifica il nome file dell'archivio\n    -m  include informazioni manifest dal file manifest specificato\n    -e  specifica il punto di ingresso per l'applicazione stand-alone \n        inclusa nel file jar eseguibile\n    -0  solo memorizzazione; senza compressione ZIP\n    -M  consente di non creare un file manifest per le voci\n    -i  genera informazioni sull'indice per i file jar specificati\n    -C  imposta la directory specificata e include il file seguente\nSe un file \u00E8 una directory, verr\u00E0 elaborato in modo ricorsivo.\nIl nome del file manifest, del file di archivio e del punto di ingresso devono\nessere specificati nello stesso ordine dei flag 'm', 'f' ed 'e'.\n\nEsempio 1: archiviazione di due file di classe in un archivio con il nome classes.jar: \n       jar cvf classes.jar Foo.class Bar.class \nEsempio 2: utilizzo del file manifest esistente 'mymanifest' e archiviazione di tutti i\n           file della directory foo/ in 'classes.jar': \n       jar cvfm classes.jar mymanifest -C foo/ .\n
+usage=Uso: jar {ctxui}[vfmn0Me] [file-jar] [file-manifest] [punto di ingresso] [-C dir] file ...\nOpzioni:\n    -c  crea un nuovo archivio\n    -t  visualizza l'indice dell'archivio\n    -x  estrae i file con nome (o tutti i file) dall'archivio\n    -u  aggiorna l'archivio esistente\n    -v  genera output commentato dall'output standard\n    -f  specifica il nome file dell'archivio\n    -m  include informazioni manifest dal file manifest specificato\n    -n  esegue la normalizzazione Pack200 dopo la creazione di un nuovo archivio\n    -e  specifica il punto di ingresso per l'applicazione standalone \n        inclusa nel file jar eseguibile\n    -0  solo memorizzazione; senza compressione ZIP\n    -M  consente di non creare un file manifest per le voci\n    -i  genera informazioni sull'indice per i file jar specificati\n    -C  imposta la directory specificata e include il file seguente\nSe un file \u00E8 una directory, verr\u00E0 elaborato in modo ricorsivo.\nIl nome del file manifest, del file di archivio e del punto di ingresso devono\nessere specificati nello stesso ordine dei flag 'm', 'f' ed 'e'.\n\nEsempio 1: archiviazione di due file di classe in un archivio con il nome classes.jar: \n       jar cvf classes.jar Foo.class Bar.class \nEsempio 2: utilizzo del file manifest esistente 'mymanifest' e archiviazione di tutti i\n           file della directory foo/ in 'classes.jar': \n       jar cvfm classes.jar mymanifest -C foo/ .\n
diff --git a/jdk/src/share/classes/sun/tools/jar/resources/jar_ja.properties b/jdk/src/share/classes/sun/tools/jar/resources/jar_ja.properties
index 0a1457e..1705543 100644
--- a/jdk/src/share/classes/sun/tools/jar/resources/jar_ja.properties
+++ b/jdk/src/share/classes/sun/tools/jar/resources/jar_ja.properties
@@ -33,6 +33,7 @@
 error.write.file=\u65E2\u5B58jar\u30D5\u30A1\u30A4\u30EB\u306E\u66F8\u8FBC\u307F\u4E2D\u306B\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F
 error.create.dir=\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA{0}\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F
 error.incorrect.length={0}\u306E\u51E6\u7406\u4E2D\u306B\u4E0D\u6B63\u306A\u9577\u3055\u304C\u3042\u308A\u307E\u3057\u305F
+error.create.tempfile=\u4E00\u6642\u30D5\u30A1\u30A4\u30EB\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F
 out.added.manifest=\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u304C\u8FFD\u52A0\u3055\u308C\u307E\u3057\u305F
 out.update.manifest=\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u304C\u66F4\u65B0\u3055\u308C\u307E\u3057\u305F
 out.ignore.entry=\u30A8\u30F3\u30C8\u30EA{0}\u3092\u7121\u8996\u3057\u307E\u3059
@@ -44,4 +45,4 @@
 out.inflated=\ {0}\u304C\u5C55\u958B\u3055\u308C\u307E\u3057\u305F
 out.size=(\u5165={0})(\u51FA={1})
 
-usage=\u4F7F\u7528\u65B9\u6CD5: jar {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] files ...\n\u30AA\u30D7\u30B7\u30E7\u30F3:\n   -c \u30A2\u30FC\u30AB\u30A4\u30D6\u3092\u65B0\u898F\u4F5C\u6210\u3059\u308B\n   -t \u30A2\u30FC\u30AB\u30A4\u30D6\u306E\u5185\u5BB9\u3092\u4E00\u89A7\u8868\u793A\u3059\u308B\n   -x \u6307\u5B9A\u306E(\u307E\u305F\u306F\u3059\u3079\u3066\u306E)\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30FC\u30AB\u30A4\u30D6\u304B\u3089\u62BD\u51FA\u3059\u308B\n   -u \u65E2\u5B58\u30A2\u30FC\u30AB\u30A4\u30D6\u3092\u66F4\u65B0\u3059\u308B\n   -v \u6A19\u6E96\u51FA\u529B\u306B\u8A73\u7D30\u306A\u51FA\u529B\u3092\u751F\u6210\u3059\u308B\n   -f \u30A2\u30FC\u30AB\u30A4\u30D6\u30FB\u30D5\u30A1\u30A4\u30EB\u540D\u3092\u6307\u5B9A\u3059\u308B\n   -m \u6307\u5B9A\u306E\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB\u304B\u3089\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u60C5\u5831\u3092\u53D6\u308A\u8FBC\u3080\n   -e \u5B9F\u884C\u53EF\u80FDjar\u30D5\u30A1\u30A4\u30EB\u306B\u30D0\u30F3\u30C9\u30EB\u3055\u308C\u305F\u30B9\u30BF\u30F3\u30C9\u30A2\u30ED\u30F3\u30FB\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\n      \u30A8\u30F3\u30C8\u30EA\u30FB\u30DD\u30A4\u30F3\u30C8\u3092\u6307\u5B9A\u3059\u308B\n   -0 \u683C\u7D0D\u306E\u307F\u3002ZIP\u5727\u7E2E\u3092\u4F7F\u7528\u3057\u306A\u3044\n   -M \u30A8\u30F3\u30C8\u30EA\u306E\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u4F5C\u6210\u3057\u306A\u3044\n   -i \u6307\u5B9A\u306Ejar\u30D5\u30A1\u30A4\u30EB\u306E\u7D22\u5F15\u60C5\u5831\u3092\u751F\u6210\u3059\u308B\n   -C \u6307\u5B9A\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306B\u5909\u66F4\u3057\u3001\u4EE5\u4E0B\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u53D6\u308A\u8FBC\u3080\n\u30D5\u30A1\u30A4\u30EB\u304C\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u5834\u5408\u306F\u518D\u5E30\u7684\u306B\u51E6\u7406\u3055\u308C\u307E\u3059\u3002\n\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB\u540D\u3001\u30A2\u30FC\u30AB\u30A4\u30D6\u30FB\u30D5\u30A1\u30A4\u30EB\u540D\u304A\u3088\u3073\u30A8\u30F3\u30C8\u30EA\u30FB\u30DD\u30A4\u30F3\u30C8\u540D\u306F\u3001\n\u30D5\u30E9\u30B0'm'\u3001'f'\u3001'e'\u306E\u6307\u5B9A\u3068\u540C\u3058\u9806\u756A\u3067\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\n\n\u4F8B1: 2\u3064\u306E\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30FC\u30AB\u30A4\u30D6classes.jar\u306B\u4FDD\u5B58\u3059\u308B:\n     jar cvf classes.jar Foo.class Bar.class\n\u4F8B2: \u65E2\u5B58\u306E\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB'mymanifest'\u3092\u4F7F\u7528\u3057\u3001foo/\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\n     \u5168\u30D5\u30A1\u30A4\u30EB\u3092'classes.jar'\u306B\u30A2\u30FC\u30AB\u30A4\u30D6\u3059\u308B:\n     jar cvfm classes.jar mymanifest -C foo/ .\n
+usage=\u4F7F\u7528\u65B9\u6CD5: jar {ctxui}[vfmn0Me] [jar-file] [manifest-file] [entry-point] [-C dir] files ...\n\u30AA\u30D7\u30B7\u30E7\u30F3:\n    -c  \u30A2\u30FC\u30AB\u30A4\u30D6\u3092\u65B0\u898F\u4F5C\u6210\u3059\u308B\n    -t  \u30A2\u30FC\u30AB\u30A4\u30D6\u306E\u5185\u5BB9\u3092\u4E00\u89A7\u8868\u793A\u3059\u308B\n    -x  \u6307\u5B9A\u306E(\u307E\u305F\u306F\u3059\u3079\u3066\u306E)\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30FC\u30AB\u30A4\u30D6\u304B\u3089\u62BD\u51FA\u3059\u308B\n    -u  \u65E2\u5B58\u30A2\u30FC\u30AB\u30A4\u30D6\u3092\u66F4\u65B0\u3059\u308B\n    -v  \u6A19\u6E96\u51FA\u529B\u306B\u8A73\u7D30\u306A\u51FA\u529B\u3092\u751F\u6210\u3059\u308B\n    -f  \u30A2\u30FC\u30AB\u30A4\u30D6\u30FB\u30D5\u30A1\u30A4\u30EB\u540D\u3092\u6307\u5B9A\u3059\u308B\n    -m  \u6307\u5B9A\u306E\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB\u304B\u3089\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u60C5\u5831\u3092\u53D6\u308A\u8FBC\u3080\n    -n  \u65B0\u898F\u30A2\u30FC\u30AB\u30A4\u30D6\u306E\u4F5C\u6210\u5F8C\u306BPack200\u6B63\u898F\u5316\u3092\u5B9F\u884C\u3059\u308B\n    -e  \u5B9F\u884C\u53EF\u80FDjar\u30D5\u30A1\u30A4\u30EB\u306B\u30D0\u30F3\u30C9\u30EB\u3055\u308C\u305F\u30B9\u30BF\u30F3\u30C9\u30A2\u30ED\u30F3\u30FB\n        \u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u30A8\u30F3\u30C8\u30EA\u30FB\u30DD\u30A4\u30F3\u30C8\u3092\u6307\u5B9A\u3059\u308B\n    -0  \u683C\u7D0D\u306E\u307F\u3002ZIP\u5727\u7E2E\u3092\u4F7F\u7528\u3057\u306A\u3044\n    -M  \u30A8\u30F3\u30C8\u30EA\u306E\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u4F5C\u6210\u3057\u306A\u3044\n    -i  \u6307\u5B9A\u306Ejar\u30D5\u30A1\u30A4\u30EB\u306E\u7D22\u5F15\u60C5\u5831\u3092\u751F\u6210\u3059\u308B\n    -C  \u6307\u5B9A\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306B\u5909\u66F4\u3057\u3001\u6B21\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u53D6\u308A\u8FBC\u3080\n\u30D5\u30A1\u30A4\u30EB\u304C\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u5834\u5408\u306F\u518D\u5E30\u7684\u306B\u51E6\u7406\u3055\u308C\u307E\u3059\u3002\n\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB\u540D\u3001\u30A2\u30FC\u30AB\u30A4\u30D6\u30FB\u30D5\u30A1\u30A4\u30EB\u540D\u304A\u3088\u3073\u30A8\u30F3\u30C8\u30EA\u30FB\u30DD\u30A4\u30F3\u30C8\u540D\u306F\u3001\n\u30D5\u30E9\u30B0'm'\u3001'f'\u3001'e'\u306E\u6307\u5B9A\u3068\u540C\u3058\u9806\u756A\u3067\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\n\n\u4F8B1: 2\u3064\u306E\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30FC\u30AB\u30A4\u30D6classes.jar\u306B\u4FDD\u5B58\u3059\u308B: \n       jar cvf classes.jar Foo.class Bar.class \n\u4F8B2: \u65E2\u5B58\u306E\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB'mymanifest'\u3092\u4F7F\u7528\u3057\u3001foo/\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\n           \u5168\u30D5\u30A1\u30A4\u30EB\u3092'classes.jar'\u306B\u30A2\u30FC\u30AB\u30A4\u30D6\u3059\u308B: \n       jar cvfm classes.jar mymanifest -C foo/ .\n
diff --git a/jdk/src/share/classes/sun/tools/jar/resources/jar_ko.properties b/jdk/src/share/classes/sun/tools/jar/resources/jar_ko.properties
index 2b414a0..079dee8 100644
--- a/jdk/src/share/classes/sun/tools/jar/resources/jar_ko.properties
+++ b/jdk/src/share/classes/sun/tools/jar/resources/jar_ko.properties
@@ -33,6 +33,7 @@
 error.write.file=\uAE30\uC874 jar \uD30C\uC77C\uC5D0 \uC4F0\uB294 \uC911 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4.
 error.create.dir={0}: \uB514\uB809\uD1A0\uB9AC\uB97C \uC0DD\uC131\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
 error.incorrect.length=\uCC98\uB9AC \uC911 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC740 \uAE38\uC774\uAC00 \uBC1C\uACAC\uB428: {0}
+error.create.tempfile=\uC784\uC2DC \uD30C\uC77C\uC744 \uC0DD\uC131\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
 out.added.manifest=Manifest\uB97C \uCD94\uAC00\uD568
 out.update.manifest=Manifest\uB97C \uC5C5\uB370\uC774\uD2B8\uD568
 out.ignore.entry={0} \uD56D\uBAA9\uC744 \uBB34\uC2DC\uD558\uB294 \uC911
@@ -44,4 +45,4 @@
 out.inflated=\ \uC99D\uAC00\uB428: {0}
 out.size=(\uC785\uB825 = {0}) (\uCD9C\uB825 = {1})
 
-usage=\uC0AC\uC6A9\uBC95: jar {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] files ...\n\uC635\uC158:\n    -c  \uC0C8 \uC544\uCE74\uC774\uBE0C\uB97C \uC0DD\uC131\uD569\uB2C8\uB2E4.\n    -t  \uC544\uCE74\uC774\uBE0C\uC5D0 \uB300\uD55C \uBAA9\uCC28\uB97C \uB098\uC5F4\uD569\uB2C8\uB2E4.\n    -x  \uBA85\uBA85\uB41C(\uB610\uB294 \uBAA8\uB4E0) \uD30C\uC77C\uC744 \uC544\uCE74\uC774\uBE0C\uC5D0\uC11C \uCD94\uCD9C\uD569\uB2C8\uB2E4.\n    -u  \uAE30\uC874 \uC544\uCE74\uC774\uBE0C\uB97C \uC5C5\uB370\uC774\uD2B8\uD569\uB2C8\uB2E4.\n    -v  \uD45C\uC900 \uCD9C\uB825\uC5D0 \uC0C1\uC138 \uC815\uBCF4 \uCD9C\uB825\uC744 \uC0DD\uC131\uD569\uB2C8\uB2E4.\n    -f  \uC544\uCE74\uC774\uBE0C \uD30C\uC77C \uC774\uB984\uC744 \uC9C0\uC815\uD569\uB2C8\uB2E4.\n    -m  \uC9C0\uC815\uB41C Manifest \uD30C\uC77C\uC758 Manifest \uC815\uBCF4\uB97C \uD3EC\uD568\uD569\uB2C8\uB2E4.\n    -e  jar \uC2E4\uD589 \uD30C\uC77C\uC5D0 \uBC88\uB4E4\uB85C \uC81C\uACF5\uB41C \uB3C5\uB9BD\uD615 \uC751\uC6A9 \uD504\uB85C\uADF8\uB7A8\uC758 \n        \uC751\uC6A9 \uD504\uB85C\uADF8\uB7A8 \uC2DC\uC791 \uC9C0\uC810\uC744 \uC9C0\uC815\uD569\uB2C8\uB2E4.\n    -0  \uC800\uC7A5 \uC804\uC6A9: ZIP \uC555\uCD95\uC744 \uC0AC\uC6A9\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.\n    -M  \uD56D\uBAA9\uC5D0 \uB300\uD574 Manifest \uD30C\uC77C\uC744 \uC0DD\uC131\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.\n    -i  \uC9C0\uC815\uB41C jar \uD30C\uC77C\uC5D0 \uB300\uD55C \uC778\uB371\uC2A4 \uC815\uBCF4\uB97C \uC0DD\uC131\uD569\uB2C8\uB2E4.\n    -C  \uC9C0\uC815\uB41C \uB514\uB809\uD1A0\uB9AC\uB85C \uBCC0\uACBD\uD558\uACE0 \uB2E4\uC74C \uD30C\uC77C\uC744 \uD3EC\uD568\uD569\uB2C8\uB2E4.\n\uD2B9\uC815 \uD30C\uC77C\uC774 \uB514\uB809\uD1A0\uB9AC\uC77C \uACBD\uC6B0 \uC21C\uD658\uC801\uC73C\uB85C \uCC98\uB9AC\uB429\uB2C8\uB2E4.\nManifest \uD30C\uC77C \uC774\uB984, \uC544\uCE74\uC774\uBE0C \uD30C\uC77C \uC774\uB984 \uBC0F \uC2DC\uC791 \uC9C0\uC810 \uC774\uB984\uC740\n'm', 'f' \uBC0F 'e' \uD50C\uB798\uADF8\uC640 \uB3D9\uC77C\uD55C \uC21C\uC11C\uB85C \uC9C0\uC815\uB429\uB2C8\uB2E4.\n\n\uC608 1: classes.jar\uB77C\uB294 \uC544\uCE74\uC774\uBE0C\uC5D0 \uB450 \uD074\uB798\uC2A4 \uD30C\uC77C\uC744 \uC544\uCE74\uC774\uBE0C\uD558\uB294 \uBC29\uBC95: \n       jar cvf classes.jar Foo.class Bar.class \n\uC608 2: \uAE30\uC874 Manifest \uD30C\uC77C 'mymanifest'\uB97C \uC0AC\uC6A9\uD558\uC5EC\n           foo/ \uB514\uB809\uD1A0\uB9AC\uC758 \uBAA8\uB4E0 \uD30C\uC77C\uC744 'classes.jar'\uB85C \uC544\uCE74\uC774\uBE0C\uD558\uB294 \uBC29\uBC95: \n       jar cvfm classes.jar mymanifest -C foo/ .\n
+usage=\uC0AC\uC6A9\uBC95: jar {ctxui}[vfmn0Me] [jar-file] [manifest-file] [entry-point] [-C dir] files ...\n\uC635\uC158:\n    -c  \uC0C8 \uC544\uCE74\uC774\uBE0C\uB97C \uC0DD\uC131\uD569\uB2C8\uB2E4.\n    -t  \uC544\uCE74\uC774\uBE0C\uC5D0 \uB300\uD55C \uBAA9\uCC28\uB97C \uB098\uC5F4\uD569\uB2C8\uB2E4.\n    -x  \uBA85\uBA85\uB41C(\uB610\uB294 \uBAA8\uB4E0) \uD30C\uC77C\uC744 \uC544\uCE74\uC774\uBE0C\uC5D0\uC11C \uCD94\uCD9C\uD569\uB2C8\uB2E4.\n    -u  \uAE30\uC874 \uC544\uCE74\uC774\uBE0C\uB97C \uC5C5\uB370\uC774\uD2B8\uD569\uB2C8\uB2E4.\n    -v  \uD45C\uC900 \uCD9C\uB825\uC5D0 \uC0C1\uC138 \uC815\uBCF4 \uCD9C\uB825\uC744 \uC0DD\uC131\uD569\uB2C8\uB2E4.\n    -f  \uC544\uCE74\uC774\uBE0C \uD30C\uC77C \uC774\uB984\uC744 \uC9C0\uC815\uD569\uB2C8\uB2E4.\n    -m  \uC9C0\uC815\uB41C Manifest \uD30C\uC77C\uC758 Manifest \uC815\uBCF4\uB97C \uD3EC\uD568\uD569\uB2C8\uB2E4.\n    -n  \uC0C8 \uC544\uCE74\uC774\uBE0C\uB97C \uC0DD\uC131\uD55C \uD6C4 Pack200 \uC815\uADDC\uD654\uB97C \uC218\uD589\uD569\uB2C8\uB2E4.\n    -e  jar \uC2E4\uD589 \uD30C\uC77C\uC5D0 \uBC88\uB4E4\uB85C \uC81C\uACF5\uB41C \uB3C5\uB9BD\uD615 \uC751\uC6A9 \uD504\uB85C\uADF8\uB7A8\uC758 \n        \uC751\uC6A9 \uD504\uB85C\uADF8\uB7A8 \uC2DC\uC791 \uC9C0\uC810\uC744 \uC9C0\uC815\uD569\uB2C8\uB2E4.\n    -0  \uC800\uC7A5 \uC804\uC6A9: ZIP \uC555\uCD95\uC744 \uC0AC\uC6A9\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.\n    -M  \uD56D\uBAA9\uC5D0 \uB300\uD574 Manifest \uD30C\uC77C\uC744 \uC0DD\uC131\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.\n    -i  \uC9C0\uC815\uB41C jar \uD30C\uC77C\uC5D0 \uB300\uD55C \uC778\uB371\uC2A4 \uC815\uBCF4\uB97C \uC0DD\uC131\uD569\uB2C8\uB2E4.\n    -C  \uC9C0\uC815\uB41C \uB514\uB809\uD1A0\uB9AC\uB85C \uBCC0\uACBD\uD558\uACE0 \uB2E4\uC74C \uD30C\uC77C\uC744 \uD3EC\uD568\uD569\uB2C8\uB2E4.\n\uD2B9\uC815 \uD30C\uC77C\uC774 \uB514\uB809\uD1A0\uB9AC\uC77C \uACBD\uC6B0 \uC21C\uD658\uC801\uC73C\uB85C \uCC98\uB9AC\uB429\uB2C8\uB2E4.\nManifest \uD30C\uC77C \uC774\uB984, \uC544\uCE74\uC774\uBE0C \uD30C\uC77C \uC774\uB984 \uBC0F \uC2DC\uC791 \uC9C0\uC810 \uC774\uB984\uC740\n'm', 'f' \uBC0F 'e' \uD50C\uB798\uADF8\uC640 \uB3D9\uC77C\uD55C \uC21C\uC11C\uB85C \uC9C0\uC815\uB429\uB2C8\uB2E4.\n\n\uC608 1: classes.jar\uB77C\uB294 \uC544\uCE74\uC774\uBE0C\uC5D0 \uB450 \uD074\uB798\uC2A4 \uD30C\uC77C\uC744 \uC544\uCE74\uC774\uBE0C\uD558\uB294 \uBC29\uBC95: \n       jar cvf classes.jar Foo.class Bar.class \n\uC608 2: \uAE30\uC874 Manifest \uD30C\uC77C 'mymanifest'\uB97C \uC0AC\uC6A9\uD558\uC5EC\n           foo/ \uB514\uB809\uD1A0\uB9AC\uC758 \uBAA8\uB4E0 \uD30C\uC77C\uC744 'classes.jar'\uB85C \uC544\uCE74\uC774\uBE0C\uD558\uB294 \uBC29\uBC95: \n       jar cvfm classes.jar mymanifest -C foo/ .
diff --git a/jdk/src/share/classes/sun/tools/jar/resources/jar_pt_BR.properties b/jdk/src/share/classes/sun/tools/jar/resources/jar_pt_BR.properties
index db6bd74..c2d3147 100644
--- a/jdk/src/share/classes/sun/tools/jar/resources/jar_pt_BR.properties
+++ b/jdk/src/share/classes/sun/tools/jar/resources/jar_pt_BR.properties
@@ -33,6 +33,7 @@
 error.write.file=Erro ao gravar o arquivo jar existente
 error.create.dir={0} : n\u00E3o foi poss\u00EDvel criar o diret\u00F3rio
 error.incorrect.length=largura incorreta durante o processamento: {0}
+error.create.tempfile=N\u00E3o foi poss\u00EDvel criar um arquivo tempor\u00E1rio
 out.added.manifest=manifesto adicionado
 out.update.manifest=manifesto atualizado
 out.ignore.entry=ignorando entrada {0}
@@ -44,4 +45,4 @@
 out.inflated=\ inflado: {0}
 out.size=(entrada = {0}) (sa\u00EDda= {1})
 
-usage=Uso: jar {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] arquivos ...\nOp\u00E7\u00F5es:\n    -c  cria novo arquivo compactado\n    -t  lista o sum\u00E1rio do arquivo compactado\n    -x  extrai arquivos com o nome (ou todos) do arquivo compactado\n    -u  atualizar o arquivo compactado existente\n    -v  gera sa\u00EDda detalhada na sa\u00EDda padr\u00E3o\n    -f  especifica o nome do arquivo do arquivo compactado\n    -m  inclui as informa\u00E7\u00F5es do manifesto do arquivo de manifesto especificado\n    -e  especifica o ponto de entrada da aplica\u00E7\u00E3o para aplica\u00E7\u00E3o independente \n        empacotando em um arquivo jar execut\u00E1vel\n    -0  armazena somente; n\u00E3o usa compacta\u00E7\u00E3o ZIP\n    -M  n\u00E3o cria um arquivo de manifesto para as entradas\n    -i  gera informa\u00E7\u00F5es de \u00EDndice para os arquivos especificados\n    -C  altera para o diret\u00F3rio e inclui o arquivo seguinte\nSe nenhum arquivo for um diret\u00F3rio, ent\u00E3o ser\u00E1 processado repetidamente.\nO nome do arquivo de manifesto, o nome do arquivo compactado e o nome do ponto de entrada s\u00E3o\nespecificados na mesma ordem dos flags  'm', 'f' e 'e'.\n\nExemplo 1: para arquivar dois arquivos de classe em um arquivo compactado com o nome classes.jar: \n       jar cvf classes.jar Foo.class Bar.class \nExemplo 2: use um arquivo de manifesto existente 'mymanifest' e arquive todos os\n           arquivos no diret\u00F3rio foo/ na 'classes.jar': \n       jar cvfm classes.jar mymanifest -C foo/ .\n
+usage=Uso: jar {ctxui}[vfmn0Me] [jar-file] [manifest-file] [entry-point] [-C dir] arquivos ...\nOp\u00E7\u00F5es:\n    -c  cria novo archive\n    -t  lista o sum\u00E1rio do archive\n    -x  extrai arquivos com o nome (ou todos) do arquivo compactado\n    -u  atualiza o archive existente\n    -v  gera sa\u00EDda detalhada na sa\u00EDda padr\u00E3o\n    -f  especifica o nome do archive\n    -m  inclui as informa\u00E7\u00F5es do manifesto do arquivo de manifesto especificado\n    -n  executa a normaliza\u00E7\u00E3o Pack200 ap\u00F3s a cria\u00E7\u00E3o de um novo archive\n    -e  especifica o ponto de entrada da aplica\u00E7\u00E3o para aplica\u00E7\u00E3o independente \n        empacotada em um arquivo jar execut\u00E1vel\n    -0  armazena somente; n\u00E3o usa compacta\u00E7\u00E3o ZIP\n    -M  n\u00E3o cria um arquivo de manifesto para as entradas\n    -i  gera informa\u00E7\u00F5es de \u00EDndice para os arquivos jar especificados\n    -C  altera para o diret\u00F3rio especificado e inclui o arquivo seguinte\nSe algum arquivo for um diret\u00F3rio, ent\u00E3o ser\u00E1 processado repetidamente.\nO nome do arquivo de manifesto, o nome do archive e o nome do ponto de entrada s\u00E3o\nespecificados na mesma ordem dos flags 'm', 'f' e 'e'.\n\nExemplo 1: para arquivar dois arquivos de classe em um archive chamado classes.jar: \n       jar cvf classes.jar Foo.class Bar.class \nExemplo 2: use um arquivo de manifesto existente 'mymanifest' e arquive todos os\n           arquivos no diret\u00F3rio foo/ na 'classes.jar': \n       jar cvfm classes.jar mymanifest -C foo/ .\n
diff --git a/jdk/src/share/classes/sun/tools/jar/resources/jar_sv.properties b/jdk/src/share/classes/sun/tools/jar/resources/jar_sv.properties
index 90ca52a..b88532f 100644
--- a/jdk/src/share/classes/sun/tools/jar/resources/jar_sv.properties
+++ b/jdk/src/share/classes/sun/tools/jar/resources/jar_sv.properties
@@ -33,6 +33,7 @@
 error.write.file=Det uppstod ett fel vid skrivning till befintlig jar-fil.
 error.create.dir={0} : kunde inte skapa n\u00E5gon katalog
 error.incorrect.length=ogiltig l\u00E4ngd vid bearbetning: {0}
+error.create.tempfile=Kunde inte skapa en tillf\u00E4llig fil
 out.added.manifest=tillagt manifestfil
 out.update.manifest=uppdaterat manifest
 out.ignore.entry=ignorerar posten {0}
@@ -44,4 +45,4 @@
 out.inflated=\ uppackat: {0}
 out.size=(in = {0}) (ut = {1})
 
-usage=Syntax: jar {ctxui}[vfm0Me] [jar-fil] [manifestfil] [startpunkt] [-C katalog] filer...\nAlternativ:\n    -c  skapa nytt arkiv\n    -t  lista inneh\u00E5llsf\u00F6rteckning f\u00F6r arkiv\n    -x  extrahera namngivna (eller alla) filer fr\u00E5n arkiv\n    -u  uppdatera befintligt arkiv\n    -v  generera utf\u00F6rliga utdata vid standardutmatning\n    -f  ange arkivfilens namn\n    -m  inkludera manifestinformation fr\u00E5n angivet manifest\n    -e  ange programstartpunkt f\u00F6r frist\u00E5ende applikation \n        som medf\u00F6ljer i en jar-programfil\n    -0  endast lagra  (ingen zip-komprimering)\n    -M  skapa inte n\u00E5gon manifestfil f\u00F6r posterna\n    -i  generera indexinformation f\u00F6r de angivna jar-filerna\n    -C  \u00E4ndra till den angivna katalogen och inkludera f\u00F6ljande fil\nOm en fil \u00E4r en katalog bearbetas den rekursivt.\nNamnen p\u00E5 manifestfilen, arkivfilen och startpunkten anges i samma\nordning som m-, f- och e-flaggorna.\n\nExempel 1: S\u00E5 h\u00E4r arkiverar du tv\u00E5 klassfiler i ett arkiv med namnet classes.jar: \n       jar cvf classes.jar Foo.class Bar.class \nExempel 2: Anv\u00E4nd en befintlig manifestfil (mymanifest) och arkivera alla\n           filer fr\u00E5n katalogen foo/ i classes.jar: \n       jar cvfm classes.jar mymanifest -C foo/ .\n
+usage=Syntax: jar {ctxui}[vfmn0Me] [jar-fil] [manifestfil] [startpunkt] [-C katalog] filer ...\nAlternativ:\n    -c  skapa nytt arkiv\n    -t  lista inneh\u00E5llsf\u00F6rteckning f\u00F6r arkiv\n    -x  extrahera namngivna (eller alla) filer fr\u00E5n arkiv\n    -u  uppdatera befintligt arkiv\n    -v  generera utf\u00F6rliga utdata vid standardutmatning\n    -f  ange arkivfilens namn\n    -m  inkludera manifestinformation fr\u00E5n angivet manifest\n    -n  utf\u00F6r Pack200-normalisering efter att ha skapat ett nytt arkiv\n    -e  ange programstartpunkt f\u00F6r frist\u00E5ende applikation \n        som medf\u00F6ljer i en jar-programfil\n    -0  endast lagra  (ingen zip-komprimering)\n    -M  skapa inte n\u00E5gon manifestfil f\u00F6r posterna\n    -i  generera indexinformation f\u00F6r de angivna jar-filerna\n    -C  \u00E4ndra till den angivna katalogen och inkludera f\u00F6ljande fil\nOm en fil \u00E4r en katalog bearbetas den rekursivt.\nNamnen p\u00E5 manifestfilen, arkivfilen och startpunkten anges\ni samma ordning som m-, f- och e-flaggorna.\n\nExempel 1: S\u00E5 h\u00E4r arkiverar du tv\u00E5 klassfiler i ett arkiv med namnet classes.jar: \n       jar cvf classes.jar Foo.class Bar.class \nExempel 2: Anv\u00E4nd en befintlig manifestfil (mymanifest) och arkivera alla\n           filer fr\u00E5n katalogen foo/ i classes.jar: \n       jar cvfm classes.jar mymanifest -C foo/ .\n
diff --git a/jdk/src/share/classes/sun/tools/jar/resources/jar_zh_CN.properties b/jdk/src/share/classes/sun/tools/jar/resources/jar_zh_CN.properties
index 146e06c..08607cc 100644
--- a/jdk/src/share/classes/sun/tools/jar/resources/jar_zh_CN.properties
+++ b/jdk/src/share/classes/sun/tools/jar/resources/jar_zh_CN.properties
@@ -33,6 +33,7 @@
 error.write.file=\u5199\u5165\u73B0\u6709\u7684 jar \u6587\u4EF6\u65F6\u51FA\u9519
 error.create.dir={0}: \u65E0\u6CD5\u521B\u5EFA\u76EE\u5F55
 error.incorrect.length=\u5904\u7406\u65F6\u9047\u5230\u4E0D\u6B63\u786E\u7684\u957F\u5EA6: {0}
+error.create.tempfile=\u65E0\u6CD5\u521B\u5EFA\u4E34\u65F6\u6587\u4EF6
 out.added.manifest=\u5DF2\u6DFB\u52A0\u6E05\u5355
 out.update.manifest=\u5DF2\u66F4\u65B0\u6E05\u5355
 out.ignore.entry=\u6B63\u5728\u5FFD\u7565\u6761\u76EE{0}
@@ -44,4 +45,4 @@
 out.inflated=\  \u5DF2\u89E3\u538B: {0}
 out.size=(\u8F93\u5165 = {0}) (\u8F93\u51FA = {1})
 
-usage=\u7528\u6CD5: jar {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] files ...\n\u9009\u9879\u5305\u62EC: \n    -c  \u521B\u5EFA\u65B0\u7684\u5F52\u6863\u6587\u4EF6\n    -t  \u5217\u51FA\u5F52\u6863\u76EE\u5F55\n    -x  \u4ECE\u6863\u6848\u4E2D\u63D0\u53D6\u6307\u5B9A\u7684 (\u6216\u6240\u6709) \u6587\u4EF6\n    -u  \u66F4\u65B0\u73B0\u6709\u7684\u5F52\u6863\u6587\u4EF6\n    -v  \u5728\u6807\u51C6\u8F93\u51FA\u4E2D\u751F\u6210\u8BE6\u7EC6\u8F93\u51FA\n    -f  \u6307\u5B9A\u5F52\u6863\u6587\u4EF6\u540D\n    -m  \u5305\u542B\u6307\u5B9A\u6E05\u5355\u6587\u4EF6\u4E2D\u7684\u6E05\u5355\u4FE1\u606F\n    -e  \u4E3A\u6346\u7ED1\u5230\u53EF\u6267\u884C jar \u6587\u4EF6\u7684\u72EC\u7ACB\u5E94\u7528\u7A0B\u5E8F\n        \u6307\u5B9A\u5E94\u7528\u7A0B\u5E8F\u5165\u53E3\u70B9\n    -0  \u4EC5\u5B58\u50A8; \u4E0D\u4F7F\u7528\u60C5\u51B5\u4EFB\u4F55 ZIP \u538B\u7F29\n    -M  \u4E0D\u521B\u5EFA\u6761\u76EE\u7684\u6E05\u5355\u6587\u4EF6\n    -i  \u4E3A\u6307\u5B9A\u7684 jar \u6587\u4EF6\u751F\u6210\u7D22\u5F15\u4FE1\u606F\n    -C  \u66F4\u6539\u4E3A\u6307\u5B9A\u7684\u76EE\u5F55\u5E76\u5305\u542B\u5176\u4E2D\u7684\u6587\u4EF6\n\u5982\u679C\u6709\u4EFB\u4F55\u76EE\u5F55\u6587\u4EF6, \u5219\u5BF9\u5176\u8FDB\u884C\u9012\u5F52\u5904\u7406\u3002\n\u6E05\u5355\u6587\u4EF6\u540D, \u5F52\u6863\u6587\u4EF6\u540D\u548C\u5165\u53E3\u70B9\u540D\u79F0\u7684\u6307\u5B9A\u987A\u5E8F\n\u4E0E 'm', 'f' \u548C 'e' \u6807\u8BB0\u7684\u6307\u5B9A\u987A\u5E8F\u76F8\u540C\u3002\n\n\u793A\u4F8B 1: \u5C06\u4E24\u4E2A\u7C7B\u6587\u4EF6\u5F52\u6863\u5230\u4E00\u4E2A\u540D\u4E3A classes.jar \u7684\u5F52\u6863\u6587\u4EF6\u4E2D: \n       jar cvf classes.jar Foo.class Bar.class \n\u793A\u4F8B 2: \u4F7F\u7528\u73B0\u6709\u7684\u6E05\u5355\u6587\u4EF6 'mymanifest' \u5E76\n           \u5C06 foo/ \u76EE\u5F55\u4E2D\u7684\u6240\u6709\u6587\u4EF6\u5F52\u6863\u5230 'classes.jar' \u4E2D: \n       jar cvfm classes.jar mymanifest -C foo/ .\n
+usage=\u7528\u6CD5: jar {ctxui}[vfmn0Me] [jar-file] [manifest-file] [entry-point] [-C dir] files ...\n\u9009\u9879:\n    -c  \u521B\u5EFA\u65B0\u6863\u6848\n    -t  \u5217\u51FA\u6863\u6848\u76EE\u5F55\n    -x  \u4ECE\u6863\u6848\u4E2D\u63D0\u53D6\u6307\u5B9A\u7684 (\u6216\u6240\u6709) \u6587\u4EF6\n    -u  \u66F4\u65B0\u73B0\u6709\u6863\u6848\n    -v  \u5728\u6807\u51C6\u8F93\u51FA\u4E2D\u751F\u6210\u8BE6\u7EC6\u8F93\u51FA\n    -f  \u6307\u5B9A\u6863\u6848\u6587\u4EF6\u540D\n    -m  \u5305\u542B\u6307\u5B9A\u6E05\u5355\u6587\u4EF6\u4E2D\u7684\u6E05\u5355\u4FE1\u606F\n    -n  \u521B\u5EFA\u65B0\u6863\u6848\u540E\u6267\u884C Pack200 \u89C4\u8303\u5316\n    -e  \u4E3A\u7ED1\u5B9A\u5230\u53EF\u6267\u884C jar \u6587\u4EF6\u7684\u72EC\u7ACB\u5E94\u7528\u7A0B\u5E8F\n        \u6307\u5B9A\u5E94\u7528\u7A0B\u5E8F\u5165\u53E3\u70B9\n    -0  \u4EC5\u5B58\u50A8; \u4E0D\u4F7F\u7528\u4EFB\u4F55 ZIP \u538B\u7F29\n    -M  \u4E0D\u521B\u5EFA\u6761\u76EE\u7684\u6E05\u5355\u6587\u4EF6\n    -i  \u4E3A\u6307\u5B9A\u7684 jar \u6587\u4EF6\u751F\u6210\u7D22\u5F15\u4FE1\u606F\n    -C  \u66F4\u6539\u4E3A\u6307\u5B9A\u7684\u76EE\u5F55\u5E76\u5305\u542B\u4EE5\u4E0B\u6587\u4EF6\n\u5982\u679C\u4EFB\u4F55\u6587\u4EF6\u4E3A\u76EE\u5F55, \u5219\u5BF9\u5176\u8FDB\u884C\u9012\u5F52\u5904\u7406\u3002\n\u6E05\u5355\u6587\u4EF6\u540D, \u6863\u6848\u6587\u4EF6\u540D\u548C\u5165\u53E3\u70B9\u540D\u79F0\u7684\u6307\u5B9A\u987A\u5E8F\n\u4E0E 'm', 'f' \u548C 'e' \u6807\u8BB0\u7684\u6307\u5B9A\u987A\u5E8F\u76F8\u540C\u3002\n\n\u793A\u4F8B 1: \u5C06\u4E24\u4E2A\u7C7B\u6587\u4EF6\u5F52\u6863\u5230\u4E00\u4E2A\u540D\u4E3A classes.jar \u7684\u6863\u6848\u4E2D: \n       jar cvf classes.jar Foo.class Bar.class \n\u793A\u4F8B 2: \u4F7F\u7528\u73B0\u6709\u7684\u6E05\u5355\u6587\u4EF6 'mymanifest' \u5E76\n           \u5C06 foo/ \u76EE\u5F55\u4E2D\u7684\u6240\u6709\u6587\u4EF6\u5F52\u6863\u5230 'classes.jar' \u4E2D: \n       jar cvfm classes.jar mymanifest -C foo/ .\n
diff --git a/jdk/src/share/classes/sun/tools/jar/resources/jar_zh_TW.properties b/jdk/src/share/classes/sun/tools/jar/resources/jar_zh_TW.properties
index 7dd4f65..76ce561 100644
--- a/jdk/src/share/classes/sun/tools/jar/resources/jar_zh_TW.properties
+++ b/jdk/src/share/classes/sun/tools/jar/resources/jar_zh_TW.properties
@@ -33,6 +33,7 @@
 error.write.file=\u5BEB\u5165\u73FE\u6709\u7684 jar \u6A94\u6848\u6642\u767C\u751F\u932F\u8AA4
 error.create.dir={0} : \u7121\u6CD5\u5EFA\u7ACB\u76EE\u9304
 error.incorrect.length=\u8655\u7406 {0} \u6642\u9577\u5EA6\u4E0D\u6B63\u78BA
+error.create.tempfile=\u7121\u6CD5\u5EFA\u7ACB\u66AB\u5B58\u6A94\u6848
 out.added.manifest=\u5DF2\u65B0\u589E\u8CC7\u8A0A\u6E05\u55AE
 out.update.manifest=\u5DF2\u66F4\u65B0\u8CC7\u8A0A\u6E05\u55AE
 out.ignore.entry=\u5FFD\u7565\u9805\u76EE {0}
@@ -44,4 +45,4 @@
 out.inflated=\ \u64F4\u5C55: {0}
 out.size=\ (\u8B80={0})(\u5BEB={1})
 
-usage=\u7528\u6CD5: jar {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] \u6A94\u6848 ...\n\u9078\u9805:\n    -c  \u5EFA\u7ACB\u65B0\u7684\u6B78\u6A94\n    -t  \u5217\u51FA\u6B78\u6A94\u7684\u76EE\u9304\n    -x  \u5F9E\u6B78\u6A94\u4E2D\u64F7\u53D6\u5DF2\u547D\u540D\u7684 (\u6216\u6240\u6709) \u6A94\u6848\n    -u  \u66F4\u65B0\u73FE\u6709\u6B78\u6A94\n    -v  \u5728\u6A19\u6E96\u8F38\u51FA\u4E2D\u7522\u751F\u8A73\u7D30\u8F38\u51FA\n    -f  \u6307\u5B9A\u6B78\u6A94\u6A94\u6848\u540D\u7A31\n    -m  \u5305\u542B\u6307\u5B9A\u8CC7\u8A0A\u6E05\u55AE\u4E2D\u7684\u8CC7\u8A0A\u6E05\u55AE\u8CC7\u8A0A\n    -e  \u70BA\u7368\u7ACB\u61C9\u7528\u7A0B\u5F0F\u6307\u5B9A\u61C9\u7528\u7A0B\u5F0F\u9032\u5165\u9EDE\n        \u5DF2\u96A8\u9644\u65BC\u53EF\u57F7\u884C jar \u6A94\u6848\u4E2D\n    -0  \u50C5\u5132\u5B58; \u4E0D\u4F7F\u7528 ZIP \u58D3\u7E2E\u65B9\u5F0F\n    -M  \u4E0D\u70BA\u9805\u76EE\u5EFA\u7ACB\u8CC7\u8A0A\u6E05\u55AE\u6A94\u6848\n    -i  \u70BA\u6307\u5B9A\u7684 jar \u6A94\u6848\u7522\u751F\u7D22\u5F15\u8CC7\u8A0A\n    -C  \u8B8A\u66F4\u81F3\u6307\u5B9A\u76EE\u9304\u4E26\u5305\u542B\u5F8C\u9762\u6240\u5217\u7684\u6A94\u6848\n\u5982\u679C\u6709\u4EFB\u4F55\u6A94\u6848\u662F\u76EE\u9304\uFF0C\u5247\u6703\u5C0D\u5176\u9032\u884C\u905E\u8FF4\u8655\u7406\u3002\n\u6E05\u55AE\u6A94\u6848\u540D\u7A31\u3001\u6B78\u6A94\u6A94\u6848\u540D\u7A31\u548C\u9032\u5165\u9EDE\u540D\u7A31\n\u7684\u6307\u5B9A\u9806\u5E8F\u8207\u6307\u5B9A 'm' \u65D7\u6A19\u3001'f' \u65D7\u6A19\u548C 'e' \u65D7\u6A19\u7684\u9806\u5E8F\u76F8\u540C\u3002\n\n\u7BC4\u4F8B 1: \u5C07\u5169\u500B\u985E\u5225\u6A94\u6848\u6B78\u6A94\u81F3\u540D\u70BA classes.jar \u7684\u6B78\u6A94\u4E2D: \n       jar cvf classes.jar Foo.class Bar.class\n\u7BC4\u4F8B 2: \u4F7F\u7528\u73FE\u6709\u8CC7\u8A0A\u6E05\u55AE\u6A94\u6848 'mymanifest' \u4E26\u5C07\n           foo/ \u76EE\u9304\u4E2D\u7684\u6240\u6709\u6A94\u6848\u6B78\u6A94\u81F3 'classes.jar' \u4E2D: \n       jar cvfm classes.jar mymanifest -C foo/ .\n
+usage=\u7528\u6CD5: jar {ctxui}[vfmn0Me] [jar-file] [manifest-file] [entry-point] [-C dir] \u6A94\u6848 ...\n\u9078\u9805:\n    -c  \u5EFA\u7ACB\u65B0\u7684\u6B78\u6A94\n    -t  \u5217\u51FA\u6B78\u6A94\u7684\u76EE\u9304\n    -x  \u5F9E\u6B78\u6A94\u4E2D\u64F7\u53D6\u5DF2\u547D\u540D\u7684 (\u6216\u6240\u6709) \u6A94\u6848\n    -u  \u66F4\u65B0\u73FE\u6709\u6B78\u6A94\n    -v  \u5728\u6A19\u6E96\u8F38\u51FA\u4E2D\u7522\u751F\u8A73\u7D30\u8F38\u51FA\n    -f  \u6307\u5B9A\u6B78\u6A94\u6A94\u6848\u540D\u7A31\n    -m  \u5305\u542B\u6307\u5B9A\u8CC7\u8A0A\u6E05\u55AE\u4E2D\u7684\u8CC7\u8A0A\u6E05\u55AE\u8CC7\u8A0A\n    -n  \u5728\u5EFA\u7ACB\u65B0\u6B78\u6A94\u4E4B\u5F8C\u57F7\u884C Pack200 \u6B63\u898F\u5316\n    -e  \u70BA\u5DF2\u96A8\u9644\u65BC\u53EF\u57F7\u884C jar \u6A94\u6848\u4E2D\u7684\u7368\u7ACB\u61C9\u7528\u7A0B\u5F0F\n        \u6307\u5B9A\u61C9\u7528\u7A0B\u5F0F\u9032\u5165\u9EDE\n    -0  \u50C5\u5132\u5B58; \u4E0D\u4F7F\u7528 ZIP \u58D3\u7E2E\u65B9\u5F0F\n    -M  \u4E0D\u70BA\u9805\u76EE\u5EFA\u7ACB\u8CC7\u8A0A\u6E05\u55AE\u6A94\u6848\n    -i  \u70BA\u6307\u5B9A\u7684 jar \u6A94\u6848\u7522\u751F\u7D22\u5F15\u8CC7\u8A0A\n    -C  \u8B8A\u66F4\u81F3\u6307\u5B9A\u76EE\u9304\u4E26\u5305\u542B\u5F8C\u9762\u6240\u5217\u7684\u6A94\u6848\n\u5982\u679C\u6709\u4EFB\u4F55\u6A94\u6848\u662F\u76EE\u9304\uFF0C\u5247\u6703\u5C0D\u5176\u9032\u884C\u905E\u8FF4\u8655\u7406\u3002\n\u6E05\u55AE\u6A94\u6848\u540D\u7A31\u3001\u6B78\u6A94\u6A94\u6848\u540D\u7A31\u548C\u9032\u5165\u9EDE\u540D\u7A31\n\u7684\u6307\u5B9A\u9806\u5E8F\u8207\u6307\u5B9A 'm' \u65D7\u6A19\u3001'f' \u65D7\u6A19\u548C 'e' \u65D7\u6A19\u7684\u9806\u5E8F\u76F8\u540C\u3002\n\n\u7BC4\u4F8B 1: \u5C07\u5169\u500B\u985E\u5225\u6A94\u6848\u6B78\u6A94\u81F3\u540D\u70BA classes.jar \u7684\u6B78\u6A94\u4E2D: \n       jar cvf classes.jar Foo.class Bar.class\n\u7BC4\u4F8B 2: \u4F7F\u7528\u73FE\u6709\u8CC7\u8A0A\u6E05\u55AE\u6A94\u6848 'mymanifest' \u4E26\u5C07\n           foo/ \u76EE\u9304\u4E2D\u7684\u6240\u6709\u6A94\u6848\u6B78\u6A94\u81F3 'classes.jar' \u4E2D: \n       jar cvfm classes.jar mymanifest -C foo/ .\n
diff --git a/jdk/src/solaris/classes/sun/awt/X11/XConstants.java b/jdk/src/solaris/classes/sun/awt/X11/XConstants.java
index e1903d8..91c5338 100644
--- a/jdk/src/solaris/classes/sun/awt/X11/XConstants.java
+++ b/jdk/src/solaris/classes/sun/awt/X11/XConstants.java
@@ -674,9 +674,4 @@
     public static final long XkbModifierMapMask = (1L<<2);
     public static final long XkbVirtualModsMask = (1L<<6); //server map
 
-    /*****************************************************************
-     * X SHARED MEMORY EXTENSION FUNCTIONS
-     *****************************************************************/
-
-    public static final int X_ShmAttach = 1;
 }
diff --git a/jdk/src/solaris/classes/sun/awt/X11/XErrorHandler.java b/jdk/src/solaris/classes/sun/awt/X11/XErrorHandler.java
index ec09cea..4fc6bd8 100644
--- a/jdk/src/solaris/classes/sun/awt/X11/XErrorHandler.java
+++ b/jdk/src/solaris/classes/sun/awt/X11/XErrorHandler.java
@@ -42,29 +42,6 @@
         }
     }
 
-    /**
-     * This is a base synthetic error handler containing a boolean flag which allows
-     * to show that an error is handled or not.
-     */
-    public static class XErrorHandlerWithFlag extends XBaseErrorHandler {
-        private volatile boolean errorOccurred = false;
-
-        public boolean getErrorOccurredFlag() {
-            return errorOccurred;
-        }
-
-        /**
-         * Sets an internal boolean flag to a particular value. Should be always called with
-         * <code>false</code> value of the parameter <code>errorOccurred</code> before this
-         * error handler is set as current.
-         * @param errorOccurred <code>true</code> to indicate that an error was handled,
-         *     <code>false</code> to reset the internal boolean flag
-         */
-        public void setErrorOccurredFlag(boolean errorOccurred) {
-            this.errorOccurred = errorOccurred;
-        }
-    }
-
     /*
      * Instead of validating window id, we simply call XGetWindowProperty,
      * but temporary install this function as the error handler to ignore
@@ -99,51 +76,4 @@
             return theInstance;
         }
     }
-
-    /**
-     * This is a synthetic error handler for errors generated by the native function
-     * <code>XShmAttach</code>. If an error is handled, an internal boolean flag of the
-     * handler is set to <code>true</code>.
-     */
-    public static final class XShmAttachHandler extends XErrorHandlerWithFlag {
-        private XShmAttachHandler() {}
-
-        @Override
-        public int handleError(long display, XErrorEvent err) {
-            if (err.get_minor_code() == XConstants.X_ShmAttach) {
-                setErrorOccurredFlag(true);
-                return 0;
-            }
-            return super.handleError(display, err);
-        }
-
-        // Shared instance
-        private static XShmAttachHandler theInstance = new XShmAttachHandler();
-        public static XShmAttachHandler getInstance() {
-            return theInstance;
-        }
-    }
-
-    /**
-     * This is a synthetic error handler for <code>BadAlloc</code> errors generated by the
-     * native <code>glX*</code> functions. Its internal boolean flag is set to <code>true</code>,
-     * if an error is handled.
-     */
-    public static final class GLXBadAllocHandler extends XErrorHandlerWithFlag {
-        private GLXBadAllocHandler() {}
-
-        @Override
-        public int handleError(long display, XErrorEvent err) {
-            if (err.get_error_code() == XConstants.BadAlloc) {
-                setErrorOccurredFlag(true);
-                return 0;
-            }
-            return super.handleError(display, err);
-        }
-
-        private static GLXBadAllocHandler theInstance = new GLXBadAllocHandler();
-        public static GLXBadAllocHandler getInstance() {
-            return theInstance;
-        }
-    }
 }
diff --git a/jdk/src/solaris/classes/sun/awt/X11/XErrorHandlerUtil.java b/jdk/src/solaris/classes/sun/awt/X11/XErrorHandlerUtil.java
index da12cd9..4bdf0ec 100644
--- a/jdk/src/solaris/classes/sun/awt/X11/XErrorHandlerUtil.java
+++ b/jdk/src/solaris/classes/sun/awt/X11/XErrorHandlerUtil.java
@@ -42,7 +42,7 @@
     private static long display;
 
     /**
-     * Error handler at the moment of <code>XErrorHandlerUtil</code> initialization.
+     * Error handler at the moment of {@code XErrorHandlerUtil} initialization.
      */
     private static long saved_error_handler;
 
@@ -63,7 +63,7 @@
         new GetBooleanAction("sun.awt.noisyerrorhandler"));
 
     /**
-     * The flag indicating that <code>init</code> was called already.
+     * The flag indicating that {@code init} was called already.
      */
     private static boolean initPassed;
 
@@ -73,9 +73,9 @@
     private XErrorHandlerUtil() {}
 
     /**
-     * Sets the toolkit global error handler, stores the connection to X11 server, which
-     * will be used during an error handling process. This method is called once from
-     * <code>awt_init_Display</code> function defined in <code>awt_GraphicsEnv.c</code>
+     * Sets the toolkit global error handler, stores the connection to X11 server,
+     * which will be used during an error handling process. This method is called
+     * once from {@code awt_init_Display} function defined in {@code awt_GraphicsEnv.c}
      * file immediately after the connection to X11 window server is opened.
      * @param display the connection to X11 server which should be stored
      */
@@ -109,9 +109,9 @@
     }
 
     private static void RESTORE_XERROR_HANDLER(boolean doXSync) {
-        // Wait until all requests are processed by the X server
-        // and only then uninstall the error handler.
         if (doXSync) {
+            // Wait until all requests are processed by the X server
+            // and only then uninstall the error handler.
             XSync();
         }
         current_error_handler = null;
diff --git a/jdk/src/solaris/doc/sun/man/man1/jdeps.1 b/jdk/src/solaris/doc/sun/man/man1/jdeps.1
index 9b8f698..c3884aa 100644
--- a/jdk/src/solaris/doc/sun/man/man1/jdeps.1
+++ b/jdk/src/solaris/doc/sun/man/man1/jdeps.1
@@ -62,7 +62,7 @@
 \fIoptions\fR
 Command-line options\&. See Options\&.
 .TP     
-\fIclass\fR\fIes\fR
+\fIclasses\fR
 Name of the classes to analyze\&. You can specify a class that can be found in the class path, by its file name, a directory, or a JAR file\&.
 .SH DESCRIPTION    
 The \fI\fR\f3jdeps\fR command shows the package-level or class-level dependencies of Java class files\&. The input class can be a path name to a \f3\&.class\fR file, a directory, a JAR file, or it can be a fully qualified class name to analyze all class files\&. The options determine the output\&. By default, \f3jdeps\fR outputs the dependencies to the system output\&. It can generate the dependencies in DOT language (see the \f3-dotoutput\fR option)\&.
@@ -106,6 +106,12 @@
 .br
 Restricts analysis to classes matching pattern\&. This option filters the list of classes to be analyzed\&. It can be used together with \f3-p\fR and \f3-e\fR which apply pattern to the dependencies\&.
 .TP
+-jdkinternals
+.br
+Finds class-level dependences in JDK internal APIs\&. By default, it analyzes all classes specified in the \f3-classpath\fR option and in input files unless you specified the \f3-include\fR option\&. You cannot use this option with the \f3-p\fR, \f3-e\fR, and \f3-s\fR options\&.
+
+\fIWarning\fR: JDK internal APIs may not be accessible in upcoming releases\&.
+.TP
 -P, -profile
 .br
 Shows profile or the file containing a package\&.
diff --git a/jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c b/jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c
index 4b6e2c6..bb042d0 100644
--- a/jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c
+++ b/jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c
@@ -906,6 +906,20 @@
 
 static jint canUseShmExt = UNSET_MITSHM;
 static jint canUseShmExtPixmaps = UNSET_MITSHM;
+static jboolean xshmAttachFailed = JNI_FALSE;
+
+int XShmAttachXErrHandler(Display *display, XErrorEvent *xerr) {
+    if (xerr->minor_code == X_ShmAttach) {
+        xshmAttachFailed = JNI_TRUE;
+    }
+    return 0;
+}
+jboolean isXShmAttachFailed() {
+    return xshmAttachFailed;
+}
+void resetXShmAttachFailed() {
+    xshmAttachFailed = JNI_FALSE;
+}
 
 extern int mitShmPermissionMask;
 
@@ -913,7 +927,6 @@
     XShmSegmentInfo shminfo;
     int XShmMajor, XShmMinor;
     int a, b, c;
-    jboolean xShmAttachResult;
 
     AWT_LOCK();
     if (canUseShmExt != UNSET_MITSHM) {
@@ -957,14 +970,21 @@
         }
         shminfo.readOnly = True;
 
-        xShmAttachResult = TryXShmAttach(env, awt_display, &shminfo);
+        resetXShmAttachFailed();
+        /**
+         * The J2DXErrHandler handler will set xshmAttachFailed
+         * to JNI_TRUE if any Shm error has occured.
+         */
+        EXEC_WITH_XERROR_HANDLER(XShmAttachXErrHandler,
+                                 XShmAttach(awt_display, &shminfo));
+
         /**
          * Get rid of the id now to reduce chances of leaking
          * system resources.
          */
         shmctl(shminfo.shmid, IPC_RMID, 0);
 
-        if (xShmAttachResult == JNI_TRUE) {
+        if (isXShmAttachFailed() == JNI_FALSE) {
             canUseShmExt = CAN_USE_MITSHM;
             /* check if we can use shared pixmaps */
             XShmQueryVersion(awt_display, &XShmMajor, &XShmMinor,
@@ -979,23 +999,6 @@
     }
     AWT_UNLOCK();
 }
-
-/*
- * Must be called with the acquired AWT lock.
- */
-jboolean TryXShmAttach(JNIEnv *env, Display *display, XShmSegmentInfo *shminfo) {
-    jboolean errorOccurredFlag = JNI_FALSE;
-    jobject errorHandlerRef;
-
-    /*
-     * XShmAttachHandler will set its internal flag to JNI_TRUE, if any Shm error occurs.
-     */
-    EXEC_WITH_XERROR_HANDLER(env, "sun/awt/X11/XErrorHandler$XShmAttachHandler",
-        "()Lsun/awt/X11/XErrorHandler$XShmAttachHandler;", JNI_TRUE,
-        errorHandlerRef, errorOccurredFlag,
-        XShmAttach(display, shminfo));
-    return errorOccurredFlag == JNI_FALSE ? JNI_TRUE : JNI_FALSE;
-}
 #endif /* MITSHM */
 
 /*
diff --git a/jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.h b/jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.h
index 0ca5a32..1675c68 100644
--- a/jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.h
+++ b/jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.h
@@ -53,7 +53,8 @@
 extern int XShmQueryExtension();
 
 void TryInitMITShm(JNIEnv *env, jint *shmExt, jint *shmPixmaps);
-jboolean TryXShmAttach(JNIEnv *env, Display *display, XShmSegmentInfo *shminfo);
+void resetXShmAttachFailed();
+jboolean isXShmAttachFailed();
 
 #endif /* MITSHM */
 
diff --git a/jdk/src/solaris/native/sun/awt/awt_util.c b/jdk/src/solaris/native/sun/awt/awt_util.c
index d92c96e..76953f9 100644
--- a/jdk/src/solaris/native/sun/awt/awt_util.c
+++ b/jdk/src/solaris/native/sun/awt/awt_util.c
@@ -41,6 +41,11 @@
 
 #include "java_awt_event_MouseWheelEvent.h"
 
+/*
+ * Called by "ToolkitErrorHandler" function in "XlibWrapper.c" file.
+ */
+XErrorHandler current_native_xerror_handler = NULL;
+
 extern jint getModifiers(uint32_t state, jint button, jint keyCode);
 extern jint getButton(uint32_t button);
 
diff --git a/jdk/src/solaris/native/sun/awt/awt_util.h b/jdk/src/solaris/native/sun/awt/awt_util.h
index b93f774..56781f5 100644
--- a/jdk/src/solaris/native/sun/awt/awt_util.h
+++ b/jdk/src/solaris/native/sun/awt/awt_util.h
@@ -29,57 +29,29 @@
 #ifndef HEADLESS
 #include "gdefs.h"
 
-/*
- * Expected types of arguments of the macro.
- * (JNIEnv*, const char*, const char*, jboolean, jobject)
- */
-#define WITH_XERROR_HANDLER(env, handlerClassName, getInstanceSignature,                          \
-                            handlerHasFlag, handlerRef) do {                                      \
-    handlerRef = JNU_CallStaticMethodByName(env, NULL, handlerClassName, "getInstance",           \
-        getInstanceSignature).l;                                                                  \
-    if (handlerHasFlag == JNI_TRUE) {                                                             \
-        JNU_CallMethodByName(env, NULL, handlerRef, "setErrorOccurredFlag", "(Z)V", JNI_FALSE);   \
-    }                                                                                             \
-    JNU_CallStaticMethodByName(env, NULL, "sun/awt/X11/XErrorHandlerUtil", "WITH_XERROR_HANDLER", \
-        "(Lsun/awt/X11/XErrorHandler;)V", handlerRef);                                            \
+#define WITH_XERROR_HANDLER(f) do {             \
+    XSync(awt_display, False);                  \
+    current_native_xerror_handler = (f);        \
+} while (0)
+
+#define RESTORE_XERROR_HANDLER do {             \
+    XSync(awt_display, False);                  \
+    current_native_xerror_handler = NULL;       \
+} while (0)
+
+#define EXEC_WITH_XERROR_HANDLER(f, code) do {  \
+    WITH_XERROR_HANDLER(f);                     \
+    do {                                        \
+        code;                                   \
+    } while (0);                                \
+    RESTORE_XERROR_HANDLER;                     \
 } while (0)
 
 /*
- * Expected types of arguments of the macro.
- * (JNIEnv*, jboolean)
+ * Called by "ToolkitErrorHandler" function in "XlibWrapper.c" file.
  */
-#define RESTORE_XERROR_HANDLER(env, doXSync) do {                                                 \
-    JNU_CallStaticMethodByName(env, NULL, "sun/awt/X11/XErrorHandlerUtil",                        \
-        "RESTORE_XERROR_HANDLER", "(Z)V", doXSync);                                               \
-} while (0)
+extern XErrorHandler current_native_xerror_handler;
 
-/*
- * Expected types of arguments of the macro.
- * (JNIEnv*, const char*, const char*, jboolean, jobject, jboolean, No type - C expression)
- */
-#define EXEC_WITH_XERROR_HANDLER(env, handlerClassName, getInstanceSignature, handlerHasFlag,     \
-                                 handlerRef, errorOccurredFlag, code) do {                        \
-    handlerRef = NULL;                                                                            \
-    WITH_XERROR_HANDLER(env, handlerClassName, getInstanceSignature, handlerHasFlag, handlerRef); \
-    do {                                                                                          \
-        code;                                                                                     \
-    } while (0);                                                                                  \
-    RESTORE_XERROR_HANDLER(env, JNI_TRUE);                                                        \
-    if (handlerHasFlag == JNI_TRUE) {                                                             \
-        GET_HANDLER_ERROR_OCCURRED_FLAG(env, handlerRef, errorOccurredFlag);                      \
-    }                                                                                             \
-} while (0)
-
-/*
- * Expected types of arguments of the macro.
- * (JNIEnv*, jobject, jboolean)
- */
-#define GET_HANDLER_ERROR_OCCURRED_FLAG(env, handlerRef, errorOccurredFlag) do {                  \
-    if (handlerRef != NULL) {                                                                     \
-        errorOccurredFlag = JNU_CallMethodByName(env, NULL, handlerRef, "getErrorOccurredFlag",   \
-            "()Z").z;                                                                             \
-    }                                                                                             \
-} while (0)
 #endif /* !HEADLESS */
 
 #ifndef INTERSECTS
diff --git a/jdk/src/solaris/native/sun/java2d/opengl/GLXSurfaceData.c b/jdk/src/solaris/native/sun/java2d/opengl/GLXSurfaceData.c
index e1cf2c5..1bdd088 100644
--- a/jdk/src/solaris/native/sun/java2d/opengl/GLXSurfaceData.c
+++ b/jdk/src/solaris/native/sun/java2d/opengl/GLXSurfaceData.c
@@ -48,6 +48,8 @@
 extern void
     OGLSD_SetNativeDimensions(JNIEnv *env, OGLSDOps *oglsdo, jint w, jint h);
 
+jboolean surfaceCreationFailed = JNI_FALSE;
+
 #endif /* !HEADLESS */
 
 JNIEXPORT void JNICALL
@@ -347,6 +349,15 @@
     return JNI_TRUE;
 }
 
+static int
+GLXSD_BadAllocXErrHandler(Display *display, XErrorEvent *xerr)
+{
+    if (xerr->error_code == BadAlloc) {
+        surfaceCreationFailed = JNI_TRUE;
+    }
+    return 0;
+}
+
 JNIEXPORT jboolean JNICALL
 Java_sun_java2d_opengl_GLXSurfaceData_initPbuffer
     (JNIEnv *env, jobject glxsd,
@@ -362,8 +373,6 @@
     int attrlist[] = {GLX_PBUFFER_WIDTH, 0,
                       GLX_PBUFFER_HEIGHT, 0,
                       GLX_PRESERVED_CONTENTS, GL_FALSE, 0};
-    jboolean errorOccurredFlag;
-    jobject errorHandlerRef;
 
     J2dTraceLn3(J2D_TRACE_INFO,
                 "GLXSurfaceData_initPbuffer: w=%d h=%d opq=%d",
@@ -391,15 +400,12 @@
     attrlist[1] = width;
     attrlist[3] = height;
 
-    errorOccurredFlag = JNI_FALSE;
-    WITH_XERROR_HANDLER(env, "sun/awt/X11/XErrorHandler$GLXBadAllocHandler",
-        "()Lsun/awt/X11/XErrorHandler$GLXBadAllocHandler;", JNI_TRUE, errorHandlerRef);
-    pbuffer = j2d_glXCreatePbuffer(awt_display, glxinfo->fbconfig, attrlist);
-    XSync(awt_display, False);
-    RESTORE_XERROR_HANDLER(env, JNI_FALSE);
-    GET_HANDLER_ERROR_OCCURRED_FLAG(env, errorHandlerRef, errorOccurredFlag);
-
-    if ((pbuffer == 0) || errorOccurredFlag) {
+    surfaceCreationFailed = JNI_FALSE;
+    EXEC_WITH_XERROR_HANDLER(
+        GLXSD_BadAllocXErrHandler,
+        pbuffer = j2d_glXCreatePbuffer(awt_display,
+                                       glxinfo->fbconfig, attrlist));
+    if ((pbuffer == 0) || surfaceCreationFailed) {
         J2dRlsTraceLn(J2D_TRACE_ERROR,
             "GLXSurfaceData_initPbuffer: could not create glx pbuffer");
         return JNI_FALSE;
diff --git a/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c b/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c
index a35d6fd..79e3be4 100644
--- a/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c
+++ b/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c
@@ -65,6 +65,7 @@
 static DisposeFunc X11SD_Dispose;
 static GetPixmapBgFunc X11SD_GetPixmapWithBg;
 static ReleasePixmapBgFunc X11SD_ReleasePixmapWithBg;
+extern int XShmAttachXErrHandler(Display *display, XErrorEvent *xerr);
 extern AwtGraphicsConfigDataPtr
     getGraphicsConfigFromComponentPeer(JNIEnv *env, jobject this);
 extern struct X11GraphicsConfigIDs x11GraphicsConfigIDs;
@@ -532,8 +533,6 @@
 {
     XImage *img = NULL;
     XShmSegmentInfo *shminfo;
-    JNIEnv* env;
-    jboolean xShmAttachResult;
 
     shminfo = malloc(sizeof(XShmSegmentInfo));
     if (shminfo == NULL) {
@@ -573,8 +572,9 @@
 
     shminfo->readOnly = False;
 
-    env = (JNIEnv*)JNU_GetEnv(jvm, JNI_VERSION_1_2);
-    xShmAttachResult = TryXShmAttach(env, awt_display, shminfo);
+    resetXShmAttachFailed();
+    EXEC_WITH_XERROR_HANDLER(XShmAttachXErrHandler,
+                             XShmAttach(awt_display, shminfo));
 
     /*
      * Once the XSync round trip has finished then we
@@ -583,7 +583,7 @@
      */
     shmctl(shminfo->shmid, IPC_RMID, 0);
 
-    if (xShmAttachResult == JNI_FALSE) {
+    if (isXShmAttachFailed() == JNI_TRUE) {
         J2dRlsTraceLn1(J2D_TRACE_ERROR,
                        "X11SD_SetupSharedSegment XShmAttach has failed: %s",
                        strerror(errno));
diff --git a/jdk/src/solaris/native/sun/xawt/XlibWrapper.c b/jdk/src/solaris/native/sun/xawt/XlibWrapper.c
index 3e75f29..cf3474d 100644
--- a/jdk/src/solaris/native/sun/xawt/XlibWrapper.c
+++ b/jdk/src/solaris/native/sun/xawt/XlibWrapper.c
@@ -41,6 +41,7 @@
 #include <sizecalc.h>
 
 #include <awt.h>
+#include <awt_util.h>
 #include <jvm.h>
 
 #include <Region.h>
@@ -1266,6 +1267,10 @@
 JavaVM* jvm = NULL;
 static int ToolkitErrorHandler(Display * dpy, XErrorEvent * event) {
     JNIEnv * env;
+    // First call the native synthetic error handler declared in "awt_util.h" file.
+    if (current_native_xerror_handler != NULL) {
+        current_native_xerror_handler(dpy, event);
+    }
     if (jvm != NULL) {
         env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
         if (env) {
diff --git a/jdk/src/windows/classes/sun/awt/windows/WPathGraphics.java b/jdk/src/windows/classes/sun/awt/windows/WPathGraphics.java
index 3a1a56d..80042a1 100644
--- a/jdk/src/windows/classes/sun/awt/windows/WPathGraphics.java
+++ b/jdk/src/windows/classes/sun/awt/windows/WPathGraphics.java
@@ -570,6 +570,10 @@
             return false;
         }
 
+        if (gv.getNumGlyphs() == 0) {
+            return true; // nothing to do.
+        }
+
         AffineTransform deviceTransform = getTransform();
         AffineTransform fontTransform = new AffineTransform(deviceTransform);
         Font font = gv.getFont();
@@ -599,6 +603,10 @@
          * device space.
          */
         Point2D.Float userpos = new Point2D.Float(x, y);
+        /* Add the position of the first glyph - its not always 0,0 */
+        Point2D g0pos = gv.getGlyphPosition(0);
+        userpos.x += (float)g0pos.getX();
+        userpos.y += (float)g0pos.getY();
         Point2D.Float devpos = new Point2D.Float();
 
         /* Already have the translate from the deviceTransform,
diff --git a/jdk/test/ProblemList.txt b/jdk/test/ProblemList.txt
index ec7f3d6..7c83f52 100644
--- a/jdk/test/ProblemList.txt
+++ b/jdk/test/ProblemList.txt
@@ -120,9 +120,6 @@
 
 # jdk_lang
 
-# 7067973
-java/lang/management/MemoryMXBean/CollectionUsageThreshold.java generic-all
-
 # 8029415
 java/lang/reflect/Method/invoke/TestPrivateInterfaceMethodReflect.java generic-all
 
@@ -208,9 +205,6 @@
 # 7146541
 java/rmi/transport/rapidExportUnexport/RapidExportUnexport.java	linux-all
 
-# 7190106
-java/rmi/reliability/benchmark/runRmiBench.sh                   generic-all
-
 # 7191877
 java/rmi/transport/checkLeaseInfoLeak/CheckLeaseLeak.java       generic-all
 
@@ -269,9 +263,6 @@
 
 # jdk_tools
 
-# 6461635
-com/sun/tools/attach/BasicTests.sh                              generic-all
-
 # 7132203
 sun/jvmstat/monitor/MonitoredVm/CR6672135.java                  generic-all
 
@@ -299,9 +290,6 @@
 
 # jdk_util
 
-# Filed 6933803
-java/util/concurrent/ThreadPoolExecutor/CoreThreadTimeOut.java  generic-all
-
 # Filed 6772009
 java/util/concurrent/locks/ReentrantLock/CancelledLockLoops.java generic-all
 
diff --git a/jdk/test/com/sun/jmx/snmp/NoInfoLeakTest.java b/jdk/test/com/sun/jmx/snmp/NoInfoLeakTest.java
deleted file mode 100644
index dcf5441..0000000
--- a/jdk/test/com/sun/jmx/snmp/NoInfoLeakTest.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Copyright (c) 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.
- */
-
-/* @test
- * @bug 8026028
- * @summary Tests no leak of internal info
- * @author Shanliang JIANG
- * @run clean NoInfoLeakTest
- * @run build NoInfoLeakTest
- * @run main NoInfoLeakTest
- */
-
-import com.sun.jmx.snmp.SnmpString;
-import com.sun.jmx.snmp.agent.SnmpMib;
-import com.sun.jmx.snmp.agent.SnmpMibTable;
-import com.sun.jmx.snmp.daemon.CommunicatorServer;
-import com.sun.jmx.snmp.daemon.SnmpAdaptorServer;
-import javax.management.MBeanNotificationInfo;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-
-public class NoInfoLeakTest {
-    public static void main(String[] args) throws Exception {
-        boolean ok = true;
-        ok &= snmpStringTest();
-        ok &= snmpMibTest();
-        ok &= communicatorServerTest();
-
-        if (!ok) {
-            throw new RuntimeException("Some tests are failed!");
-        }
-    }
-
-    private static boolean snmpStringTest() {
-        System.out.println("\n---NoInfoLeakTest-snmpStringTest: testing the method byteValue()...");
-        boolean passed = true;
-
-        byte[] mine = new byte[]{1,1,1,};
-        SnmpString ss = new SnmpString(mine);
-        byte[] got = ss.byteValue();
-        got[0]=0;
-
-        if (ss.byteValue()[0] == 0) {
-            System.err.println("Failed: SnmpString.byteValue() returns an internal mutable object value");
-            passed = false;
-        } else {
-            System.out.println("---NoInfoLeakTest-snmpStringTest done.");
-        }
-        return passed;
-    }
-
-    private static boolean snmpMibTest() {
-        boolean passed = true;
-        System.out.println("\n---NoInfoLeakTest-snmpMibTest: testing the method "
-                + "SnmpMib.getRootOid()...");
-        SnmpMib mib = new MySnmpMib();
-
-        if (mib.getRootOid() == mib.getRootOid()) {
-            System.err.println("Failed: SnmpMib.getRootOid() returns an internal"
-                    + " mutable object value "+mib.getRootOid());
-        } else {
-            System.out.println("---NoInfoLeakTest-snmpMibTest done.");
-        }
-        return passed;
-    }
-
-    private static boolean communicatorServerTest() {
-        boolean passed = true;
-        System.out.println("\n---NoInfoLeakTest-communicatorServerTest: testing the method CommunicatorServer.getNotificationInfo()...");
-        CommunicatorServer server = new SnmpAdaptorServer();
-        MBeanNotificationInfo[] notifs = server.getNotificationInfo();
-
-        assert notifs.length > 0 && notifs[0] != null; // the current implementation ensures this
-        notifs[0] = null;
-        if (server.getNotificationInfo()[0] == null) {
-            System.err.println("Failed: CommunicatorServer.getNotificationInfo()"
-                    + " returns an internal mutable object value");
-            passed = false;
-        } else {
-            System.out.println("---NoInfoLeakTest-communicatorServerTest done.");
-        }
-        return passed;
-    }
-
-    private static class MySnmpMib extends SnmpMib {
-        @Override
-        public void registerTableMeta(String name, SnmpMibTable table) {
-            throw new UnsupportedOperationException("Not supported yet.");
-        }
-
-        @Override
-        public SnmpMibTable getRegisteredTableMeta(String name) {
-            throw new UnsupportedOperationException("Not supported yet.");
-        }
-
-        @Override
-        public void init() throws IllegalAccessException {
-            throw new UnsupportedOperationException("Not supported yet.");
-        }
-
-        @Override
-        public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception {
-            throw new UnsupportedOperationException("Not supported yet.");
-        }
-    }
-}
diff --git a/jdk/test/com/sun/management/GarbageCollectorMXBean/LastGCInfo.java b/jdk/test/com/sun/management/GarbageCollectorMXBean/LastGCInfo.java
index fe06d0a..a60ae8a 100644
--- a/jdk/test/com/sun/management/GarbageCollectorMXBean/LastGCInfo.java
+++ b/jdk/test/com/sun/management/GarbageCollectorMXBean/LastGCInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -27,8 +27,11 @@
  * @summary Sanity Test for GarbageCollectorMXBean.getLastGcInfo().
  * @author  Mandy Chung
  *
- * @run main LastGCInfo
+ * @run main/othervm -XX:-ExplicitGCInvokesConcurrent LastGCInfo
  */
+// Passing "-XX:-ExplicitGCInvokesConcurrent" to force System.gc()
+// run on foreground when CMS is used and prevent situations when "GcInfo"
+// is missing even though System.gc() was successfuly processed.
 
 import java.lang.management.ManagementFactory;
 import java.lang.management.MemoryUsage;
diff --git a/jdk/test/com/sun/tools/attach/AgentSetup.sh b/jdk/test/com/sun/tools/attach/AgentSetup.sh
deleted file mode 100644
index dee69a3..0000000
--- a/jdk/test/com/sun/tools/attach/AgentSetup.sh
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/bin/sh
-
-#
-# Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-
-#
-#
-# Agent set - creates Agent.jar, BadAgent.jar and RedefineAgent.jar in ${TESTCLASSES}
- 
-$JAVAC -d "${TESTCLASSES}" "${TESTSRC}"/Agent.java "${TESTSRC}"/BadAgent.java "${TESTSRC}"/RedefineAgent.java
-
-$JAR -cfm "${TESTCLASSES}"/Agent.jar "${TESTSRC}"/agent.mf \
-  -C "${TESTCLASSES}" Agent.class
-
-$JAR -cfm "${TESTCLASSES}"/BadAgent.jar "${TESTSRC}"/badagent.mf \
-  -C "${TESTCLASSES}" BadAgent.class
-
-$JAR -cfm "${TESTCLASSES}"/RedefineAgent.jar "${TESTSRC}"/redefineagent.mf \
-  -C "${TESTCLASSES}" RedefineAgent.class
-
-agent="${TESTCLASSES}${FS}Agent.jar"
-badagent="${TESTCLASSES}${FS}BadAgent.jar"
-redefineagent="${TESTCLASSES}${FS}RedefineAgent.jar"
-
diff --git a/jdk/test/com/sun/tools/attach/Application.java b/jdk/test/com/sun/tools/attach/Application.java
index 5db6c8a..d29b138 100644
--- a/jdk/test/com/sun/tools/attach/Application.java
+++ b/jdk/test/com/sun/tools/attach/Application.java
@@ -22,25 +22,39 @@
  */
 
 /*
- *
- *
  * A simple "Application" used by the Attach API unit tests. This application is
  * launched by the test. It binds to a random port and shuts down when somebody
  * connects to that port.
+ * Used port and pid are written both to stdout and to a specified file.
  */
 import java.net.Socket;
 import java.net.ServerSocket;
+import java.io.PrintWriter;
+import jdk.testlibrary.ProcessTools;
 
 public class Application {
     public static void main(String args[]) throws Exception {
         // bind to a random port
+        if (args.length < 1) {
+            System.err.println("First argument should be path to output file.");
+        }
+        String outFileName = args[0];
+
         ServerSocket ss = new ServerSocket(0);
         int port = ss.getLocalPort();
+        int pid = ProcessTools.getProcessId();
 
-        // signal test that we are started - do not remove this line!!
-        System.out.println(port);
+        System.out.println("shutdownPort=" + port);
+        System.out.println("pid=" + pid);
         System.out.flush();
 
+        try (PrintWriter writer = new PrintWriter(outFileName)) {
+            writer.println("shutdownPort=" + port);
+            writer.println("pid=" + pid);
+            writer.println("done");
+            writer.flush();
+        }
+
         // wait for test harness to connect
         Socket s = ss.accept();
         s.close();
diff --git a/jdk/test/com/sun/tools/attach/ApplicationSetup.sh b/jdk/test/com/sun/tools/attach/ApplicationSetup.sh
deleted file mode 100644
index e8296df..0000000
--- a/jdk/test/com/sun/tools/attach/ApplicationSetup.sh
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/bin/sh
-
-#
-# Copyright (c) 2005, 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.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-
-#
-#
-# Application Setup - creates ${TESTCLASSES}/Application.jar and the following
-# procedures:
-#	startApplication - starts target application
-#	stopApplication $1 - stops application via TCP shutdown port $1
-
-$JAVAC -d "${TESTCLASSES}" "${TESTSRC}"/Application.java "${TESTSRC}"/Shutdown.java
-$JAR -cfm "${TESTCLASSES}"/Application.jar "${TESTSRC}"/application.mf \
-  -C "${TESTCLASSES}" Application.class
-
-OUTPUTFILE=${TESTCLASSES}/Application.out
-rm -f ${OUTPUTFILE}
-
-startApplication() 
-{
-  # put all output from the app into ${OUTPUTFILE}
-  ${JAVA} ${TESTVMOPTS} $1 $2 $3 -jar "${TESTCLASSES}"/Application.jar > ${OUTPUTFILE} 2>&1 &
-  pid="$!"
-
-  # MKS creates an intermediate shell to launch ${JAVA} so
-  # ${pid} is not the actual pid. We have put in a small sleep
-  # to give the intermediate shell process time to launch the
-  # "java" process.
-  if [ "$OS" = "Windows" ]; then
-    sleep 2
-    if [ "${isCygwin}" = "true" ] ; then
-      realpid=`ps -p ${pid} | tail -1 | awk '{print $4;}'`
-    else
-      realpid=`ps -o pid,ppid,comm|grep ${pid}|grep "java"|cut -c1-6`
-    fi
-    pid=${realpid}
-  fi
-                                                                                                                  
-  echo "Waiting for Application to initialize..."
-  attempts=0
-  while true; do
-    sleep 1
-    port=`tail -1 ${OUTPUTFILE} | sed -e 's@\\r@@g' `
-    if [ ! -z "$port" ]; then
-      # In case of errors wait time for output to be flushed
-      sleep 1
-      cat ${OUTPUTFILE}
-      break
-    fi
-    attempts=`expr $attempts + 1`
-    echo "Waiting $attempts second(s) ..."
-  done
-  echo "Application is process $pid, shutdown port is $port"
-  return $port
-}
-
-stopApplication() 
-{
-  $JAVA ${TESTVMOPTS} -classpath "${TESTCLASSES}" Shutdown $1
-}
-
diff --git a/jdk/test/com/sun/tools/attach/BasicTests.java b/jdk/test/com/sun/tools/attach/BasicTests.java
index 79056e6..51f202b 100644
--- a/jdk/test/com/sun/tools/attach/BasicTests.java
+++ b/jdk/test/com/sun/tools/attach/BasicTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -21,160 +21,257 @@
  * questions.
  */
 
-/*
- *
- *
- * Unit test for Attach API. Attaches to the given VM and performs a number
- * unit tests.
- */
 import com.sun.tools.attach.*;
 import java.net.ServerSocket;
 import java.net.Socket;
 import java.io.IOException;
 import java.util.Properties;
 import java.util.List;
+import java.io.File;
+import jdk.testlibrary.OutputAnalyzer;
+import jdk.testlibrary.JDKToolLauncher;
+import jdk.testlibrary.ProcessTools;
+import jdk.testlibrary.ProcessThread;
 
+/*
+ * @test
+ * @bug 6173612 6273707 6277253 6335921 6348630 6342019 6381757
+ * @summary Basic unit tests for the VM attach mechanism.
+ * @library /lib/testlibrary
+ * @run build Agent BadAgent RedefineAgent Application Shutdown RedefineDummy
+ * @run main BasicTests
+ *
+ * This test will perform a number of basic attach tests.
+ */
 public class BasicTests {
-    public static void main(String args[]) throws Exception {
-        String pid = args[0];
-        String agent = args[1];
-        String badagent = args[2];
-        String redefineagent = args[3];
 
-        System.out.println(" - Attaching to application ...");
-        VirtualMachine vm = VirtualMachine.attach(pid);
-
-        // Test 1 - read the system properties from the target VM and
-        // check that property is set
-        System.out.println(" - Test: system properties in target VM");
-        Properties props = vm.getSystemProperties();
-        String value = props.getProperty("attach.test");
-        if (value == null || !value.equals("true")) {
-            throw new RuntimeException("attach.test property not set");
-        }
-        System.out.println(" - attach.test property set as expected");
-
-        // Test 1a - read the agent properties from the target VM.
-        // By default, the agent property contains "sun.java.command",
-        // "sun.jvm.flags", and "sun.jvm.args".
-        // Just sanity check - make sure not empty.
-        System.out.println(" - Test: agent properties in target VM");
-        props = vm.getAgentProperties();
-        if (props == null || props.size() == 0) {
-            throw new RuntimeException("Agent properties is empty");
-        }
-        System.out.println(" - agent properties non-empty as expected");
-
-        // Test 2 - attempt to load an agent that does not exist
-        System.out.println(" - Test: Load an agent that does not exist");
+    /*
+     * The actual test is in the nested class TestMain.
+     * The responsibility of this class is to:
+     * 1. Build all needed jars.
+     * 2. Start the Application class in a separate process.
+     * 3. Find the pid and shutdown port of the running Application.
+     * 4. Launches the tests in nested class TestMain that will attach to the Application.
+     * 5. Shut down the Application.
+     */
+    public static void main(String args[]) throws Throwable {
+        final String pidFile = "TestsBasic.Application.pid";
+        ProcessThread processThread = null;
+        RunnerUtil.ProcessInfo info = null;
         try {
-            vm.loadAgent("SilverBullet.jar");
-        } catch (AgentLoadException x) {
-            System.out.println(" - AgentLoadException thrown as expected!");
+            buildJars();
+            processThread = RunnerUtil.startApplication(pidFile);
+            info = RunnerUtil.readProcessInfo(pidFile);
+            runTests(info.pid);
+        } catch (Throwable t) {
+            System.out.println("TestBasic got unexpected exception: " + t);
+            t.printStackTrace();
+            throw t;
+        } finally {
+            // Make sure the Application process is stopped.
+            RunnerUtil.stopApplication(info.shutdownPort, processThread);
         }
+    }
 
-        // Test 3 - load an "bad" agent (agentmain throws an exception)
-        System.out.println(" - Test: Load a bad agent");
-        System.out.println("INFO: This test will cause error messages "
-            + "to appear in the application log about SilverBullet.jar "
-            + "not being found and an agent failing to start.");
-        try {
-            vm.loadAgent(badagent);
-            throw new RuntimeException(
-                "AgentInitializationException not thrown as expected!");
-        } catch (AgentInitializationException x) {
-            System.out.println(
-                " - AgentInitializationException thrown as expected!");
+    /**
+     * Runs the actual tests in nested class TestMain.
+     * The reason for running the tests in a separate process
+     * is that we need to modify the class path.
+     */
+    private static void runTests(int pid) throws Throwable {
+        final String sep = File.separator;
+
+        // Need to add jdk/lib/tools.jar to classpath.
+        String classpath =
+            System.getProperty("test.class.path", "") + File.pathSeparator +
+            System.getProperty("test.jdk", ".") + sep + "lib" + sep + "tools.jar";
+        String testClassDir = System.getProperty("test.classes", "") + sep;
+
+        // Argumenta : -classpath cp BasicTests$TestMain pid agent badagent redefineagent
+        String[] args = {
+            "-classpath",
+            classpath,
+            "BasicTests$TestMain",
+            Integer.toString(pid),
+            testClassDir + "Agent.jar",
+            testClassDir + "BadAgent.jar",
+            testClassDir + "RedefineAgent.jar" };
+        OutputAnalyzer output = ProcessTools.executeTestJvm(args);
+        output.shouldHaveExitValue(0);
+    }
+
+    /**
+     * Will build all jars needed by the tests.
+     */
+    private static void buildJars() throws Throwable {
+        String[] jars = {"Agent", "BadAgent", "RedefineAgent", "Application" };
+        for (String jar : jars) {
+            buildJar(jar);
         }
+    }
 
-        // Test 4 - detach from the VM and attempt a load (should throw IOE)
-        System.out.println(" - Test: Detach from VM");
-        System.out.println("INFO: This test will cause error messages "
-            + "to appear in the application log about a BadAgent including "
-            + "a RuntimeException and an InvocationTargetException.");
-        vm.detach();
-        try {
-            vm.loadAgent(agent);
-            throw new RuntimeException("loadAgent did not throw an exception!!");
-        } catch (IOException ioe) {
-            System.out.println(" - IOException as expected");
-        }
+    /**
+     * Will build a jar with the given name.
+     * Class file and manifest must already exist.
+     * @param jarName Name of the jar.
+     */
+    private static void buildJar(String jarName) throws Throwable {
+        String testClasses = System.getProperty("test.classes", "?");
+        String testSrc = System.getProperty("test.src", "?");
+        String jar = String.format("%s/%s.jar", testClasses, jarName);
+        String manifest = String.format("%s/%s.mf", testSrc, jarName.toLowerCase());
+        String clazz = String.format("%s.class", jarName);
 
-        // Test 5 - functional "end-to-end" test.
-        // Create a listener socket. Load Agent.jar into the target VM passing
-        // it the port number of our listener. When agent loads it should connect
-        // back to the tool.
+        // Arguments to the jar command has this format:
+        // "-cfm TESTCLASSES/Agent.jar TESTSRC/agent.mf -C TESTCLASSES Agent.class"
+        RunnerUtil.createJar("-cfm", jar, manifest, "-C", testClasses, clazz);
+    }
 
-        System.out.println(" - Re-attaching to application ...");
-        vm = VirtualMachine.attach(pid);
+    /**
+     * This is the actual test. It will attach to the running Application
+     * and perform a number of basic attach tests.
+     */
+    public static class TestMain {
+        public static void main(String args[]) throws Exception {
+            String pid = args[0];
+            String agent = args[1];
+            String badagent = args[2];
+            String redefineagent = args[3];
 
-        System.out.println(" - Test: End-to-end connection with agent");
+            System.out.println(" - Attaching to application ...");
+            VirtualMachine vm = VirtualMachine.attach(pid);
 
-        ServerSocket ss = new ServerSocket(0);
-        int port = ss.getLocalPort();
+            // Test 1 - read the system properties from the target VM and
+            // check that property is set
+            System.out.println(" - Test: system properties in target VM");
+            Properties props = vm.getSystemProperties();
+            String value = props.getProperty("attach.test");
+            if (value == null || !value.equals("true")) {
+                throw new RuntimeException("attach.test property not set");
+            }
+            System.out.println(" - attach.test property set as expected");
 
-        System.out.println(" - Loading Agent.jar into target VM ...");
-        vm.loadAgent(agent, Integer.toString(port));
+            // Test 1a - read the agent properties from the target VM.
+            // By default, the agent property contains "sun.java.command",
+            // "sun.jvm.flags", and "sun.jvm.args".
+            // Just sanity check - make sure not empty.
+            System.out.println(" - Test: agent properties in target VM");
+            props = vm.getAgentProperties();
+            if (props == null || props.size() == 0) {
+                throw new RuntimeException("Agent properties is empty");
+            }
+            System.out.println(" - agent properties non-empty as expected");
 
-        System.out.println(" - Waiting for agent to connect back to tool ...");
-        Socket s = ss.accept();
-        System.out.println(" - Connected to agent.");
+            // Test 2 - attempt to load an agent that does not exist
+            System.out.println(" - Test: Load an agent that does not exist");
+            try {
+                vm.loadAgent("SilverBullet.jar");
+            } catch (AgentLoadException x) {
+                System.out.println(" - AgentLoadException thrown as expected!");
+            }
 
-        // Test 5b - functional "end-to-end" test.
-        // Now with an agent that does redefine.
+            // Test 3 - load an "bad" agent (agentmain throws an exception)
+            System.out.println(" - Test: Load a bad agent");
+            System.out.println("INFO: This test will cause error messages "
+                + "to appear in the application log about SilverBullet.jar "
+                + "not being found and an agent failing to start.");
+            try {
+                vm.loadAgent(badagent);
+                throw new RuntimeException(
+                    "AgentInitializationException not thrown as expected!");
+            } catch (AgentInitializationException x) {
+                System.out.println(
+                    " - AgentInitializationException thrown as expected!");
+            }
 
-        System.out.println(" - Re-attaching to application ...");
-        vm = VirtualMachine.attach(pid);
+            // Test 4 - detach from the VM and attempt a load (should throw IOE)
+            System.out.println(" - Test: Detach from VM");
+            System.out.println("INFO: This test will cause error messages "
+                + "to appear in the application log about a BadAgent including "
+                + "a RuntimeException and an InvocationTargetException.");
+            vm.detach();
+            try {
+                vm.loadAgent(agent);
+                throw new RuntimeException("loadAgent did not throw an exception!!");
+            } catch (IOException ioe) {
+                System.out.println(" - IOException as expected");
+            }
 
-        System.out.println(" - Test: End-to-end connection with RedefineAgent");
+            // Test 5 - functional "end-to-end" test.
+            // Create a listener socket. Load Agent.jar into the target VM passing
+            // it the port number of our listener. When agent loads it should connect
+            // back to the tool.
 
-        ServerSocket ss2 = new ServerSocket(0);
-        int port2 = ss2.getLocalPort();
+            System.out.println(" - Re-attaching to application ...");
+            vm = VirtualMachine.attach(pid);
 
-        System.out.println(" - Loading RedefineAgent.jar into target VM ...");
-        vm.loadAgent(redefineagent, Integer.toString(port2));
+            System.out.println(" - Test: End-to-end connection with agent");
 
-        System.out.println(" - Waiting for RedefineAgent to connect back to tool ...");
-        Socket s2 = ss2.accept();
-        System.out.println(" - Connected to RedefineAgent.");
+            ServerSocket ss = new ServerSocket(0);
+            int port = ss.getLocalPort();
 
-        // Test 6 - list method should list the target VM
-        System.out.println(" - Test: VirtualMachine.list");
-        List<VirtualMachineDescriptor> l = VirtualMachine.list();
-        if (!l.isEmpty()) {
-            boolean found = false;
-            for (VirtualMachineDescriptor vmd: l) {
-                if (vmd.id().equals(pid)) {
-                    found = true;
-                    break;
+            System.out.println(" - Loading Agent.jar into target VM ...");
+            vm.loadAgent(agent, Integer.toString(port));
+
+            System.out.println(" - Waiting for agent to connect back to tool ...");
+            Socket s = ss.accept();
+            System.out.println(" - Connected to agent.");
+
+            // Test 5b - functional "end-to-end" test.
+            // Now with an agent that does redefine.
+
+            System.out.println(" - Re-attaching to application ...");
+            vm = VirtualMachine.attach(pid);
+
+            System.out.println(" - Test: End-to-end connection with RedefineAgent");
+
+            ServerSocket ss2 = new ServerSocket(0);
+            int port2 = ss2.getLocalPort();
+
+            System.out.println(" - Loading RedefineAgent.jar into target VM ...");
+            vm.loadAgent(redefineagent, Integer.toString(port2));
+
+            System.out.println(" - Waiting for RedefineAgent to connect back to tool ...");
+            Socket s2 = ss2.accept();
+            System.out.println(" - Connected to RedefineAgent.");
+
+            // Test 6 - list method should list the target VM
+            System.out.println(" - Test: VirtualMachine.list");
+            List<VirtualMachineDescriptor> l = VirtualMachine.list();
+            if (!l.isEmpty()) {
+                boolean found = false;
+                for (VirtualMachineDescriptor vmd: l) {
+                    if (vmd.id().equals(pid)) {
+                        found = true;
+                        break;
+                    }
+                }
+                if (found) {
+                    System.out.println(" - " + pid + " found.");
+                } else {
+                    throw new RuntimeException(pid + " not found in VM list");
                 }
             }
-            if (found) {
-                System.out.println(" - " + pid + " found.");
-            } else {
-                throw new RuntimeException(pid + " not found in VM list");
+
+            // test 7 - basic hashCode/equals tests
+            System.out.println(" - Test: hashCode/equals");
+
+            VirtualMachine vm1 = VirtualMachine.attach(pid);
+            VirtualMachine vm2 = VirtualMachine.attach(pid);
+            if (!vm1.equals(vm2)) {
+                throw new RuntimeException("virtual machines are not equal");
             }
+            if (vm.hashCode() != vm.hashCode()) {
+                throw new RuntimeException("virtual machine hashCodes not equal");
+            }
+            System.out.println(" - hashCode/equals okay");
+
+            // ---
+            System.out.println(" - Cleaning up...");
+            s.close();
+            ss.close();
+            s2.close();
+            ss2.close();
         }
-
-        // test 7 - basic hashCode/equals tests
-        System.out.println(" - Test: hashCode/equals");
-
-        VirtualMachine vm1 = VirtualMachine.attach(pid);
-        VirtualMachine vm2 = VirtualMachine.attach(pid);
-        if (!vm1.equals(vm2)) {
-            throw new RuntimeException("virtual machines are not equal");
-        }
-        if (vm.hashCode() != vm.hashCode()) {
-            throw new RuntimeException("virtual machine hashCodes not equal");
-        }
-        System.out.println(" - hashCode/equals okay");
-
-
-        // ---
-        System.out.println(" - Cleaning up...");
-        s.close();
-        ss.close();
-        s2.close();
-        ss2.close();
     }
 }
diff --git a/jdk/test/com/sun/tools/attach/BasicTests.sh b/jdk/test/com/sun/tools/attach/BasicTests.sh
deleted file mode 100644
index fc5a7fb..0000000
--- a/jdk/test/com/sun/tools/attach/BasicTests.sh
+++ /dev/null
@@ -1,86 +0,0 @@
-#!/bin/sh
-
-#
-# Copyright (c) 2005, 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.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please 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 6173612 6273707 6277253 6335921 6348630 6342019 6381757
-# @summary Basic unit tests for the VM attach mechanism.
-#
-# @build BasicTests
-# @run shell BasicTests.sh
-
-if [ "${TESTSRC}" = "" ]
-then
-  echo "TESTSRC not set.  Test cannot execute.  Failed."
-  exit 1
-fi
-
-# Windows 2000 is a problem here, so we skip it, see 6962615
-osrev=`uname -a`
-if [ "`echo ${osrev} | grep 'CYGWIN[^ ]*-5\.0'`" != "" ] ; then
-  echo "Treating as a pass, not testing Windows 2000"
-  exit 0
-fi
-if [ "`echo ${osrev} | grep 'Windows'`" != "" ] ; then
-  if [ "`echo ${osrev} | grep '5 00'`" != "" ] ; then
-     echo "Treating as a pass, not testing Windows 2000"
-     exit 0
-  fi
-fi
-
-. ${TESTSRC}/CommonSetup.sh
-. ${TESTSRC}/ApplicationSetup.sh
-. ${TESTSRC}/AgentSetup.sh
-
-startApplication -Dattach.test=true
-# pid = process-id, port = shutdown port
-
-failures=0
-
-echo "Running tests ..."
-
-$JAVA ${TESTVMOPTS} -classpath "${TESTCLASSES}${PS}${TESTJAVA}/lib/tools.jar" \
-  BasicTests $pid $agent $badagent $redefineagent 2>&1
-if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
-
-stopApplication $port
-
-# Add these info messages to $OUTPUTFILE just in case someone
-# looks at it and wonders about the failures. We have to do
-# this after the application is stopped because it is writing
-# to $OUTPUTFILE.
-(
-echo ""
-echo "INFO: Test 2 will cause error messages about SilverBullet.jar" \
-    "and an agent failing to start."
-echo "INFO: Test 3 will cause error messages about BadAgent" \
-    "including a RuntimeException and an InvocationTargetException."
-) >> ${OUTPUTFILE}
-
-if [ $failures = 0 ]; 
-  then echo "All tests passed.";
-  else echo "$failures test(s) failed:"; cat ${OUTPUTFILE};
-fi
-exit $failures
diff --git a/jdk/test/com/sun/tools/attach/CommonSetup.sh b/jdk/test/com/sun/tools/attach/CommonSetup.sh
deleted file mode 100644
index 1355491..0000000
--- a/jdk/test/com/sun/tools/attach/CommonSetup.sh
+++ /dev/null
@@ -1,81 +0,0 @@
-#!/bin/sh
-
-#
-# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-
-#
-#
-# Common setup for the Attach API unit tests. Setups up the following variables:
-#
-# PS - path sep.
-# FS - file sep.
-# JAVA - java cmd.
-# JAVAC - javac cmd.
-# JAR - jar cmd.
-
-OS=`uname -s`
-case "$OS" in
-  SunOS | Linux | Darwin )
-    PS=":"
-    FS="/"
-    ;;
-  Windows* )
-    PS=";"
-    OS="Windows"
-    FS="\\"
-    ;;
-  CYGWIN* )
-    PS=";"
-    OS="Windows"
-    FS="\\"
-    isCygwin=true
-    ;;
-  * )
-    echo "Unrecognized system!"
-    exit 1;
-    ;;
-esac
-
-if [ "${TESTJAVA}" = "" ]
-then
-  echo "TESTJAVA not set.  Test cannot execute.  Failed."
-  exit 1
-fi
-
-if [ "${TESTSRC}" = "" ]
-then
-  echo "TESTSRC not set.  Test cannot execute.  Failed."
-  exit 1
-fi
-
-if [ "${TESTCLASSES}" = "" ]
-then
-  echo "TESTCLASSES not set.  Test cannot execute.  Failed."
-  exit 1
-fi
-
-JAVA="${TESTJAVA}/bin/java"
-JAVAC="${TESTJAVA}/bin/javac"
-JAR="${TESTJAVA}/bin/jar"
-
diff --git a/jdk/test/com/sun/tools/attach/PermissionTest.java b/jdk/test/com/sun/tools/attach/PermissionTest.java
index 5be6c05..933ec2c 100644
--- a/jdk/test/com/sun/tools/attach/PermissionTest.java
+++ b/jdk/test/com/sun/tools/attach/PermissionTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -21,39 +21,119 @@
  * questions.
  */
 
-/*
- *
- *
- * Unit test for Attach API - this checks that a SecurityException is thrown as
- * expected.
- */
 import com.sun.tools.attach.VirtualMachine;
 import com.sun.tools.attach.AttachNotSupportedException;
 import java.util.Properties;
+import java.io.File;
+import jdk.testlibrary.OutputAnalyzer;
+import jdk.testlibrary.ProcessTools;
+import jdk.testlibrary.ProcessThread;
 
+/*
+ * @test
+ * @bug 6173612 6273707 6277253 6335921 6348630 6342019 6381757
+ * @summary Basic unit tests for the VM attach mechanism.
+ * @library /lib/testlibrary
+ * @run build Application Shutdown
+ * @run main PermissionTest
+ *
+ * Unit test for Attach API -
+ * this checks that a SecurityException is thrown as expected.
+ */
 public class PermissionTest {
-    public static void main(String args[]) throws Exception {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm == null) {
-            throw new RuntimeException("Test configuration error - no security manager set");
-        }
 
-        String pid = args[0];
-        boolean shouldFail = Boolean.parseBoolean(args[1]);
-
+    /*
+     * The actual test is in the nested class TestMain.
+     * The responsibility of this class is to:
+     * 1. Start the Application class in a separate process.
+     * 2. Find the pid and shutdown port of the running Application.
+     * 3. Run the tests in TstMain that will attach to the Application.
+     * 4. Shut down the Application.
+     */
+    public static void main(String args[]) throws Throwable {
+        final String pidFile ="TestPermission.Application.pid";
+        ProcessThread processThread = null;
+        RunnerUtil.ProcessInfo info = null;
         try {
-            VirtualMachine.attach(pid).detach();
-            if (shouldFail) {
-                throw new RuntimeException("SecurityException should be thrown");
+            processThread = RunnerUtil.startApplication(pidFile);
+            info = RunnerUtil.readProcessInfo(pidFile);
+            runTests(info.pid);
+        } catch (Throwable t) {
+            System.out.println("TestPermission got unexpected exception: " + t);
+            t.printStackTrace();
+            throw t;
+        } finally {
+            // Make sure the Application process is stopped.
+            RunnerUtil.stopApplication(info.shutdownPort, processThread);
+        }
+    }
+
+    /**
+     * Runs the actual test the nested class TestMain.
+     * The test is run in a separate process because we need to add to the classpath.
+     */
+    private static void runTests(int pid) throws Throwable {
+        final String sep = File.separator;
+
+        // Need to add jdk/lib/tools.jar to classpath.
+        String classpath =
+            System.getProperty("test.class.path", "") + File.pathSeparator +
+            System.getProperty("test.jdk", ".") + sep + "lib" + sep + "tools.jar";
+        String testSrc = System.getProperty("test.src", "") + sep;
+
+        // Use a policy that will NOT allow attach. Test will verify exception.
+        String[] args = {
+            "-classpath",
+            classpath,
+            "-Djava.security.manager",
+            String.format("-Djava.security.policy=%sjava.policy.deny", testSrc),
+            "PermissionTest$TestMain",
+            Integer.toString(pid),
+            "true" };
+        OutputAnalyzer output = ProcessTools.executeTestJvm(args);
+        output.shouldHaveExitValue(0);
+
+        // Use a policy that will allow attach.
+        args = new String[] {
+            "-classpath",
+            classpath,
+            "-Djava.security.manager",
+            String.format("-Djava.security.policy=%sjava.policy.allow", testSrc),
+            "PermissionTest$TestMain",
+            Integer.toString(pid),
+            "false" };
+        output = ProcessTools.executeTestJvm(args);
+        output.shouldHaveExitValue(0);
+    }
+
+    /**
+     * This is the actual test code. It will attach to the Application and verify
+     * that we get a SecurityException when that is expected.
+     */
+    public static class TestMain {
+        public static void main(String args[]) throws Exception {
+            SecurityManager sm = System.getSecurityManager();
+            if (sm == null) {
+                throw new RuntimeException("Test configuration error - no security manager set");
             }
-            System.out.println(" - attached to target VM as expected.");
-        } catch (Exception x) {
-            // AttachNotSupportedException thrown when no providers can be loaded
-            if (shouldFail && ((x instanceof AttachNotSupportedException) ||
-                (x instanceof SecurityException))) {
-                System.out.println(" - exception thrown as expected.");
-            } else {
-                throw x;
+
+            String pid = args[0];
+            boolean shouldFail = Boolean.parseBoolean(args[1]);
+
+            try {
+                VirtualMachine.attach(pid).detach();
+                if (shouldFail) {
+                    throw new RuntimeException("SecurityException should be thrown");
+                }
+                System.out.println(" - attached to target VM as expected.");
+            } catch (Exception x) {
+                // AttachNotSupportedException thrown when no providers can be loaded
+                if (shouldFail && ((x instanceof AttachNotSupportedException) ||
+                    (x instanceof SecurityException))) {
+                    System.out.println(" - exception thrown as expected.");
+                } else {
+                    throw x;
+                }
             }
         }
     }
diff --git a/jdk/test/com/sun/tools/attach/PermissionTests.sh b/jdk/test/com/sun/tools/attach/PermissionTests.sh
deleted file mode 100644
index d1cfb3c..0000000
--- a/jdk/test/com/sun/tools/attach/PermissionTests.sh
+++ /dev/null
@@ -1,72 +0,0 @@
-#!/bin/sh
-
-#
-# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please 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 6173612
-# @summary Security manager and permission tests for Attach API
-#
-# @build PermissionTest 
-# @run shell PermissionTests.sh
-
-if [ "${TESTSRC}" = "" ]
-then
-  echo "TESTSRC not set.  Test cannot execute.  Failed."
-  exit 1
-fi
-
-. ${TESTSRC}/CommonSetup.sh
-. ${TESTSRC}/ApplicationSetup.sh
-
-failures=0
-
-# Start target VM
-startApplication
-# pid = process-id, port = shutdown port
-
-echo "Deny test"
-# deny 
-$JAVA ${TESTVMOPTS} -classpath "${TESTCLASSES}${PS}${TESTJAVA}/lib/tools.jar" \
-    -Djava.security.manager \
-    -Djava.security.policy=${TESTSRC}/java.policy.deny \
-    PermissionTest $pid true 2>&1
-if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
-
-# allow
-echo "Allow test"
-$JAVA ${TESTVMOPTS} -classpath "${TESTCLASSES}${PS}${TESTJAVA}/lib/tools.jar" \
-    -Djava.security.manager \
-    -Djava.security.policy=${TESTSRC}/java.policy.allow \
-    PermissionTest $pid false 2>&1 
-if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
-
-# Stop target VM
-stopApplication $port
-
-if [ $failures = 0 ]; 
-  then echo "All tests passed.";
-  else echo "$failures test(s) failed:"; cat ${OUTPUTFILE};
-fi
-exit $failures
diff --git a/jdk/test/com/sun/tools/attach/ProviderTest.java b/jdk/test/com/sun/tools/attach/ProviderTest.java
index 5391209..58ea6d5 100644
--- a/jdk/test/com/sun/tools/attach/ProviderTest.java
+++ b/jdk/test/com/sun/tools/attach/ProviderTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -21,24 +21,98 @@
  * questions.
  */
 
-/*
- *
- *
- * Unit test for Attach API. Attaches to the given VM and performs a number
- * unit tests.
- */
+import java.io.File;
+import jdk.testlibrary.OutputAnalyzer;
+import jdk.testlibrary.JDKToolLauncher;
+import jdk.testlibrary.ProcessTools;
 import com.sun.tools.attach.VirtualMachine;
 import com.sun.tools.attach.spi.AttachProvider;
 
+/*
+ * @test
+ * @bug 6173612 6273707 6277253 6335921 6348630 6342019 6381757
+ * @summary Basic unit tests for the VM attach mechanism.
+ * @library /lib/testlibrary
+ * @run build SimpleProvider
+ * @run main ProviderTest
+ *
+ * The test will attach and detach to/from the running Application.
+ */
 public class ProviderTest {
-    public static void main(String args[]) throws Exception {
-        // deal with internal builds where classes are loaded from the
-        // 'classes' directory rather than rt.jar
-        ClassLoader cl = AttachProvider.class.getClassLoader();
-        if (cl != ClassLoader.getSystemClassLoader()) {
-            System.out.println("Attach API not loaded by system class loader - test skipped");
-            return;
+
+    /*
+     * The actual tests are in the nested class TestMain below.
+     * The responsibility of this class is to:
+     * 1. Build the needed jar.
+     * 2. Run tests in ProviderTest.TestMain.
+     */
+    public static void main(String args[]) throws Throwable {
+        try {
+            buildJar();
+            runTests();
+        } catch (Throwable t) {
+            System.out.println("TestProvider got unexpected exception: " + t);
+            t.printStackTrace();
+            throw t;
         }
-        VirtualMachine.attach("simple:1234").detach();
+    }
+
+    /**
+     * Runs the actual tests in the nested class TestMain.
+     * We need to run the tests in a separate process,
+     * because we need to add to the classpath.
+     */
+    private static void runTests() throws Throwable {
+        final String sep = File.separator;
+        String testClassPath = System.getProperty("test.class.path", "");
+        String testClasses = System.getProperty("test.classes", "") + sep;
+        String jdkLib = System.getProperty("test.jdk", ".") + sep + "lib" + sep;
+
+        // Need to add SimpleProvider.jar and tools.jar to classpath.
+        String classpath =
+                testClassPath + File.pathSeparator +
+                testClasses + "SimpleProvider.jar" + File.pathSeparator +
+                jdkLib + "tools.jar";
+
+        String[] args = {
+                "-classpath",
+                classpath,
+                "ProviderTest$TestMain" };
+        OutputAnalyzer output = ProcessTools.executeTestJvm(args);
+        output.shouldHaveExitValue(0);
+    }
+
+    /**
+     * Will build the SimpleProvider.jar.
+     */
+    private static void buildJar() throws Throwable {
+        final String sep = File.separator;
+        String testClasses = System.getProperty("test.classes", "?") + sep;
+        String testSrc = System.getProperty("test.src", "?") + sep;
+        String serviceDir = "META-INF" + sep + "services" + sep;
+
+        RunnerUtil.createJar(
+            "-cf", testClasses + "SimpleProvider.jar",
+            "-C", testClasses, "SimpleProvider.class",
+            "-C", testClasses, "SimpleVirtualMachine.class",
+            "-C", testSrc,
+            serviceDir + "com.sun.tools.attach.spi.AttachProvider");
+    }
+
+    /**
+     * This is the actual test code that attaches to the running Application.
+     * This class is run in a separate process.
+     */
+    public static class TestMain {
+        public static void main(String args[]) throws Exception {
+            // deal with internal builds where classes are loaded from the
+            // 'classes' directory rather than rt.jar
+            ClassLoader cl = AttachProvider.class.getClassLoader();
+            if (cl != ClassLoader.getSystemClassLoader()) {
+                System.out.println("Attach API not loaded by system class loader - test skipped");
+                return;
+            }
+            VirtualMachine.attach("simple:1234").detach();
+        }
     }
 }
diff --git a/jdk/test/com/sun/tools/attach/ProviderTests.sh b/jdk/test/com/sun/tools/attach/ProviderTests.sh
deleted file mode 100644
index f5d6411..0000000
--- a/jdk/test/com/sun/tools/attach/ProviderTests.sh
+++ /dev/null
@@ -1,51 +0,0 @@
-#
-# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please 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 6173612
-# @summary AttachProvider unit tests
-#
-# @build ProviderTest SimpleProvider
-# @run shell ProviderTests.sh
-
-if [ "${TESTSRC}" = "" ]
-then
-  echo "TESTSRC not set.  Test cannot execute.  Failed."
-  exit 1
-fi
-
-. ${TESTSRC}/CommonSetup.sh
-
-echo "Creating JAR file ..."
-
-$JAR -cf ${TESTCLASSES}/SimpleProvider.jar \
-    -C ${TESTCLASSES} SimpleProvider.class \
-    -C ${TESTCLASSES} SimpleVirtualMachine.class \
-    -C "${TESTSRC}" META-INF/services/com.sun.tools.attach.spi.AttachProvider
-
-echo "Running test ..."
-
-$JAVA ${TESTVMOPTS} -classpath \
-  "${TESTCLASSES}${PS}${TESTCLASSES}/SimpleProvider.jar${PS}${TESTJAVA}/lib/tools.jar" \
-  ProviderTest
-
diff --git a/jdk/test/com/sun/tools/attach/RedefineAgent.java b/jdk/test/com/sun/tools/attach/RedefineAgent.java
index fc514b7..1650b35 100644
--- a/jdk/test/com/sun/tools/attach/RedefineAgent.java
+++ b/jdk/test/com/sun/tools/attach/RedefineAgent.java
@@ -43,15 +43,15 @@
 public class RedefineAgent implements ClassFileTransformer {
 
     static byte[] classfilebytes;
-    static final String targetName = "java.math.BigInteger";
-    static final String targetNameSlashes = "java/math/BigInteger";
+    static final String targetName = "RedefineDummy";
+    static final String targetNameSlashes = "RedefineDummy";
     static boolean gotRedefineTransform = false;
 
     // test transform and capture class bytes for redefine
     public byte[] transform(ClassLoader loader,
                             String className,
                             Class<?> classBeingRedefined,
-                            ProtectionDomain    protectionDomain,
+                            ProtectionDomain  protectionDomain,
                             byte[] classfileBuffer) {
         if (className.equals(targetNameSlashes)) {
             if (classBeingRedefined == null) {
diff --git a/jdk/test/com/sun/tools/attach/RedefineDummy.java b/jdk/test/com/sun/tools/attach/RedefineDummy.java
new file mode 100644
index 0000000..44204a5
--- /dev/null
+++ b/jdk/test/com/sun/tools/attach/RedefineDummy.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 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.
+ */
+
+/*
+ * Simple dummy class used to test class retransform.
+ */
+public class RedefineDummy {
+    public String toString() {
+        return "RedefineDummy";
+    }
+}
diff --git a/jdk/test/com/sun/tools/attach/RunnerUtil.java b/jdk/test/com/sun/tools/attach/RunnerUtil.java
new file mode 100644
index 0000000..0adbbbf
--- /dev/null
+++ b/jdk/test/com/sun/tools/attach/RunnerUtil.java
@@ -0,0 +1,180 @@
+/*
+ * Copyright (c) 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.
+ */
+
+import java.io.IOException;
+import java.io.File;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.Arrays;
+import java.util.regex.Pattern;
+import java.util.regex.Matcher;
+import jdk.testlibrary.OutputAnalyzer;
+import jdk.testlibrary.JDKToolLauncher;
+import jdk.testlibrary.ProcessTools;
+import jdk.testlibrary.Utils;
+import jdk.testlibrary.ProcessThread;
+
+/*
+ * Utility functions for test runners.
+ * (Test runner = class that launch a test)
+ */
+public class RunnerUtil {
+    /**
+     * The Application process must be run concurrently with our tests since
+     * the tests will attach to the Application.
+     * We will run the Application process in a separate thread.
+     *
+     * The Application must be started with flag "-Xshare:off" for the Retransform
+     * test in TestBasics to pass on all platforms.
+     *
+     * The Application will write its pid and shutdownPort in the given outFile.
+     */
+    public static ProcessThread startApplication(String outFile) throws Throwable {
+        String classpath = System.getProperty("test.class.path", ".");
+        String[] args = Utils.addTestJavaOpts(
+            "-Dattach.test=true", "-classpath", classpath, "Application", outFile);
+        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args);
+        ProcessThread pt = new ProcessThread("runApplication", pb);
+        pt.start();
+        return pt;
+    }
+
+    /**
+     * Will stop the running Application.
+     * First tries to shutdown nicely by connecting to the shut down port.
+     * If that fails, the process will be killed hard with stopProcess().
+     *
+     * If the nice shutdown fails, then an Exception is thrown and the test should fail.
+     *
+     * @param port The shut down port.
+     * @param processThread The process to stop.
+     */
+    public static void stopApplication(int port, ProcessThread processThread) throws Throwable {
+        if (processThread == null) {
+            System.out.println("RunnerUtil.stopApplication ignored since proc is null");
+            return;
+        }
+        try {
+            System.out.println("RunnerUtil.stopApplication waiting to for shutdown");
+            OutputAnalyzer output = ProcessTools.executeTestJvm(
+                    "-classpath",
+                    System.getProperty("test.class.path", "."),
+                    "Shutdown",
+                    Integer.toString(port));
+            // Verify that both the Shutdown command and the Application finished ok.
+            output.shouldHaveExitValue(0);
+            processThread.joinAndThrow();
+            processThread.getOutput().shouldHaveExitValue(0);
+        } catch (Throwable t) {
+            System.out.println("RunnerUtil.stopApplication failed. Will kill it hard: " + t);
+            processThread.stopProcess();
+            throw t;
+        }
+    }
+
+    /**
+     * Creates a jar file.
+     * @param args Command to the jar tool.
+     */
+    public static void createJar(String... args) {
+        System.out.println("Running: jar " + Arrays.toString(args));
+        sun.tools.jar.Main jar = new sun.tools.jar.Main(System.out, System.err, "jar");
+        if (!jar.run(args)) {
+            throw new RuntimeException("jar failed: args=" + Arrays.toString(args));
+        }
+    }
+
+    /**
+     * Read process info for the running Application.
+     * The Application writes its info to a file with this format:
+     * shutdownPort=42994
+     * pid=19597
+     * done
+     *
+     * The final "done" is used to make sure the complete file has been written
+     * before we try to read it.
+     * This function will wait until the file is available.
+     *
+     * @param filename Path to file to read.
+     * @return The ProcessInfo containing pid and shutdownPort.
+     */
+    public static ProcessInfo readProcessInfo(String filename) throws Throwable {
+        System.out.println("Reading port and pid from file: " + filename);
+        File file = new File(filename);
+        String content = null;
+
+        // Read file or wait for it to be created.
+        while (true) {
+            content = readFile(file);
+            if (content != null && content.indexOf("done") >= 0) {
+                break;
+            }
+            Thread.sleep(100);
+        }
+
+        ProcessInfo info = new ProcessInfo();
+        // search for a line with format: key=nnn
+        Pattern pattern = Pattern.compile("(\\w*)=([0-9]+)\\r?\\n");
+        Matcher matcher = pattern.matcher(content);
+        while (matcher.find()) {
+            String key = matcher.group(1);
+            int value  = Integer.parseInt(matcher.group(2));
+            if ("pid".equals(key)) {
+                info.pid = value;
+            } else if ("shutdownPort".equals(key)) {
+                info.shutdownPort = value;
+            }
+        }
+        System.out.println("processInfo.pid:" + info.pid);
+        System.out.println("processInfo.shutdownPort:" + info.shutdownPort);
+        return info;
+    }
+
+    /**
+     * Read the content of a file.
+     * @param file The file to read.
+     * @return The file content or null if file does not exists.
+     */
+    public static String readFile(File file) throws IOException {
+        if (!file.exists()) {
+            return null;
+        }
+        try {
+            byte[] bytes = Files.readAllBytes(file.toPath());
+            String content = new String(bytes);
+            return content;
+        } catch (IOException e) {
+            e.printStackTrace();
+            throw e;
+        }
+    }
+
+    /**
+     * Helper class with info of the running Application.
+     */
+    public static class ProcessInfo {
+        public int pid = -1;
+        public int shutdownPort = -1;
+    }
+
+}
diff --git a/jdk/test/java/awt/Choice/ChoiceMouseWheelTest/ChoiceMouseWheelTest.java b/jdk/test/java/awt/Choice/ChoiceMouseWheelTest/ChoiceMouseWheelTest.java
index e545b08..a63e6c1 100644
--- a/jdk/test/java/awt/Choice/ChoiceMouseWheelTest/ChoiceMouseWheelTest.java
+++ b/jdk/test/java/awt/Choice/ChoiceMouseWheelTest/ChoiceMouseWheelTest.java
@@ -25,7 +25,9 @@
   @test
   @bug 7050935
   @summary closed/java/awt/Choice/WheelEventsConsumed/WheelEventsConsumed.html fails on win32
+  @library ../../regtesthelpers
   @author Oleg Pekhovskiy: area=awt-choice
+  @build Util
   @run main ChoiceMouseWheelTest
 */
 
@@ -142,8 +144,7 @@
                 throw new RuntimeException("Mouse Wheel scroll position error!");
             }
 
-            System.exit(0);
-
+            dispose();
         } catch (AWTException e) {
             throw new RuntimeException("AWTException occurred - problem creating robot!");
         }
diff --git a/jdk/test/java/awt/FileDialog/FileDialogForDirectories/FileDialogForDirectories.html b/jdk/test/java/awt/FileDialog/FileDialogForDirectories/FileDialogForDirectories.html
new file mode 100644
index 0000000..f217944
--- /dev/null
+++ b/jdk/test/java/awt/FileDialog/FileDialogForDirectories/FileDialogForDirectories.html
@@ -0,0 +1,45 @@
+<!--
+ Copyright (c) 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.
+-->
+
+<html>
+<!--
+  @test
+  @bug 7161437
+  @summary We should support "apple.awt.fileDialogForDirectories" property.
+  @author Sergey Bylokhov area=awt.filedialog
+  @library ../../regtesthelpers
+  @build Sysout
+  @run applet/manual=yesno FileDialogForDirectories.html
+  -->
+<head>
+    <title> FileDialogForDirectories </title>
+</head>
+<body>
+
+<h1>FileDialogForDirectories<br>Bug ID: 7161437</h1>
+
+<p> See the dialog box (usually in upper left corner) for instructions</p>
+
+<APPLET CODE="FileDialogForDirectories.class" WIDTH=200 HEIGHT=200></APPLET>
+</body>
+</html>
diff --git a/jdk/test/java/awt/FileDialog/FileDialogForDirectories/FileDialogForDirectories.java b/jdk/test/java/awt/FileDialog/FileDialogForDirectories/FileDialogForDirectories.java
new file mode 100644
index 0000000..71dcaea
--- /dev/null
+++ b/jdk/test/java/awt/FileDialog/FileDialogForDirectories/FileDialogForDirectories.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 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.
+ */
+
+
+import sun.awt.OSInfo;
+import test.java.awt.regtesthelpers.Sysout;
+
+import java.applet.Applet;
+import java.awt.Button;
+import java.awt.FileDialog;
+import java.awt.Frame;
+import java.awt.GridLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+public class FileDialogForDirectories extends Applet implements ActionListener {
+    private volatile Button showBtn;
+    private volatile FileDialog fd;
+
+    @Override
+    public void init() {
+        if (OSInfo.getOSType() != OSInfo.OSType.MACOSX) {
+            Sysout.createDialogWithInstructions(new String[]{
+                    "Press PASS, this test is for MacOS X only."});
+            return;
+        }
+
+        System.setProperty("apple.awt.fileDialogForDirectories", "true");
+
+        setLayout(new GridLayout(1, 1));
+
+        fd = new FileDialog(new Frame(), "Open");
+
+        showBtn = new Button("Show File Dialog");
+        showBtn.addActionListener(this);
+        add(showBtn);
+        String[] instructions = {
+                "1) Click on 'Show File Dialog' button. A file dialog will come up.",
+                "2) Check that files can't be selected.",
+                "3) Check that directories can be selected.",
+                "4) Repeat steps 1 - 3 a few times for different files and directories.",
+                "5) If it's true then the test passed, otherwise it failed."};
+        Sysout.createDialogWithInstructions(instructions);
+    }//End  init()
+
+    @Override
+    public void start() {
+        setSize(200, 200);
+        show();
+    }// start()
+
+    @Override
+    public void actionPerformed(ActionEvent e) {
+        if (e.getSource() == showBtn) {
+            fd.setVisible(true);
+            String output = fd.getFile();
+            if (output != null) {
+                Sysout.println(output + " is selected");
+            }
+        }
+    }
+}// class ManualYesNoTest
diff --git a/jdk/test/java/awt/Mouse/MouseModifiersUnitTest/MouseModifiersUnitTest_Extra.java b/jdk/test/java/awt/Mouse/MouseModifiersUnitTest/MouseModifiersUnitTest_Extra.java
index 1ef1474..b5d59d0 100644
--- a/jdk/test/java/awt/Mouse/MouseModifiersUnitTest/MouseModifiersUnitTest_Extra.java
+++ b/jdk/test/java/awt/Mouse/MouseModifiersUnitTest/MouseModifiersUnitTest_Extra.java
@@ -29,6 +29,8 @@
   @run main MouseModifiersUnitTest_Extra
  */
 
+import sun.awt.OSInfo;
+
 import java.awt.*;
 import java.awt.event.*;
 import java.util.Arrays;
@@ -61,6 +63,17 @@
     static int [] modifiersExStandardCTRL;
     static int [] modifiersExStandardALT;
 
+    private final static String SHIFT_MODIFIER = OSInfo.getOSType().equals(OSInfo.OSType.MACOSX) ?
+                                                "\u21e7" : "Shift";
+
+    private final static String ALT_MODIFIER = OSInfo.getOSType().equals(OSInfo.OSType.MACOSX) ?
+                                                "\u2325" : "Alt";
+
+
+    private final static String CTRL_MODIFIER = OSInfo.getOSType().equals(OSInfo.OSType.MACOSX) ?
+                                                "\u2303" : "Ctrl";
+
+
     // BUTTON1, 2, 3 press-release.
     final static int  modifiersStandard = 0; //InputEvent.BUTTON_DOWN_MASK;
 
@@ -77,7 +90,8 @@
 
         if (modifiersEx != curStandardExModifiers[index]){
 //            System.out.println(">>>>>>>>>>>>>>> Pressed. modifiersEx "+modifiersEx +" : "+!= curStandardExModifiers");
-            MessageLogger.reportError("Test failed :  Pressed. modifiersEx != curStandardExModifiers. Got: " + modifiersEx + " , Expected: " + curStandardExModifiers[index]);
+            MessageLogger.reportError("Test failed :  Pressed. modifiersEx != curStandardExModifiers. Got: "
+                    + modifiersEx + " , Expected: " + curStandardExModifiers[index]);
         }
 
      //check event.paramString() output
@@ -88,51 +102,54 @@
         checkExtModifiersOnPress(testModifier, paramStringElements, button);
     }
 
-    public static void checkExtModifiersOnReleaseClick(int testModifier, HashMap h, int button){
+    public static void checkExtModifiersOnReleaseClick(int testModifier, HashMap<String, String> h, int button){
         String ethalon = "";
         switch (testModifier){
             case SHIFT:{
-                ethalon = "Shift";
+                ethalon = SHIFT_MODIFIER;
                 break;
             }
             case ALT:{
-                ethalon = "Alt";
+                ethalon = ALT_MODIFIER;
                 break;
             }
             case CTRL:{
-                ethalon = "Ctrl";
+                ethalon = CTRL_MODIFIER;
                 break;
             }
         }
-        //
+
         if (h.get("extModifiers") == null){
             h.put("extModifiers", "");
         }
+
         if (!ethalon.equals(h.get("extModifiers"))) {
-            MessageLogger.reportError("Test failed :  Released/Clicked. extModifiers = " +h.get("extModifiers")+" instead of : "+ethalon);
+            MessageLogger.reportError("Test failed :  Released/Clicked. extModifiers = "
+                    + h.get("extModifiers") + " instead of : " + ethalon);
         }
     }
 
-    public static void checkExtModifiersOnPress(int testModifier, HashMap h, int button){
+    public static void checkExtModifiersOnPress(int testModifier, HashMap<String, String> h, int button){
         String ethalon = "";
         switch (testModifier){
             case SHIFT:{
-                ethalon = "Shift+";
+                ethalon = SHIFT_MODIFIER + "+";
                 break;
             }
             case ALT:{
-                ethalon = "Alt+";
+                ethalon = ALT_MODIFIER + "+";
                 break;
             }
             case CTRL:{
-                ethalon = "Ctrl+";
+                ethalon = CTRL_MODIFIER + "+";
                 break;
             }
         }
         ethalon = ethalon + "Button" +button;
 
         if (!h.get("extModifiers").equals(ethalon)) {
-            MessageLogger.reportError("Test failed :  Pressed. extModifiers = " +h.get("extModifiers")+" instead of : "+ethalon);
+            MessageLogger.reportError("Test failed :  Pressed. extModifiers = " +h.get("extModifiers")+" instead of : "
+                    + ethalon);
         }
     }
 
@@ -152,7 +169,7 @@
         }
     }
     public static HashMap<String, String> tokenizeParamString(String param){
-        HashMap <String, String> params = new HashMap<String, String>();
+        HashMap <String, String> params = new HashMap<>();
         StringTokenizer st = new StringTokenizer(param, ",=");
         while (st.hasMoreTokens()){
             String tmp = st.nextToken();
@@ -167,7 +184,7 @@
     }
 
     public static Vector<String> tokenizeModifiers(String modifierList){
-        Vector<String> modifiers = new Vector<String>();
+        Vector<String> modifiers = new Vector<>();
         StringTokenizer st = new StringTokenizer(modifierList, "+");
         while (st.hasMoreTokens()){
             String tmp = st.nextToken();
@@ -189,7 +206,8 @@
         }
 
         if (modifiersEx != curStandardExModifiers[index]){
-            MessageLogger.reportError("Test failed :  Released. modifiersEx != curStandardExModifiers. Got: " + modifiersEx + " , Expected: " + curStandardExModifiers[index]);
+            MessageLogger.reportError("Test failed :  Released. modifiersEx != curStandardExModifiers. Got: "
+                    + modifiersEx + " , Expected: " + curStandardExModifiers[index]);
         }
 
      //check event.paramString() output
@@ -212,7 +230,8 @@
         }
 
         if (modifiersEx != curStandardExModifiers[index]){
-            MessageLogger.reportError("Test failed :  Clicked. modifiersEx != curStandardExModifiers. Got: " + modifiersEx + " , Expected: " + curStandardExModifiers[index]);
+            MessageLogger.reportError("Test failed :  Clicked. modifiersEx != curStandardExModifiers. Got: "
+                    + modifiersEx + " , Expected: " + curStandardExModifiers[index]);
         }
 
      //check event.paramString() output
@@ -243,22 +262,10 @@
     static Robot robot;
     public void init() {
         this.setLayout(new BorderLayout());
-
-        String[] instructions =
-        {
-            "This test should be used with the mouse having more then three buttons.",
-            "Currently, " + MouseInfo.getNumberOfButtons() +" buttons are available.",
-            "If there are less then three buttons, press PASS.",
-            "1. Press each extra mouse button.",
-            "2. For each mouse event its modifiers and ExModifiers will be printed.",
-            "3. Verify that they are correct.",
-            "4. Press Pass or Fail accordingly."
-        };
-//        Sysout.createDialogWithInstructions( instructions );
-
-//        addMouseListener(adapterTest1);
         try {
             robot  = new Robot();
+            robot.setAutoDelay(100);
+            robot.setAutoWaitForIdle(true);
         } catch (Exception e) {
             MessageLogger.reportError("Test failed. "+e);
         }
@@ -297,9 +304,8 @@
         robot.delay(1000);
         robot.mouseMove(getLocationOnScreen().x + getWidth()/2, getLocationOnScreen().y + getHeight()/2);
         for (int i = 3; i< mouseButtonDownMasks.length; i++){
-            System.out.println("testNONE() => " +mouseButtonDownMasks[i] );
+            System.out.println("testNONE() => " + mouseButtonDownMasks[i]);
             robot.mousePress(mouseButtonDownMasks[i]);
-            robot.delay(100);
             robot.mouseRelease(mouseButtonDownMasks[i]);
         }
         robot.delay(1000);
@@ -312,9 +318,8 @@
         robot.mouseMove(getLocationOnScreen().x + getWidth()/2, getLocationOnScreen().y + getHeight()/2);
         for (int i = 3; i< mouseButtonDownMasks.length; i++){
             robot.keyPress(KeyEvent.VK_SHIFT);
-            System.out.println("testSHIFT() => " +mouseButtonDownMasks[i] );
+            System.out.println("testSHIFT() => " + mouseButtonDownMasks[i]);
             robot.mousePress(mouseButtonDownMasks[i]);
-            robot.delay(100);
             robot.mouseRelease(mouseButtonDownMasks[i]);
             robot.keyRelease(KeyEvent.VK_SHIFT);
         }
@@ -328,9 +333,8 @@
         robot.mouseMove(getLocationOnScreen().x + getWidth()/2, getLocationOnScreen().y + getHeight()/2);
         for (int i = 3; i< mouseButtonDownMasks.length; i++){
             robot.keyPress(KeyEvent.VK_CONTROL);
-            System.out.println("testCTRL() => " +mouseButtonDownMasks[i] );
+            System.out.println("testCTRL() => " + mouseButtonDownMasks[i]);
             robot.mousePress(mouseButtonDownMasks[i]);
-            robot.delay(100);
             robot.mouseRelease(mouseButtonDownMasks[i]);
             robot.keyRelease(KeyEvent.VK_CONTROL);
         }
@@ -344,9 +348,8 @@
         robot.mouseMove(getLocationOnScreen().x + getWidth()/2, getLocationOnScreen().y + getHeight()/2);
         for (int i = 3; i< mouseButtonDownMasks.length; i++){
             robot.keyPress(KeyEvent.VK_ALT);
-            System.out.println("testALT() => " +mouseButtonDownMasks[i] );
+            System.out.println("testALT() => " + mouseButtonDownMasks[i]);
             robot.mousePress(mouseButtonDownMasks[i]);
-            robot.delay(100);
             robot.mouseRelease(mouseButtonDownMasks[i]);
             robot.keyRelease(KeyEvent.VK_ALT);
         }
diff --git a/jdk/test/java/awt/MouseInfo/JContainerMousePositionTest.java b/jdk/test/java/awt/MouseInfo/JContainerMousePositionTest.java
new file mode 100644
index 0000000..028d2e1
--- /dev/null
+++ b/jdk/test/java/awt/MouseInfo/JContainerMousePositionTest.java
@@ -0,0 +1,148 @@
+/*
+ * Copyright (c) 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.
+ */
+
+/*
+  @test
+  @summary unit test for a new method in Container class: getMousePosition(boolean)
+  @author dav@sparc.spb.su: area=
+  @bug 4009555
+  @run main JContainerMousePositionTest
+*/
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.concurrent.atomic.AtomicReference;
+
+// this test looks at mouse pointer when it
+// 1 over component
+// 2 over Container, but not over one of its child Components.
+// out of bounds of Container
+// two values of paramater allowChildren are considered.
+
+public class JContainerMousePositionTest {
+    //Declare things used in the test, like buttons and labels here
+    private static JButton jButton1;
+    private static JButton jButton4;
+    private static JFrame frame1;
+    private static Container contentPane;
+
+    public static void main(final String[] args) throws Exception {
+        Robot robot = new Robot();
+        robot.setAutoDelay(200);
+        robot.setAutoWaitForIdle(true);
+
+        SwingUtilities.invokeAndWait(JContainerMousePositionTest::init);
+
+        robot.delay(500);
+        robot.waitForIdle();
+
+        AtomicReference<Point> centerC4 = new AtomicReference<>();
+        SwingUtilities.invokeAndWait(() -> {
+            centerC4.set(jButton4.getLocation());
+            contentPane.remove(jButton4);
+            contentPane.validate();
+            contentPane.repaint();
+        });
+        robot.waitForIdle();
+
+        AtomicReference<Rectangle> frameBounds = new AtomicReference<>();
+        AtomicReference<Dimension> button1Size = new AtomicReference<>();
+        SwingUtilities.invokeAndWait(() -> {
+            frameBounds.set(frame1.getBounds());
+            button1Size.set(jButton1.getSize());
+        });
+
+//point mouse to center of top-left Component (button1)
+        robot.mouseMove(frameBounds.get().x + button1Size.get().width / 2,
+                        frameBounds.get().y + button1Size.get().height / 2);
+
+        AtomicReference<Point> pFalse = new AtomicReference<>();
+        AtomicReference<Point> pTrue = new AtomicReference<>();
+        SwingUtilities.invokeAndWait(() -> {
+            pFalse.set(frame1.getMousePosition(false));
+            pTrue.set(frame1.getMousePosition(true));
+        });
+        robot.waitForIdle();
+        if (pFalse.get() != null) {
+            throw new RuntimeException("Test failed: Container.getMousePosition(false) returned non-null over one of children.");
+        }
+        System.out.println("Test stage completed: Container.getMousePosition(false) returned null result over child Component. Passed.");
+
+        if (pTrue.get() == null) {
+            throw new RuntimeException("Test failed: Container.getMousePosition(true) returned null result over child Component");
+        }
+        System.out.println("Test stage compelted: Container.getMousePosition(true) returned non-null result over child Component. Passed.");
+
+//point mouse out from Container's area
+        robot.mouseMove(frameBounds.get().x + frameBounds.get().width + 10,
+                        frameBounds.get().y + frameBounds.get().height + 10);
+        SwingUtilities.invokeAndWait(() -> {
+            pFalse.set(frame1.getMousePosition(false));
+            pTrue.set(frame1.getMousePosition(true));
+        });
+        robot.waitForIdle();
+        if (pFalse.get() != null || pTrue.get() != null) {
+            throw new RuntimeException("Test failed: Container.getMousePosition(boolean) returned incorrect result outside Container");
+        }
+        System.out.println("Test stage completed: Container.getMousePosition(boolean) returned null result outside Container. Passed.");
+
+//point mouse in place free from child components (right-botton component)
+        robot.mouseMove(frameBounds.get().x + centerC4.get().x,
+                        frameBounds.get().y + centerC4.get().y);
+
+        robot.delay(3000);
+        SwingUtilities.invokeAndWait(() -> {
+            pFalse.set(contentPane.getMousePosition(false));
+            pTrue.set(frame1.getMousePosition(true));
+        });
+        robot.waitForIdle();
+
+        if (pFalse.get() == null || pTrue.get() == null) {
+            throw new RuntimeException("Test failed: Container.getMousePosition(boolean) returned null result inside Container.");
+        }
+        System.out.println("Test stage completed: Container.getMousePosition(boolean) returned non-null results  inside Container. Passed.");
+
+        if (pTrue.get().x != centerC4.get().x || pTrue.get().y != centerC4.get().y) {
+            throw new RuntimeException("Test failed: Container.getMousePosition(true) returned incorrect result inside Container.");
+        }
+        System.out.println("Test stage completed: Container.getMousePosition(true) returned correct result inside Container. Passed.");
+
+        System.out.println("TEST PASSED");
+    }
+
+    private static void init() {
+        frame1 = new JFrame("Testing getMousePosition() on LWs");
+        jButton1 = new JButton("C1");
+        jButton4 = new JButton("C4");
+        contentPane = frame1.getContentPane();
+        contentPane.setLayout(new GridLayout(2, 2, 25, 25));
+        contentPane.add(jButton1);
+        contentPane.add(new JButton("C2"));
+        contentPane.add(new JButton("C3"));
+        contentPane.add(jButton4);
+        frame1.setSize(200, 200);
+        frame1.setVisible(true);
+    }
+}
+
+
diff --git a/jdk/test/java/awt/datatransfer/HTMLDataFlavors/ManualHTMLDataFlavorTest.java b/jdk/test/java/awt/datatransfer/HTMLDataFlavors/ManualHTMLDataFlavorTest.java
index 156bbe4..015d46f 100644
--- a/jdk/test/java/awt/datatransfer/HTMLDataFlavors/ManualHTMLDataFlavorTest.java
+++ b/jdk/test/java/awt/datatransfer/HTMLDataFlavors/ManualHTMLDataFlavorTest.java
@@ -96,9 +96,7 @@
                 Sysout.println(t.getTransferData(DataFlavor.fragmentHtmlFlavor).toString());
                 Sysout.println("SELECTION:");
                 Sysout.println(t.getTransferData(DataFlavor.selectionHtmlFlavor).toString());
-            } catch (UnsupportedFlavorException e) {
-                e.printStackTrace();
-            } catch (IOException e) {
+            } catch (UnsupportedFlavorException | IOException e) {
                 e.printStackTrace();
             }
 
@@ -116,6 +114,7 @@
                 "   otherwise for instance iexplore can prohibit drag and drop from",
                 "   the browser to other applications because of",
                 "   the protected mode restrictions.",
+                "   On Mac OS X do NOT use Safari, it does not provide the needed DataFlavor",
                 "3) Check the data in the output area of this dialog",
                 "5) The output should not contain information that any of",
                 "   flavors is not present in the system clipboard",
diff --git a/jdk/test/java/awt/event/MouseEvent/DisabledComponents/DisabledComponentsTest.java b/jdk/test/java/awt/event/MouseEvent/DisabledComponents/DisabledComponentsTest.java
new file mode 100644
index 0000000..3da25c6
--- /dev/null
+++ b/jdk/test/java/awt/event/MouseEvent/DisabledComponents/DisabledComponentsTest.java
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 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.
+ */
+
+/*
+  @test
+  @bug 4173714
+  @summary java.awt.button behaves differently under Win32/Solaris
+  @author tdv@sparc.spb.su
+  @library ../../../regtesthelpers
+  @build Util
+  @run main DisabledComponentsTest
+*/
+
+/**
+ * DisabledComponentsTest.java
+ *
+ * summary: java.awt.button behaves differently under Win32/Solaris
+ * Disabled component should not receive events. This is what this
+ * test checks out.
+ */
+
+import java.awt.*;
+import java.awt.event.*;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import test.java.awt.regtesthelpers.Util;
+
+import javax.swing.*;
+
+public class DisabledComponentsTest {
+
+    private static Frame frame;
+    private static Button b = new Button("Button");
+    private static final AtomicBoolean pressed = new AtomicBoolean(false);
+    private static final AtomicBoolean entered = new AtomicBoolean(false);
+
+    private static void init() {
+        frame = new Frame("Test");
+        frame.setBounds(100, 100, 100, 100);
+        b = new Button("Test");
+        b.setEnabled(false);
+        b.addMouseListener(new MouseAdapter() {
+            public void mousePressed(MouseEvent e) {
+                System.err.println("Mouse pressed. target=" + e.getSource());
+                if (!b.isEnabled()) {
+                    System.err.println("TEST FAILED: BUTTON RECEIVED AN EVENT WHEN DISABLED!");
+                    pressed.set(true);
+                }
+            }
+            public void mouseEntered(MouseEvent e) {
+                System.out.println("Mouse entered. target=" + e.getSource());
+                if (!b.isEnabled())
+                    System.err.println("TEST FAILED: BUTTON RECEIVED AN EVENT WHEN DISABLED!");
+                entered.set(true);
+            }
+        });
+        frame.add(b);
+        frame.setVisible(true);
+    }
+
+    public static void main(String[] args) throws Exception {
+        try {
+            Robot r = Util.createRobot();
+            r.setAutoDelay(200);
+            r.setAutoWaitForIdle(true);
+            r.mouseMove(0, 0);
+            SwingUtilities.invokeAndWait(DisabledComponentsTest::init);
+            Util.waitForIdle(r);
+            Util.pointOnComp(b, r);
+            if (entered.get()) {
+                throw new RuntimeException("TEST FAILED: disabled button received MouseEntered event");
+            }
+            Util.clickOnComp(b, r);
+            if (pressed.get()) {
+                throw new RuntimeException("TEST FAILED: disabled button received MousePressed event");
+            }
+        } finally {
+            if (frame != null) {
+                frame.dispose();
+            }
+        }
+    }
+}
diff --git a/jdk/test/java/awt/event/MouseEvent/EnterAsGrabbedEvent/EnterAsGrabbedEvent.java b/jdk/test/java/awt/event/MouseEvent/EnterAsGrabbedEvent/EnterAsGrabbedEvent.java
new file mode 100644
index 0000000..8f62e4f
--- /dev/null
+++ b/jdk/test/java/awt/event/MouseEvent/EnterAsGrabbedEvent/EnterAsGrabbedEvent.java
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 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.
+ */
+
+/*
+  @test
+  @bug 6317481 8012325
+  @summary REG:Pressing the mouse, dragging and releasing it outside the button triggers ActionEvent, XAWT
+  @author Dmitry.Cherepanov@SUN.COM area=awt.event
+  @run main EnterAsGrabbedEvent
+*/
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.*;
+
+public class EnterAsGrabbedEvent
+{
+    //Declare things used in the test, like buttons and labels here
+    private static Frame frame;
+    private static Button button;
+    private static volatile boolean enterTriggered = false;
+    private static volatile boolean actionTriggered = false;
+
+    private static void init()
+    {
+        frame = new Frame();
+        frame.setLayout(new FlowLayout());
+        button = new Button("button");
+        button.addActionListener(actionEvent -> {
+            actionTriggered = true;
+        });
+        frame.add(button);
+        frame.setBounds(100, 100, 200, 200);
+        frame.setVisible(true);
+        frame.validate();
+      }
+
+    public static void main(String[] args) throws Exception {
+        try {
+            Robot r = new Robot();
+            r.setAutoDelay(200);
+            r.setAutoWaitForIdle(true);
+            SwingUtilities.invokeAndWait(EnterAsGrabbedEvent::init);
+            r.waitForIdle();
+
+            Point loc = button.getLocationOnScreen();
+            r.mouseMove(loc.x+button.getWidth()/2, loc.y+button.getHeight()/2);
+            r.mousePress(InputEvent.BUTTON1_MASK);
+
+            // in this case (drag mouse outside the button):
+            // NotifyEnter (->MouseEnter) should be dispatched to the top-level
+            // event if the grabbed window is the component (button)
+            frame.addMouseListener(
+                    new MouseAdapter() {
+                        public void mouseEntered(MouseEvent me) {
+                            System.out.println(me);
+                            enterTriggered = true;
+                        }
+
+                        // Just for tracing
+                        public void mouseExited(MouseEvent me) {
+                            System.out.println(me);
+                        }
+                    });
+
+            // Just for tracing
+            button.addMouseListener(
+                    new MouseAdapter(){
+                        public void mouseEntered(MouseEvent me){
+                            System.out.println(me);
+                        }
+                        public void mouseExited(MouseEvent me){
+                            System.out.println(me);
+                        }
+                    });
+
+            r.mouseMove(loc.x+button.getWidth() + 1, loc.y+button.getHeight()/2);
+
+            r.mouseRelease(InputEvent.BUTTON1_MASK);
+
+            if (!enterTriggered) {
+                throw new RuntimeException("Test failed. MouseEntered was not triggered");
+            }
+
+            if (actionTriggered) {
+                throw new RuntimeException("Test failed. ActionEvent triggered");
+            }
+        } finally {
+            if (frame != null) {
+                frame.dispose();
+            }
+        }
+    }
+}
diff --git a/jdk/test/java/awt/print/PrinterJob/PrintGlyphVectorTest.java b/jdk/test/java/awt/print/PrinterJob/PrintGlyphVectorTest.java
new file mode 100644
index 0000000..12a7dca
--- /dev/null
+++ b/jdk/test/java/awt/print/PrinterJob/PrintGlyphVectorTest.java
@@ -0,0 +1,150 @@
+/*
+ * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please 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 8029204
+ * @summary Tests GlyphVector is printed in the correct location
+ * @run main/manual=yesno PrintGlyphVectorTest
+ */
+
+import java.io.*;
+import java.awt.*;
+import java.awt.event.*;
+import java.awt.font.*;
+import java.awt.geom.*;
+import java.awt.print.*;
+
+public class PrintGlyphVectorTest extends Component implements Printable {
+
+    public void drawGVs(Graphics g) {
+
+        String testString = "0123456789abcdefghijklm";
+        Graphics2D g2d = (Graphics2D)g;
+        g2d.setColor(Color.black);
+        Font font = new Font("SansSerif", Font.PLAIN, 30);
+        FontRenderContext frc = g2d.getFontRenderContext();
+        GlyphVector v = font.createGlyphVector(frc, testString);
+
+
+        float x = 50f,
+              y = 50f;
+
+        g2d.drawGlyphVector(v, x, y);
+        Rectangle2D r = v.getVisualBounds();
+        r.setRect(r.getX()+x, r.getY()+y, r.getWidth(), r.getHeight());
+        g2d.draw(r);
+
+        Point2D p; // .Float p = new Point2D.Float();
+        for (int i = 0; i < v.getNumGlyphs(); i++) {
+            p = v.getGlyphPosition(i);
+            p.setLocation(p.getX()+50, p.getY());
+            v.setGlyphPosition(i, p);
+        }
+
+        x = 0;
+        y+= 50;
+
+        g2d.drawGlyphVector(v, x, y);
+        r = v.getVisualBounds();
+        r.setRect(r.getX()+x, r.getY()+y, r.getWidth(), r.getHeight());
+        g2d.draw(r);
+
+
+
+    }
+
+     public void paint(Graphics g) {
+       g.setColor(Color.white);
+       g.fillRect(0,0,getSize().width, getSize().height);
+       drawGVs(g);
+     }
+
+    public Dimension getPreferredSize() {
+        return new Dimension(600,200);
+    }
+
+    public int print(Graphics g, PageFormat pf, int pageIndex) {
+
+        if (pageIndex > 0) {
+            return Printable.NO_SUCH_PAGE;
+        }
+
+        Graphics2D g2d = (Graphics2D)g;
+        g2d.translate(pf.getImageableX(), pf.getImageableY());
+        drawGVs(g2d);
+
+        return Printable.PAGE_EXISTS;
+    }
+
+
+    public static void main(String arg[]) throws Exception {
+
+       Frame f = new Frame();
+       PrintGlyphVectorTest pvt = new PrintGlyphVectorTest();
+       f.add("Center", pvt);
+       f.add("South", new PrintInstructions());
+       f.pack();
+       f.show();
+
+
+    }
+}
+
+class PrintInstructions extends Panel implements ActionListener {
+
+   static final String INSTRUCTIONS =
+       "You must have a printer installed for this test.\n" +
+       "Press the PRINT button below and OK the print dialog\n" +
+       "Retrieve the output and compare the printed and on-screen text\n" +
+       " to confirm that in both cases the text is aligned and the boxes\n" +
+       "are around the text, not offset from the text.";
+
+  PrintInstructions() {
+
+     setLayout(new GridLayout(2,1));
+     TextArea t = new TextArea(INSTRUCTIONS, 8, 80);
+     add(t);
+     Button b = new Button("PRINT");
+     b.setFont(new Font("Dialog", Font.BOLD, 30));
+     b.addActionListener(this);
+     add(b);
+  }
+
+  public void actionPerformed(ActionEvent e) {
+       PrinterJob pj = PrinterJob.getPrinterJob();
+       if (pj == null ||
+           pj.getPrintService() == null ||
+           !pj.printDialog()) {
+           return;
+       }
+
+       pj.setPrintable(new PrintGlyphVectorTest());
+       try {
+           pj.print();
+       } catch (PrinterException ex) {
+           System.err.println(ex);
+       }
+  }
+
+}
diff --git a/jdk/test/java/io/BufferedReader/Lines.java b/jdk/test/java/io/BufferedReader/Lines.java
index 2e83e1a..2e35f75 100644
--- a/jdk/test/java/io/BufferedReader/Lines.java
+++ b/jdk/test/java/io/BufferedReader/Lines.java
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8003258
+ * @bug 8003258 8029434
  * @run testng Lines
  */
 
@@ -38,6 +38,7 @@
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.NoSuchElementException;
+import java.util.Spliterator;
 import java.util.stream.Stream;
 import java.util.concurrent.atomic.AtomicInteger;
 import org.testng.annotations.Test;
@@ -281,4 +282,15 @@
         // Read after EOL
         assertFalse(it.hasNext());
     }
+
+    public void testCharacteristics() {
+        try (BufferedReader br = new BufferedReader(
+                                    new StringReader(""))) {
+            Spliterator<String> instance = br.lines().spliterator();
+            assertTrue(instance.hasCharacteristics(Spliterator.NONNULL));
+            assertTrue(instance.hasCharacteristics(Spliterator.ORDERED));
+        } catch (IOException ioe) {
+            fail("Should not have any exception.");
+        }
+    }
 }
diff --git a/jdk/test/java/lang/ProcessBuilder/Basic.java b/jdk/test/java/lang/ProcessBuilder/Basic.java
index 4434e9b..ff4c374 100644
--- a/jdk/test/java/lang/ProcessBuilder/Basic.java
+++ b/jdk/test/java/lang/ProcessBuilder/Basic.java
@@ -2239,24 +2239,33 @@
             childArgs.add("sleep");
             final Process p = new ProcessBuilder(childArgs).start();
             final long start = System.nanoTime();
-            final CountDownLatch latch = new CountDownLatch(1);
+            final CountDownLatch ready = new CountDownLatch(1);
+            final CountDownLatch done = new CountDownLatch(1);
 
             final Thread thread = new Thread() {
                 public void run() {
                     try {
+                        final boolean result;
                         try {
-                            latch.countDown();
-                            p.waitFor(30000, TimeUnit.MILLISECONDS);
+                            ready.countDown();
+                            result = p.waitFor(30000, TimeUnit.MILLISECONDS);
                         } catch (InterruptedException e) {
                             return;
                         }
-                        fail("waitFor() wasn't interrupted");
-                    } catch (Throwable t) { unexpected(t); }}};
+                        fail("waitFor() wasn't interrupted, its return value was: " + result);
+                    } catch (Throwable t) {
+                        unexpected(t);
+                    } finally {
+                        done.countDown();
+                    }
+                }
+            };
 
             thread.start();
-            latch.await();
+            ready.await();
             Thread.sleep(1000);
             thread.interrupt();
+            done.await();
             p.destroy();
         } catch (Throwable t) { unexpected(t); }
 
diff --git a/jdk/test/java/lang/management/GarbageCollectorMXBean/GcInfoCompositeType.java b/jdk/test/java/lang/management/GarbageCollectorMXBean/GcInfoCompositeType.java
index 73488d9..0c4a480 100644
--- a/jdk/test/java/lang/management/GarbageCollectorMXBean/GcInfoCompositeType.java
+++ b/jdk/test/java/lang/management/GarbageCollectorMXBean/GcInfoCompositeType.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 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
@@ -26,8 +26,11 @@
  * @bug     6396794
  * @summary Check that LastGcInfo contents are reasonable
  * @author  Eamonn McManus
- * @run     main/othervm GcInfoCompositeType
+ * @run     main/othervm -XX:-ExplicitGCInvokesConcurrent GcInfoCompositeType
  */
+// Passing "-XX:-ExplicitGCInvokesConcurrent" to force System.gc()
+// run on foreground when CMS is used and prevent situations when "GcInfo"
+// is missing even though System.gc() was successfuly processed.
 
 import java.util.*;
 import java.lang.management.*;
diff --git a/jdk/test/java/lang/management/MemoryMXBean/CollectionUsageThreshold.java b/jdk/test/java/lang/management/MemoryMXBean/CollectionUsageThreshold.java
index 62dc211..42ae7d0 100644
--- a/jdk/test/java/lang/management/MemoryMXBean/CollectionUsageThreshold.java
+++ b/jdk/test/java/lang/management/MemoryMXBean/CollectionUsageThreshold.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -31,44 +31,45 @@
  * @author  Mandy Chung
  *
  * @build CollectionUsageThreshold MemoryUtil
- * @run main/timeout=300 CollectionUsageThreshold
+ * @run main/othervm/timeout=300 -XX:+PrintGCDetails -XX:+UseSerialGC CollectionUsageThreshold
+ * @run main/othervm/timeout=300 -XX:+PrintGCDetails -XX:+UseParallelGC CollectionUsageThreshold
+ * @run main/othervm/timeout=300 -XX:+PrintGCDetails -XX:+UseG1GC CollectionUsageThreshold
+ * @run main/othervm/timeout=300 -XX:+PrintGCDetails -XX:+UseConcMarkSweepGC CollectionUsageThreshold
  */
 
-import java.lang.Thread.*;
-import java.lang.management.*;
 import java.util.*;
 import java.util.concurrent.*;
+import java.util.concurrent.atomic.AtomicInteger;
 import javax.management.*;
 import javax.management.openmbean.CompositeData;
+import java.lang.management.*;
+import static java.lang.management.MemoryNotificationInfo.*;;
+import static java.lang.management.ManagementFactory.*;
 
 public class CollectionUsageThreshold {
-    private static MemoryMXBean mm = ManagementFactory.getMemoryMXBean();
-    private static List<MemoryPoolMXBean> pools = ManagementFactory.getMemoryPoolMXBeans();
-    private static List<MemoryManagerMXBean> managers = ManagementFactory.getMemoryManagerMXBeans();
-    private static Map<String, PoolRecord> result = new HashMap<>();
+    private static final MemoryMXBean mm = getMemoryMXBean();
+    private static final Map<String, PoolRecord> result = new HashMap<>();
     private static boolean trace = false;
-    private static boolean testFailed = false;
-    private static int numMemoryPools = 1;
+    private static volatile int numMemoryPools = 1;
     private static final int NUM_GCS = 3;
     private static final int THRESHOLD = 10;
-    private static Checker checker;
-    private static int numGCs = 0;
+    private static volatile int numGCs = 0;
 
     // semaphore to signal the arrival of a low memory notification
-    private static Semaphore signals = new Semaphore(0);
+    private static final Semaphore signals = new Semaphore(0);
     // barrier for the main thread to wait until the checker thread
     // finishes checking the low memory notification result
-    private static CyclicBarrier barrier = new CyclicBarrier(2);
+    private static final CyclicBarrier barrier = new CyclicBarrier(2);
 
     static class PoolRecord {
-        private MemoryPoolMXBean pool;
-        private int listenerInvoked = 0;
-        private long notifCount = 0;
+        private final MemoryPoolMXBean pool;
+        private final AtomicInteger listenerInvoked = new AtomicInteger(0);
+        private volatile long notifCount = 0;
         PoolRecord(MemoryPoolMXBean p) {
             this.pool = p;
         }
         int getListenerInvokedCount() {
-            return listenerInvoked;
+            return listenerInvoked.get();
         }
         long getNotifCount() {
             return notifCount;
@@ -77,18 +78,17 @@
             return pool;
         }
         void addNotification(MemoryNotificationInfo minfo) {
-            listenerInvoked++;
+            listenerInvoked.incrementAndGet();
             notifCount = minfo.getCount();
         }
     }
 
     static class SensorListener implements NotificationListener {
-        private int numNotifs = 0;
+        @Override
         public void handleNotification(Notification notif, Object handback) {
             String type = notif.getType();
-            if (type.equals(MemoryNotificationInfo.MEMORY_THRESHOLD_EXCEEDED) ||
-                type.equals(MemoryNotificationInfo.
-                    MEMORY_COLLECTION_THRESHOLD_EXCEEDED)) {
+            if (MEMORY_THRESHOLD_EXCEEDED.equals(type) ||
+                MEMORY_COLLECTION_THRESHOLD_EXCEEDED.equals(type)) {
                 MemoryNotificationInfo minfo = MemoryNotificationInfo.
                     from((CompositeData) notif.getUserData());
 
@@ -98,28 +98,26 @@
                     throw new RuntimeException("Pool " + minfo.getPoolName() +
                         " is not selected");
                 }
-                if (type != MemoryNotificationInfo.
-                        MEMORY_COLLECTION_THRESHOLD_EXCEEDED) {
+                if (!MEMORY_COLLECTION_THRESHOLD_EXCEEDED.equals(type)) {
                     throw new RuntimeException("Pool " + minfo.getPoolName() +
                         " got unexpected notification type: " +
                         type);
                 }
                 pr.addNotification(minfo);
-                synchronized (this) {
-                    System.out.println("notifying the checker thread to check result");
-                    numNotifs++;
-                    signals.release();
-                }
+                System.out.println("notifying the checker thread to check result");
+                signals.release();
             }
         }
     }
 
-    private static long newThreshold;
     public static void main(String args[]) throws Exception {
         if (args.length > 0 && args[0].equals("trace")) {
             trace = true;
         }
 
+        List<MemoryPoolMXBean> pools = getMemoryPoolMXBeans();
+        List<MemoryManagerMXBean> managers = getMemoryManagerMXBeans();
+
         if (trace) {
             MemoryUtil.printMemoryPools(pools);
             MemoryUtil.printMemoryManagers(managers);
@@ -127,7 +125,6 @@
 
         // Find the Old generation which supports low memory detection
         for (MemoryPoolMXBean p : pools) {
-            MemoryUsage u = p.getUsage();
             if (p.isUsageThresholdSupported() && p.isCollectionUsageThresholdSupported()) {
                 if (p.getName().toLowerCase().contains("perm")) {
                     // if we have a "perm gen" pool increase the number of expected
@@ -149,7 +146,7 @@
             // This test creates a checker thread responsible for checking
             // the low memory notifications.  It blocks until a permit
             // from the signals semaphore is available.
-            checker = new Checker("Checker thread");
+            Checker checker = new Checker("Checker thread");
             checker.setDaemon(true);
             checker.start();
 
@@ -182,12 +179,7 @@
                 pr.getPool().setCollectionUsageThreshold(0);
             }
         }
-
-        if (testFailed)
-            throw new RuntimeException("TEST FAILED.");
-
         System.out.println("Test passed.");
-
     }
 
 
@@ -205,20 +197,16 @@
     }
 
     static class Checker extends Thread {
-        private boolean checkerReady = false;
-        private int waiters = 0;
-        private boolean readyToCheck = false;
         Checker(String name) {
             super(name);
         };
+        @Override
         public void run() {
             while (true) {
                 try {
                     signals.acquire(numMemoryPools);
                     checkResult();
-                } catch (InterruptedException e) {
-                    throw new RuntimeException(e);
-                } catch (BrokenBarrierException e) {
+                } catch (InterruptedException | BrokenBarrierException e) {
                     throw new RuntimeException(e);
                 }
             }
diff --git a/jdk/test/java/lang/management/MemoryMXBean/CollectionUsageThresholdConcMarkSweepGC.sh b/jdk/test/java/lang/management/MemoryMXBean/CollectionUsageThresholdConcMarkSweepGC.sh
deleted file mode 100644
index afdaaa4..0000000
--- a/jdk/test/java/lang/management/MemoryMXBean/CollectionUsageThresholdConcMarkSweepGC.sh
+++ /dev/null
@@ -1,53 +0,0 @@
-#
-# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please 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     4959889
-# @summary Test CollectionUsageThreshold with concurrent marksweep collector
-# @author  Mandy Chung
-#
-# @ignore  6982965
-# @run build CollectionUsageThreshold
-# @run shell/timeout=300 CollectionUsageThresholdConcMarkSweepGC.sh
-#
-
-#Set appropriate jdk
-
-if [ ! -z "${TESTJAVA}" ] ; then
-     jdk="$TESTJAVA"
-else
-     echo "--Error: TESTJAVA must be defined as the pathname of a jdk to test."
-     exit 1
-fi
-
-runOne()
-{
-   echo "runOne $@"
-   $TESTJAVA/bin/java ${TESTVMOPTS} -classpath $TESTCLASSES $@ || exit 2
-}
-
-# Test CollectionUsageThreshold with concurrent collector
-runOne -XX:+UseConcMarkSweepGC CollectionUsageThreshold
-
-exit 0
diff --git a/jdk/test/java/lang/management/MemoryMXBean/CollectionUsageThresholdParallelGC.sh b/jdk/test/java/lang/management/MemoryMXBean/CollectionUsageThresholdParallelGC.sh
deleted file mode 100644
index b0749b1..0000000
--- a/jdk/test/java/lang/management/MemoryMXBean/CollectionUsageThresholdParallelGC.sh
+++ /dev/null
@@ -1,52 +0,0 @@
-#
-# Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please 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     4959889
-# @summary Test CollectionUsageThreshold with parallel collector
-# @author  Mandy Chung
-#
-# @run build CollectionUsageThreshold
-# @run shell/timeout=300 CollectionUsageThresholdParallelGC.sh
-#
-
-#Set appropriate jdk
-
-if [ ! -z "${TESTJAVA}" ] ; then
-     jdk="$TESTJAVA"
-else
-     echo "--Error: TESTJAVA must be defined as the pathname of a jdk to test."
-     exit 1
-fi
-
-runOne()
-{
-   echo "runOne $@"
-   $TESTJAVA/bin/java ${TESTVMOPTS} -classpath $TESTCLASSES $@ || exit 2
-}
-
-# Test CollectionUsageThreshold with parallel collector
-runOne -XX:+UseParallelGC CollectionUsageThreshold
-
-exit 0
diff --git a/jdk/test/java/lang/management/MemoryMXBean/CollectionUsageThresholdSerialGC.sh b/jdk/test/java/lang/management/MemoryMXBean/CollectionUsageThresholdSerialGC.sh
deleted file mode 100644
index 2baa9b9..0000000
--- a/jdk/test/java/lang/management/MemoryMXBean/CollectionUsageThresholdSerialGC.sh
+++ /dev/null
@@ -1,52 +0,0 @@
-#
-# Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please 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     4959889
-# @summary Test CollectionUsageThreshold with serial collector
-# @author  Mandy Chung
-#
-# @run build CollectionUsageThreshold
-# @run shell/timeout=300 CollectionUsageThresholdSerialGC.sh
-#
-
-#Set appropriate jdk
-
-if [ ! -z "${TESTJAVA}" ] ; then
-     jdk="$TESTJAVA"
-else
-     echo "--Error: TESTJAVA must be defined as the pathname of a jdk to test."
-     exit 1
-fi
-
-runOne()
-{
-   echo "runOne $@"
-   $TESTJAVA/bin/java ${TESTVMOPTS} -classpath $TESTCLASSES $@ || exit 2
-}
-
-# Test CollectionUsageThreshold with serial collector
-runOne -XX:+UseSerialGC CollectionUsageThreshold
-
-exit 0
diff --git a/jdk/test/java/math/BigInteger/BigIntegerTest.java b/jdk/test/java/math/BigInteger/BigIntegerTest.java
index 279f554..8d7ad25 100644
--- a/jdk/test/java/math/BigInteger/BigIntegerTest.java
+++ b/jdk/test/java/math/BigInteger/BigIntegerTest.java
@@ -56,32 +56,32 @@
     // Bit large number thresholds based on the int thresholds
     // defined in BigInteger itself:
     //
-    // KARATSUBA_THRESHOLD        = 50  ints = 1600 bits
-    // TOOM_COOK_THRESHOLD        = 75  ints = 2400 bits
-    // KARATSUBA_SQUARE_THRESHOLD = 90  ints = 2880 bits
-    // TOOM_COOK_SQUARE_THRESHOLD = 140 ints = 4480 bits
+    // KARATSUBA_THRESHOLD        = 80  ints = 2560 bits
+    // TOOM_COOK_THRESHOLD        = 240 ints = 7680 bits
+    // KARATSUBA_SQUARE_THRESHOLD = 128 ints = 4096 bits
+    // TOOM_COOK_SQUARE_THRESHOLD = 216 ints = 6912 bits
     //
-    // SCHOENHAGE_BASE_CONVERSION_THRESHOLD = 8 ints = 256 bits
+    // SCHOENHAGE_BASE_CONVERSION_THRESHOLD = 20 ints = 640 bits
     //
-    // BURNIKEL_ZIEGLER_THRESHOLD = 50  ints = 1600 bits
+    // BURNIKEL_ZIEGLER_THRESHOLD = 80  ints = 2560 bits
     //
-    static final int BITS_KARATSUBA = 1600;
-    static final int BITS_TOOM_COOK = 2400;
-    static final int BITS_KARATSUBA_SQUARE = 2880;
-    static final int BITS_TOOM_COOK_SQUARE = 4480;
-    static final int BITS_SCHOENHAGE_BASE = 256;
-    static final int BITS_BURNIKEL_ZIEGLER = 1600;
+    static final int BITS_KARATSUBA = 2560;
+    static final int BITS_TOOM_COOK = 7680;
+    static final int BITS_KARATSUBA_SQUARE = 4096;
+    static final int BITS_TOOM_COOK_SQUARE = 6912;
+    static final int BITS_SCHOENHAGE_BASE = 640;
+    static final int BITS_BURNIKEL_ZIEGLER = 2560;
 
     static final int ORDER_SMALL = 60;
     static final int ORDER_MEDIUM = 100;
     // #bits for testing Karatsuba
-    static final int ORDER_KARATSUBA = 1800;
+    static final int ORDER_KARATSUBA = 2760;
     // #bits for testing Toom-Cook and Burnikel-Ziegler
-    static final int ORDER_TOOM_COOK = 4000;
+    static final int ORDER_TOOM_COOK = 8000;
     // #bits for testing Karatsuba squaring
-    static final int ORDER_KARATSUBA_SQUARE = 3200;
+    static final int ORDER_KARATSUBA_SQUARE = 4200;
     // #bits for testing Toom-Cook squaring
-    static final int ORDER_TOOM_COOK_SQUARE = 4600;
+    static final int ORDER_TOOM_COOK_SQUARE = 7000;
 
     static final int SIZE = 1000; // numbers per batch
 
diff --git a/jdk/test/java/net/DatagramSocket/PortUnreachable.java b/jdk/test/java/net/DatagramSocket/PortUnreachable.java
index c6dcf40..91e6847 100644
--- a/jdk/test/java/net/DatagramSocket/PortUnreachable.java
+++ b/jdk/test/java/net/DatagramSocket/PortUnreachable.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -31,20 +31,17 @@
 import java.net.InetAddress;
 import java.net.DatagramSocket;
 import java.net.DatagramPacket;
-import java.io.InterruptedIOException;
 
-public class PortUnreachable implements Runnable {
+public class PortUnreachable {
 
     DatagramSocket clientSock;
     int serverPort;
     int clientPort;
 
-    public void run() {
+    public void serverSend() {
         try {
             InetAddress addr = InetAddress.getLocalHost();
-
-            Thread.currentThread().sleep(2000);
-
+            Thread.currentThread().sleep(1000);
             // send a delayed packet which should mean a delayed icmp
             // port unreachable
             byte b[] = "A late msg".getBytes();
@@ -52,11 +49,8 @@
                                                        serverPort);
             clientSock.send(packet);
 
-            // wait before bringing the server up
-            Thread.currentThread().sleep(5000);
-
             DatagramSocket sock = new DatagramSocket(serverPort);
-            b = "Grettings from the server".getBytes();
+            b = "Greetings from the server".getBytes();
             packet = new DatagramPacket(b, b.length, addr, clientPort);
             sock.send(packet);
             sock.close();
@@ -70,10 +64,13 @@
         clientSock = new DatagramSocket();
         clientPort = clientSock.getLocalPort();
 
+    }
+
+    void execute () throws Exception{
+
         // pick a port for the server
         DatagramSocket sock2 = new DatagramSocket();
         serverPort = sock2.getLocalPort();
-        sock2.close();
 
         // send a burst of packets to the unbound port - we should get back
         // icmp port unreachable messages
@@ -82,23 +79,26 @@
         byte b[] = "Hello me".getBytes();
         DatagramPacket packet = new DatagramPacket(b, b.length, addr,
                                                    serverPort);
+        //close just before sending
+        sock2.close();
         for (int i=0; i<100; i++)
             clientSock.send(packet);
 
-        // start the server thread
-        Thread thr = new Thread(this);
-        thr.start();
-
+        serverSend();
         // try to receive
+        b = new byte[25];
+        packet = new DatagramPacket(b, b.length, addr, serverPort);
         clientSock.setSoTimeout(10000);
         clientSock.receive(packet);
+        System.out.println("client received data packet " + new String(packet.getData()));
 
         // done
         clientSock.close();
     }
 
     public static void main(String[] args) throws Exception {
-        new PortUnreachable();
+        PortUnreachable test = new PortUnreachable();
+        test.execute();
     }
 
 }
diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/Main.java b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/Main.java
index d43b7a2..efc4d5e 100644
--- a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/Main.java
+++ b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/Main.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -21,8 +21,27 @@
  * questions.
  */
 
-/*
- *
+/**
+ * @test
+ * @summary The RMI benchmark test. This java class is used to run the test
+ *          under JTREG.
+ * @library ../../../../testlibrary ../../
+ * @build TestLibrary bench.BenchInfo bench.HtmlReporter bench.Util
+ * bench.Benchmark bench.Reporter bench.XmlReporter bench.ConfigFormatException
+ * bench.Harness bench.TextReporter bench.rmi.BenchServer
+ * bench.rmi.DoubleArrayCalls bench.rmi.LongCalls bench.rmi.ShortCalls
+ * bench.rmi.BenchServerImpl bench.rmi.DoubleCalls bench.rmi.Main
+ * bench.rmi.SmallObjTreeCalls bench.rmi.BooleanArrayCalls
+ * bench.rmi.ExceptionCalls bench.rmi.NullCalls bench.rmi.BooleanCalls
+ * bench.rmi.ExportObjs bench.rmi.ObjArrayCalls bench.rmi.ByteArrayCalls
+ * bench.rmi.FloatArrayCalls bench.rmi.ObjTreeCalls bench.rmi.ByteCalls
+ * bench.rmi.FloatCalls bench.rmi.ProxyArrayCalls bench.rmi.CharArrayCalls
+ * bench.rmi.IntArrayCalls bench.rmi.RemoteObjArrayCalls bench.rmi.CharCalls
+ * bench.rmi.IntCalls bench.rmi.ClassLoading bench.rmi.LongArrayCalls
+ * bench.rmi.ShortArrayCalls
+ * bench.rmi.altroot.Node
+ * @run main/othervm/policy=policy.all/timeout=1800 bench.rmi.Main -server -c config
+ * @author Mike Warres, Nigel Daley
  */
 
 package bench.rmi;
@@ -33,21 +52,27 @@
 import bench.Reporter;
 import bench.TextReporter;
 import bench.XmlReporter;
+import static bench.rmi.Main.OutputFormat.*;
+import java.io.File;
 import java.io.FileInputStream;
+import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.InputStream;
 import java.io.IOException;
 import java.io.OutputStream;
 import java.io.PrintStream;
+import java.rmi.AlreadyBoundException;
+import java.rmi.NotBoundException;
 import java.rmi.RemoteException;
-import java.rmi.RMISecurityManager;
 import java.rmi.registry.LocateRegistry;
 import java.rmi.registry.Registry;
 import java.rmi.server.RemoteObject;
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Timer;
 import java.util.TimerTask;
 
-/*
+/**
  * RMI/Serialization benchmark tests.
  */
 public class Main {
@@ -66,19 +91,20 @@
         /**
          * Cleanup both client and server side in between each benchmark.
          */
+        @Override
         protected void cleanup() {
             System.gc();
             if (Main.runmode == CLIENT) {
                 try {
                     Main.server.gc();
-                } catch (Exception e) {
+                } catch (RemoteException e) {
                     System.err.println("Warning: server gc failed: " + e);
                 }
             }
         }
     }
 
-    static final String CONFFILE = "/bench/rmi/config";
+    static final String CONFFILE = "config";
     static final String VERSION = "1.3";
     static final String REGNAME = "server";
 
@@ -86,9 +112,32 @@
     static final int CLIENT = 1;
     static final int SERVER = 2;
 
-    static final int TEXT = 0;
-    static final int HTML = 1;
-    static final int XML = 2;
+    static enum OutputFormat {
+
+        TEXT {
+            @Override
+            Reporter getReport(String title) {
+                return new TextReporter(repstr, title);
+            }
+        },
+        HTML {
+
+            @Override
+            Reporter getReport(String title) {
+                return new HtmlReporter(repstr, title);
+            }
+        },
+        XML {
+            @Override
+            Reporter getReport(String title) {
+                return new XmlReporter(repstr, title);
+            }
+        };
+
+        abstract Reporter getReport(String title);
+    };
+
+    static final String TEST_SRC_PATH = System.getProperty("test.src") + File.separator;
 
     static boolean verbose;
     static boolean list;
@@ -96,9 +145,11 @@
     static int testDurationSeconds;
     static volatile boolean exitRequested;
     static Timer timer;
-    static int format = TEXT;
+    static OutputFormat format = TEXT;
     static int runmode;
+    static String confFile;
     static InputStream confstr;
+    static String repFile;
     static OutputStream repstr;
     static String host;
     static int port;
@@ -109,6 +160,8 @@
 
     /**
      * Returns reference to benchmark server.
+     *
+     * @return a benchmark server
      */
     public static BenchServer getBenchServer() {
         return server;
@@ -126,44 +179,29 @@
         p.println("  -l                   list configuration file");
         p.println("  -t <num hours>       repeat benchmarks for specified number of hours");
         p.println("  -o <file>            specify output file");
-        p.println("  -c <file>            specify (non-default) " +
-                "configuration file");
-        p.println("  -html                format output as html " +
-                "(default is text)");
+        p.println("  -c <file>            specify (non-default) "
+                + "configuration file");
+        p.println("  -html                format output as html "
+                + "(default is text)");
         p.println("  -xml                 format output as xml");
-        p.println("  -client <host:port>  run benchmark client using server " +
-                "on specified host/port");
-        p.println("  -server <port>       run benchmark server on given port");
+        p.println("  -server              run benchmark server ");
+        p.println("  -client <host:port>  run benchmark client using server "
+                + "on specified host/port");
     }
 
     /**
-     * Print error message and exit.
+     * Throw RuntimeException that wrap message.
+     *
+     * @param mesg a message will be wrapped in the RuntimeException.
      */
     static void die(String mesg) {
-        System.err.println(mesg);
-        System.exit(1);
-    }
-
-    /**
-     * Stop server and exit.
-     */
-    public static void exit() {
-        switch (runmode) {
-            case CLIENT:
-                if (server != null) {
-                    try {
-                        server.terminate(0);
-                    } catch (RemoteException re) {
-                        // ignore
-                    }
-                }
-            default:
-                System.exit(0);
-        }
+        throw new RuntimeException(mesg);
     }
 
     /**
      * Benchmark mainline.
+     *
+     * @param args
      */
     public static void main(String[] args) {
         setupSecurity();
@@ -173,21 +211,78 @@
             listConfig();
         } else {
             setupServer();
-            if (runmode != SERVER) {
-                setupHarness();
-                setupReporter();
-                if (exitOnTimer) {
-                    setupTimer(testDurationSeconds);
-                    while (true) {
+            switch (runmode) {
+                case SAMEVM:
+                case CLIENT:
+                    setupHarness();
+                    setupReporter();
+                    if (exitOnTimer) {
+                        setupTimer(testDurationSeconds);
+                        do {
+                            runBenchmarks();
+                        } while (!exitRequested);
+                    } else {
                         runBenchmarks();
-                        if (exitRequested) {
-                            exit();
-                        }
                     }
-                } else {
-                    runBenchmarks();
-                    exit();
-                }
+                    break;
+                case SERVER:
+                    //Setup for client mode, server will fork client process
+                    //after its initiation.
+                    List<String> clientProcessStr = new ArrayList<>();
+                    clientProcessStr.add(System.getProperty("test.jdk") +
+                            File.separator + "bin" + File.separator + "java");
+                    String classpath = System.getProperty("java.class.path");
+                    if (classpath != null) {
+                        clientProcessStr.add("-cp");
+                        clientProcessStr.add(classpath);
+                    }
+                    clientProcessStr.add("-Djava.security.policy=" + TEST_SRC_PATH + "policy.all");
+                    clientProcessStr.add("-Dtest.src=" + TEST_SRC_PATH);
+                    clientProcessStr.add("bench.rmi.Main"); //Client mode
+                    if (verbose) {
+                        clientProcessStr.add("-v");
+                    }
+                    if (list) {
+                        clientProcessStr.add("-l");
+                    }
+                    clientProcessStr.add("-client");
+                    clientProcessStr.add("localhost:" + port);
+
+                    if (exitOnTimer) {
+                        clientProcessStr.add("-t");
+                        clientProcessStr.add(String.valueOf(testDurationSeconds / 3600));
+                    }
+                    if (repFile != null) {
+                        clientProcessStr.add("-o");
+                        clientProcessStr.add(repFile);
+                    }
+                    if (confFile != null) {
+                        clientProcessStr.add("-c");
+                        clientProcessStr.add(confFile);
+                    }
+                    switch (format) {
+                        case HTML:
+                            clientProcessStr.add("-html");
+                            break;
+                        case XML:
+                            clientProcessStr.add("-xml");
+                            break;
+                    }
+
+                    try {
+                        Process client = new ProcessBuilder(clientProcessStr).
+                                inheritIO().start();
+                        client.waitFor();
+                        int exitValue = client.exitValue();
+                        if (0 != exitValue) {
+                            die("Error: error happened in client process, exitValue = " + exitValue);
+                        }
+                    } catch (IOException ex) {
+                        die("Error: Unable start client process, ex=" + ex.getMessage());
+                    } catch (InterruptedException ex) {
+                        die("Error: Error happening to client process, ex=" + ex.getMessage());
+                    }
+                    break;
             }
         }
     }
@@ -197,78 +292,107 @@
      */
     static void parseArgs(String[] args) {
         for (int i = 0; i < args.length; i++) {
-            if (args[i].equals("-h")) {
-                usage();
-                System.exit(0);
-            } else if (args[i].equals("-v")) {
-                verbose = true;
-            } else if (args[i].equals("-l")) {
-                list = true;
-            } else if (args[i].equals("-t")) {
-                if (++i >= args.length)
-                    die("Error: no timeout value specified");
-                try {
-                    exitOnTimer = true;
-                    testDurationSeconds = Integer.parseInt(args[i]) * 3600;
-                } catch (Exception e) {
-                    die("Error: unable to determine timeout value");
-                }
-            } else if (args[i].equals("-o")) {
-                if (++i >= args.length)
-                    die("Error: no output file specified");
-                try {
-                    repstr = new FileOutputStream(args[i]);
-                } catch (IOException e) {
-                    die("Error: unable to open \"" + args[i] + "\"");
-                }
-            } else if (args[i].equals("-c")) {
-                if (++i >= args.length)
-                    die("Error: no config file specified");
-                try {
-                    confstr = new FileInputStream(args[i]);
-                } catch (IOException e) {
-                    die("Error: unable to open \"" + args[i] + "\"");
-                }
-            } else if (args[i].equals("-html")) {
-                if (format != TEXT)
-                    die("Error: conflicting formats");
-                format = HTML;
-            } else if (args[i].equals("-xml")) {
-                if (format != TEXT)
-                    die("Error: conflicting formats");
-                format = XML;
-            } else if (args[i].equals("-client")) {
-                if (runmode == CLIENT)
-                    die("Error: multiple -client options");
-                if (runmode == SERVER)
-                    die("Error: -client and -server options conflict");
-                if (++i >= args.length)
-                    die("Error: -client missing host/port");
-                try {
-                    int sepi = args[i].indexOf(':');
-                    host = args[i].substring(0, sepi);
-                    port = Integer.parseInt(args[i].substring(sepi + 1));
-                } catch (Exception e) {
-                    die("Error: illegal host/port specified for -client");
-                }
-                runmode = CLIENT;
-            } else if (args[i].equals("-server")) {
-                if (runmode == CLIENT)
-                    die("Error: -client and -server options conflict");
-                if (runmode == SERVER)
-                    die("Error: multiple -server options");
-                if (++i >= args.length)
-                    die("Error: -server missing port");
-                try {
-                    port = Integer.parseInt(args[i]);
-                } catch (Exception e) {
-                    die("Error: illegal port specified for -server");
-                }
-                runmode = SERVER;
-            } else {
-                System.err.println("Illegal option: \"" + args[i] + "\"");
-                usage();
-                System.exit(1);
+            switch (args[i]) {
+                case "-h":
+                    usage();
+                    System.exit(0);
+                    break;
+                case "-v":
+                    verbose = true;
+                    break;
+                case "-l":
+                    list = true;
+                    break;
+                case "-t":
+                    if (++i >= args.length) {
+                        die("Error: no timeout value specified");
+                    }
+                    try {
+                        exitOnTimer = true;
+                        testDurationSeconds = Integer.parseInt(args[i]) * 3600;
+                    } catch (NumberFormatException e) {
+                        die("Error: unable to determine timeout value");
+                    }
+                    break;
+                case "-o":
+                    if (++i >= args.length) {
+                        die("Error: no output file specified");
+                    }
+                    try {
+                        repFile = args[i];
+                        repstr = new FileOutputStream(repFile);
+                    } catch (FileNotFoundException e) {
+                        die("Error: unable to open \"" + args[i] + "\"");
+                    }
+                    break;
+                case "-c":
+                    if (++i >= args.length) {
+                        die("Error: no config file specified");
+                    }
+                    confFile = args[i];
+                    String confFullPath = TEST_SRC_PATH + confFile;
+                    try {
+                        confstr = new FileInputStream(confFullPath);
+                    } catch (FileNotFoundException e) {
+                        die("Error: unable to open \"" + confFullPath + "\"");
+                    }
+                    break;
+                case "-html":
+                    if (format != TEXT) {
+                        die("Error: conflicting formats");
+                    }
+                    format = HTML;
+                    break;
+                case "-xml":
+                    if (format != TEXT) {
+                        die("Error: conflicting formats");
+                    }
+                    format = XML;
+                    break;
+                case "-client":
+                    if (runmode == CLIENT) {
+                        die("Error: multiple -client options");
+                    }
+                    if (runmode == SERVER) {
+                        die("Error: -client and -server options conflict");
+                    }
+                    if (++i >= args.length) {
+                        die("Error: -client missing host/port");
+                    }
+                    try {
+                        String[] hostAndPort = args[i].split(":");
+                        if (hostAndPort.length != 2) {
+                            die("Error: Invalid format host/port:" + args[i]);
+                        }
+                        host = hostAndPort[0];
+                        port = Integer.parseInt(hostAndPort[1]);
+                    } catch (NumberFormatException e) {
+                        die("Error: illegal host/port specified for -client");
+                    }
+                    runmode = CLIENT;
+                    break;
+                case "-server":
+                    if (runmode == CLIENT) {
+                        die("Error: -client and -server options conflict");
+                    }
+                    if (runmode == SERVER) {
+                        die("Error: multiple -server options");
+                    }
+                    try {
+                        //This is the hack code because named package class has
+                        //difficulty in accessing unamed package class. This
+                        //should be removed ater JDK-8003358 is finished.
+                        port = (int) Class.forName("TestLibrary")
+                                .getMethod("getUnusedRandomPort")
+                                .invoke(null);
+                    } catch (ReflectiveOperationException ex) {
+                        die("Error: can't get a free port " + ex);
+                    }
+                    runmode = SERVER;
+                    break;
+                default:
+                    usage();
+                    die("Illegal option: \"" + args[i] + "\"");
             }
         }
     }
@@ -277,27 +401,31 @@
      * Set up security manager and policy, if not set already.
      */
     static void setupSecurity() {
-        if (System.getSecurityManager() != null)
+        if (System.getSecurityManager() != null) {
             return;
+        }
 
         /* As of 1.4, it is too late to set the security policy
          * file at this point so these line have been commented out.
          */
         //System.setProperty("java.security.policy",
         //      Main.class.getResource("/bench/rmi/policy.all").toString());
-        System.setSecurityManager(new RMISecurityManager());
+        System.setSecurityManager(new SecurityManager());
     }
 
     /**
      * Set up configuration file and report streams, if not set already.
      */
     static void setupStreams() {
-        if (repstr == null)
+        if (repstr == null) {
             repstr = System.out;
-        if (confstr == null)
-            confstr = (new Main()).getClass().getResourceAsStream(CONFFILE);
-        if (confstr == null)
+        }
+        if (confstr == null) {
+            confstr = Main.class.getResourceAsStream(TEST_SRC_PATH + CONFFILE);
+        }
+        if (confstr == null) {
             die("Error: unable to find default config file");
+        }
     }
 
     /**
@@ -323,7 +451,7 @@
                 try {
                     serverImpl = new BenchServerImpl();
                     server = (BenchServer) RemoteObject.toStub(serverImpl);
-                } catch (Exception e) {
+                } catch (RemoteException e) {
                     die("Error: failed to create local server: " + e);
                 }
                 if (verbose)
@@ -334,7 +462,7 @@
                 try {
                     Registry reg = LocateRegistry.getRegistry(host, port);
                     server = (BenchServer) reg.lookup(REGNAME);
-                } catch (Exception e) {
+                } catch (NotBoundException | RemoteException e) {
                     die("Error: failed to connect to server: " + e);
                 }
                 if (server == null) {
@@ -351,7 +479,7 @@
                     Registry reg = LocateRegistry.createRegistry(port);
                     serverImpl = new BenchServerImpl();
                     reg.bind(REGNAME, serverImpl);
-                } catch (Exception e) {
+                } catch (AlreadyBoundException | RemoteException e) {
                     die("Error: failed to initialize server: " + e);
                 }
                 if (verbose) {
@@ -368,18 +496,19 @@
     /**
      * Set up the timer to end the test.
      *
-     * @param delay the amount of delay, in seconds, before requesting
-     * the process exit
+     * @param delay the amount of delay, in seconds, before requesting the
+     * process exit
      */
     static void setupTimer(int delay) {
         timer = new Timer(true);
         timer.schedule(
-            new TimerTask() {
-                public void run() {
-                    exitRequested = true;
-                }
-            },
-            delay * 1000);
+                new TimerTask() {
+                    @Override
+                    public void run() {
+                        exitRequested = true;
+                    }
+                },
+                delay * 1000);
     }
 
     /**
@@ -404,23 +533,7 @@
      * Setup benchmark reporter.
      */
     static void setupReporter() {
-        String title = "RMI Benchmark, v" + VERSION;
-        switch (format) {
-            case TEXT:
-                reporter = new TextReporter(repstr, title);
-                break;
-
-            case HTML:
-                reporter = new HtmlReporter(repstr, title);
-                break;
-
-            case XML:
-                reporter = new XmlReporter(repstr, title);
-                break;
-
-            default:
-                die("Error: unrecognized format type");
-        }
+        reporter = format.getReport("RMI Benchmark, v" + VERSION);
     }
 
     /**
diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/serial/Main.java b/jdk/test/java/rmi/reliability/benchmark/bench/serial/Main.java
index a031b08..3e83a5b 100644
--- a/jdk/test/java/rmi/reliability/benchmark/bench/serial/Main.java
+++ b/jdk/test/java/rmi/reliability/benchmark/bench/serial/Main.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,7 +22,29 @@
  */
 
 /*
- *
+ * @test
+ * @summary The Serialization benchmark test. This java class is used to run the
+ *          test under JTREG.
+ * @library ../../
+ * @build bench.BenchInfo bench.HtmlReporter bench.Util bench.Benchmark
+ * @build bench.Reporter bench.XmlReporter bench.ConfigFormatException
+ * @build bench.Harness bench.TextReporter
+ * @build bench.serial.BooleanArrays bench.serial.Booleans
+ * @build bench.serial.ByteArrays bench.serial.Bytes bench.serial.CharArrays
+ * @build bench.serial.Chars bench.serial.ClassDesc bench.serial.Cons
+ * @build bench.serial.CustomDefaultObjTrees bench.serial.CustomObjTrees
+ * @build bench.serial.DoubleArrays bench.serial.Doubles
+ * @build bench.serial.ExternObjTrees bench.serial.FloatArrays
+ * @build bench.serial.Floats bench.serial.GetPutFieldTrees
+ * @build bench.serial.IntArrays bench.serial.Ints bench.serial.LongArrays
+ * @build bench.serial.Longs bench.serial.Main bench.serial.ObjArrays
+ * @build bench.serial.ObjTrees bench.serial.ProxyArrays
+ * @build bench.serial.ProxyClassDesc bench.serial.RepeatObjs
+ * @build bench.serial.ReplaceTrees bench.serial.ShortArrays
+ * @build bench.serial.Shorts bench.serial.SmallObjTrees
+ * @build bench.serial.StreamBuffer bench.serial.Strings
+ * @run main/othervm/timeout=1800 bench.serial.Main -c jtreg-config
+ * @author Mike Warres, Nigel Daley
  */
 
 package bench.serial;
@@ -33,7 +55,9 @@
 import bench.Reporter;
 import bench.TextReporter;
 import bench.XmlReporter;
+import java.io.File;
 import java.io.FileInputStream;
+import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.InputStream;
 import java.io.IOException;
@@ -47,8 +71,9 @@
  */
 public class Main {
 
-    static final String CONFFILE = "/bench/serial/config";
+    static final String CONFFILE = "config";
     static final String VERSION = "1.3";
+    static final String TEST_SRC_PATH = System.getProperty("test.src") + File.separator;
 
     static final int TEXT = 0;
     static final int HTML = 1;
@@ -84,15 +109,18 @@
     }
 
     /**
-     * Print error message and exit.
+     * Throw RuntimeException that wrap message.
+     *
+     * @param mesg a message will be wrapped in the RuntimeException.
      */
     static void die(String mesg) {
-        System.err.println(mesg);
-        System.exit(1);
+        throw new RuntimeException(mesg);
     }
 
     /**
      * Mainline parses command line, then hands off to benchmark harness.
+     *
+     * @param args
      */
     public static void main(String[] args) {
         parseArgs(args);
@@ -104,15 +132,11 @@
             setupReporter();
             if (exitOnTimer) {
                 setupTimer(testDurationSeconds);
-                while (true) {
+                do {
                     runBenchmarks();
-                    if (exitRequested) {
-                        System.exit(0);
-                    }
-                }
+                } while (!exitRequested);
             } else {
                 runBenchmarks();
-                System.exit(0);
             }
         }
     }
@@ -122,50 +146,59 @@
      */
     static void parseArgs(String[] args) {
         for (int i = 0; i < args.length; i++) {
-            if (args[i].equals("-h")) {
-                usage();
-                System.exit(0);
-            } else if (args[i].equals("-v")) {
-                verbose = true;
-            } else if (args[i].equals("-l")) {
-                list = true;
-            } else if (args[i].equals("-t")) {
-                if (++i >= args.length)
-                    die("Error: no timeout value specified");
-                try {
-                    exitOnTimer = true;
-                    testDurationSeconds = Integer.parseInt(args[i]) * 3600;
-                } catch (Exception e) {
-                    die("Error: unable to determine timeout value");
-                }
-            } else if (args[i].equals("-o")) {
-                if (++i >= args.length)
-                    die("Error: no output file specified");
-                try {
-                    repstr = new FileOutputStream(args[i]);
-                } catch (IOException e) {
-                    die("Error: unable to open \"" + args[i] + "\"");
-                }
-            } else if (args[i].equals("-c")) {
-                if (++i >= args.length)
-                    die("Error: no config file specified");
-                try {
-                    confstr = new FileInputStream(args[i]);
-                } catch (IOException e) {
-                    die("Error: unable to open \"" + args[i] + "\"");
-                }
-            } else if (args[i].equals("-html")) {
-                if (format != TEXT)
-                    die("Error: conflicting formats");
-                format = HTML;
-            } else if (args[i].equals("-xml")) {
-                if (format != TEXT)
-                    die("Error: conflicting formats");
-                format = XML;
-            } else {
-                System.err.println("Illegal option: \"" + args[i] + "\"");
-                usage();
-                System.exit(1);
+            switch (args[i]) {
+                case "-h":
+                    usage();
+                    System.exit(0);
+                    break;
+                case "-v":
+                    verbose = true;
+                    break;
+                case "-l":
+                    list = true;
+                    break;
+                case "-t":
+                    if (++i >= args.length)
+                        die("Error: no timeout value specified");
+                    try {
+                        exitOnTimer = true;
+                        testDurationSeconds = Integer.parseInt(args[i]) * 3600;
+                    } catch (NumberFormatException e) {
+                        die("Error: unable to determine timeout value");
+                    }
+                    break;
+                case "-o":
+                    if (++i >= args.length)
+                        die("Error: no output file specified");
+                    try {
+                        repstr = new FileOutputStream(args[i]);
+                    } catch (FileNotFoundException e) {
+                        die("Error: unable to open \"" + args[i] + "\"");
+                    }
+                    break;
+                case "-c":
+                    if (++i >= args.length)
+                        die("Error: no config file specified");
+                    String confFileName = TEST_SRC_PATH + args[i];
+                    try {
+                        confstr = new FileInputStream(confFileName);
+                    } catch (FileNotFoundException e) {
+                        die("Error: unable to open \"" + confFileName + "\"");
+                    }
+                    break;
+                case "-html":
+                    if (format != TEXT)
+                        die("Error: conflicting formats");
+                    format = HTML;
+                    break;
+                case "-xml":
+                    if (format != TEXT)
+                        die("Error: conflicting formats");
+                    format = XML;
+                    break;
+                default:
+                    usage();
+                    die("Illegal option: \"" + args[i] + "\"");
             }
         }
     }
@@ -177,7 +210,7 @@
         if (repstr == null)
             repstr = System.out;
         if (confstr == null)
-            confstr = (new Main()).getClass().getResourceAsStream(CONFFILE);
+            confstr = Main.class.getResourceAsStream(TEST_SRC_PATH + CONFFILE);
         if (confstr == null)
             die("Error: unable to find default config file");
     }
@@ -206,6 +239,7 @@
         timer = new Timer(true);
         timer.schedule(
             new TimerTask() {
+                @Override
                 public void run() {
                     exitRequested = true;
                 }
diff --git a/jdk/test/java/rmi/reliability/benchmark/runRmiBench.sh b/jdk/test/java/rmi/reliability/benchmark/runRmiBench.sh
deleted file mode 100644
index 98a31d1..0000000
--- a/jdk/test/java/rmi/reliability/benchmark/runRmiBench.sh
+++ /dev/null
@@ -1,69 +0,0 @@
-#
-# Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please 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
-#
-# @summary The RMI benchmark test.  This script is only
-#          used to run the test under JTREG.
-#
-# @build bench.BenchInfo bench.HtmlReporter bench.Util bench.Benchmark 
-#     bench.Reporter bench.XmlReporter bench.ConfigFormatException 
-#     bench.Harness bench.TextReporter bench.rmi.BenchServer 
-#     bench.rmi.DoubleArrayCalls bench.rmi.LongCalls bench.rmi.ShortCalls
-#     bench.rmi.BenchServerImpl bench.rmi.DoubleCalls 
-#     bench.rmi.Main bench.rmi.SmallObjTreeCalls
-#     bench.rmi.BooleanArrayCalls bench.rmi.ExceptionCalls 
-#     bench.rmi.NullCalls bench.rmi.BooleanCalls bench.rmi.ExportObjs 
-#     bench.rmi.ObjArrayCalls bench.rmi.ByteArrayCalls 
-#     bench.rmi.FloatArrayCalls bench.rmi.ObjTreeCalls
-#     bench.rmi.ByteCalls bench.rmi.FloatCalls bench.rmi.ProxyArrayCalls
-#     bench.rmi.CharArrayCalls bench.rmi.IntArrayCalls 
-#     bench.rmi.RemoteObjArrayCalls bench.rmi.CharCalls bench.rmi.IntCalls
-#     bench.rmi.ClassLoading bench.rmi.LongArrayCalls 
-#     bench.rmi.ShortArrayCalls bench.rmi.altroot.Node
-#
-# @run shell/timeout=1800 runRmiBench.sh
-#
-# @author Mike Warres, Nigel Daley
-
-echo "Starting RMI benchmark server "
-
-$TESTJAVA/bin/java \
-    -server \
-    -cp $TESTCLASSES \
-    -Djava.security.policy=$TESTSRC/bench/rmi/policy.all \
-    bench.rmi.Main \
-    -server 2007 \
-    -c $TESTSRC/bench/rmi/config &
-
-sleep 10
-echo "Starting RMI benchmark client "
-
-$TESTJAVA/bin/java \
-    -client \
-    -cp $TESTCLASSES \
-    -Djava.security.policy=$TESTSRC/bench/rmi/policy.all \
-    bench.rmi.Main \
-    -client localhost:2007 \
-    -c $TESTSRC/bench/rmi/config
-
diff --git a/jdk/test/java/rmi/reliability/benchmark/runSerialBench.sh b/jdk/test/java/rmi/reliability/benchmark/runSerialBench.sh
deleted file mode 100644
index 82a2837..0000000
--- a/jdk/test/java/rmi/reliability/benchmark/runSerialBench.sh
+++ /dev/null
@@ -1,58 +0,0 @@
-#
-# Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please 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
-#
-# @summary The Serialization benchmark test.  This script is only
-#          used to run the test under JTREG.
-#
-# @build bench.BenchInfo bench.HtmlReporter bench.Util bench.Benchmark 
-# @build bench.Reporter bench.XmlReporter bench.ConfigFormatException 
-# @build bench.Harness bench.TextReporter
-# @build bench.serial.BooleanArrays bench.serial.Booleans
-# @build bench.serial.ByteArrays bench.serial.Bytes bench.serial.CharArrays
-# @build bench.serial.Chars bench.serial.ClassDesc bench.serial.Cons
-# @build bench.serial.CustomDefaultObjTrees bench.serial.CustomObjTrees
-# @build bench.serial.DoubleArrays bench.serial.Doubles
-# @build bench.serial.ExternObjTrees bench.serial.FloatArrays
-# @build bench.serial.Floats bench.serial.GetPutFieldTrees
-# @build bench.serial.IntArrays bench.serial.Ints bench.serial.LongArrays
-# @build bench.serial.Longs bench.serial.Main bench.serial.ObjArrays
-# @build bench.serial.ObjTrees bench.serial.ProxyArrays
-# @build bench.serial.ProxyClassDesc bench.serial.RepeatObjs
-# @build bench.serial.ReplaceTrees bench.serial.ShortArrays
-# @build bench.serial.Shorts bench.serial.SmallObjTrees
-# @build bench.serial.StreamBuffer bench.serial.Strings
-#
-# @run shell/timeout=1800 runSerialBench.sh
-#
-# @author Mike Warres, Nigel Daley
-
-echo "Starting serialization benchmark "
-
-$TESTJAVA/bin/java \
-    ${TESTVMOPTS} \
-    -cp $TESTCLASSES \
-    bench.serial.Main \
-    -c $TESTSRC/bench/serial/jtreg-config &
-
diff --git a/jdk/test/java/util/Base64/Base64GetEncoderTest.java b/jdk/test/java/util/Base64/Base64GetEncoderTest.java
index c5658d2..563cb79 100644
--- a/jdk/test/java/util/Base64/Base64GetEncoderTest.java
+++ b/jdk/test/java/util/Base64/Base64GetEncoderTest.java
@@ -51,30 +51,6 @@
 
         testWrapEncode2(encoder);
 
-        testEncodeWithByteBuffer(encoder);
-
-    }
-
-    private static void testEncodeWithByteBuffer(final Base64.Encoder encoder) {
-        System.err.println("\n\nEncoder.encode with ByteBuffer test  ");
-        final byte[] secondTestBuffer =
-                "api/java_util/Base64/index.html#GetEncoderMimeCustom[noLineSeparatorInEncodedString]"
-                .getBytes(US_ASCII);
-        String base64EncodedString;
-        ByteBuffer srcData = ByteBuffer.wrap(secondTestBuffer);
-        ByteBuffer dstData = ByteBuffer.allocate(secondTestBuffer.length * 2);
-
-        encoder.encode(srcData, dstData, 0);
-        dstData.flip();
-        if (dstData.hasArray()) {
-            System.err.println("\nByteBuffer test dstData is Base64 encoding = "
-                    + new String(dstData.array(), US_ASCII) + "\n");
-        }
-
-        base64EncodedString = new String(dstData.array(), US_ASCII);
-        if (base64EncodedString.contains("$$$")) {
-            throw new RuntimeException("Base64 encoding contains line separator after Encoder.encode ByteBuffer ... \n");
-        }
     }
 
     private static void testWrapEncode2(final Base64.Encoder encoder)
diff --git a/jdk/test/java/util/Base64/TestBase64.java b/jdk/test/java/util/Base64/TestBase64.java
index 9f7babe..afa41b3 100644
--- a/jdk/test/java/util/Base64/TestBase64.java
+++ b/jdk/test/java/util/Base64/TestBase64.java
@@ -23,7 +23,7 @@
 
 /**
  * @test 4235519 8004212 8005394 8007298 8006295 8006315 8006530 8007379 8008925
- *       8014217 8025003 8026330
+ *       8014217 8025003 8026330 8028397
  * @summary tests java.util.Base64
  */
 
@@ -92,6 +92,9 @@
         // illegal line separator
         checkIAE(new Runnable() { public void run() { Base64.getMimeEncoder(10, new byte[]{'\r', 'N'}); }});
 
+        // malformed padding/ending
+        testMalformedPadding();
+
         // illegal base64 character
         decoded[2] = (byte)0xe0;
         checkIAE(new Runnable() {
@@ -100,34 +103,15 @@
             public void run() { Base64.getDecoder().decode(decoded, new byte[1024]); }});
         checkIAE(new Runnable() { public void run() {
             Base64.getDecoder().decode(ByteBuffer.wrap(decoded)); }});
-        checkIAE(new Runnable() { public void run() {
-            Base64.getDecoder().decode(ByteBuffer.wrap(decoded), ByteBuffer.allocate(1024)); }});
-        checkIAE(new Runnable() { public void run() {
-            Base64.getDecoder().decode(ByteBuffer.wrap(decoded), ByteBuffer.allocateDirect(1024)); }});
-
-        // illegal ending unit
-        checkIOE(new Testable() { public void test() throws IOException {
-                                     byte[] bytes = "AA=".getBytes("ASCII");
-                                     try (InputStream stream =
-                                              Base64.getDecoder().wrap(new ByteArrayInputStream(bytes))) {
-                                         while (stream.read() != -1);
-                                     }
-        }});
-
-        // test return value from decode(ByteBuffer, ByteBuffer)
-        testDecBufRet();
 
         // test single-non-base64 character for mime decoding
         testSingleNonBase64MimeDec();
 
         // test decoding of unpadded data
         testDecodeUnpadded();
+
         // test mime decoding with ignored character after padding
         testDecodeIgnoredAfterPadding();
-
-        // lenient mode for ending unit
-        testLenientPadding();
-
     }
 
     private static sun.misc.BASE64Encoder sunmisc = new sun.misc.BASE64Encoder();
@@ -202,24 +186,6 @@
                     if (encoded2 != null)
                         testDecode(dec, ByteBuffer.wrap(encoded2), orig);
 
-                    // -------- testing encode(Buffer, Buffer)--------
-                    testEncode(enc, encoded,
-                               ByteBuffer.wrap(orig),
-                               ByteBuffer.allocate(encoded.length + 10));
-
-                    testEncode(enc, encoded,
-                               ByteBuffer.wrap(orig),
-                               ByteBuffer.allocateDirect(encoded.length + 10));
-
-                    // --------testing decode(Buffer, Buffer);--------
-                    testDecode(dec, orig,
-                               ByteBuffer.wrap(encoded),
-                               ByteBuffer.allocate(orig.length + 10));
-
-                    testDecode(dec, orig,
-                               ByteBuffer.wrap(encoded),
-                               ByteBuffer.allocateDirect(orig.length + 10));
-
                     // --------testing decode.wrap(input stream)--------
                     // 1) random buf length
                     ByteArrayInputStream bais = new ByteArrayInputStream(encoded);
@@ -322,9 +288,7 @@
         checkNull(new Runnable() { public void run() { enc.encode(ba_null, new byte[10]); }});
         checkNull(new Runnable() { public void run() { enc.encode(new byte[10], ba_null); }});
         checkNull(new Runnable() { public void run() { enc.encode(bb_null); }});
-        checkNull(new Runnable() { public void run() { enc.encode(bb_null, ByteBuffer.allocate(10), 0); }});
-        checkNull(new Runnable() { public void run() { enc.encode(ByteBuffer.allocate(10), bb_null, 0); }});
-        checkNull(new Runnable() { public void run() { enc.wrap(null); }});
+        checkNull(new Runnable() { public void run() { enc.wrap((OutputStream)null); }});
     }
 
     private static void testNull(final Base64.Decoder dec) {
@@ -333,9 +297,7 @@
         checkNull(new Runnable() { public void run() { dec.decode(ba_null, new byte[10]); }});
         checkNull(new Runnable() { public void run() { dec.decode(new byte[10], ba_null); }});
         checkNull(new Runnable() { public void run() { dec.decode(bb_null); }});
-        checkNull(new Runnable() { public void run() { dec.decode(bb_null, ByteBuffer.allocate(10)); }});
-        checkNull(new Runnable() { public void run() { dec.decode(ByteBuffer.allocate(10), bb_null); }});
-        checkNull(new Runnable() { public void run() { dec.wrap(null); }});
+        checkNull(new Runnable() { public void run() { dec.wrap((InputStream)null); }});
     }
 
     private static interface Testable {
@@ -412,78 +374,63 @@
                     dec.decode(encoded);
                     throw new RuntimeException("No IAE for non-base64 char");
                 } catch (IllegalArgumentException iae) {}
-
-                // decode(ByteBuffer[], ByteBuffer[])
-                ByteBuffer encodedBB = ByteBuffer.wrap(encoded);
-                ByteBuffer decodedBB = ByteBuffer.allocate(100);
-                int ret = decM.decode(encodedBB, decodedBB);
-                byte[] buf = new byte[ret];
-                decodedBB.flip();
-                decodedBB.get(buf);
-                checkEqual(buf, src[i], "Non-base64 char is not ignored");
-                try {
-                    encodedBB.rewind();
-                    decodedBB.clear();
-                    dec.decode(encodedBB, decodedBB);
-                    throw new RuntimeException("No IAE for non-base64 char");
-                } catch (IllegalArgumentException iae) {}
-                // direct
-                encodedBB.rewind();
-                decodedBB = ByteBuffer.allocateDirect(100);
-                ret = decM.decode(encodedBB, decodedBB);
-                buf = new byte[ret];
-                decodedBB.flip();
-                decodedBB.get(buf);
-                checkEqual(buf, src[i], "Non-base64 char is not ignored");
-                try {
-                    encodedBB.rewind();
-                    decodedBB.clear();
-                    dec.decode(encodedBB, decodedBB);
-                    throw new RuntimeException("No IAE for non-base64 char");
-                } catch (IllegalArgumentException iae) {}
             }
         }
     }
 
-    private static void testLenientPadding() throws Throwable {
-        String[] data = new String[] {
-            "=",         "",        // unnecessary padding
-            "QUJD=",     "ABC",     //"ABC".encode() -> "QUJD"
+    private static void testMalformedPadding() throws Throwable {
+        Object[] data = new Object[] {
+            "$=#",       "",      0,      // illegal ending unit
+            "A",         "",      0,      // dangling single byte
+            "A=",        "",      0,
+            "A==",       "",      0,
+            "QUJDA",     "ABC",   4,
+            "QUJDA=",    "ABC",   4,
+            "QUJDA==",   "ABC",   4,
 
-            "QQ=",       "A",       // incomplete padding
-            "QQ=N",      "A",       // incorrect padding
-            "QQ=?",      "A",
-            "QUJDQQ=",   "ABCA",
-            "QUJDQQ=N",  "ABCA",
-            "QUJDQQ=?",  "ABCA",
+            "=",         "",      0,      // unnecessary padding
+            "QUJD=",     "ABC",   4,      //"ABC".encode() -> "QUJD"
 
-            "QUI=X",     "AB",      // incorrect padding
-            "QUI=?",     "AB",      // incorrect padding
+            "AA=",       "",      0,      // incomplete padding
+            "QQ=",       "",      0,
+            "QQ=N",      "",      0,      // incorrect padding
+            "QQ=?",      "",      0,
+            "QUJDQQ=",   "ABC",   4,
+            "QUJDQQ=N",  "ABC",   4,
+            "QUJDQQ=?",  "ABC",   4,
         };
-        Base64.Decoder dec = Base64.getMimeDecoder();
 
-        for (int i = 0; i < data.length; i += 2) {
-            byte[] src = data[i].getBytes("ASCII");
-            byte[] expected = data[i + 1].getBytes("ASCII");
-            // decode(byte[])
-            byte[] ret = dec.decode(src);
-            checkEqual(ret, expected, "lenient padding decoding failed!");
+        Base64.Decoder[] decs = new Base64.Decoder[] {
+            Base64.getDecoder(),
+            Base64.getUrlDecoder(),
+            Base64.getMimeDecoder()
+        };
 
-            // decode(String)
-            ret = dec.decode(data[i]);
-            checkEqual(ret, expected, "lenient padding decoding failed!");
+        for (Base64.Decoder dec : decs) {
+            for (int i = 0; i < data.length; i += 3) {
+                final String srcStr = (String)data[i];
+                final byte[] srcBytes = srcStr.getBytes("ASCII");
+                final ByteBuffer srcBB = ByteBuffer.wrap(srcBytes);
+                byte[] expected = ((String)data[i + 1]).getBytes("ASCII");
+                int pos = (Integer)data[i + 2];
 
-            // decode(ByteBuffer)
-            ByteBuffer srcBB = ByteBuffer.wrap(src);
-            ByteBuffer retBB = dec.decode(srcBB);
-            checkEqual(srcBB.remaining(), 0, "lenient padding decoding failed!");
-            checkEqual(Arrays.copyOf(retBB.array(), retBB.remaining()),
-                       expected, "lenient padding decoding failed!");
+                // decode(byte[])
+                checkIAE(new Runnable() { public void run() { dec.decode(srcBytes); }});
 
-            // wrap.decode(byte[])
-            ret = new byte[10];
-            int n = dec.wrap(new ByteArrayInputStream(src)).read(ret);
-            checkEqual(Arrays.copyOf(ret, n), expected, "lenient padding decoding failed!");
+                // decode(String)
+                checkIAE(new Runnable() { public void run() { dec.decode(srcStr); }});
+
+                // decode(ByteBuffer)
+                checkIAE(new Runnable() { public void run() { dec.decode(srcBB); }});
+
+                // wrap stream
+                checkIOE(new Testable() {
+                    public void test() throws IOException {
+                        try (InputStream is = dec.wrap(new ByteArrayInputStream(srcBytes))) {
+                            while (is.read() != -1);
+                        }
+                }});
+            }
         }
     }
 
@@ -520,51 +467,6 @@
         }
     }
 
-    private static void testDecBufRet() throws Throwable {
-        Random rnd = new java.util.Random();
-        Base64.Encoder encoder = Base64.getEncoder();
-        Base64.Decoder decoder = Base64.getDecoder();
-        //                src   pos, len  expected
-        int[][] tests = { { 6,    3,   3,   3},   // xxx xxx    -> yyyy yyyy
-                          { 6,    3,   4,   3},
-                          { 6,    3,   5,   3},
-                          { 6,    3,   6,   6},
-                          { 6,   11,   4,   3},
-                          { 6,   11,   4,   3},
-                          { 6,   11,   5,   3},
-                          { 6,   11,   6,   6},
-                          { 7,    3,   6,   6},   // xxx xxx x  -> yyyy yyyy yy==
-                          { 7,    3,   7,   7},
-                          { 7,   11,   6,   6},
-                          { 7,   11,   7,   7},
-                          { 8,    3,   6,   6},   // xxx xxx xx -> yyyy yyyy yyy=
-                          { 8,    3,   7,   6},
-                          { 8,    3,   8,   8},
-                          { 8,   13,   6,   6},
-                          { 8,   13,   7,   6},
-                          { 8,   13,   8,   8},
-
-        };
-        ByteBuffer dstBuf = ByteBuffer.allocate(100);
-        for (boolean direct : new boolean[] { false, true}) {
-            for (int[] test : tests) {
-                byte[] src = new byte[test[0]];
-                rnd.nextBytes(src);
-                ByteBuffer srcBuf = direct ? ByteBuffer.allocate(100)
-                                           : ByteBuffer.allocateDirect(100);
-                srcBuf.put(encoder.encode(src)).flip();
-                dstBuf.clear().position(test[1]).limit(test[1]+ test[2]);
-                int ret = decoder.decode(srcBuf, dstBuf);
-                if (ret != test[3]) {
-                    System.out.printf(" [%6s] src=%d, pos=%d, len=%d, expected=%d, ret=%d%n",
-                                      direct?"direct":"",
-                                      test[0], test[1], test[2], test[3], ret);
-                    throw new RuntimeException("ret != expected");
-                }
-            }
-        }
-    }
-
     private static final void testEncode(Base64.Encoder enc, ByteBuffer bin, byte[] expected)
         throws Throwable {
 
@@ -587,71 +489,6 @@
         checkEqual(buf, expected, "Base64 dec.decode(bf) failed!");
     }
 
-    private static final void testEncode(Base64.Encoder enc, byte[] expected,
-                                         ByteBuffer ibb, ByteBuffer obb)
-        throws Throwable {
-        Random rnd = new Random();
-        int bytesOut = enc.encode(ibb, obb, 0);
-        if (ibb.hasRemaining()) {
-            throw new RuntimeException(
-                "Base64 enc.encode(bf, bf) failed with wrong return!");
-        }
-        obb.flip();
-        byte[] buf = new byte[obb.remaining()];
-        obb.get(buf);
-        checkEqual(buf, expected, "Base64 enc.encode(bf, bf) failed!");
-        ibb.rewind();
-        obb.position(0);
-        obb.limit(0);
-        bytesOut = 0;
-
-        do {  // increase the "limit" incrementally & randomly
-            int n = rnd.nextInt(expected.length - obb.position());
-            if (n == 0)
-                n = 1;
-            obb.limit(obb.limit() + n);
-            //obb.limit(Math.min(obb.limit() + n, expected.length));
-            bytesOut = enc.encode(ibb, obb, bytesOut);
-        } while (ibb.hasRemaining());
-        obb.flip();
-        buf = new byte[obb.remaining()];
-        obb.get(buf);
-        checkEqual(buf, expected, "Base64 enc.encode(bf, bf) failed!");
-    }
-
-    private static final void testDecode(Base64.Decoder dec, byte[] expected,
-                                         ByteBuffer ibb, ByteBuffer obb)
-        throws Throwable {
-        Random rnd = new Random();
-
-        dec.decode(ibb, obb);
-        if (ibb.hasRemaining()) {
-            throw new RuntimeException(
-                "Base64 dec.decode(bf, bf) failed with un-decoded ibb!");
-        }
-        obb.flip();
-        byte[] buf = new byte[obb.remaining()];
-        obb.get(buf);
-        checkEqual(buf, expected, "Base64 dec.decode(bf, bf) failed!");
-
-        ibb.rewind();
-        obb.position(0);
-        obb.limit(0);
-        do {  // increase the "limit" incrementally & randomly
-            int n = rnd.nextInt(expected.length - obb.position());
-            if (n == 0)
-                n = 1;
-            obb.limit(obb.limit() + n);
-            dec.decode(ibb, obb);
-         } while (ibb.hasRemaining());
-
-
-        obb.flip();
-        buf = new byte[obb.remaining()];
-        obb.get(buf);
-        checkEqual(buf, expected, "Base64 dec.decode(bf, bf) failed!");
-    }
-
     private static final void checkEqual(int v1, int v2, String msg)
         throws Throwable {
        if (v1 != v2) {
diff --git a/jdk/test/java/util/Base64/TestBase64Golden.java b/jdk/test/java/util/Base64/TestBase64Golden.java
index 192f2ed..bcee18c 100644
--- a/jdk/test/java/util/Base64/TestBase64Golden.java
+++ b/jdk/test/java/util/Base64/TestBase64Golden.java
@@ -55,7 +55,6 @@
         test0(Base64Type.MIME, Base64.getMimeEncoder(), Base64.getMimeDecoder(),
               "plain.txt", "mimeEncode.txt");
         test1();
-        test2();
     }
 
     public static void test0(Base64Type type, Encoder encoder, Decoder decoder,
@@ -113,28 +112,6 @@
             assertEqual(resBuf, encodedBuf);
             srcBuf.rewind(); // reset for next test
 
-            // test encode(ByteBuffer, ByteBuffer, bytesOut)
-            resBuf.clear();
-            len = encoder.encode(srcBuf, resBuf, 0);
-            assertEqual(len, encodedArr.length);
-            assertEqual(srcBuf.position(), limit);
-            assertEqual(srcBuf.limit(), limit);
-            assertEqual(resBuf.position(), len);
-            resBuf.flip();
-            assertEqual(resBuf, encodedBuf);
-            srcBuf.rewind();
-
-            // test encode(ByteBuffer, ByteBuffer, bytesOut)[direct]
-            ByteBuffer resBuf_d = ByteBuffer.allocateDirect(encodedArr.length);
-            len = encoder.encode(srcBuf, resBuf_d, 0);
-            assertEqual(len, encodedArr.length);
-            assertEqual(srcBuf.position(), limit);
-            assertEqual(srcBuf.limit(), limit);
-            assertEqual(resBuf_d.position(), len);
-            resBuf_d.flip();
-            assertEqual(resBuf_d, encodedBuf);
-            srcBuf.rewind();
-
             // test String encodeToString(byte[])
             String resEncodeStr = encoder.encodeToString(srcArr);
             assertEqual(resEncodeStr, encodedStr);
@@ -157,28 +134,6 @@
             assertEqual(resBuf, srcBuf);
             encodedBuf.rewind(); // reset for next test
 
-            // test int decode(ByteBuffer, ByteBuffer)
-            resBuf.clear();
-            len = decoder.decode(encodedBuf, resBuf);
-            assertEqual(len, srcArr.length);
-            assertEqual(encodedBuf.position(), limit);
-            assertEqual(encodedBuf.limit(), limit);
-            assertEqual(resBuf.position(), len);
-            resBuf.flip();
-            assertEqual(resBuf, srcBuf);
-            encodedBuf.rewind(); // reset for next test
-
-            // test int decode(ByteBuffer, ByteBuffer)[direct]
-            resBuf_d = ByteBuffer.allocateDirect(srcArr.length);
-            len = decoder.decode(encodedBuf, resBuf_d);
-            assertEqual(len, srcArr.length);
-            assertEqual(encodedBuf.position(), limit);
-            assertEqual(encodedBuf.limit(), limit);
-            assertEqual(resBuf_d.position(), len);
-            resBuf_d.flip();
-            assertEqual(resBuf_d, srcBuf);
-            encodedBuf.rewind(); // reset for next test
-
             // test byte[] decode(String)
             resArr = decoder.decode(encodedStr);
             assertEqual(resArr, srcArr);
@@ -197,35 +152,6 @@
     }
 
     private static void test1() throws Exception {
-        byte[] src = new byte[6];
-        new Random().nextBytes(src);
-
-        ByteBuffer srcBuf = ByteBuffer.allocate(10);
-        srcBuf.position(2);
-        srcBuf.mark();
-        srcBuf.limit(8);
-        srcBuf.put(src);
-        srcBuf.reset();
-
-        ByteBuffer dstBuf = ByteBuffer.allocate((src.length + 2) / 3 * 4);
-        Base64.getEncoder().encode(srcBuf, dstBuf, 0);
-        dstBuf.rewind();
-        byte[] dst = new byte[dstBuf.limit()];
-        dstBuf.get(dst);
-        System.out.printf("%n    src[%d]: %s%n", src.length, new String(src));
-        System.out.printf("encoded[%d]: %s%n",   dst.length, new String(dst));
-        assertEqual(src, Base64.getDecoder().decode(dst));
-
-        dstBuf = ByteBuffer.allocateDirect((src.length + 2) / 3 * 4);
-        srcBuf.reset();
-        Base64.getEncoder().encode(srcBuf, dstBuf, 0);
-        dstBuf.rewind();
-        dst = new byte[dstBuf.limit()];
-        dstBuf.get(dst);
-        assertEqual(src, Base64.getDecoder().decode(dst));
-    }
-
-    private static void test2() throws Exception {
         byte[] src = new byte[] {
             46, -97, -35, -44, 127, -60, -39, -4, -112, 34, -57, 47, -14, 67,
             40, 18, 90, -59, 68, 112, 23, 121, -91, 94, 35, 49, 104, 17, 30,
diff --git a/jdk/test/java/util/concurrent/CompletableFuture/ThenComposeAsyncTest.java b/jdk/test/java/util/concurrent/CompletableFuture/ThenComposeAsyncTest.java
new file mode 100644
index 0000000..2ee785b
--- /dev/null
+++ b/jdk/test/java/util/concurrent/CompletableFuture/ThenComposeAsyncTest.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 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.
+ */
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.CountDownLatch;
+
+
+/**
+ * @test
+ * @bug 8029164
+ * @run testng ThenComposeAsyncTest
+ * @run testng/othervm -Djava.util.concurrent.ForkJoinPool.common.parallelism=0 ThenComposeAsyncTest
+ * @summary Test that CompletableFuture.thenCompose works correctly if the
+ * composing task is complete before composition
+ */
+@Test
+public class ThenComposeAsyncTest {
+
+    public void testThenComposeAsync() throws Exception {
+        // Composing CompletableFuture is complete
+        CompletableFuture<String> cf1 = CompletableFuture.completedFuture("one");
+
+        // Composing function returns a CompletableFuture executed asynchronously
+        CountDownLatch cdl = new CountDownLatch(1);
+        CompletableFuture<String> cf2 = cf1.thenCompose(str -> CompletableFuture.supplyAsync(() -> {
+            while (true) {
+                try {
+                    cdl.await();
+                    break;
+                }
+                catch (InterruptedException e) {
+                }
+            }
+            return str + ", two";
+        }));
+
+        // Ensure returned CompletableFuture completes after call to thenCompose
+        // This guarantees that any premature internal completion will be
+        // detected
+        cdl.countDown();
+
+        String val = cf2.get();
+        Assert.assertNotNull(val);
+        Assert.assertEquals(val, "one, two");
+    }
+}
diff --git a/jdk/test/java/util/concurrent/ConcurrentHashMap/ConcurrentAssociateTest.java b/jdk/test/java/util/concurrent/ConcurrentHashMap/ConcurrentAssociateTest.java
new file mode 100644
index 0000000..b0a1ecc
--- /dev/null
+++ b/jdk/test/java/util/concurrent/ConcurrentHashMap/ConcurrentAssociateTest.java
@@ -0,0 +1,145 @@
+/*
+ * Copyright (c) 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.
+ */
+
+import org.testng.annotations.Test;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.CompletionException;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.ThreadLocalRandom;
+import java.util.function.BiConsumer;
+import java.util.function.Supplier;
+import java.util.stream.IntStream;
+import java.util.stream.Stream;
+
+/**
+ * @test
+ * @bug 8028564
+ * @run testng ConcurrentAssociateTest
+ * @summary Test that association operations, such as put and compute,
+ * place entries in the map
+ */
+@Test
+public class ConcurrentAssociateTest {
+
+    // The number of entries for each thread to place in a map
+    private static final int N = Integer.getInteger("n", 128);
+    // The number of iterations of the test
+    private static final int I = Integer.getInteger("i", 256);
+
+    // Object to be placed in the concurrent map
+    static class X {
+        // Limit the hash code to trigger collisions
+        int hc = ThreadLocalRandom.current().nextInt(1, 9);
+
+        public int hashCode() { return hc; }
+    }
+
+    @Test
+    public void testPut() {
+        test("CHM.put", (m, o) -> m.put(o, o));
+    }
+
+    @Test
+    public void testCompute() {
+        test("CHM.compute", (m, o) -> m.compute(o, (k, v) -> o));
+    }
+
+    @Test
+    public void testComputeIfAbsent() {
+        test("CHM.computeIfAbsent", (m, o) -> m.computeIfAbsent(o, (k) -> o));
+    }
+
+    @Test
+    public void testMerge() {
+        test("CHM.merge", (m, o) -> m.merge(o, o, (v1, v2) -> v1));
+    }
+
+    @Test
+    public void testPutAll() {
+        test("CHM.putAll", (m, o) -> {
+            Map<Object, Object> hm = new HashMap<>();
+            hm.put(o, o);
+            m.putAll(hm);
+        });
+    }
+
+    private static void test(String desc, BiConsumer<ConcurrentMap<Object, Object>, Object> associator) {
+        for (int i = 0; i < I; i++) {
+            testOnce(desc, associator);
+        }
+    }
+
+    static class AssociationFailure extends RuntimeException {
+        AssociationFailure(String message) {
+            super(message);
+        }
+    }
+
+    private static void testOnce(String desc, BiConsumer<ConcurrentMap<Object, Object>, Object> associator) {
+        ConcurrentHashMap<Object, Object> m = new ConcurrentHashMap<>();
+        CountDownLatch s = new CountDownLatch(1);
+
+        Supplier<Runnable> sr = () -> () -> {
+            try {
+                s.await();
+            }
+            catch (InterruptedException e) {
+            }
+
+            for (int i = 0; i < N; i++) {
+                Object o = new X();
+                associator.accept(m, o);
+                if (!m.containsKey(o)) {
+                    throw new AssociationFailure(desc + " failed: entry does not exist");
+                }
+            }
+        };
+
+        int ps = Runtime.getRuntime().availableProcessors();
+        Stream<CompletableFuture> runners = IntStream.range(0, ps)
+                .mapToObj(i -> sr.get())
+                .map(CompletableFuture::runAsync);
+
+        CompletableFuture all = CompletableFuture.allOf(
+                runners.toArray(CompletableFuture[]::new));
+
+        // Trigger the runners to start associating
+        s.countDown();
+        try {
+            all.join();
+        } catch (CompletionException e) {
+            Throwable t = e.getCause();
+            if (t instanceof AssociationFailure) {
+                throw (AssociationFailure) t;
+            }
+            else {
+                throw e;
+            }
+        }
+    }
+}
diff --git a/jdk/test/java/util/concurrent/ConcurrentHashMap/ConcurrentContainsKeyTest.java b/jdk/test/java/util/concurrent/ConcurrentHashMap/ConcurrentContainsKeyTest.java
new file mode 100644
index 0000000..84929de
--- /dev/null
+++ b/jdk/test/java/util/concurrent/ConcurrentHashMap/ConcurrentContainsKeyTest.java
@@ -0,0 +1,137 @@
+/*
+ * Copyright (c) 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.
+ */
+
+import org.testng.annotations.Test;
+
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.CompletionException;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.CountDownLatch;
+import java.util.function.Supplier;
+import java.util.stream.IntStream;
+import java.util.stream.Stream;
+
+/**
+ * @test
+ * @bug 8028564
+ * @run testng ConcurrentContainsKeyTest
+ * @summary Test that entries are always present in the map,
+ * when entries are held within one bin that is a tree
+ */
+@Test
+public class ConcurrentContainsKeyTest {
+
+    // The number of entries for each thread to place in a map
+    // Should be > ConcurrentHashMap.TREEIFY_THRESHOLD but small
+    // enough to allow for enough iteration overlap by multiple threads
+    private static final int N = Integer.getInteger("n", 16);
+    // The number of rounds each thread performs per entry
+    private static final int R = Integer.getInteger("r", 32);
+    // The number of iterations of the test
+    private static final int I = Integer.getInteger("i", 256);
+
+    // Object to be placed in the concurrent map
+    static class X implements Comparable<X> {
+
+        private final int a;
+
+        X(int a) {
+            this.a = a;
+        }
+
+        public int compareTo(X o) {
+            return this.a - o.a;
+        }
+
+        public int hashCode() {
+            // Return the same hash code to guarantee collisions
+            return 0;
+        }
+    }
+
+    @Test
+    public void testContainsKey() {
+        X[] content = IntStream.range(0, N).mapToObj(i -> new X(i)).toArray(X[]::new);
+        // Create map with an initial size >= ConcurrentHashMap.TREEIFY_THRESHOLD
+        // ensuring tree'ification will occur for a small number of entries
+        // with the same hash code
+        ConcurrentHashMap<Object, Object> m = new ConcurrentHashMap<>(64);
+        Stream.of(content).forEach(x -> m.put(x, x));
+        test(content, m);
+    }
+
+
+    private static void test(X[] content, ConcurrentHashMap<Object, Object> m) {
+        for (int i = 0; i < I; i++) {
+            testOnce(content, m);
+        }
+    }
+
+    static class AssociationFailure extends RuntimeException {
+        AssociationFailure(String message) {
+            super(message);
+        }
+    }
+
+    private static void testOnce(Object[] content, ConcurrentHashMap<Object, Object> m) {
+        CountDownLatch s = new CountDownLatch(1);
+
+        Supplier<Runnable> sr = () -> () -> {
+            try {
+                s.await();
+            }
+            catch (InterruptedException e) {
+            }
+
+            for (int i = 0; i < R * N; i++) {
+                Object o = content[i % content.length];
+                if (!m.containsKey(o)) {
+                    throw new AssociationFailure("CHM.containsKey failed: entry does not exist");
+                }
+            }
+        };
+
+        int ps = Runtime.getRuntime().availableProcessors();
+        Stream<CompletableFuture> runners = IntStream.range(0, ps)
+                .mapToObj(i -> sr.get())
+                .map(CompletableFuture::runAsync);
+
+        CompletableFuture all = CompletableFuture.allOf(
+                runners.toArray(CompletableFuture[]::new));
+
+        // Trigger the runners to start checking key membership
+        s.countDown();
+        try {
+            all.join();
+        }
+        catch (CompletionException e) {
+            Throwable t = e.getCause();
+            if (t instanceof AssociationFailure) {
+                throw (AssociationFailure) t;
+            }
+            else {
+                throw e;
+            }
+        }
+    }
+}
diff --git a/jdk/test/java/util/logging/TestLogConfigurationDeadLock.java b/jdk/test/java/util/logging/TestLogConfigurationDeadLock.java
new file mode 100644
index 0000000..3d1e3d2
--- /dev/null
+++ b/jdk/test/java/util/logging/TestLogConfigurationDeadLock.java
@@ -0,0 +1,255 @@
+/*
+ * Copyright (c) 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.
+ */
+import java.lang.management.ManagementFactory;
+import java.lang.management.ThreadInfo;
+import java.security.Permission;
+import java.security.Policy;
+import java.security.ProtectionDomain;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicLong;
+import java.util.logging.LogManager;
+import java.util.logging.Logger;
+
+
+/**
+ * @test
+ * @bug 8029281 8027670
+ * @summary Synchronization issues in Logger and LogManager. This test
+ *       focusses more particularly on potential deadlock in
+ *       drainLoggerRefQueueBounded / readConfiguration
+ * @run main/othervm TestLogConfigurationDeadLock
+ * @author danielfuchs
+ */
+// This test is a best effort to try & detect issues. The test itself will run
+// for 8secs. This is usually unsufficient to detect issues.
+// To get a greater confidence it is recommended to run this test in a loop:
+// e.g. use something like:
+// $ while jtreg -jdk:$JDK -verbose:all  \
+//      test/java/util/logging/TestLogConfigurationDeadLock.java ; \
+//      do echo Running test again ; done
+// and let it run for a few hours...
+//
+public class TestLogConfigurationDeadLock {
+
+    static volatile Exception thrown = null;
+    static volatile boolean goOn = true;
+
+    static final int READERS = 2;
+    static final int LOGGERS = 2;
+    static final long TIME = 4 * 1000; // 4 sec.
+    static final long STEP = 1 * 1000;  // message every 1 sec.
+    static final int  LCOUNT = 50; // 50 loggers created in a row...
+    static final AtomicLong nextLogger = new AtomicLong(0);
+    static final AtomicLong readCount = new AtomicLong(0);
+    static final AtomicLong checkCount = new AtomicLong(0);
+
+    /**
+     * This test will run both with and without a security manager.
+     *
+     * The test starts a number of threads that will call
+     *     LogManager.readConfiguration() concurrently (ReadConf), then starts
+     *     a number of threads that will create new loggers concurrently
+     *     (AddLogger), and then two additional threads: one (Stopper) that
+     *     will stop the test after 4secs (TIME ms), and one DeadlockDetector
+     *     that will attempt to detect deadlocks.
+     * If after 4secs no deadlock was detected and no exception was thrown
+     * then the test is considered a success and passes.
+     *
+     * This procedure is done twice: once without a security manager and once
+     * again with a security manager - which means the test takes ~8secs to
+     * run.
+     *
+     * Note that 8sec may not be enough to detect issues if there are some.
+     * This is a best effort test.
+     *
+     * @param args the command line arguments
+     */
+    public static void main(String[] args) throws Exception {
+
+        // test without security
+        System.out.println("No security");
+        test();
+
+        // test with security
+        System.out.println("\nWith security");
+        Policy.setPolicy(new Policy() {
+            @Override
+            public boolean implies(ProtectionDomain domain, Permission permission) {
+                if (super.implies(domain, permission)) return true;
+                // System.out.println("Granting " + permission);
+                return true; // all permissions
+            }
+        });
+        System.setSecurityManager(new SecurityManager());
+        test();
+    }
+
+    /**
+     * Starts all threads, wait 4secs, then stops all threads.
+     * @throws Exception if a deadlock was detected or an error occurred.
+     */
+    public static void test() throws Exception {
+          goOn = true;
+          thrown = null;
+          long sNextLogger = nextLogger.get();
+          long sReadCount  = readCount.get();
+          long sCheckCount = checkCount.get();
+          List<Thread> threads = new ArrayList<>();
+          for (int i = 0; i<READERS; i++) {
+              threads.add(new ReadConf());
+          }
+          for (int i = 0; i<LOGGERS; i++) {
+              threads.add(new AddLogger());
+          }
+          threads.add(new DeadlockDetector());
+          threads.add(0, new Stopper(TIME));
+          for (Thread t : threads) {
+              t.start();
+          }
+          for (Thread t : threads) {
+              try {
+                  t.join();
+              } catch (Exception x) {
+                  fail(x);
+              }
+          }
+          if (thrown != null) {
+              throw thrown;
+          }
+          System.out.println("Passed: " + (nextLogger.get() - sNextLogger)
+                  + " loggers created by " + LOGGERS + " Thread(s),");
+          System.out.println("\t LogManager.readConfiguration() called "
+                  + (readCount.get() - sReadCount) + " times by " + READERS
+                  + " Thread(s).");
+          System.out.println("\t ThreadMXBean.findDeadlockedThreads called "
+                  + (checkCount.get() -sCheckCount) + " times by 1 Thread.");
+
+    }
+
+
+    final static class ReadConf extends Thread {
+        @Override
+        public void run() {
+            while (goOn) {
+                try {
+                    LogManager.getLogManager().readConfiguration();
+                    readCount.incrementAndGet();
+                    Thread.sleep(1);
+                } catch (Exception x) {
+                    fail(x);
+                }
+            }
+        }
+    }
+
+    final static class AddLogger extends Thread {
+        @Override
+        public void run() {
+            try {
+                while (goOn) {
+                    Logger l;
+                    Logger foo = Logger.getLogger("foo");
+                    Logger bar = Logger.getLogger("foo.bar");
+                    for (int i=0; i < LCOUNT ; i++) {
+                        l = Logger.getLogger("foo.bar.l"+nextLogger.incrementAndGet());
+                        l.fine("I'm fine");
+                        if (!goOn) break;
+                        Thread.sleep(1);
+                    }
+                }
+            } catch (InterruptedException | RuntimeException x ) {
+                fail(x);
+            }
+        }
+    }
+
+    final static class DeadlockDetector extends Thread {
+
+        @Override
+        public void run() {
+            while(goOn) {
+                try {
+                    long[] ids = ManagementFactory.getThreadMXBean().findDeadlockedThreads();
+                    checkCount.incrementAndGet();
+                    ids = ids == null ? new long[0] : ids;
+                    if (ids.length == 1) {
+                        throw new RuntimeException("Found 1 deadlocked thread: "+ids[0]);
+                    } else if (ids.length > 0) {
+                        ThreadInfo[] infos = ManagementFactory.getThreadMXBean().getThreadInfo(ids);
+                        System.err.println("Found "+ids.length+" deadlocked threads: ");
+                        for (ThreadInfo inf : infos) {
+                            System.err.println(inf.toString());
+                        }
+                        throw new RuntimeException("Found "+ids.length+" deadlocked threads");
+                    }
+                    Thread.sleep(100);
+                } catch(InterruptedException | RuntimeException x) {
+                    fail(x);
+                }
+            }
+        }
+
+    }
+
+    static final class Stopper extends Thread {
+        long start;
+        long time;
+
+        Stopper(long time) {
+            start = System.currentTimeMillis();
+            this.time = time;
+        }
+
+        @Override
+        public void run() {
+            try {
+                long rest, previous;
+                previous = time;
+                while (goOn && (rest = start - System.currentTimeMillis() + time) > 0) {
+                    if (previous == time || previous - rest >= STEP) {
+                        Logger.getLogger("remaining").info(String.valueOf(rest)+"ms remaining...");
+                        previous = rest == time ? rest -1 : rest;
+                        System.gc();
+                    }
+                    if (goOn == false) break;
+                    Thread.sleep(Math.min(rest, 100));
+                }
+                System.out.println(System.currentTimeMillis() - start
+                        + " ms elapsed ("+time+ " requested)");
+                goOn = false;
+            } catch(InterruptedException | RuntimeException x) {
+                fail(x);
+            }
+        }
+
+    }
+
+    static void fail(Exception x) {
+        x.printStackTrace();
+        if (thrown == null) {
+            thrown = x;
+        }
+        goOn = false;
+    }
+}
diff --git a/jdk/test/java/util/logging/TestLoggerBundleSync.java b/jdk/test/java/util/logging/TestLoggerBundleSync.java
new file mode 100644
index 0000000..bbac23c
--- /dev/null
+++ b/jdk/test/java/util/logging/TestLoggerBundleSync.java
@@ -0,0 +1,534 @@
+/*
+ * Copyright (c) 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.
+ */
+
+import java.lang.management.ManagementFactory;
+import java.lang.management.ThreadInfo;
+import java.security.Permission;
+import java.security.Policy;
+import java.security.ProtectionDomain;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.ListResourceBundle;
+import java.util.Objects;
+import java.util.ResourceBundle;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.FutureTask;
+import java.util.concurrent.atomic.AtomicLong;
+import java.util.logging.Handler;
+import java.util.logging.Level;
+import java.util.logging.LogRecord;
+import java.util.logging.Logger;
+
+/**
+ * @test
+ * @bug 8029281 8028763
+ * @summary Attempts to detect synchronization issues with getResourceBundle()
+ *          and getResourceBundleName(). It might also detect issues in the way
+ *          that the logger tree is cleaned up after a logger has been garbage
+ *          collected. This test helped find the root cause of 8029092, so if
+ *          this test fails one might also expect failures in
+ *          java/util/logging/Logger/logrb/TestLogrbResourceBundle.java and
+ *          java/util/logging/Logger/setResourceBundle/TestSetResourceBundle.java.
+ *          Note that this is a best effort test. Running it in a loop to
+ *          reproduce intermittent issues can be a good idea.
+ * @run main/othervm TestLoggerBundleSync
+ * @author danielfuchs
+ */
+public class TestLoggerBundleSync {
+
+    static volatile Exception thrown = null;
+    static volatile boolean goOn = true;
+
+    static final int READERS = 3;
+    static final long TIME = 4 * 1000; // 4 sec.
+    static final long STEP = 1 * 1000;  // message every 1 sec.
+    static final int  LCOUNT = 50; // change bundle 50 times...
+    static final AtomicLong setRBcount = new AtomicLong(0);
+    static final AtomicLong setRBNameCount = new AtomicLong(0);
+    static final AtomicLong getRBcount = new AtomicLong(0);
+    static final AtomicLong checkCount = new AtomicLong(0);
+    static final AtomicLong nextLong = new AtomicLong(0);
+
+    public static class MyBundle extends ListResourceBundle {
+        @Override
+        protected Object[][] getContents() {
+            return new Object[][] {
+               {"dummy", "foo"}
+            };
+        }
+    }
+
+    public static final class MyBundle1 extends MyBundle { };
+    public static final class MyBundle2 extends MyBundle { };
+    public static final class MyBundle3 extends MyBundle { };
+
+
+    public static final class LoggerRB {
+        public final String resourceBundleName;
+        public final ResourceBundle userBundle;
+        public LoggerRB(String name, ResourceBundle bundle) {
+            resourceBundleName = name;
+            userBundle = bundle;
+        }
+    }
+
+    static final List<Class<? extends ResourceBundle>> classes = new ArrayList<>();
+    static {
+        classes.add(MyBundle1.class);
+        classes.add(MyBundle2.class);
+        classes.add(MyBundle3.class);
+    }
+
+
+    /**
+     * This test will run both with and without a security manager.
+     *
+     * The test starts a number of threads that will attempt to concurrently
+     * set resource bundles on Logger, and verifies the consistency of the
+     * obtained results.
+     *
+     * This is a best effort test.
+     *
+     * @param args the command line arguments
+     */
+    public static void main(String[] args) throws Exception {
+
+        try {
+            // test without security
+            System.out.println("No security");
+            test();
+
+            // test with security
+            System.out.println("\nWith security");
+            Policy.setPolicy(new Policy() {
+                @Override
+                public boolean implies(ProtectionDomain domain, Permission permission) {
+                    if (super.implies(domain, permission)) return true;
+                    // System.out.println("Granting " + permission);
+                    return true; // all permissions
+                }
+            });
+            System.setSecurityManager(new SecurityManager());
+            test();
+        } finally {
+            SetRB.executor.shutdownNow();
+            SetRBName.executor.shutdownNow();
+        }
+    }
+
+    /**
+     * Starts all threads, wait 15secs, then stops all threads.
+     * @throws Exception if a deadlock was detected or an error occurred.
+     */
+    public static void test() throws Exception {
+          goOn = true;
+          thrown = null;
+          long sGetRBCount = getRBcount.get();
+          long sSetRBCount  = setRBcount.get();
+          long sSetRBNameCount  = setRBNameCount.get();
+          long sCheckCount = checkCount.get();
+          long sNextLong = nextLong.get();
+          List<Thread> threads = new ArrayList<>();
+          for (Class<? extends ResourceBundle> type : classes) {
+              threads.add(new SetRB(type));
+              threads.add(new SetRBName(type));
+          }
+          for (int i =0 ; i < READERS ; i++) {
+              threads.add(new GetRB());
+          }
+          threads.add(new DeadlockDetector());
+          threads.add(0, new Stopper(TIME));
+          for (Thread t : threads) {
+              t.start();
+          }
+          for (Thread t : threads) {
+              try {
+                  t.join();
+              } catch (Exception x) {
+                  fail(x);
+              }
+          }
+          if (thrown != null) {
+              throw thrown;
+          }
+          System.out.println("Passed: " + (nextLong.longValue() - sNextLong)
+                  + " unique loggers created");
+          System.out.println("\t " +(getRBcount.get() - sGetRBCount)
+                  + " loggers tested by " + READERS + " Thread(s),");
+          System.out.println("\t " + (setRBcount.get() - sSetRBCount)
+                  + " resource bundles set by " + classes.size() + " Thread(s),");
+          System.out.println("\t " + (setRBNameCount.get() - sSetRBNameCount)
+                  + " resource bundle names set by " + classes.size() + " Thread(s),");
+          System.out.println("\t ThreadMXBean.findDeadlockedThreads called "
+                  + (checkCount.get() -sCheckCount) + " times by 1 Thread.");
+
+    }
+
+    final static class GetRB extends Thread {
+        final static class MyHandler extends Handler {
+            volatile ResourceBundle rb;
+            volatile String rbName;
+            @Override
+            public synchronized void publish(LogRecord record) {
+                rb = record.getResourceBundle();
+                rbName = record.getResourceBundleName();
+            }
+
+            @Override
+            public void flush() {
+            }
+
+            @Override
+            public void close() throws SecurityException {
+            }
+        };
+        final MyHandler handler = new MyHandler();
+        @Override
+        public void run() {
+            try {
+                handler.setLevel(Level.FINEST);
+                while (goOn) {
+                    Logger l;
+                    Logger foo = Logger.getLogger("foo");
+                    Logger bar = Logger.getLogger("foo.bar");
+                    for (long i=0; i < nextLong.longValue() + 100 ; i++) {
+                        if (!goOn) break;
+                        l = Logger.getLogger("foo.bar.l"+i);
+                        final ResourceBundle b = l.getResourceBundle();
+                        final String name = l.getResourceBundleName();
+                        if (b != null) {
+                            if (!name.equals(b.getBaseBundleName())) {
+                                throw new RuntimeException("Unexpected bundle name: "
+                                        +b.getBaseBundleName());
+                            }
+                        }
+                        Logger ll = Logger.getLogger(l.getName()+".bie.bye");
+                        ResourceBundle hrb;
+                        String hrbName;
+                        ll.setLevel(Level.FINEST);
+                        ll.addHandler(handler);
+                        ll.fine("dummy");
+                        ll.removeHandler(handler);
+                        hrb = handler.rb;
+                        hrbName = handler.rbName;
+                        if (name != null) {
+                            if (!name.equals(hrbName)) {
+                                throw new RuntimeException("Unexpected bundle name: "
+                                        +hrb.getBaseBundleName());
+                            }
+                            if (!name.equals(hrb.getBaseBundleName())) {
+                                throw new RuntimeException("Unexpected bundle name: "
+                                        +hrb.getBaseBundleName());
+                            }
+                        }
+
+                        getRBcount.incrementAndGet();
+                        if (!goOn) break;
+                        Thread.sleep(1);
+                    }
+                }
+           } catch (Exception x) {
+               fail(x);
+           }
+        }
+    }
+
+    final static class SetRB extends Thread {
+        final Class<? extends ResourceBundle> type;
+        final static ExecutorService executor = Executors.newSingleThreadExecutor();
+        final static class CheckRBTask implements Callable<Exception> {
+            final Logger logger;
+            volatile String rbName;
+            volatile ResourceBundle rb;
+
+            public CheckRBTask(Logger logger) {
+                this.logger = logger;
+            }
+
+            @Override
+            public Exception call() throws Exception {
+                try {
+                    final String name = logger.getResourceBundleName();
+                    if (!Objects.equals(name, rbName)) {
+                        throw new RuntimeException("Unexpected rbname for "
+                            + logger.getName() + ": " + name);
+                    }
+                    final ResourceBundle b = logger.getResourceBundle();
+                    if (b != rb) {
+                        throw new RuntimeException("Unexpected rb for "
+                            + logger.getName() + ": " + b);
+                    }
+                } catch(Exception x) {
+                    return x;
+                }
+                return null;
+            }
+
+            public void check() throws Exception {
+                final FutureTask<Exception> futureTask = new FutureTask<>(this);
+                executor.submit(futureTask);
+                Exception x = futureTask.get();
+                if ( x != null) {
+                    throw new RuntimeException("Check failed: "+x,x);
+                }
+            }
+        }
+        SetRB(Class<? extends ResourceBundle> type) {
+            super("SetRB["+type.getSimpleName()+"]");
+            this.type = type;
+        }
+        @Override
+        public void run() {
+            try {
+                while (goOn) {
+                    Logger l;
+                    Logger foo = Logger.getLogger("foo");
+                    Logger bar = Logger.getLogger("foo.bar");
+                    l = Logger.getLogger("foo.bar.l"+nextLong.incrementAndGet());
+                    final CheckRBTask checkTask = new CheckRBTask(l);
+                    checkTask.check();
+
+                    for (int i=0; i < LCOUNT ; i++) {
+                        if (!goOn) break;
+
+                        ResourceBundle b = ResourceBundle.getBundle(type.getName());
+                        try {
+                            l.setResourceBundle(b);
+                            checkTask.rb = b;
+                            checkTask.rbName = type.getName();
+                            checkTask.check();
+                            if (!goOn) break;
+
+                            String name = l.getResourceBundleName();
+                            ResourceBundle bb = l.getResourceBundle();
+                            if (!type.getName().equals(name)) {
+                                throw new RuntimeException(this.getName()
+                                        + ": Unexpected name: "+name);
+                            }
+                            if (!b.getBaseBundleName().equals(name)) {
+                                throw new RuntimeException(this.getName()
+                                        + ": Unexpected base name: " +
+                                        b.getBaseBundleName());
+                            }
+                            if (b != bb) {
+                                throw new RuntimeException(this.getName()
+                                        + ": Unexpected bundle: "+bb);
+                            }
+                            setRBcount.incrementAndGet();
+                        } catch (IllegalArgumentException x) {
+                            final String name = l.getResourceBundleName();
+                            if (!name.startsWith(MyBundle.class.getName())) {
+                                throw new RuntimeException(this.getName()
+                                        + ": Unexpected name: "+name, x);
+                            } else if (type.getName().equals(name)) {
+                                throw new RuntimeException(this.getName()
+                                        + ": Unexpected exception for "+name, x);
+                            }
+                            throw x;
+                        }
+                        l.fine("I'm fine");
+                        if (!goOn) break;
+                        Thread.sleep(1);
+                    }
+                }
+            } catch (Exception x) {
+                fail(x);
+            }
+        }
+    }
+
+    final static class SetRBName extends Thread {
+        int nexti = 0;
+        final Class<? extends ResourceBundle> type;
+        final static ExecutorService executor = Executors.newSingleThreadExecutor();
+        final static class CheckRBNameTask implements Callable<Exception> {
+            final Logger logger;
+            volatile String rbName;
+
+            public CheckRBNameTask(Logger logger) {
+                this.logger = logger;
+            }
+
+            @Override
+            public Exception call() throws Exception {
+                try {
+                    final String name = logger.getResourceBundleName();
+                    if (!Objects.equals(name, rbName)) {
+                        throw new RuntimeException("Unexpected rbname for "
+                            + logger.getName() + ": " + name);
+                    }
+                    final ResourceBundle b = logger.getResourceBundle();
+                    if (!Objects.equals(b == null ? null : b.getBaseBundleName(), rbName)) {
+                        throw new RuntimeException("Unexpected base name for "
+                            + logger.getName() + ": " + b.getBaseBundleName());
+                    }
+                } catch(Exception x) {
+                    return x;
+                }
+                return null;
+            }
+
+            public void check() throws Exception {
+                final FutureTask<Exception> futureTask = new FutureTask<>(this);
+                executor.submit(futureTask);
+                Exception x = futureTask.get();
+                if ( x != null) {
+                    throw new RuntimeException("Check failed: "+x,x);
+                }
+            }
+
+        }
+        SetRBName(Class<? extends ResourceBundle> type) {
+            super("SetRB["+type.getSimpleName()+"]");
+            this.type = type;
+        }
+        @Override
+        public void run() {
+            try {
+                while (goOn) {
+                    Logger foo = Logger.getLogger("foo");
+                    Logger bar = Logger.getLogger("foo.bar");
+                    Logger l = Logger.getLogger("foo.bar.l"+nextLong.incrementAndGet());
+                    final CheckRBNameTask checkTask = new CheckRBNameTask(l);
+                    checkTask.check();
+
+                    for (int i=0; i < LCOUNT ; i++) {
+                        if (!goOn) break;
+
+                        try {
+                            Logger l2 = Logger.getLogger(l.getName(), type.getName());
+                            if (l2 != l) {
+                                System.err.println("**** ERROR WITH "+l.getName());
+                                throw new RuntimeException("l2 != l ["
+                                        + l2 + "(" + l2.getName() + ") != "
+                                        + l  + "(" + l.getName()  + ")]");
+                            }
+                            checkTask.rbName = type.getName();
+                            checkTask.check();
+                            if (!goOn) break;
+
+                            String name = l.getResourceBundleName();
+                            ResourceBundle bb = l.getResourceBundle();
+                            if (!type.getName().equals(name)) {
+                                throw new RuntimeException(this.getName()
+                                        + ": Unexpected name: "+name);
+                            }
+                            if (!bb.getBaseBundleName().equals(name)) {
+                                throw new RuntimeException(this.getName()
+                                        + ": Unexpected base name: "
+                                        + bb.getBaseBundleName());
+                            }
+                            setRBNameCount.incrementAndGet();
+                        } catch (IllegalArgumentException x) {
+                            final String name = l.getResourceBundleName();
+                            if (!name.startsWith(MyBundle.class.getName())) {
+                                throw new RuntimeException(this.getName()
+                                        + ": Unexpected name: "+name, x);
+                            } else if (type.getName().equals(name)) {
+                                throw new RuntimeException(this.getName()
+                                        + ": Unexpected exception for "+name, x);
+                            }
+                            throw x;
+                        }
+                        l.fine("I'm fine");
+                        if (!goOn) break;
+                        Thread.sleep(1);
+                    }
+                }
+            } catch (Exception x) {
+                fail(x);
+            }
+        }
+    }
+
+    final static class DeadlockDetector extends Thread {
+
+        @Override
+        public void run() {
+            while(goOn) {
+                try {
+                    long[] ids = ManagementFactory.getThreadMXBean().findDeadlockedThreads();
+                    checkCount.incrementAndGet();
+                    ids = ids == null ? new long[0] : ids;
+                    if (ids.length == 1) {
+                        throw new RuntimeException("Found 1 deadlocked thread: "+ids[0]);
+                    } else if (ids.length > 0) {
+                        ThreadInfo[] infos = ManagementFactory.getThreadMXBean().getThreadInfo(ids);
+                        System.err.println("Found "+ids.length+" deadlocked threads: ");
+                        for (ThreadInfo inf : infos) {
+                            System.err.println(inf.toString());
+                        }
+                        throw new RuntimeException("Found "+ids.length+" deadlocked threads");
+                    }
+                    Thread.sleep(100);
+                } catch(InterruptedException | RuntimeException x) {
+                    fail(x);
+                }
+            }
+        }
+
+    }
+
+    static final class Stopper extends Thread {
+        long start;
+        long time;
+
+        Stopper(long time) {
+            start = System.currentTimeMillis();
+            this.time = time;
+        }
+
+        @Override
+        public void run() {
+            try {
+                long rest, previous;
+                previous = time;
+                while (goOn && (rest = start - System.currentTimeMillis() + time) > 0) {
+                    if (previous == time || previous - rest >= STEP) {
+                        Logger.getLogger("remaining").info(String.valueOf(rest)+"ms remaining...");
+                        previous = rest == time ? rest -1 : rest;
+                        System.gc();
+                    }
+                    if (goOn == false) break;
+                    Thread.sleep(Math.min(rest, 100));
+                }
+                System.out.println(System.currentTimeMillis() - start
+                        + " ms elapsed ("+time+ " requested)");
+                goOn = false;
+            } catch(InterruptedException | RuntimeException x) {
+                fail(x);
+            }
+        }
+
+    }
+
+    static void fail(Exception x) {
+        x.printStackTrace();
+        if (thrown == null) {
+            thrown = x;
+        }
+        goOn = false;
+    }
+}
diff --git a/jdk/test/java/util/stream/TestDoubleSumAverage.java b/jdk/test/java/util/stream/TestDoubleSumAverage.java
new file mode 100644
index 0000000..01453bd
--- /dev/null
+++ b/jdk/test/java/util/stream/TestDoubleSumAverage.java
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 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.
+ */
+
+import java.util.*;
+import java.util.function.*;
+import java.util.stream.*;
+
+/*
+ * @test
+ * @bug 8006572
+ * @summary Test for use of non-naive summation in stream-related sum and average operations.
+ */
+public class TestDoubleSumAverage {
+    public static void main(String... args) {
+        int failures = 0;
+
+        failures += testForCompenstation();
+        failures += testZeroAverageOfNonEmptyStream();
+
+        if (failures > 0) {
+            throw new RuntimeException("Found " + failures + " numerical failure(s).");
+        }
+    }
+
+    /**
+     * Compute the sum and average of a sequence of double values in
+     * various ways and report an error if naive summation is used.
+     */
+    private static int testForCompenstation() {
+        int failures = 0;
+
+        /*
+         * The exact sum of the test stream is 1 + 1e6*ulp(1.0) but a
+         * naive summation algorithm will return 1.0 since (1.0 +
+         * ulp(1.0)/2) will round to 1.0 again.
+         */
+        double base = 1.0;
+        double increment = Math.ulp(base)/2.0;
+        int count = 1_000_001;
+
+        double expectedSum = base + (increment * (count - 1));
+        double expectedAvg = expectedSum / count;
+
+        // Factory for double a stream of [base, increment, ..., increment] limited to a size of count
+        Supplier<DoubleStream> ds = () -> DoubleStream.iterate(base, e -> increment).limit(count);
+
+        DoubleSummaryStatistics stats = ds.get().collect(DoubleSummaryStatistics::new,
+                                                         DoubleSummaryStatistics::accept,
+                                                         DoubleSummaryStatistics::combine);
+
+        failures += compareUlpDifference(expectedSum, stats.getSum(), 3);
+        failures += compareUlpDifference(expectedAvg, stats.getAverage(), 3);
+
+        failures += compareUlpDifference(expectedSum,
+                                         ds.get().sum(), 3);
+        failures += compareUlpDifference(expectedAvg,
+                                         ds.get().average().getAsDouble(), 3);
+
+        failures += compareUlpDifference(expectedSum,
+                                         ds.get().boxed().collect(Collectors.summingDouble(d -> d)), 3);
+        failures += compareUlpDifference(expectedAvg,
+                                         ds.get().boxed().collect(Collectors.averagingDouble(d -> d)),3);
+        return failures;
+    }
+
+    /**
+     * Test to verify that a non-empty stream with a zero average is non-empty.
+     */
+    private static int testZeroAverageOfNonEmptyStream() {
+        Supplier<DoubleStream> ds = () -> DoubleStream.iterate(0.0, e -> 0.0).limit(10);
+
+        return  compareUlpDifference(0.0, ds.get().average().getAsDouble(), 0);
+    }
+
+    /**
+     * Compute the ulp difference of two double values and compare against an error threshold.
+     */
+    private static int compareUlpDifference(double expected, double computed, double threshold) {
+        double ulpDifference = Math.abs(expected - computed) / Math.ulp(expected);
+
+        if (ulpDifference > threshold) {
+            System.err.printf("Numerical summation error too large, %g ulps rather than %g.%n",
+                              ulpDifference, threshold);
+            return 1;
+        } else
+            return 0;
+    }
+}
diff --git a/jdk/test/javax/swing/JFrame/NSTexturedJFrame/NSTexturedJFrame.java b/jdk/test/javax/swing/JFrame/NSTexturedJFrame/NSTexturedJFrame.java
new file mode 100644
index 0000000..f3dd87c
--- /dev/null
+++ b/jdk/test/javax/swing/JFrame/NSTexturedJFrame/NSTexturedJFrame.java
@@ -0,0 +1,121 @@
+/*
+ * Copyright (c) 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.
+ */
+
+import java.awt.Rectangle;
+import java.awt.Robot;
+import java.awt.Toolkit;
+import java.awt.image.BufferedImage;
+
+import javax.swing.JFrame;
+import javax.swing.SwingUtilities;
+
+import sun.awt.OSInfo;
+import sun.awt.SunToolkit;
+
+/**
+ * @test
+ * @bug 7124513
+ * @summary We should support NSTexturedBackgroundWindowMask style on OSX.
+ * @author Sergey Bylokhov
+ */
+public final class NSTexturedJFrame {
+
+    private static final String BRUSH = "apple.awt.brushMetalLook";
+    private static final String STYLE = "Window.style";
+    private static final BufferedImage[] images = new BufferedImage[3];
+    private static Rectangle bounds;
+    private static volatile int step;
+    private static JFrame frame;
+
+    public static void main(final String[] args) throws Exception {
+        if (OSInfo.getOSType() != OSInfo.OSType.MACOSX) {
+            System.out.println("This test is for OSX, considered passed.");
+            return;
+        }
+        // Default window appearance
+        showFrame();
+        step++;
+        // apple.awt.brushMetalLook appearance
+        showFrame();
+        step++;
+        // Window.style appearance
+        showFrame();
+
+        // images on step 1 and 2 should be same
+        testImages(images[1], images[2], false);
+        // images on step 1 and 2 should be different from default
+        testImages(images[0], images[1], true);
+        testImages(images[0], images[2], true);
+    }
+
+    private static void testImages(BufferedImage img1, BufferedImage img2,
+                                   boolean shouldbeDifferent) {
+        boolean different = false;
+        for (int x = 0; x < img1.getWidth(); ++x) {
+            for (int y = 0; y < img1.getHeight(); ++y) {
+                if (img1.getRGB(x, y) != img2.getRGB(x, y)) {
+                    different = true;
+                }
+            }
+        }
+        if (different != shouldbeDifferent) {
+            throw new RuntimeException("Textured property does not work");
+        }
+    }
+
+    private static void showFrame() throws Exception {
+        final Robot robot = new Robot();
+        robot.setAutoDelay(50);
+        createUI();
+        images[step] = robot.createScreenCapture(bounds);
+        SwingUtilities.invokeAndWait(frame::dispose);
+        sleep();
+    }
+
+    private static void createUI() throws Exception {
+        SwingUtilities.invokeAndWait(() -> {
+            frame = new JFrame();
+            frame.setUndecorated(true);
+            frame.setSize(400, 400);
+            frame.setLocationRelativeTo(null);
+            switch (step) {
+                case 1:
+                    frame.getRootPane().putClientProperty(BRUSH, true);
+                    break;
+                case 2:
+                    frame.getRootPane().putClientProperty(STYLE, "textured");
+            }
+            frame.setVisible(true);
+        });
+        sleep();
+        SwingUtilities.invokeAndWait(() -> {
+            bounds = frame.getBounds();
+        });
+        sleep();
+    }
+
+    private static void sleep() throws InterruptedException {
+        ((SunToolkit) Toolkit.getDefaultToolkit()).realSync();
+        Thread.sleep(1000);
+    }
+}
diff --git a/jdk/test/lib/testlibrary/jdk/testlibrary/ProcessThread.java b/jdk/test/lib/testlibrary/jdk/testlibrary/ProcessThread.java
index 32e324e..dc6b32c 100644
--- a/jdk/test/lib/testlibrary/jdk/testlibrary/ProcessThread.java
+++ b/jdk/test/lib/testlibrary/jdk/testlibrary/ProcessThread.java
@@ -37,39 +37,21 @@
     /**
      * Creates a new {@code ProcessThread} object.
      *
-     * @param cmd The list of program and its arguments to pass to {@link ProcessBuilder}
-     */
-    public ProcessThread(List<String> cmd) {
-        super(new ProcessRunnable(cmd));
-    }
-
-    /**
-     * Creates a new {@code ProcessThread} object.
-     *
-     * @param cmd The string array of program and its arguments to pass to {@link ProcessBuilder}
-     */
-    public ProcessThread(String... cmd) {
-        super(new ProcessRunnable(cmd));
-    }
-
-    /**
-     * Creates a new {@code ProcessThread} object.
-     *
-     * @param threadName The name of thread
-     * @param cmd The list of program and its arguments to pass to {@link ProcessBuilder}
-     */
-    public ProcessThread(String threadName, List<String> cmd) {
-        super(new ProcessRunnable(cmd), threadName);
-    }
-
-    /**
-     * Creates a new {@code ProcessThread} object.
-     *
      * @param threadName The name of thread
      * @param cmd The string array of program and its arguments to pass to {@link ProcessBuilder}
      */
     public ProcessThread(String threadName, String... cmd) {
-        super(new ProcessRunnable(cmd), threadName);
+        super(new ProcessRunnable(new ProcessBuilder(cmd)), threadName);
+    }
+
+    /**
+     * Creates a new {@code ProcessThread} object.
+     *
+     * @param threadName The name of thread.
+     * @param pb The ProcessBuilder to execute.
+     */
+    public ProcessThread(String threadName, ProcessBuilder pb) {
+        super(new ProcessRunnable(pb), threadName);
     }
 
     /**
@@ -82,6 +64,13 @@
     }
 
     /**
+     * @return The process output, or null if the process has not yet completed.
+     */
+    public OutputAnalyzer getOutput() {
+        return ((ProcessRunnable) getRunnable()).getOutput();
+    }
+
+    /**
      * {@link Runnable} interface for starting and stopping {@link Process}.
      */
     static class ProcessRunnable extends XRun {
@@ -89,26 +78,16 @@
         private final ProcessBuilder processBuilder;
         private final CountDownLatch latch;
         private volatile Process process;
+        private volatile OutputAnalyzer output;
 
         /**
          * Creates a new {@code ProcessRunnable} object.
          *
-         * @param cmd The list of program and its arguments to to pass to {@link ProcessBuilder}
+         * @param pb The {@link ProcessBuilder} to run.
          */
-        public ProcessRunnable(List<String> cmd) {
+        public ProcessRunnable(ProcessBuilder pb) {
             super();
-            this.processBuilder = new ProcessBuilder(cmd);
-            this.latch = new CountDownLatch(1);
-        }
-
-        /**
-         * Creates a new {@code ProcessRunnable} object.
-         *
-         * @param cmd The string array of program and its arguments to to pass to {@link ProcessBuilder}
-         */
-        public ProcessRunnable(String... cmd) {
-            super();
-            this.processBuilder = new ProcessBuilder(cmd);
+            this.processBuilder = pb;
             this.latch = new CountDownLatch(1);
         }
 
@@ -125,12 +104,16 @@
             latch.countDown();
 
             // Will block...
-            OutputAnalyzer output = new OutputAnalyzer(this.process);
-
-            assertTrue(output.getOutput().isEmpty(), "Should get an empty output, got: "
-                        + Utils.NEW_LINE + output.getOutput());
-            assertNotEquals(output.getExitValue(), 0,
-                    "Process exited with unexpected exit code");
+            try {
+                output = new OutputAnalyzer(this.process);
+            } catch (Throwable t) {
+                String name = Thread.currentThread().getName();
+                System.out.println(String.format("ProcessThread[%s] failed: %s", name, t.toString()));
+                throw t;
+            } finally {
+                String logMsg = ProcessTools.getProcessLog(processBuilder, output);
+                System.out.println(logMsg);
+            }
         }
 
         /**
@@ -142,10 +125,19 @@
             // Wait until process is started
             latch.await();
             if (this.process != null) {
+                System.out.println("ProcessThread.stopProcess() will kill process");
                 this.process.destroy();
             }
         }
 
+        /**
+         * Returns the OutputAnalyzer with stdout/stderr from the process.
+         * @return The process output, or null if process not completed.
+         * @throws InterruptedException
+         */
+        public OutputAnalyzer getOutput() {
+            return output;
+        }
     }
 
 }
diff --git a/jdk/test/lib/testlibrary/jdk/testlibrary/ProcessTools.java b/jdk/test/lib/testlibrary/jdk/testlibrary/ProcessTools.java
index 9f96baa..a454ce5 100644
--- a/jdk/test/lib/testlibrary/jdk/testlibrary/ProcessTools.java
+++ b/jdk/test/lib/testlibrary/jdk/testlibrary/ProcessTools.java
@@ -266,4 +266,79 @@
         }
     }
 
+    /**
+     * Executes a test jvm process, waits for it to finish and returns the process output.
+     * The default jvm options from jtreg, test.vm.opts and test.java.opts, are added.
+     * The java from the test.jdk is used to execute the command.
+     *
+     * The command line will be like:
+     * {test.jdk}/bin/java {test.vm.opts} {test.java.opts} cmds
+     *
+     * @param cmds User specifed arguments.
+     * @return The output from the process.
+     */
+    public static OutputAnalyzer executeTestJvm(String... cmds) throws Throwable {
+        ProcessBuilder pb = createJavaProcessBuilder(Utils.addTestJavaOpts(cmds));
+        return executeProcess(pb);
+    }
+
+    /**
+     * Executes a process, waits for it to finish and returns the process output.
+     * @param pb The ProcessBuilder to execute.
+     * @return The output from the process.
+     */
+    public static OutputAnalyzer executeProcess(ProcessBuilder pb) throws Throwable {
+        OutputAnalyzer output = null;
+        try {
+            output = new OutputAnalyzer(pb.start());
+            return output;
+        } catch (Throwable t) {
+            System.out.println("executeProcess() failed: " + t);
+            throw t;
+        } finally {
+            System.out.println(getProcessLog(pb, output));
+        }
+    }
+
+    /**
+     * Executes a process, waits for it to finish and returns the process output.
+     * @param cmds The command line to execute.
+     * @return The output from the process.
+     */
+    public static OutputAnalyzer executeProcess(String... cmds) throws Throwable {
+        return executeProcess(new ProcessBuilder(cmds));
+    }
+
+    /**
+     * Used to log command line, stdout, stderr and exit code from an executed process.
+     * @param pb The executed process.
+     * @param output The output from the process.
+     */
+    public static String getProcessLog(ProcessBuilder pb, OutputAnalyzer output) {
+        String stderr = output == null ? "null" : output.getStderr();
+        String stdout = output == null ? "null" : output.getStdout();
+        String exitValue = output == null ? "null": Integer.toString(output.getExitValue());
+        StringBuilder logMsg = new StringBuilder();
+        final String nl = System.getProperty("line.separator");
+        logMsg.append("--- ProcessLog ---" + nl);
+        logMsg.append("cmd: " + getCommandLine(pb) + nl);
+        logMsg.append("exitvalue: " + exitValue + nl);
+        logMsg.append("stderr: " + stderr + nl);
+        logMsg.append("stdout: " + stdout + nl);
+        return logMsg.toString();
+    }
+
+    /**
+     * @return The full command line for the ProcessBuilder.
+     */
+    public static String getCommandLine(ProcessBuilder pb) {
+        if (pb == null) {
+            return "null";
+        }
+        StringBuilder cmd = new StringBuilder();
+        for (String s : pb.command()) {
+            cmd.append(s).append(" ");
+        }
+        return cmd.toString().trim();
+    }
 }
diff --git a/jdk/test/lib/testlibrary/jdk/testlibrary/Utils.java b/jdk/test/lib/testlibrary/jdk/testlibrary/Utils.java
index 387c0e3..d557a7e 100644
--- a/jdk/test/lib/testlibrary/jdk/testlibrary/Utils.java
+++ b/jdk/test/lib/testlibrary/jdk/testlibrary/Utils.java
@@ -33,6 +33,8 @@
 import java.util.List;
 import java.util.Arrays;
 import java.util.Collections;
+import java.util.regex.Pattern;
+import java.util.regex.Matcher;
 
 /**
  * Common library for various test helper functions.
@@ -170,4 +172,61 @@
         return hostName;
     }
 
+    /**
+     * Uses "jcmd -l" to search for a jvm pid. This function will wait
+     * forever (until jtreg timeout) for the pid to be found.
+     * @param key Regular expression to search for
+     * @return The found pid.
+     */
+    public static int waitForJvmPid(String key) throws Throwable {
+        final long iterationSleepMillis = 250;
+        System.out.println("waitForJvmPid: Waiting for key '" + key + "'");
+        System.out.flush();
+        while (true) {
+            int pid = tryFindJvmPid(key);
+            if (pid >= 0) {
+                return pid;
+            }
+            Thread.sleep(iterationSleepMillis);
+        }
+    }
+
+    /**
+     * Searches for a jvm pid in the output from "jcmd -l".
+     *
+     * Example output from jcmd is:
+     * 12498 sun.tools.jcmd.JCmd -l
+     * 12254 /tmp/jdk8/tl/jdk/JTwork/classes/com/sun/tools/attach/Application.jar
+     *
+     * @param key A regular expression to search for.
+     * @return The found pid, or -1 if Enot found.
+     * @throws Exception If multiple matching jvms are found.
+     */
+    public static int tryFindJvmPid(String key) throws Throwable {
+        ProcessBuilder pb = null;
+        OutputAnalyzer output = null;
+        try {
+            JDKToolLauncher jcmdLauncher = JDKToolLauncher.create("jcmd");
+            jcmdLauncher.addToolArg("-l");
+            output = ProcessTools.executeProcess(jcmdLauncher.getCommand());
+            output.shouldHaveExitValue(0);
+
+            // Search for a line starting with numbers (pid), follwed by the key.
+            Pattern pattern = Pattern.compile("([0-9]+)\\s.*(" + key + ").*\\r?\\n");
+            Matcher matcher = pattern.matcher(output.getStdout());
+
+            int pid = -1;
+            if (matcher.find()) {
+                pid = Integer.parseInt(matcher.group(1));
+                System.out.println("findJvmPid.pid: " + pid);
+                if (matcher.find()) {
+                    throw new Exception("Found multiple JVM pids for key: " + key);
+                }
+            }
+            return pid;
+        } catch (Throwable t) {
+            System.out.println(String.format("Utils.findJvmPid(%s) failed: %s", key, t));
+            throw t;
+        }
+    }
 }
diff --git a/jdk/test/sun/net/www/protocol/http/RedirectOnPost.java b/jdk/test/sun/net/www/protocol/http/RedirectOnPost.java
new file mode 100644
index 0000000..ebbbadb
--- /dev/null
+++ b/jdk/test/sun/net/www/protocol/http/RedirectOnPost.java
@@ -0,0 +1,175 @@
+/*
+ * Copyright (c) 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.
+ */
+
+/**
+ * @test
+ * @compile ../../../../../com/sun/net/httpserver/SimpleSSLContext.java RedirectOnPost.java
+ * @run main/othervm RedirectOnPost
+ * @bug 8029127
+ * @summary A redirect POST request does not work and illegalStateException on HttpURLConnection.getInputStream
+ */
+
+import java.net.*;
+import java.io.*;
+import java.util.*;
+import com.sun.net.httpserver.*;
+import java.util.concurrent.*;
+import javax.net.ssl.*;
+
+public class RedirectOnPost {
+
+
+    public static void main(String[] args) throws Exception {
+            ExecutorService e= Executors.newFixedThreadPool(5);
+        String keysdir = System.getProperty("test.src")
+                  + "/../../../../../com/sun/net/httpserver/";
+        SSLContext ctx = new SimpleSSLContext(keysdir).get();
+            HttpServer httpServer = getHttpServer(e);
+            HttpsServer httpsServer = getHttpsServer(e, ctx);
+
+        try {
+            // take the keystore from elsewhere in test hierarchy
+            int port = httpServer.getAddress().getPort();
+            int sslPort = httpsServer.getAddress().getPort();
+            httpServer.start();
+            httpsServer.start();
+            runTest("http://127.0.0.1:"+port+"/test/", null);
+            runTest("https://127.0.0.1:"+sslPort+"/test/", ctx);
+            System.out.println("Main thread waiting");
+        } finally {
+            httpServer.stop(0);
+            httpsServer.stop(0);
+            e.shutdownNow();
+        }
+    }
+
+    public static void runTest(String baseURL, SSLContext ctx) throws Exception
+    {
+        byte[] buf = "Hello world".getBytes();
+        URL url = new URL(baseURL + "a");
+        HttpURLConnection con = (HttpURLConnection)url.openConnection();
+        if (con instanceof HttpsURLConnection) {
+            HttpsURLConnection ssl = (HttpsURLConnection)con;
+            ssl.setHostnameVerifier(new HostnameVerifier() {
+                public boolean verify(String host, SSLSession sess) {
+                    return true;
+                }
+            });
+            ssl.setSSLSocketFactory (ctx.getSocketFactory());
+        }
+        con.setDoOutput(true);
+        con.setDoInput(true);
+        con.setRequestMethod("POST");
+        try (OutputStream out = con.getOutputStream()) {
+            out.write(buf);
+        }
+        try (InputStream in = con.getInputStream()) {
+            byte[] newBuf = readFully(in);
+        }
+    }
+
+    private static byte[] readFully(InputStream istream) throws IOException {
+        ByteArrayOutputStream bout = new ByteArrayOutputStream();
+        byte[] buf = new byte[1024];
+        int num = 0;
+
+        if (istream != null) {
+            while ((num = istream.read(buf)) != -1) {
+                bout.write(buf, 0, num);
+            }
+        }
+        byte[] ret = bout.toByteArray();
+        return ret;
+    }
+
+
+    static class Handler implements HttpHandler {
+
+        String baseURL;
+
+        Handler(String baseURL) {
+            this.baseURL = baseURL;
+        }
+
+        int calls = 0;
+
+        public void handle(HttpExchange msg) {
+            try {
+                String method = msg.getRequestMethod();
+                System.out.println ("Server: " + baseURL);
+                if (calls++ == 0) {
+                    System.out.println ("Server: redirecting");
+                    InputStream is = msg.getRequestBody();
+                    byte[] buf = readFully(is);
+                    is.close();
+                    Headers h = msg.getResponseHeaders();
+                    h.add("Location", baseURL + "b");
+                    msg.sendResponseHeaders(302, -1);
+                    msg.close();
+                } else {
+                    System.out.println ("Server: second call");
+                    InputStream is = msg.getRequestBody();
+                    byte[] buf = readFully(is);
+                    is.close();
+                    msg.sendResponseHeaders(200, -1);
+                    msg.close();
+                }
+            }
+            catch(Exception e) {
+                e.printStackTrace();
+            }
+            finally {
+                msg.close();
+            }
+        }
+    }
+
+    private static HttpServer getHttpServer(ExecutorService execs)
+        throws Exception
+    {
+        InetSocketAddress inetAddress = new InetSocketAddress(0);
+        HttpServer testServer = HttpServer.create(inetAddress, 15);
+        int port = testServer.getAddress().getPort();
+        testServer.setExecutor(execs);
+        String base = "http://127.0.0.1:"+port+"/test";
+        HttpContext context = testServer.createContext("/test");
+        context.setHandler(new Handler(base));
+        return testServer;
+    }
+
+    private static HttpsServer getHttpsServer(
+        ExecutorService execs, SSLContext ctx
+    )
+        throws Exception
+    {
+        InetSocketAddress inetAddress = new InetSocketAddress(0);
+        HttpsServer testServer = HttpsServer.create(inetAddress, 15);
+        int port = testServer.getAddress().getPort();
+        testServer.setExecutor(execs);
+        testServer.setHttpsConfigurator(new HttpsConfigurator (ctx));
+        String base = "https://127.0.0.1:"+port+"/test";
+        HttpContext context = testServer.createContext("/test");
+        context.setHandler(new Handler(base));
+        return testServer;
+    }
+}
diff --git a/jdk/test/sun/rmi/runtime/Log/checkLogging/CheckLogging.java b/jdk/test/sun/rmi/runtime/Log/checkLogging/CheckLogging.java
index 347725a..cf43fbf 100644
--- a/jdk/test/sun/rmi/runtime/Log/checkLogging/CheckLogging.java
+++ b/jdk/test/sun/rmi/runtime/Log/checkLogging/CheckLogging.java
@@ -76,6 +76,7 @@
 public class CheckLogging {
     private static int REGISTRY_PORT = -1;
     private static String LOCATION;
+    private static Logger logger;
 
     private static final ByteArrayOutputStream clientCallOut =
         new ByteArrayOutputStream();
@@ -89,8 +90,8 @@
             System.err.println("set default stream");
             LogStream.setDefaultStream(new PrintStream(clientCallOut));
         } else {
-            Logger.getLogger("sun.rmi.client.call").
-                addHandler(new InternalStreamHandler(clientCallOut));
+            logger = Logger.getLogger("sun.rmi.client.call");
+            logger.addHandler(new InternalStreamHandler(clientCallOut));
         }
     }
 
diff --git a/jdk/test/sun/security/krb5/auto/KDC.java b/jdk/test/sun/security/krb5/auto/KDC.java
index 0157a93..6b82a6b 100644
--- a/jdk/test/sun/security/krb5/auto/KDC.java
+++ b/jdk/test/sun/security/krb5/auto/KDC.java
@@ -605,7 +605,7 @@
      * @return the response
      * @throws java.lang.Exception for various errors
      */
-    private byte[] processMessage(byte[] in) throws Exception {
+    protected byte[] processMessage(byte[] in) throws Exception {
         if ((in[0] & 0x1f) == Krb5.KRB_AS_REQ)
             return processAsReq(in);
         else
@@ -618,7 +618,7 @@
      * @return the response
      * @throws java.lang.Exception for various errors
      */
-    private byte[] processTgsReq(byte[] in) throws Exception {
+    protected byte[] processTgsReq(byte[] in) throws Exception {
         TGSReq tgsReq = new TGSReq(in);
         PrincipalName service = tgsReq.reqBody.sname;
         if (options.containsKey(KDC.Option.RESP_NT)) {
@@ -841,7 +841,7 @@
      * @return the response
      * @throws java.lang.Exception for various errors
      */
-    private byte[] processAsReq(byte[] in) throws Exception {
+    protected byte[] processAsReq(byte[] in) throws Exception {
         ASReq asReq = new ASReq(in);
         int[] eTypes = null;
         List<PAData> outPAs = new ArrayList<>();
diff --git a/jdk/test/sun/security/krb5/auto/LoginNoPass.java b/jdk/test/sun/security/krb5/auto/LoginNoPass.java
new file mode 100644
index 0000000..73de940
--- /dev/null
+++ b/jdk/test/sun/security/krb5/auto/LoginNoPass.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 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.
+ */
+
+/*
+ * @test
+ * @bug 8028351
+ * @summary JWS doesn't get authenticated when using kerberos auth proxy
+ * @compile -XDignore.symbol.file LoginNoPass.java
+ * @run main/othervm LoginNoPass
+ */
+
+import sun.security.jgss.GSSUtil;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.NameCallback;
+import javax.security.auth.callback.PasswordCallback;
+import java.security.Security;
+
+public class LoginNoPass {
+
+    static boolean kdcTouched = false;
+    public static void main(String[] args) throws Exception {
+
+        new OneKDC(null) {
+            protected byte[] processAsReq(byte[] in) throws Exception {
+                kdcTouched = true;
+                return super.processAsReq(in);
+            }
+        }.writeJAASConf();
+        Security.setProperty("auth.login.defaultCallbackHandler",
+                "LoginNoPass$CallbackForClient");
+        System.setProperty("javax.security.auth.useSubjectCredsOnly", "false");
+
+        try {
+            Context c;
+            c = Context.fromJAAS("client");
+            c.startAsClient(OneKDC.SERVER, GSSUtil.GSS_KRB5_MECH_OID);
+            c.take(new byte[0]);
+        } catch (Exception e) {
+            e.printStackTrace(System.out);
+            // OK
+        }
+        if (kdcTouched) {
+            throw new Exception("Failed");
+        }
+    }
+    public static class CallbackForClient implements CallbackHandler {
+        public void handle(Callback[] callbacks) {
+            // Do nothing
+        }
+    }
+}
diff --git a/jdk/test/sun/security/pkcs11/KeyStore/Basic.sh b/jdk/test/sun/security/pkcs11/KeyStore/Basic.sh
index ab7045f..037b5d7 100644
--- a/jdk/test/sun/security/pkcs11/KeyStore/Basic.sh
+++ b/jdk/test/sun/security/pkcs11/KeyStore/Basic.sh
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2003, 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
@@ -170,7 +170,8 @@
     ${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \
 	-classpath ${TESTSRC}${FS}..${PS}${TESTSRC}${FS}loader.jar \
 	-d ${TESTCLASSES} \
-	${TESTSRC}${FS}Basic.java
+	${TESTSRC}${FS}Basic.java \
+	${TESTSRC}${FS}..${FS}PKCS11Test.java
 fi
 
 # run test
diff --git a/jdk/test/sun/security/pkcs11/KeyStore/ClientAuth.sh b/jdk/test/sun/security/pkcs11/KeyStore/ClientAuth.sh
index eb340c9..f889417 100644
--- a/jdk/test/sun/security/pkcs11/KeyStore/ClientAuth.sh
+++ b/jdk/test/sun/security/pkcs11/KeyStore/ClientAuth.sh
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2003, 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
@@ -128,7 +128,8 @@
 ${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \
 	-classpath ${TESTSRC}${FS}..${PS}${TESTSRC}${FS}loader.jar \
 	-d ${TESTCLASSES} \
-	${TESTSRC}${FS}ClientAuth.java
+	${TESTSRC}${FS}ClientAuth.java \
+	${TESTSRC}${FS}..${FS}PKCS11Test.java
 
 # run test
 echo "Run ClientAuth ..."
diff --git a/jdk/test/sun/security/pkcs11/KeyStore/Solaris.sh b/jdk/test/sun/security/pkcs11/KeyStore/Solaris.sh
index 302ce50..2d34ef4 100644
--- a/jdk/test/sun/security/pkcs11/KeyStore/Solaris.sh
+++ b/jdk/test/sun/security/pkcs11/KeyStore/Solaris.sh
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 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
@@ -140,7 +140,8 @@
     ${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \
 	-classpath ${TESTSRC}${FS}..${PS}${TESTSRC}${FS}loader.jar \
 	-d ${TESTCLASSES} \
-	${TESTSRC}${FS}Basic.java
+	${TESTSRC}${FS}Basic.java \
+	${TESTSRC}${FS}..${FS}PKCS11Test.java
 fi
 
 # run test
diff --git a/jdk/test/sun/security/pkcs11/PKCS11Test.java b/jdk/test/sun/security/pkcs11/PKCS11Test.java
index 1382524..3699f88 100644
--- a/jdk/test/sun/security/pkcs11/PKCS11Test.java
+++ b/jdk/test/sun/security/pkcs11/PKCS11Test.java
@@ -29,6 +29,8 @@
 import java.lang.reflect.*;
 
 import java.security.*;
+import java.security.spec.ECGenParameterSpec;
+import java.security.spec.ECParameterSpec;
 
 public abstract class PKCS11Test {
 
@@ -357,6 +359,93 @@
         test.premain(p);
     }
 
+    // Generate a vector of supported elliptic curves of a given provider
+    static Vector<ECParameterSpec> getKnownCurves(Provider p) throws Exception {
+        int index;
+        int begin;
+        int end;
+        String curve;
+        KeyPair kp = null;
+
+        Vector<ECParameterSpec> results = new Vector<ECParameterSpec>();
+        // Get Curves to test from SunEC.
+        String kcProp = Security.getProvider("SunEC").
+                getProperty("AlgorithmParameters.EC SupportedCurves");
+
+        if (kcProp == null) {
+            throw new RuntimeException(
+            "\"AlgorithmParameters.EC SupportedCurves property\" not found");
+        }
+
+        System.out.println("Finding supported curves using list from SunEC\n");
+        index = 0;
+        for (;;) {
+            // Each set of curve names is enclosed with brackets.
+            begin = kcProp.indexOf('[', index);
+            end = kcProp.indexOf(']', index);
+            if (begin == -1 || end == -1) {
+                break;
+            }
+
+            /*
+             * Each name is separated by a comma.
+             * Just get the first name in the set.
+             */
+            index = end + 1;
+            begin++;
+            end = kcProp.indexOf(',', begin);
+            if (end == -1) {
+                // Only one name in the set.
+                end = index -1;
+            }
+
+            curve = kcProp.substring(begin, end);
+            ECParameterSpec e = getECParameterSpec(p, curve);
+            System.out.print("\t "+ curve + ": ");
+            try {
+                KeyPairGenerator kpg = KeyPairGenerator.getInstance("EC", p);
+                kpg.initialize(e);
+                kp = kpg.generateKeyPair();
+                results.add(e);
+                System.out.println("Supported");
+            } catch (ProviderException ex) {
+                System.out.println("Unsupported: PKCS11: " +
+                        ex.getCause().getMessage());
+            } catch (InvalidAlgorithmParameterException ex) {
+                System.out.println("Unsupported: Key Length: " +
+                        ex.getMessage());
+            }
+        }
+
+        if (results.size() == 0) {
+            throw new RuntimeException("No supported EC curves found");
+        }
+
+        return results;
+    }
+
+    private static ECParameterSpec getECParameterSpec(Provider p, String name)
+            throws Exception {
+
+        AlgorithmParameters parameters =
+            AlgorithmParameters.getInstance("EC", p);
+
+        parameters.init(new ECGenParameterSpec(name));
+
+        return parameters.getParameterSpec(ECParameterSpec.class);
+    }
+
+    // Check support for a curve with a provided Vector of EC support
+    boolean checkSupport(Vector<ECParameterSpec> supportedEC,
+            ECParameterSpec curve) {
+        boolean found = false;
+        for (ECParameterSpec ec: supportedEC) {
+            if (ec.equals(curve)) {
+                return true;
+            }
+        }
+        return false;
+    }
 
     private static final Map<String,String[]> osMap;
 
diff --git a/jdk/test/sun/security/pkcs11/Provider/ConfigQuotedString.sh b/jdk/test/sun/security/pkcs11/Provider/ConfigQuotedString.sh
index b1cf0d9..30b245c 100644
--- a/jdk/test/sun/security/pkcs11/Provider/ConfigQuotedString.sh
+++ b/jdk/test/sun/security/pkcs11/Provider/ConfigQuotedString.sh
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 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
@@ -99,7 +99,8 @@
 ${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \
         -classpath ${TESTSRC}${FS}.. \
         -d ${TESTCLASSES} \
-        ${TESTSRC}${FS}ConfigQuotedString.java
+        ${TESTSRC}${FS}ConfigQuotedString.java \
+        ${TESTSRC}${FS}..${FS}PKCS11Test.java
 
 # run test
 
diff --git a/jdk/test/sun/security/pkcs11/Provider/Login.sh b/jdk/test/sun/security/pkcs11/Provider/Login.sh
index cbbcb06..a1f6b13 100644
--- a/jdk/test/sun/security/pkcs11/Provider/Login.sh
+++ b/jdk/test/sun/security/pkcs11/Provider/Login.sh
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 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
@@ -108,7 +108,8 @@
 ${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \
         -classpath ${TESTSRC}${FS}.. \
         -d ${TESTCLASSES} \
-        ${TESTSRC}${FS}Login.java
+        ${TESTSRC}${FS}Login.java \
+        ${TESTSRC}${FS}..${FS}PKCS11Test.java
 
 # run test
 
diff --git a/jdk/test/sun/security/pkcs11/Signature/TestDSAKeyLength.java b/jdk/test/sun/security/pkcs11/Signature/TestDSAKeyLength.java
index a3ad441..89b2b7a 100644
--- a/jdk/test/sun/security/pkcs11/Signature/TestDSAKeyLength.java
+++ b/jdk/test/sun/security/pkcs11/Signature/TestDSAKeyLength.java
@@ -22,10 +22,10 @@
  */
 /*
  * @test
- * @bug 7200306
- * @run main/othervm/timeout=250 TestDSAKeyLength
+ * @bug 7200306 8029158
  * @summary verify that P11Signature impl will error out when initialized
  * with unsupported key sizes
+ * @library ..
  */
 
 
@@ -40,6 +40,11 @@
     }
 
     public void main(Provider provider) throws Exception {
+        if (isNSS(provider) && getNSSVersion() >= 3.14) {
+            System.out.println("Skip testing NSS " + getNSSVersion());
+            return;
+        }
+
         KeyPairGenerator kpg = KeyPairGenerator.getInstance("DSA", "SUN");
         kpg.initialize(2048, new SecureRandom());
         KeyPair pair = kpg.generateKeyPair();
diff --git a/jdk/test/sun/security/pkcs11/ec/ReadCertificates.java b/jdk/test/sun/security/pkcs11/ec/ReadCertificates.java
index ff0a62b..8311b8d 100644
--- a/jdk/test/sun/security/pkcs11/ec/ReadCertificates.java
+++ b/jdk/test/sun/security/pkcs11/ec/ReadCertificates.java
@@ -37,6 +37,7 @@
 import java.security.cert.*;
 import java.security.*;
 import java.security.interfaces.*;
+import java.security.spec.ECParameterSpec;
 
 import javax.security.auth.x500.X500Principal;
 
@@ -101,33 +102,44 @@
         }
         System.out.println("OK: " + certs.size() + " certificates.");
 
+        // Get supported curves
+        Vector<ECParameterSpec> supportedEC = getKnownCurves(p);
+
+        System.out.println("Test Certs:\n");
         for (X509Certificate cert : certs.values()) {
             X509Certificate issuer = certs.get(cert.getIssuerX500Principal());
-            System.out.println("Verifying " + cert.getSubjectX500Principal() + "...");
+            System.out.print("Verifying " + cert.getSubjectX500Principal() +
+                    "...  ");
             PublicKey key = issuer.getPublicKey();
-            // First try the provider under test (if it does not support the
-            // necessary algorithm then try any registered provider).
-            try {
-                cert.verify(key, p.getName());
-            } catch (NoSuchAlgorithmException e) {
-                System.out.println("Warning: " + e.getMessage() +
-                ". Trying another provider...");
-                cert.verify(key);
-            } catch (InvalidKeyException e) {
-                // The root cause of the exception might be NSS not having
-                // "ECC Extended" support curves.  If so, we can ignore it.
-                Throwable t = e;
-                while (t.getCause() != null) {
-                    t = t.getCause();
-                }
-                if (t instanceof sun.security.pkcs11.wrapper.PKCS11Exception &&
-                        t.getMessage().equals("CKR_DOMAIN_PARAMS_INVALID") &&
-                        isNSS(p) && getNSSECC() == ECCState.Basic) {
-                    System.out.println("Failed as expected. NSS Basic ECC.");
+            // Check if curve is supported
+            if (issuer.getPublicKey() instanceof ECPublicKey) {
+                if (!checkSupport(supportedEC,
+                        ((ECPublicKey)key).getParams())) {
+                    System.out.println("Curve not found. Skipped.");
                     continue;
                 }
-                throw e;
             }
+
+           try {
+               cert.verify(key, p.getName());
+               System.out.println("Pass.");
+           } catch (NoSuchAlgorithmException e) {
+               System.out.println("Warning: " + e.getMessage() +
+                   ". Trying another provider...");
+               cert.verify(key);
+           } catch (Exception e) {
+               System.out.println(e.getMessage());
+               if (key instanceof ECPublicKey) {
+                   System.out.println("Failed.\n\tCurve: " +
+                           ((ECPublicKey)key).getParams() +
+                           "\n\tSignature Alg: " + cert.getSigAlgName());
+               } else {
+                   System.out.println("Key: "+key.toString());
+               }
+
+               System.err.println("Verifying " + cert.getSubjectX500Principal());
+               e.printStackTrace();
+           }
         }
 
         // try some random invalid signatures to make sure we get the correct
diff --git a/jdk/test/sun/security/pkcs11/ec/TestCurves.java b/jdk/test/sun/security/pkcs11/ec/TestCurves.java
index 511bbaf..de53e21 100644
--- a/jdk/test/sun/security/pkcs11/ec/TestCurves.java
+++ b/jdk/test/sun/security/pkcs11/ec/TestCurves.java
@@ -56,47 +56,49 @@
             return;
         }
 
+        // Check if this is sparc for later failure avoidance.
+        boolean sparc = false;
+        if (System.getProperty("os.arch").equals("sparcv9")) {
+            sparc = true;
+            System.out.println("This is a sparcv9");
+        }
+
         Random random = new Random();
         byte[] data = new byte[2048];
         random.nextBytes(data);
 
         Vector<ECParameterSpec> curves = getKnownCurves(p);
-
         for (ECParameterSpec params : curves) {
             System.out.println("Testing " + params + "...");
             KeyPairGenerator kpg = KeyPairGenerator.getInstance("EC", p);
             kpg.initialize(params);
             KeyPair kp1, kp2;
 
-            try {
-                kp1 = kpg.generateKeyPair();
-                kp2 = kpg.generateKeyPair();
-            } catch (Exception e) {
-                // The root cause of the exception might be NSS not having
-                // "ECC Extended" support curves.  If so, we can ignore it.
-                if (e instanceof java.security.ProviderException) {
-                    Throwable t = e.getCause();
-                    if (t instanceof
-                            sun.security.pkcs11.wrapper.PKCS11Exception &&
-                            t.getMessage().equals("CKR_DOMAIN_PARAMS_INVALID") &&
-                            isNSS(p) && (getNSSECC() == ECCState.Basic) &&
-                            (!params.toString().startsWith("secp256r1") &&
-                            !params.toString().startsWith("secp384r1") &&
-                            !params.toString().startsWith("secp521r1"))) {
-                        System.out.println("NSS Basic ECC.  Failure expected");
-                        continue;
-                    }
-                }
-
-                throw e;
-            }
+            kp1 = kpg.generateKeyPair();
+            kp2 = kpg.generateKeyPair();
 
             testSigning(p, "SHA1withECDSA", data, kp1, kp2);
-            testSigning(p, "SHA224withECDSA", data, kp1, kp2);
-            testSigning(p, "SHA256withECDSA", data, kp1, kp2);
-            testSigning(p, "SHA384withECDSA", data, kp1, kp2);
-            testSigning(p, "SHA512withECDSA", data, kp1, kp2);
-            // System.out.println();
+            // Check because Solaris ncp driver does not support these but
+            // Solaris metaslot causes them to be run.
+            try {
+                testSigning(p, "SHA224withECDSA", data, kp1, kp2);
+                testSigning(p, "SHA256withECDSA", data, kp1, kp2);
+                testSigning(p, "SHA384withECDSA", data, kp1, kp2);
+                testSigning(p, "SHA512withECDSA", data, kp1, kp2);
+            } catch (ProviderException e) {
+                if (sparc) {
+                    Throwable t = e.getCause();
+                    if (t instanceof sun.security.pkcs11.wrapper.PKCS11Exception &&
+                        t.getMessage().equals("CKR_ATTRIBUTE_VALUE_INVALID")) {
+                        System.out.print("-Failure not uncommon.  Probably pre-T4.");
+                    } else {
+                        throw e;
+                    }
+                } else {
+                    throw e;
+                }
+            }
+            System.out.println();
 
             KeyAgreement ka1 = KeyAgreement.getInstance("ECDH", p);
             ka1.init(kp1.getPrivate());
@@ -116,70 +118,9 @@
         System.out.println("OK");
     }
 
-    private static Vector<ECParameterSpec>
-            getKnownCurves(Provider p) throws Exception {
-
-        int index;
-        int begin;
-        int end;
-        String curve;
-        Vector<ECParameterSpec> results = new Vector<ECParameterSpec>();
-        // Get Curves to test from SunEC.
-        String kcProp = Security.getProvider("SunEC").
-                getProperty("AlgorithmParameters.EC SupportedCurves");
-
-        if (kcProp == null) {
-            throw new RuntimeException(
-            "\"AlgorithmParameters.EC SupportedCurves property\" not found");
-        }
-
-        index = 0;
-        for (;;) {
-            // Each set of curve names is enclosed with brackets.
-            begin = kcProp.indexOf('[', index);
-            end = kcProp.indexOf(']', index);
-            if (begin == -1 || end == -1) {
-                break;
-            }
-
-            /*
-             * Each name is separated by a comma.
-             * Just get the first name in the set.
-             */
-            index = end + 1;
-            begin++;
-            end = kcProp.indexOf(',', begin);
-            if (end == -1) {
-                // Only one name in the set.
-                end = index -1;
-            }
-
-            curve = kcProp.substring(begin, end);
-
-            results.add(getECParameterSpec(p, curve));
-        }
-
-        if (results.size() == 0) {
-            throw new RuntimeException("No supported EC curves found");
-        }
-
-        return results;
-    }
-
-    private static ECParameterSpec getECParameterSpec(Provider p, String name)
-            throws Exception {
-
-        AlgorithmParameters parameters =
-            AlgorithmParameters.getInstance("EC", p);
-
-        parameters.init(new ECGenParameterSpec(name));
-
-        return parameters.getParameterSpec(ECParameterSpec.class);
-    }
-
     private static void testSigning(Provider p, String algorithm,
             byte[] data, KeyPair kp1, KeyPair kp2) throws Exception {
-        // System.out.print("  " + algorithm);
+        System.out.print("  " + algorithm);
         Signature s = Signature.getInstance(algorithm, p);
         s.initSign(kp1.getPrivate());
         s.update(data);
diff --git a/jdk/test/sun/security/ssl/templates/SSLSocketSSLEngineTemplate.java b/jdk/test/sun/security/ssl/templates/SSLSocketSSLEngineTemplate.java
index 7e97d8e..16696dbe 100644
--- a/jdk/test/sun/security/ssl/templates/SSLSocketSSLEngineTemplate.java
+++ b/jdk/test/sun/security/ssl/templates/SSLSocketSSLEngineTemplate.java
@@ -206,7 +206,9 @@
     private void runTest(boolean direct) throws Exception {
         boolean serverClose = direct;
 
-        serverSocket = new ServerSocket(0);
+        serverSocket = new ServerSocket();
+        serverSocket.setReuseAddress(false);
+        serverSocket.bind(null);
         int port = serverSocket.getLocalPort();
         Thread thread = createClientThread(port, serverClose);
 
diff --git a/jdk/test/sun/tools/jstatd/JstatdTest.java b/jdk/test/sun/tools/jstatd/JstatdTest.java
index 1a11788..f07ce6b 100644
--- a/jdk/test/sun/tools/jstatd/JstatdTest.java
+++ b/jdk/test/sun/tools/jstatd/JstatdTest.java
@@ -353,6 +353,14 @@
         } finally {
             cleanUpThread(jstatdThread);
         }
+
+        // Verify output from jstatd
+        OutputAnalyzer output = jstatdThread.getOutput();
+        assertTrue(output.getOutput().isEmpty(),
+                "jstatd should get an empty output, got: "
+                + Utils.NEW_LINE + output.getOutput());
+        assertNotEquals(output.getExitValue(), 0,
+                "jstatd process exited with unexpected exit code");
     }
 
 }
diff --git a/make/MakeHelpers.gmk b/make/MakeHelpers.gmk
index 63223ee..66f4ca4 100644
--- a/make/MakeHelpers.gmk
+++ b/make/MakeHelpers.gmk
@@ -50,7 +50,7 @@
 
 # Global targets are possible to run either with or without a SPEC. The prototypical
 # global target is "help".
-global_targets=help jprt% bridgeBuild
+global_targets=help jprt% bridgeBuild bridge2configure
 
 ##############################
 # Functions
diff --git a/nashorn/.hgtags b/nashorn/.hgtags
index 3fe1fdb..5b35293 100644
--- a/nashorn/.hgtags
+++ b/nashorn/.hgtags
@@ -228,3 +228,4 @@
 0fb1a427fbf6e04c77cebbbf99b6631c664ed793 jdk8-b116
 1db3d4e4d18913e853d7bebf86816e87fda00a71 jdk8-b117
 8d014b039b44c23fa520ce20c2c27f7aa91441e9 jdk8-b118
+c3343930c73c58a22c1d58719bb988aeb25a871f jdk8-b119
diff --git a/nashorn/src/jdk/nashorn/internal/runtime/DebuggerSupport.java b/nashorn/src/jdk/nashorn/internal/runtime/DebuggerSupport.java
index 9f7783e..c288a96 100644
--- a/nashorn/src/jdk/nashorn/internal/runtime/DebuggerSupport.java
+++ b/nashorn/src/jdk/nashorn/internal/runtime/DebuggerSupport.java
@@ -243,7 +243,7 @@
             return value.toString();
 
         case STRING:
-            return escape((String)value);
+            return escape(value.toString());
 
         case NUMBER:
             return JSType.toString(((Number)value).doubleValue());