Merge
authortwisti
Mon, 02 Jun 2014 13:53:52 -0700
changeset 24929 5d300c3c4569
parent 24927 1449552c239c (current diff)
parent 24928 a94ef5a38492 (diff)
child 24930 1fc3041c8e78
Merge
hotspot/test/runtime/6929067/T.java
hotspot/test/runtime/6929067/Test6929067.sh
hotspot/test/runtime/6929067/invoke.c
hotspot/test/runtime/InitialThreadOverflow/DoOverflow.java
hotspot/test/runtime/InitialThreadOverflow/invoke.c
hotspot/test/runtime/InitialThreadOverflow/testme.sh
jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Makefile.inc
jaxp/src/com/sun/org/apache/xalan/internal/xsltc/javax.xml.transform.TransformerFactory
jaxp/src/com/sun/org/apache/xerces/internal/dom/org.apache.xerces.dom.DOMImplementationSourceImpl
jaxp/src/com/sun/org/apache/xerces/internal/dom/org.w3c.dom.DOMImplementationSourceList
jaxp/src/com/sun/org/apache/xerces/internal/jaxp/datatype/javax.xml.datatype.DatatypeFactory
jaxp/src/com/sun/org/apache/xerces/internal/jaxp/javax.xml.parsers.DocumentBuilderFactory
jaxp/src/com/sun/org/apache/xerces/internal/jaxp/javax.xml.parsers.SAXParserFactory
jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/javax.xml.validation.SchemaFactory
jaxp/src/com/sun/org/apache/xerces/internal/parsers/org.apache.xerces.xni.parser.DTDConfiguration
jaxp/src/com/sun/org/apache/xerces/internal/parsers/org.apache.xerces.xni.parser.XML11Configuration
jaxp/src/com/sun/org/apache/xerces/internal/parsers/org.apache.xerces.xni.parser.XMLParserConfiguration
jaxp/src/com/sun/org/apache/xerces/internal/parsers/org.xml.sax.driver
jaxp/src/com/sun/xml/internal/stream/javax.xml.stream.XMLEventFactory
jaxp/src/com/sun/xml/internal/stream/javax.xml.stream.XMLInputFactory
jaxp/src/com/sun/xml/internal/stream/javax.xml.stream.XMLOutputFactory
jaxp/src/org/xml/sax/COPYING
jaxp/src/org/xml/sax/COPYING.txt
jaxws/src/share/jaxws_classes/com/sun/tools/etc/META-INF/services/com.sun.xml.internal.ws.spi.db.BindingContextFactory
jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/gen/config/config.rng
jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/bindingfile.rng
jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/binding.rng
jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/xmlschema-for-jaxb.rng
jaxws/src/share/jaxws_classes/com/sun/xml/internal/rngom/parse/compact/CompactSyntax.jj
jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/pacakge-info.java
jdk/src/share/classes/com/sun/org/apache/xml/internal/security/resource/schema/etsi.xsd
jdk/src/share/classes/com/sun/org/apache/xml/internal/security/resource/schema/xenc-schema.rng
jdk/src/share/classes/com/sun/org/apache/xml/internal/security/resource/schema/xenc-schema.xsd
jdk/src/share/classes/com/sun/org/apache/xml/internal/security/resource/schema/xmldsig-core-schema.dtd
jdk/src/share/classes/com/sun/org/apache/xml/internal/security/resource/schema/xmldsig-core-schema.rng
jdk/src/share/classes/com/sun/org/apache/xml/internal/security/resource/schema/xmldsig-core-schema.xsd
jdk/src/share/classes/com/sun/pept/Delegate.java
jdk/src/share/classes/com/sun/pept/encoding/Decoder.java
jdk/src/share/classes/com/sun/pept/encoding/Encoder.java
jdk/src/share/classes/com/sun/pept/ept/Acceptor.java
jdk/src/share/classes/com/sun/pept/ept/ContactInfo.java
jdk/src/share/classes/com/sun/pept/ept/ContactInfoList.java
jdk/src/share/classes/com/sun/pept/ept/ContactInfoListIterator.java
jdk/src/share/classes/com/sun/pept/ept/EPTFactory.java
jdk/src/share/classes/com/sun/pept/ept/MessageInfo.java
jdk/src/share/classes/com/sun/pept/presentation/MessageStruct.java
jdk/src/share/classes/com/sun/pept/presentation/Stub.java
jdk/src/share/classes/com/sun/pept/presentation/TargetFinder.java
jdk/src/share/classes/com/sun/pept/presentation/Tie.java
jdk/src/share/classes/com/sun/pept/protocol/Interceptors.java
jdk/src/share/classes/com/sun/pept/protocol/MessageDispatcher.java
jdk/src/share/classes/com/sun/pept/transport/Connection.java
jdk/src/share/classes/com/sun/tools/hat/MANIFEST.mf
jdk/src/share/classes/com/sun/tools/hat/README.txt
jdk/src/share/classes/com/sun/tools/hat/build.xml
jdk/src/share/classes/sun/awt/image/MultiResolutionBufferedImage.java
jdk/src/share/classes/sun/dc/META-INF/services/sun.java2d.pipe.RenderingEngine
jdk/src/share/classes/sun/java2d/cmm/lcms/META-INF/services/sun.java2d.cmm.CMMServiceProvider
jdk/src/share/classes/sun/java2d/pisces/META-INF/services/sun.java2d.pipe.RenderingEngine
jdk/src/share/classes/sun/misc/ThreadGroupUtils.java
jdk/src/solaris/classes/sun/java2d/pisces/META-INF/services/sun.java2d.pipe.RenderingEngine
jdk/src/solaris/native/sun/awt/awt_Plugin.c
jdk/src/solaris/native/sun/awt/awt_Plugin.h
langtools/src/share/classes/com/sun/tools/javadoc/JavadocClassReader.java
langtools/test/tools/javac/inference/EagerReturnTypeResolution/EagerReturnTypeResolutionTesta.java
langtools/test/tools/javac/inference/EagerReturnTypeResolution/EagerReturnTypeResolutionTestb.java
langtools/test/tools/javac/inference/EagerReturnTypeResolution/EagerReturnTypeResolutionTestb.out
langtools/test/tools/javac/inference/EagerReturnTypeResolution/PrimitiveTypeBoxingTest.java
langtools/test/tools/javac/inference/EagerReturnTypeResolution/PrimitiveTypeBoxingTest.out
--- a/.hgtags	Mon Jun 02 15:49:53 2014 -0400
+++ b/.hgtags	Mon Jun 02 13:53:52 2014 -0700
@@ -256,3 +256,5 @@
 0809c9a4d36e6291f1c4384604c4bbf29e975722 jdk9-b11
 0d1f816217dce5e72187f167cc1816080cbeb453 jdk9-b12
 1a30593dcb9802faec3b6edb24d86ca088594e4e jdk9-b13
+97932f6ad950ae5a73a9da5c96e6e58503ff646b jdk9-b14
+74eb0778e4f2dbff6628e718378449fba27c4265 jdk9-b15
--- a/.hgtags-top-repo	Mon Jun 02 15:49:53 2014 -0400
+++ b/.hgtags-top-repo	Mon Jun 02 13:53:52 2014 -0700
@@ -256,3 +256,5 @@
 ab55a18a95e1990a588929d5d29db3eb9985fea0 jdk9-b11
 59f6350295f9681fe5956d8bc889bf341914c6cb jdk9-b12
 5800456add07e1a68170a229fb5e27376f8875e5 jdk9-b13
+4e3aa9723e9972623e3dafc321b368e7db7e9b3b jdk9-b14
+b114474fb25af4e73cb7219f7c04bd8994da03a5 jdk9-b15
--- a/README	Mon Jun 02 15:49:53 2014 -0400
+++ b/README	Mon Jun 02 13:53:52 2014 -0700
@@ -1,15 +1,15 @@
 README:
   This file should be located at the top of the OpenJDK Mercurial root
   repository. A full OpenJDK repository set (forest) should also include
-  the following 6 nested repositories:
-    "jdk", "hotspot", "langtools", "corba", "jaxws"  and "jaxp".
+  the following 7 nested repositories:
+    "jdk", "hotspot", "langtools", "nashorn", "corba", "jaxws"  and "jaxp".
 
   The root repository can be obtained with something like:
-    hg clone http://hg.openjdk.java.net/jdk8/jdk8 openjdk8
+    hg clone http://hg.openjdk.java.net/jdk9/jdk9 openjdk9
   
   You can run the get_source.sh script located in the root repository to get
   the other needed repositories:
-    cd openjdk8 && sh ./get_source.sh
+    cd openjdk9 && sh ./get_source.sh
 
   People unfamiliar with Mercurial should read the first few chapters of
   the Mercurial book: http://hgbook.red-bean.com/read/
@@ -19,9 +19,9 @@
 Simple Build Instructions:
   
   0. Get the necessary system software/packages installed on your system, see
-     http://hg.openjdk.java.net/jdk8/jdk8/raw-file/tip/README-builds.html
+     http://hg.openjdk.java.net/jdk9/jdk9/raw-file/tip/README-builds.html
 
-  1. If you don't have a jdk7u7 or newer jdk, download and install it from
+  1. If you don't have a jdk8 or newer jdk, download and install it from
      http://java.sun.com/javase/downloads/index.jsp
      Add the /bin directory of this installation to your PATH environment
      variable.
@@ -37,4 +37,4 @@
 is 3.81 or newer. Note that on Solaris, GNU make is called "gmake".
 
 Complete details are available in the file:
-     http://hg.openjdk.java.net/jdk8/jdk8/raw-file/tip/README-builds.html
+     http://hg.openjdk.java.net/jdk9/jdk9/raw-file/tip/README-builds.html
--- a/common/autoconf/generated-configure.sh	Mon Jun 02 15:49:53 2014 -0400
+++ b/common/autoconf/generated-configure.sh	Mon Jun 02 13:53:52 2014 -0700
@@ -656,6 +656,9 @@
 USE_EXTERNAL_LIBPNG
 PNG_LIBS
 PNG_CFLAGS
+USE_EXTERNAL_LCMS
+LCMS_LIBS
+LCMS_CFLAGS
 USE_EXTERNAL_LIBGIF
 USE_EXTERNAL_LIBJPEG
 ALSA_LIBS
@@ -1079,6 +1082,7 @@
 with_alsa_include
 with_alsa_lib
 with_giflib
+with_lcms
 with_libpng
 with_zlib
 with_stdc__lib
@@ -1192,6 +1196,8 @@
 FREETYPE_LIBS
 ALSA_CFLAGS
 ALSA_LIBS
+LCMS_CFLAGS
+LCMS_LIBS
 PNG_CFLAGS
 PNG_LIBS
 LIBFFI_CFLAGS
@@ -1934,6 +1940,8 @@
   --with-alsa-lib         specify directory for the alsa library
   --with-giflib           use giflib from build system or OpenJDK source
                           (system, bundled) [bundled]
+  --with-lcms             use lcms2 from build system or OpenJDK source
+                          (system, bundled) [bundled]
   --with-libpng           use libpng from build system or OpenJDK source
                           (system, bundled) [bundled]
   --with-zlib             use zlib from build system or OpenJDK source
@@ -2060,6 +2068,8 @@
               linker flags for FREETYPE, overriding pkg-config
   ALSA_CFLAGS C compiler flags for ALSA, overriding pkg-config
   ALSA_LIBS   linker flags for ALSA, overriding pkg-config
+  LCMS_CFLAGS C compiler flags for LCMS, overriding pkg-config
+  LCMS_LIBS   linker flags for LCMS, overriding pkg-config
   PNG_CFLAGS  C compiler flags for PNG, overriding pkg-config
   PNG_LIBS    linker flags for PNG, overriding pkg-config
   LIBFFI_CFLAGS
@@ -47309,6 +47319,115 @@
 
   ###############################################################################
   #
+  # Check for the lcms2 library
+  #
+
+
+# Check whether --with-lcms was given.
+if test "${with_lcms+set}" = set; then :
+  withval=$with_lcms;
+fi
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for which lcms to use" >&5
+$as_echo_n "checking for which lcms to use... " >&6; }
+
+  DEFAULT_LCMS=bundled
+
+  #
+  # If user didn't specify, use DEFAULT_LCMS
+  #
+  if test "x${with_lcms}" = "x"; then
+      with_lcms=${DEFAULT_LCMS}
+  fi
+
+  if test "x${with_lcms}" = "xbundled"; then
+    USE_EXTERNAL_LCMS=false
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: bundled" >&5
+$as_echo "bundled" >&6; }
+  elif test "x${with_lcms}" = "xsystem"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: system" >&5
+$as_echo "system" >&6; }
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LCMS" >&5
+$as_echo_n "checking for LCMS... " >&6; }
+
+if test -n "$LCMS_CFLAGS"; then
+    pkg_cv_LCMS_CFLAGS="$LCMS_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lcms2\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "lcms2") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_LCMS_CFLAGS=`$PKG_CONFIG --cflags "lcms2" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$LCMS_LIBS"; then
+    pkg_cv_LCMS_LIBS="$LCMS_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lcms2\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "lcms2") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_LCMS_LIBS=`$PKG_CONFIG --libs "lcms2" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+	        LCMS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "lcms2" 2>&1`
+        else
+	        LCMS_PKG_ERRORS=`$PKG_CONFIG --print-errors "lcms2" 2>&1`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$LCMS_PKG_ERRORS" >&5
+
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+                LCMS_FOUND=no
+elif test $pkg_failed = untried; then
+	LCMS_FOUND=no
+else
+	LCMS_CFLAGS=$pkg_cv_LCMS_CFLAGS
+	LCMS_LIBS=$pkg_cv_LCMS_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+	LCMS_FOUND=yes
+fi
+    if test "x${LCMS_FOUND}" = "xyes"; then
+      USE_EXTERNAL_LCMS=true
+    else
+      as_fn_error $? "--with-lcms=system specified, but no lcms found!" "$LINENO" 5
+    fi
+  else
+    as_fn_error $? "Invalid value for --with-lcms: ${with_lcms}, use 'system' or 'bundled'" "$LINENO" 5
+  fi
+
+
+
+  ###############################################################################
+  #
   # Check for the png library
   #
 
--- a/common/autoconf/libraries.m4	Mon Jun 02 15:49:53 2014 -0400
+++ b/common/autoconf/libraries.m4	Mon Jun 02 13:53:52 2014 -0700
@@ -666,6 +666,42 @@
 
   ###############################################################################
   #
+  # Check for the lcms2 library
+  #
+
+  AC_ARG_WITH(lcms, [AS_HELP_STRING([--with-lcms],
+  	[use lcms2 from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])])
+
+  AC_MSG_CHECKING([for which lcms to use])
+
+  DEFAULT_LCMS=bundled
+
+  #
+  # If user didn't specify, use DEFAULT_LCMS
+  #
+  if test "x${with_lcms}" = "x"; then
+      with_lcms=${DEFAULT_LCMS}
+  fi
+
+  if test "x${with_lcms}" = "xbundled"; then
+    USE_EXTERNAL_LCMS=false
+    AC_MSG_RESULT([bundled])
+  elif test "x${with_lcms}" = "xsystem"; then
+    AC_MSG_RESULT([system])
+    PKG_CHECK_MODULES([LCMS], [lcms2], [LCMS_FOUND=yes], [LCMS_FOUND=no])
+    if test "x${LCMS_FOUND}" = "xyes"; then
+      USE_EXTERNAL_LCMS=true
+    else
+      AC_MSG_ERROR([--with-lcms=system specified, but no lcms found!])
+    fi
+  else
+    AC_MSG_ERROR([Invalid value for --with-lcms: ${with_lcms}, use 'system' or 'bundled'])
+  fi
+
+  AC_SUBST(USE_EXTERNAL_LCMS)
+
+  ###############################################################################
+  #
   # Check for the png library
   #
 
--- a/common/autoconf/spec.gmk.in	Mon Jun 02 15:49:53 2014 -0400
+++ b/common/autoconf/spec.gmk.in	Mon Jun 02 13:53:52 2014 -0700
@@ -652,6 +652,10 @@
 # Libraries
 #
 
+USE_EXTERNAL_LCMS:=@USE_EXTERNAL_LCMS@
+LCMS_CFLAGS:=@LCMS_CFLAGS@
+LCMS_LIBS:=@LCMS_LIBS@
+
 USE_EXTERNAL_LIBPNG:=@USE_EXTERNAL_LIBPNG@
 PNG_LIBS:=@PNG_LIBS@
 PNG_CFLAGS:=@PNG_CFLAGS@
--- a/corba/.hgtags	Mon Jun 02 15:49:53 2014 -0400
+++ b/corba/.hgtags	Mon Jun 02 13:53:52 2014 -0700
@@ -256,3 +256,5 @@
 77ea0a2503582a28e4e66be7239a49a0d1dd313f jdk9-b11
 e212cdcc8c11f0ba5acf6f5ddb596c4c545a93f9 jdk9-b12
 088eec4c36f4d7f250fcd19c4969bf698e3d2cdc jdk9-b13
+a2b82f863ba95a596da555a4c1b871c404863e7e jdk9-b14
+e54022d0dd92106fff7f7fe670010cd7e6517ee3 jdk9-b15
--- a/hotspot/.hgtags	Mon Jun 02 15:49:53 2014 -0400
+++ b/hotspot/.hgtags	Mon Jun 02 13:53:52 2014 -0700
@@ -416,3 +416,5 @@
 783309c3a1a629a452673399dcfa83ef7eca94d8 jdk9-b11
 1c383bb39e2849ca62cb763f4e182a29b421d60a jdk9-b12
 456ad9c99133803d4e1433124c85a6fd141b9ac9 jdk9-b13
+bd333491bb6c012d7b606939406d0fa9a5ac7ffd jdk9-b14
+170f6d733d7aec062f743a6b8c1cce940a7a984a jdk9-b15
--- a/hotspot/src/share/vm/classfile/classLoaderData.cpp	Mon Jun 02 15:49:53 2014 -0400
+++ b/hotspot/src/share/vm/classfile/classLoaderData.cpp	Mon Jun 02 13:53:52 2014 -0700
@@ -274,6 +274,8 @@
   MutexLockerEx ml(metaspace_lock(),  Mutex::_no_safepoint_check_flag);
   Klass* old_value = _klasses;
   k->set_next_link(old_value);
+  // Make sure linked class is stable, since the class list is walked without a lock
+  OrderAccess::storestore();
   // link the new item into the list
   _klasses = k;
 
--- a/hotspot/src/share/vm/classfile/verifier.cpp	Mon Jun 02 15:49:53 2014 -0400
+++ b/hotspot/src/share/vm/classfile/verifier.cpp	Mon Jun 02 13:53:52 2014 -0700
@@ -2036,7 +2036,7 @@
     while ((bcp + padding_offset) < aligned_bcp) {
       if(*(bcp + padding_offset) != 0) {
         verify_error(ErrorContext::bad_code(bci),
-                     "Nonzero padding byte in lookswitch or tableswitch");
+                     "Nonzero padding byte in lookupswitch or tableswitch");
         return;
       }
       padding_offset++;
--- a/hotspot/src/share/vm/compiler/compilerOracle.cpp	Mon Jun 02 15:49:53 2014 -0400
+++ b/hotspot/src/share/vm/compiler/compilerOracle.cpp	Mon Jun 02 13:53:52 2014 -0700
@@ -307,6 +307,9 @@
   return (check_predicate(PrintCommand, method));
 }
 
+bool CompilerOracle::should_print_methods() {
+  return lists[PrintCommand] != NULL;
+}
 
 bool CompilerOracle::should_log(methodHandle method) {
   if (!LogCompilation)            return false;
--- a/hotspot/src/share/vm/compiler/compilerOracle.hpp	Mon Jun 02 15:49:53 2014 -0400
+++ b/hotspot/src/share/vm/compiler/compilerOracle.hpp	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -73,6 +73,9 @@
   // For updating the oracle file
   static void append_comment_to_file(const char* message);
   static void append_exclude_to_file(methodHandle method);
+
+  // Tells whether there are any methods to print for print_method_statistics()
+  static bool should_print_methods();
 };
 
 #endif // SHARE_VM_COMPILER_COMPILERORACLE_HPP
--- a/hotspot/src/share/vm/memory/metaspace.cpp	Mon Jun 02 15:49:53 2014 -0400
+++ b/hotspot/src/share/vm/memory/metaspace.cpp	Mon Jun 02 13:53:52 2014 -0700
@@ -3095,7 +3095,7 @@
 
 void Metaspace::global_initialize() {
   // Initialize the alignment for shared spaces.
-  int max_alignment = os::vm_page_size();
+  int max_alignment = os::vm_allocation_granularity();
   size_t cds_total = 0;
 
   MetaspaceShared::set_max_alignment(max_alignment);
--- a/hotspot/src/share/vm/oops/instanceKlass.cpp	Mon Jun 02 15:49:53 2014 -0400
+++ b/hotspot/src/share/vm/oops/instanceKlass.cpp	Mon Jun 02 13:53:52 2014 -0700
@@ -1273,6 +1273,12 @@
 
 
 void InstanceKlass::methods_do(void f(Method* method)) {
+  // Methods aren't stable until they are loaded.  This can be read outside
+  // a lock through the ClassLoaderData for profiling
+  if (!is_loaded()) {
+    return;
+  }
+
   int len = methods()->length();
   for (int index = 0; index < len; index++) {
     Method* m = methods()->at(index);
--- a/hotspot/src/share/vm/prims/jvmtiEnv.cpp	Mon Jun 02 15:49:53 2014 -0400
+++ b/hotspot/src/share/vm/prims/jvmtiEnv.cpp	Mon Jun 02 13:53:52 2014 -0700
@@ -307,9 +307,9 @@
       !java_lang_Class::is_primitive(mirror)) {
     Klass* k = java_lang_Class::as_Klass(mirror);
     assert(k != NULL, "class for non-primitive mirror must exist");
-    *size_ptr = k->size() * wordSize;
+    *size_ptr = (jlong)k->size() * wordSize;
   } else {
-    *size_ptr = mirror->size() * wordSize;
+    *size_ptr = (jlong)mirror->size() * wordSize;
     }
   return JVMTI_ERROR_NONE;
 } /* end GetObjectSize */
--- a/hotspot/src/share/vm/runtime/arguments.cpp	Mon Jun 02 15:49:53 2014 -0400
+++ b/hotspot/src/share/vm/runtime/arguments.cpp	Mon Jun 02 13:53:52 2014 -0700
@@ -1449,7 +1449,7 @@
   return true;
 }
 
-uintx Arguments::max_heap_for_compressed_oops() {
+size_t Arguments::max_heap_for_compressed_oops() {
   // Avoid sign flip.
   assert(OopEncodingHeapMax > (uint64_t)os::vm_page_size(), "Unusual page size");
   // We need to fit both the NULL page and the heap into the memory budget, while
--- a/hotspot/src/share/vm/runtime/java.cpp	Mon Jun 02 15:49:53 2014 -0400
+++ b/hotspot/src/share/vm/runtime/java.cpp	Mon Jun 02 13:53:52 2014 -0700
@@ -120,7 +120,8 @@
 }
 
 void print_method_profiling_data() {
-  if (ProfileInterpreter COMPILER1_PRESENT(|| C1UpdateMethodData)) {
+  if (ProfileInterpreter COMPILER1_PRESENT(|| C1UpdateMethodData) &&
+     (PrintMethodData || CompilerOracle::should_print_methods())) {
     ResourceMark rm;
     HandleMark hm;
     collected_profiled_methods = new GrowableArray<Method*>(1024);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef SHARE_VM_RUNTIME_SHAREDRUNTIMEMATH_HPP
+#define SHARE_VM_RUNTIME_SHAREDRUNTIMEMATH_HPP
+
+#include <math.h>
+
+// VM_LITTLE_ENDIAN is #defined appropriately in the Makefiles
+// [jk] this is not 100% correct because the float word order may different
+// from the byte order (e.g. on ARM FPA)
+#ifdef VM_LITTLE_ENDIAN
+# define __HI(x) *(1+(int*)&x)
+# define __LO(x) *(int*)&x
+#else
+# define __HI(x) *(int*)&x
+# define __LO(x) *(1+(int*)&x)
+#endif
+
+static double copysignA(double x, double y) {
+  __HI(x) = (__HI(x)&0x7fffffff)|(__HI(y)&0x80000000);
+  return x;
+}
+
+/*
+ * ====================================================
+ * Copyright (c) 1998 Oracle and/or its affiliates. All rights reserved.
+ *
+ * Developed at SunSoft, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+/*
+ * scalbn (double x, int n)
+ * scalbn(x,n) returns x* 2**n  computed by  exponent
+ * manipulation rather than by actually performing an
+ * exponentiation or a multiplication.
+ */
+
+static const double
+two54   =  1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */
+twom54  =  5.55111512312578270212e-17, /* 0x3C900000, 0x00000000 */
+hugeX  = 1.0e+300,
+tiny   = 1.0e-300;
+
+static double scalbnA (double x, int n) {
+  int  k,hx,lx;
+  hx = __HI(x);
+  lx = __LO(x);
+  k = (hx&0x7ff00000)>>20;              /* extract exponent */
+  if (k==0) {                           /* 0 or subnormal x */
+    if ((lx|(hx&0x7fffffff))==0) return x; /* +-0 */
+    x *= two54;
+    hx = __HI(x);
+    k = ((hx&0x7ff00000)>>20) - 54;
+    if (n< -50000) return tiny*x;       /*underflow*/
+  }
+  if (k==0x7ff) return x+x;             /* NaN or Inf */
+  k = k+n;
+  if (k >  0x7fe) return hugeX*copysignA(hugeX,x); /* overflow  */
+  if (k > 0)                            /* normal result */
+    {__HI(x) = (hx&0x800fffff)|(k<<20); return x;}
+  if (k <= -54) {
+    if (n > 50000)      /* in case integer overflow in n+k */
+      return hugeX*copysignA(hugeX,x);  /*overflow*/
+    else return tiny*copysignA(tiny,x); /*underflow*/
+  }
+  k += 54;                              /* subnormal result */
+  __HI(x) = (hx&0x800fffff)|(k<<20);
+  return x*twom54;
+}
+
+#endif // SHARE_VM_RUNTIME_SHAREDRUNTIMEMATH_HPP
--- a/hotspot/src/share/vm/runtime/sharedRuntimeTrans.cpp	Mon Jun 02 15:49:53 2014 -0400
+++ b/hotspot/src/share/vm/runtime/sharedRuntimeTrans.cpp	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -43,78 +43,7 @@
 # pragma optimize ( "", off )
 #endif
 
-#include <math.h>
-
-// VM_LITTLE_ENDIAN is #defined appropriately in the Makefiles
-// [jk] this is not 100% correct because the float word order may different
-// from the byte order (e.g. on ARM)
-#ifdef VM_LITTLE_ENDIAN
-# define __HI(x) *(1+(int*)&x)
-# define __LO(x) *(int*)&x
-#else
-# define __HI(x) *(int*)&x
-# define __LO(x) *(1+(int*)&x)
-#endif
-
-#if !defined(AIX)
-double copysign(double x, double y) {
-  __HI(x) = (__HI(x)&0x7fffffff)|(__HI(y)&0x80000000);
-  return x;
-}
-#endif
-
-/*
- * ====================================================
- * Copyright (c) 1998 Oracle and/or its affiliates. All rights reserved.
- *
- * Developed at SunSoft, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-/*
- * scalbn (double x, int n)
- * scalbn(x,n) returns x* 2**n  computed by  exponent
- * manipulation rather than by actually performing an
- * exponentiation or a multiplication.
- */
-
-static const double
-two54   =  1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */
-  twom54  =  5.55111512312578270212e-17, /* 0x3C900000, 0x00000000 */
-  hugeX   = 1.0e+300,
-  tiny   = 1.0e-300;
-
-#if !defined(AIX)
-double scalbn (double x, int n) {
-  int  k,hx,lx;
-  hx = __HI(x);
-  lx = __LO(x);
-  k = (hx&0x7ff00000)>>20;              /* extract exponent */
-  if (k==0) {                           /* 0 or subnormal x */
-    if ((lx|(hx&0x7fffffff))==0) return x; /* +-0 */
-    x *= two54;
-    hx = __HI(x);
-    k = ((hx&0x7ff00000)>>20) - 54;
-    if (n< -50000) return tiny*x;       /*underflow*/
-  }
-  if (k==0x7ff) return x+x;             /* NaN or Inf */
-  k = k+n;
-  if (k >  0x7fe) return hugeX*copysign(hugeX,x); /* overflow  */
-  if (k > 0)                            /* normal result */
-    {__HI(x) = (hx&0x800fffff)|(k<<20); return x;}
-  if (k <= -54) {
-    if (n > 50000)      /* in case integer overflow in n+k */
-      return hugeX*copysign(hugeX,x);   /*overflow*/
-    else return tiny*copysign(tiny,x);  /*underflow*/
-  }
-  k += 54;                              /* subnormal result */
-  __HI(x) = (hx&0x800fffff)|(k<<20);
-  return x*twom54;
-}
-#endif
+#include "runtime/sharedRuntimeMath.hpp"
 
 /* __ieee754_log(x)
  * Return the logarithm of x
@@ -719,7 +648,7 @@
   z  = one-(r-z);
   j  = __HI(z);
   j += (n<<20);
-  if((j>>20)<=0) z = scalbn(z,n);       /* subnormal output */
+  if((j>>20)<=0) z = scalbnA(z,n);       /* subnormal output */
   else __HI(z) += (n<<20);
   return s*z;
 }
--- a/hotspot/src/share/vm/runtime/sharedRuntimeTrig.cpp	Mon Jun 02 15:49:53 2014 -0400
+++ b/hotspot/src/share/vm/runtime/sharedRuntimeTrig.cpp	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -63,63 +63,7 @@
 #define SAFEBUF
 #endif
 
-#include <math.h>
-
-// VM_LITTLE_ENDIAN is #defined appropriately in the Makefiles
-// [jk] this is not 100% correct because the float word order may different
-// from the byte order (e.g. on ARM)
-#ifdef VM_LITTLE_ENDIAN
-# define __HI(x) *(1+(int*)&x)
-# define __LO(x) *(int*)&x
-#else
-# define __HI(x) *(int*)&x
-# define __LO(x) *(1+(int*)&x)
-#endif
-
-static double copysignA(double x, double y) {
-  __HI(x) = (__HI(x)&0x7fffffff)|(__HI(y)&0x80000000);
-  return x;
-}
-
-/*
- * scalbn (double x, int n)
- * scalbn(x,n) returns x* 2**n  computed by  exponent
- * manipulation rather than by actually performing an
- * exponentiation or a multiplication.
- */
-
-static const double
-two54   =  1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */
-twom54  =  5.55111512312578270212e-17, /* 0x3C900000, 0x00000000 */
-hugeX  = 1.0e+300,
-tiny   = 1.0e-300;
-
-static double scalbnA (double x, int n) {
-  int  k,hx,lx;
-  hx = __HI(x);
-  lx = __LO(x);
-  k = (hx&0x7ff00000)>>20;              /* extract exponent */
-  if (k==0) {                           /* 0 or subnormal x */
-    if ((lx|(hx&0x7fffffff))==0) return x; /* +-0 */
-    x *= two54;
-    hx = __HI(x);
-    k = ((hx&0x7ff00000)>>20) - 54;
-    if (n< -50000) return tiny*x;       /*underflow*/
-  }
-  if (k==0x7ff) return x+x;             /* NaN or Inf */
-  k = k+n;
-  if (k >  0x7fe) return hugeX*copysignA(hugeX,x); /* overflow  */
-  if (k > 0)                            /* normal result */
-    {__HI(x) = (hx&0x800fffff)|(k<<20); return x;}
-  if (k <= -54) {
-    if (n > 50000)      /* in case integer overflow in n+k */
-      return hugeX*copysignA(hugeX,x);  /*overflow*/
-    else return tiny*copysignA(tiny,x); /*underflow*/
-  }
-  k += 54;                              /* subnormal result */
-  __HI(x) = (hx&0x800fffff)|(k<<20);
-  return x*twom54;
-}
+#include "runtime/sharedRuntimeMath.hpp"
 
 /*
  * __kernel_rem_pio2(x,y,e0,nx,prec,ipio2)
--- a/hotspot/test/TEST.groups	Mon Jun 02 15:49:53 2014 -0400
+++ b/hotspot/test/TEST.groups	Mon Jun 02 13:53:52 2014 -0700
@@ -83,6 +83,7 @@
   runtime/RedefineObject/TestRedefineObject.java \
   runtime/XCheckJniJsig/XCheckJSig.java \
   serviceability/attach/AttachWithStalePidFile.java \
+  serviceability/jvmti/8036666/GetObjectLockCount.java \
   serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java \
   serviceability/dcmd/DynLibDcmdTest.java
 
@@ -135,6 +136,8 @@
   gc/parallelScavenge/TestDynShrinkHeap.java \
   runtime/InternalApi/ThreadCpuTimesDeadlock.java \
   serviceability/threads/TestFalseDeadLock.java \
+  serviceability/jvmti/GetObjectSizeOverflow.java \
+  serviceability/jvmti/TestRedefineWithUnresolvedClass.java \
   compiler/tiered/NonTieredLevelsTest.java \
   compiler/tiered/TieredLevelsTest.java \
   compiler/intrinsics/bmi/verifycode \
--- a/hotspot/test/gc/parallelScavenge/TestDynShrinkHeap.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/hotspot/test/gc/parallelScavenge/TestDynShrinkHeap.java	Mon Jun 02 13:53:52 2014 -0700
@@ -26,7 +26,7 @@
  * @bug 8016479
  * @summary Verify that the heap shrinks after full GC according to the current values of the Min/MaxHeapFreeRatio flags
  * @library /testlibrary
- * @run main/othervm -XX:+UseAdaptiveSizePolicyWithSystemGC -XX:+UseParallelGC -XX:MinHeapFreeRatio=0 -XX:MaxHeapFreeRatio=100 -verbose:gc TestDynShrinkHeap
+ * @run main/othervm -XX:+UseAdaptiveSizePolicyWithSystemGC -XX:+UseParallelGC -XX:MinHeapFreeRatio=0 -XX:MaxHeapFreeRatio=100 -Xmx1g -verbose:gc TestDynShrinkHeap
  */
 import com.oracle.java.testlibrary.DynamicVMOption;
 import java.lang.management.ManagementFactory;
@@ -41,7 +41,7 @@
     public static final String MAX_FREE_RATIO_FLAG_NAME = "MaxHeapFreeRatio";
 
     private static ArrayList<byte[]> list = new ArrayList<>(0);
-    private static final int M = 1024 * 1024; // to make heap more manageable by test code
+    private static final int LEN = 512 * 1024 + 1;
 
     public TestDynShrinkHeap() {
     }
@@ -69,12 +69,12 @@
     }
 
     private void eat() {
-        for (int i = 0; i < M; i++) {
+        for (int i = 0; i < LEN; i++) {
             list.add(new byte[1024]);
         }
-        MemoryUsagePrinter.printMemoryUsage("allocated " + M + " arrays");
+        MemoryUsagePrinter.printMemoryUsage("allocated " + LEN + " arrays");
 
-        list.subList(0, M / 2).clear();
+        list.subList(0, LEN / 2).clear();
         System.gc();
         MemoryUsagePrinter.printMemoryUsage("array halved");
     }
--- a/hotspot/test/runtime/6929067/T.java	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-public class T
-{
-  public static boolean foo(boolean bar)
-  {
-    return bar;
-  }
-
-  public static void printIt()
-  {
-    System.out.println("Hello");
-  }
-}
--- a/hotspot/test/runtime/6929067/Test6929067.sh	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-#!/bin/sh
-
-##
-## @test Test6929067.sh
-## @bug 6929067
-## @bug 8021296
-## @bug 8025519
-## @summary Stack guard pages should be removed when thread is detached
-## @run shell Test6929067.sh
-##
-
-if [ "${TESTSRC}" = "" ]
-then
-  TESTSRC=${PWD}
-  echo "TESTSRC not set.  Using "${TESTSRC}" as default"
-fi
-echo "TESTSRC=${TESTSRC}"
-## Adding common setup Variables for running shell tests.
-. ${TESTSRC}/../../test_env.sh
-
-if [ "${VM_OS}" != "linux" ]
-then
-  echo "Test only valid for Linux"
-  exit 0
-fi
-
-gcc_cmd=`which gcc`
-if [ "x$gcc_cmd" = "x" ]; then
-  echo "WARNING: gcc not found. Cannot execute test." 2>&1
-  exit 0;
-fi
-
-CFLAGS=-m${VM_BITS}
-
-LD_LIBRARY_PATH=.:${TESTJAVA}/jre/lib/${VM_CPU}/${VM_TYPE}:/usr/lib:$LD_LIBRARY_PATH
-export LD_LIBRARY_PATH
-
-cp ${TESTSRC}/*.java ${THIS_DIR}
-${COMPILEJAVA}/bin/javac *.java
-
-echo "Architecture: ${VM_CPU}"
-echo "Compilation flag: ${CFLAGS}"
-echo "VM type: ${VM_TYPE}"
-echo "LD_LIBRARY_PATH: ${LD_LIBRARY_PATH}"
-
-# Note pthread may not be found thus invoke creation will fail to be created.
-# Check to ensure you have a /usr/lib/libpthread.so if you don't please look
-# for /usr/lib/`uname -m`-linux-gnu version ensure to add that path to below compilation.
-
-$gcc_cmd -DLINUX ${CFLAGS} -o invoke \
-    -I${TESTJAVA}/include -I${TESTJAVA}/include/linux \
-    -L${TESTJAVA}/jre/lib/${VM_CPU}/${VM_TYPE} \
-     ${TESTSRC}/invoke.c -ljvm -lpthread
-
-./invoke
-exit $?
--- a/hotspot/test/runtime/6929067/invoke.c	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +0,0 @@
-#include <assert.h>
-#include <jni.h>
-#include <alloca.h>
-
-#include <pthread.h>
-
-union env_union
-{
-  void *void_env;
-  JNIEnv *jni_env;
-};
-
-union env_union tmp;
-JNIEnv* env;
-JavaVM* jvm;
-JavaVMInitArgs vm_args;
-JavaVMOption options[1];
-jclass class_id;
-jmethodID method_id;
-jint result;
-
-long product(unsigned long n, unsigned long m) {
-    if (m == 1) {
-      return n;
-    } else {
-      int *p = alloca(sizeof (int));
-      *p = n;
-      return product (n, m-1) + *p;
-    }
-}
-
-void *
-floobydust (void *p)
-{
-  (*jvm)->AttachCurrentThread(jvm, &tmp.void_env, NULL);
-  env = tmp.jni_env;
-
-  class_id = (*env)->FindClass (env, "T");
-  assert (class_id);
-
-  method_id = (*env)->GetStaticMethodID (env, class_id, "printIt", "()V");
-  assert (method_id);
-
-  (*env)->CallStaticVoidMethod (env, class_id, method_id, NULL);
-
-  (*jvm)->DetachCurrentThread(jvm);
-
-  printf("%ld\n", product(5000,5000));
-
-  (*jvm)->AttachCurrentThread(jvm, &tmp.void_env, NULL);
-  env = tmp.jni_env;
-
-  class_id = (*env)->FindClass (env, "T");
-  assert (class_id);
-
-  method_id = (*env)->GetStaticMethodID (env, class_id, "printIt", "()V");
-  assert (method_id);
-
-  (*env)->CallStaticVoidMethod (env, class_id, method_id, NULL);
-
-  (*jvm)->DetachCurrentThread(jvm);
-
-  printf("%ld\n", product(5000,5000));
-
-  return NULL;
-}
-
-int
-main (int argc, const char** argv)
-{
-  options[0].optionString = "-Xss320k";
-
-  vm_args.version = JNI_VERSION_1_2;
-  vm_args.ignoreUnrecognized = JNI_TRUE;
-  vm_args.options = options;
-  vm_args.nOptions = 1;
-
-  result = JNI_CreateJavaVM (&jvm, &tmp.void_env, &vm_args);
-  assert (result >= 0);
-
-  env = tmp.jni_env;
-
-  floobydust (NULL);
-
-  pthread_t thr;
-  pthread_create (&thr, NULL, floobydust, NULL);
-  pthread_join (thr, NULL);
-
-  return 0;
-}
--- a/hotspot/test/runtime/InitialThreadOverflow/DoOverflow.java	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +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.
- */
-
-public class DoOverflow {
-
-    static int count;
-
-    public void overflow() {
-        count+=1;
-        overflow();
-    }
-
-    public static void printIt() {
-        System.out.println("Going to overflow stack");
-        try {
-            new DoOverflow().overflow();
-        } catch(java.lang.StackOverflowError e) {
-            System.out.println("Overflow OK " + count);
-        }
-    }
-}
--- a/hotspot/test/runtime/InitialThreadOverflow/invoke.c	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +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.
- */
-
-#include <assert.h>
-#include <jni.h>
-
-#include <pthread.h>
-
-JavaVM* jvm;
-
-void *
-floobydust (void *p) {
-  JNIEnv *env;
-  jclass class_id;
-  jmethodID method_id;
-
-  (*jvm)->AttachCurrentThread(jvm, (void**)&env, NULL);
-
-  class_id = (*env)->FindClass (env, "DoOverflow");
-  assert (class_id);
-
-  method_id = (*env)->GetStaticMethodID(env, class_id, "printIt", "()V");
-  assert (method_id);
-
-  (*env)->CallStaticVoidMethod(env, class_id, method_id, NULL);
-
-  (*jvm)->DetachCurrentThread(jvm);
-}
-
-int
-main (int argc, const char** argv) {
-  JavaVMOption options[1];
-  options[0].optionString = (char*) "-Xss320k";
-
-  JavaVMInitArgs vm_args;
-  vm_args.version = JNI_VERSION_1_2;
-  vm_args.ignoreUnrecognized = JNI_TRUE;
-  vm_args.options = options;
-  vm_args.nOptions = 1;
-
-  JNIEnv* env;
-  jint result = JNI_CreateJavaVM(&jvm, (void**)&env, &vm_args);
-  assert(result >= 0);
-
-  pthread_t thr;
-  pthread_create(&thr, NULL, floobydust, NULL);
-  pthread_join(thr, NULL);
-
-  floobydust(NULL);
-
-  return 0;
-}
--- a/hotspot/test/runtime/InitialThreadOverflow/testme.sh	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-#!/bin/sh
-
-# 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 testme.sh
-# @bug 8009062
-# @summary Poor performance of JNI AttachCurrentThread after fix for 7017193
-# @compile DoOverflow.java
-# @run shell testme.sh
-
-set -x
-if [ "${TESTSRC}" = "" ]
-then
-  TESTSRC=${PWD}
-  echo "TESTSRC not set.  Using "${TESTSRC}" as default"
-fi
-echo "TESTSRC=${TESTSRC}"
-## Adding common setup Variables for running shell tests.
-. ${TESTSRC}/../../test_env.sh
-
-if [ "${VM_OS}" != "linux" ]
-then
-  echo "Test only valid for Linux"
-  exit 0
-fi
-
-gcc_cmd=`which gcc`
-if [ "x$gcc_cmd" = "x" ]; then
-    echo "WARNING: gcc not found. Cannot execute test." 2>&1
-    exit 0;
-fi
-
-CFLAGS="-m${VM_BITS}"
-
-LD_LIBRARY_PATH=.:${TESTJAVA}/jre/lib/${VM_CPU}/${VM_TYPE}:/usr/lib:$LD_LIBRARY_PATH
-export LD_LIBRARY_PATH
-
-cp ${TESTSRC}/invoke.c .
-
-# Copy the result of our @compile action:
-cp ${TESTCLASSES}/DoOverflow.class .
-
-echo "Architecture: ${VM_CPU}"
-echo "Compilation flag: ${CFLAGS}"
-echo "VM type: ${VM_TYPE}"
-echo "LD_LIBRARY_PATH: ${LD_LIBRARY_PATH}"
-
-# Note pthread may not be found thus invoke creation will fail to be created.
-# Check to ensure you have a /usr/lib/libpthread.so if you don't please look
-# for /usr/lib/`uname -m`-linux-gnu version ensure to add that path to below compilation.
-
-$gcc_cmd -DLINUX ${CFLAGS} -o invoke \
-    -I${TESTJAVA}/include -I${TESTJAVA}/include/linux \
-    -L${TESTJAVA}/jre/lib/${VM_CPU}/${VM_TYPE} \
-    -ljvm -lpthread invoke.c
-
-./invoke
-exit $?
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/runtime/StackGuardPages/DoOverflow.java	Mon Jun 02 13:53:52 2014 -0700
@@ -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.
+ */
+
+public class DoOverflow {
+
+    static int count;
+
+    public void overflow() {
+        count+=1;
+        overflow();
+    }
+
+    public static void printAlive() {
+      System.out.println("Java thread is alive.");
+    }
+
+    public static void printIt() {
+        System.out.println("Going to overflow stack");
+        try {
+            new DoOverflow().overflow();
+        } catch(java.lang.StackOverflowError e) {
+            System.out.println("Test PASSED. Got StackOverflowError at " + count + " iteration");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/runtime/StackGuardPages/invoke.c	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,266 @@
+/*
+ * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/* This code tests the fact that we actually remove stack guard page when calling
+ * JavaThread::exit() i.e. when detaching from current thread.
+ * We overflow the stack and check that we get access error because of a guard page.
+ * Than we detach from vm thread and overflow stack once again. This time we shouldn't
+ * get access error because stack guard page is removed
+ *
+ * Notice: due a complicated interaction of signal handlers, the test may crash.
+ * It's OK - don't file a bug.
+ */
+
+#include <assert.h>
+#include <jni.h>
+#include <alloca.h>
+#include <signal.h>
+#include <sys/mman.h>
+#include <stdlib.h>
+#include <sys/ucontext.h>
+#include <setjmp.h>
+#include <unistd.h>
+#include <sys/syscall.h>
+#include <errno.h>
+
+#include <pthread.h>
+
+JavaVM* _jvm;
+
+static jmp_buf  context;
+
+static int _last_si_code = -1;
+static int _failures = 0;
+static int _rec_count = 0;
+static int _kp_rec_count = 0;
+
+pid_t gettid() {
+  return (pid_t) syscall(SYS_gettid);
+}
+
+static void handler(int sig, siginfo_t *si, void *unused) {
+  _last_si_code = si->si_code;
+  printf("Got SIGSEGV(%d) at address: 0x%lx\n",si->si_code, (long) si->si_addr);
+  longjmp(context, 1);
+}
+
+void set_signal_handler() {
+  static char altstack[SIGSTKSZ];
+
+  stack_t ss = {
+    .ss_size = SIGSTKSZ,
+    .ss_flags = 0,
+    .ss_sp = altstack
+  };
+
+  struct sigaction sa = {
+    .sa_sigaction = handler,
+    .sa_flags = SA_ONSTACK | SA_SIGINFO | SA_RESETHAND
+  };
+
+  _last_si_code = -1;
+
+  sigaltstack(&ss, 0);
+  sigemptyset(&sa.sa_mask);
+  if (sigaction(SIGSEGV, &sa, NULL) == -1) {
+    fprintf(stderr, "Test ERROR. Can't set sigaction (%d)\n", errno);
+    exit(7);
+  }
+}
+
+void *run_java_overflow (void *p) {
+  JNIEnv *env;
+  jclass class_id;
+  jmethodID method_id;
+  int res;
+
+  res = (*_jvm)->AttachCurrentThread(_jvm, (void**)&env, NULL);
+  if (res != JNI_OK) {
+    fprintf(stderr, "Test ERROR. Can't attach to current thread\n");
+    exit(7);
+  }
+
+  class_id = (*env)->FindClass (env, "DoOverflow");
+  if (class_id == NULL) {
+    fprintf(stderr, "Test ERROR. Can't load class DoOverflow\n");
+    exit(7);
+  }
+
+  method_id = (*env)->GetStaticMethodID(env, class_id, "printIt", "()V");
+  if (method_id == NULL) {
+    fprintf(stderr, "Test ERROR. Can't find method DoOverflow.printIt\n");
+    exit(7);
+  }
+
+  (*env)->CallStaticVoidMethod(env, class_id, method_id, NULL);
+
+  res = (*_jvm)->DetachCurrentThread(_jvm);
+  if (res != JNI_OK) {
+    fprintf(stderr, "Test ERROR. Can't call detach from current thread\n");
+    exit(7);
+  }
+}
+
+void do_overflow(){
+  int *p = alloca(sizeof(int));
+  if (_kp_rec_count == 0 || _rec_count < _kp_rec_count) {
+      _rec_count ++;
+      do_overflow();
+  }
+}
+
+void *run_native_overflow(void *p) {
+  // Test that stack guard page is correctly set for initial and non initial thread
+  // and correctly removed for the initial thread
+  JNIEnv *env;
+  jclass class_id;
+  jmethodID method_id;
+  int res;
+
+  printf("run_native_overflow %ld\n", (long) gettid());
+
+  res = (*_jvm)->AttachCurrentThread(_jvm, (void **)&env, NULL);
+  if (res != JNI_OK) {
+    fprintf(stderr, "Test ERROR. Can't attach to current thread\n");
+    exit(7);
+  }
+
+  class_id = (*env)->FindClass (env, "DoOverflow");
+  if (class_id == NULL) {
+    fprintf(stderr, "Test ERROR. Can't load class DoOverflow\n");
+    exit(7);
+  }
+
+  method_id = (*env)->GetStaticMethodID (env, class_id, "printAlive", "()V");
+  if (method_id == NULL) {
+    fprintf(stderr, "Test ERROR. Can't find method DoOverflow.printAlive\n");
+    exit(7);
+  }
+
+  (*env)->CallStaticVoidMethod (env, class_id, method_id, NULL);
+
+  set_signal_handler();
+  if (! setjmp(context)) {
+    do_overflow();
+  }
+
+  if (_last_si_code == SEGV_ACCERR) {
+    printf("Test PASSED. Got access violation accessing guard page at %d\n", _rec_count);
+  }
+
+  res = (*_jvm)->DetachCurrentThread(_jvm);
+  if (res != JNI_OK) {
+    fprintf(stderr, "Test ERROR. Can't call detach from current thread\n");
+    exit(7);
+  }
+
+  if (getpid() != gettid()) {
+    // For non-initial thread we don't unmap the region but call os::uncommit_memory and keep PROT_NONE
+    // so if host has enough swap space we will get the same SEGV with code SEGV_ACCERR(2) trying
+    // to access it as if the guard page is present.
+    // We have no way to check this, so bail out, marking test as succeeded
+    printf("Test PASSED. Not initial thread\n");
+    return NULL;
+  }
+
+  // Limit depth of recursion for second run. It can't exceed one for first run.
+  _kp_rec_count = _rec_count;
+  _rec_count = 0;
+
+  set_signal_handler();
+  if (! setjmp(context)) {
+    do_overflow();
+  }
+
+  if (_last_si_code == SEGV_ACCERR) {
+      ++ _failures;
+      fprintf(stderr,"Test FAILED. Stack guard page is still there at %d\n", _rec_count);
+  } else if (_last_si_code == -1) {
+      printf("Test PASSED. No stack guard page is present. Maximum recursion level reached at %d\n", _rec_count);
+  }
+  else{
+      printf("Test PASSED. No stack guard page is present. SIGSEGV(%d) at %d\n", _last_si_code, _rec_count);
+  }
+
+  return NULL;
+}
+
+void usage() {
+  fprintf(stderr, "Usage: invoke test_java_overflow\n");
+  fprintf(stderr, "       invoke test_native_overflow\n");
+  exit(7);
+}
+
+
+int main (int argc, const char** argv) {
+  JavaVMInitArgs vm_args;
+  JavaVMOption options[2];
+  JNIEnv* env;
+
+  printf("Test started with pid: %ld\n", (long) getpid());
+
+  options[0].optionString = "-Xint";
+  options[1].optionString = "-Xss320k";
+
+  vm_args.version = JNI_VERSION_1_2;
+  vm_args.ignoreUnrecognized = JNI_TRUE;
+  vm_args.options = options;
+  vm_args.nOptions = 2;
+
+  if (JNI_CreateJavaVM (&_jvm, (void **)&env, &vm_args) < 0 ) {
+    fprintf(stderr, "Test ERROR. Can't create JavaVM\n");
+    exit(7);
+  }
+
+  pthread_t thr;
+
+  if (argc > 1 && strcmp(argv[1], "test_java_overflow") == 0) {
+    printf("\nTesting JAVA_OVERFLOW\n");
+
+    printf("Testing stack guard page behaviour for other thread\n");
+    pthread_create (&thr, NULL, run_java_overflow, NULL);
+    pthread_join (thr, NULL);
+
+    printf("Testing stack guard page behaviour for initial thread\n");
+    run_java_overflow(NULL);
+    // This test crash on error
+    exit(0);
+  }
+
+  if (argc > 1 && strcmp(argv[1], "test_native_overflow") == 0) {
+    printf("\nTesting NATIVE_OVERFLOW\n");
+
+    printf("Testing stack guard page behaviour for other thread\n");
+    pthread_create (&thr, NULL, run_native_overflow, NULL);
+    pthread_join (thr, NULL);
+
+    printf("Testing stack guard page behaviour for initial thread\n");
+    run_native_overflow(NULL);
+
+    exit((_failures > 0) ? 1 : 0);
+  }
+
+  fprintf(stderr, "Test ERROR. Unknown parameter %s\n", ((argc > 1) ? argv[1] : "none"));
+  usage();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/runtime/StackGuardPages/testme.sh	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,60 @@
+#!/bin/sh
+
+#
+# @test testme.sh
+# @summary Stack guard pages should be installed correctly and removed when thread is detached
+# @run shell testme.sh
+#
+
+if [ "${TESTSRC}" = "" ]
+then
+  TESTSRC=${PWD}
+  echo "TESTSRC not set.  Using "${TESTSRC}" as default"
+fi
+echo "TESTSRC=${TESTSRC}"
+## Adding common setup Variables for running shell tests.
+. ${TESTSRC}/../../test_env.sh
+
+if [ "${VM_OS}" != "linux" ]
+then
+  echo "Test only valid for Linux"
+  exit 0
+fi
+
+gcc_cmd=`which gcc`
+if [ "x$gcc_cmd" = "x" ]; then
+  echo "WARNING: gcc not found. Cannot execute test." 2>&1
+  exit 0;
+fi
+
+CFLAGS=-m${VM_BITS}
+
+LD_LIBRARY_PATH=.:${TESTJAVA}/jre/lib/${VM_CPU}/${VM_TYPE}:${TESTJAVA}/lib/${VM_CPU}/${VM_TYPE}:/usr/lib:$LD_LIBRARY_PATH
+export LD_LIBRARY_PATH
+
+echo "Architecture: ${VM_CPU}"
+echo "Compilation flag: ${CFLAGS}"
+echo "VM type: ${VM_TYPE}"
+echo "LD_LIBRARY_PATH: ${LD_LIBRARY_PATH}"
+
+# Note pthread may not be found thus invoke creation will fail to be created.
+# Check to ensure you have a /usr/lib/libpthread.so if you don't please look
+# for /usr/lib/`uname -m`-linux-gnu version ensure to add that path to below compilation.
+
+cp ${TESTSRC}/DoOverflow.java .
+${COMPILEJAVA}/bin/javac DoOverflow.java
+
+$gcc_cmd -DLINUX -g3 ${CFLAGS} -o invoke \
+    -I${TESTJAVA}/include -I${TESTJAVA}/include/linux \
+    -L${TESTJAVA}/jre/lib/${VM_CPU}/${VM_TYPE} \
+    -L${TESTJAVA}/lib/${VM_CPU}/${VM_TYPE} \
+     ${TESTSRC}/invoke.c -ljvm -lpthread
+
+if [ $? -ne 0 ] ; then
+    echo "Compile failed, Ignoring failed compilation and forcing the test to pass"
+    exit 0
+fi
+
+./invoke test_java_overflow
+./invoke test_native_overflow
+exit $?
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/serviceability/jvmti/GetObjectSizeOverflow.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+import java.io.PrintWriter;
+import com.oracle.java.testlibrary.*;
+
+/*
+ * Test to verify GetObjectSize does not overflow on a 600M element int[]
+ *
+ * @test
+ * @bug 8027230
+ * @library /testlibrary
+ * @build GetObjectSizeOverflowAgent
+ * @run main ClassFileInstaller GetObjectSizeOverflowAgent
+ * @run main GetObjectSizeOverflow
+ */
+public class GetObjectSizeOverflow {
+    public static void main(String[] args) throws Exception  {
+
+        if (!Platform.is64bit()) {
+            System.out.println("Test needs a 4GB heap and can only be run as a 64bit process, skipping.");
+            return;
+        }
+
+        PrintWriter pw = new PrintWriter("MANIFEST.MF");
+        pw.println("Premain-Class: GetObjectSizeOverflowAgent");
+        pw.close();
+
+        ProcessBuilder pb = new ProcessBuilder();
+        pb.command(new String[] { JDKToolFinder.getJDKTool("jar"), "cmf", "MANIFEST.MF", "agent.jar", "GetObjectSizeOverflowAgent.class"});
+        pb.start().waitFor();
+
+        ProcessBuilder pt = ProcessTools.createJavaProcessBuilder(true, "-Xmx4000m", "-javaagent:agent.jar",  "GetObjectSizeOverflowAgent");
+        OutputAnalyzer output = new OutputAnalyzer(pt.start());
+
+        if (output.getStdout().contains("Could not reserve enough space") || output.getStderr().contains("java.lang.OutOfMemoryError")) {
+            System.out.println("stdout: " + output.getStdout());
+            System.out.println("stderr: " + output.getStderr());
+            System.out.println("Test could not reserve or allocate enough space, skipping");
+            return;
+        }
+
+        output.stdoutShouldContain("GetObjectSizeOverflow passed");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/serviceability/jvmti/GetObjectSizeOverflowAgent.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+import java.lang.instrument.*;
+
+public class GetObjectSizeOverflowAgent {
+
+    static Instrumentation instrumentation;
+
+    public static void premain(String agentArgs, Instrumentation instrumentation) {
+        GetObjectSizeOverflowAgent.instrumentation = instrumentation;
+    }
+
+    public static void main(String[] args) throws Exception {
+        int[] a = new int[600_000_000];
+        long size = instrumentation.getObjectSize(a);
+
+        if (size < 2_400_000_000L) {
+            throw new RuntimeException("Invalid size of array, expected >= 2400000000, got " + size);
+        }
+
+        System.out.println("GetObjectSizeOverflow passed");
+    }
+}
--- a/jaxp/.hgtags	Mon Jun 02 15:49:53 2014 -0400
+++ b/jaxp/.hgtags	Mon Jun 02 13:53:52 2014 -0700
@@ -256,3 +256,5 @@
 6b4280dceb00642f54d5bc1c2cb7d34c99a04992 jdk9-b11
 e88cecf5a21b760ff7d7761c2db6bb8c82bc9f0c jdk9-b12
 5eaf717f6e36037a6d3744ffeee0e4c88e64a0d2 jdk9-b13
+32b3fc4bc7374a34d52b7f4e2391b4b4b0c084e8 jdk9-b14
+6bad71866c7598587860e0981b0b0e51ec8c0476 jdk9-b15
--- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Makefile.inc	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-###########################################################################
-# reserved comment block
-# DO NOT REMOVE OR ALTER!
-###########################################################################
-##########################################################################
-# Copyright 2001-2004 The Apache Software Foundation.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-##########################################################################
-#
-# $Id: Makefile.inc,v 1.2 2004/02/17 16:32:49 minchau Exp $
-#
-####################################################################
-#                                                                  #
-# Makefile.inc for XSLT compiler                                   #
-#                                                                  #
-####################################################################
-
-####################################################################
-# Useful macros                                                    #
-####################################################################
-
-JAVAC = javac
-#JAVAC_FLAGS = -g -d $(XSLT)/src/classes
-JAVAC_FLAGS = -sourcepath $(XSLT)/src
-JAVACC = javacc
-JAVACC_FLAGS = -static=FALSE 
-JAVACUP = javacup
-JAVACUP_FLAGS =
-JAVALEX = jlex
-JAVALEX_FLAGS =
-
-####################################################################
-#  Explicit rules                                                  #
-####################################################################
-
-.SUFFIXES: .java .class .jj .lex .cup
-
-.java.class:
-	$(JAVAC) $(JAVAC_FLAGS) $<
-
-.jj.java:
-	$(JAVACC) $(JAVACC_FLAGS) $<
-
-.cup.java:
-	$(JAVACUP) $(JAVACUP_FLAGS) $<
-
-.lex.java:
-	$(JAVALEX) $(JAVALEX_FLAGS) $<
-
--- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/javax.xml.transform.TransformerFactory	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl
--- a/jaxp/src/com/sun/org/apache/xerces/internal/dom/org.apache.xerces.dom.DOMImplementationSourceImpl	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-com.sun.org.apache.xerces.internal.dom.DOMImplementationSourceImpl
--- a/jaxp/src/com/sun/org/apache/xerces/internal/dom/org.w3c.dom.DOMImplementationSourceList	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-com.sun.org.apache.xerces.internal.dom.DOMXSImplementationSourceImpl
--- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/datatype/javax.xml.datatype.DatatypeFactory	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-com.sun.org.apache.xerces.internal.jaxp.datatype.DatatypeFactoryImpl
--- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/javax.xml.parsers.DocumentBuilderFactory	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
--- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/javax.xml.parsers.SAXParserFactory	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
--- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/javax.xml.validation.SchemaFactory	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-com.sun.org.apache.xerces.internal.jaxp.validation.XMLSchemaFactory
--- a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/org.apache.xerces.xni.parser.DTDConfiguration	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-com.sun.org.apache.xerces.internal.parsers.DTDConfiguration
--- a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/org.apache.xerces.xni.parser.XML11Configuration	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-com.sun.org.apache.xerces.internal.parsers.XML11Configuration
--- a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/org.apache.xerces.xni.parser.XMLParserConfiguration	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-com.sun.org.apache.xerces.internal.parsers.XIncludeAwareParserConfiguration
--- a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/org.xml.sax.driver	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-com.sun.org.apache.xerces.internal.parsers.SAXParser
-
--- a/jaxp/src/com/sun/xml/internal/stream/javax.xml.stream.XMLEventFactory	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-com.sun.xml.internal.stream.events.XMLEventFactoryImpl
--- a/jaxp/src/com/sun/xml/internal/stream/javax.xml.stream.XMLInputFactory	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-com.sun.xml.internal.stream.XMLInputFactoryImpl
--- a/jaxp/src/com/sun/xml/internal/stream/javax.xml.stream.XMLOutputFactory	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-com.sun.xml.internal.stream.XMLOutputFactoryImpl
--- a/jaxp/src/org/xml/sax/COPYING	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-SAX IS FREE
------------
-
-I hereby abandon any property rights to SAX 2.0 (the Simple API for
-XML), and release all of the SAX 2.0 source code, compiled code, and
-documentation contained in this distribution into the Public Domain.
-SAX comes with NO WARRANTY or guarantee of fitness for any purpose.
-
-
-David Megginson
-david@megginson.com
-2000-01-14
--- a/jaxp/src/org/xml/sax/COPYING.txt	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-			 SAX COPYRIGHT STATUS
-
-Version 1.0 of the Simple API for XML (SAX), created collectively by
-the membership of the XML-DEV mailing list, is hereby released into
-the public domain.
-
-No one owns SAX: you may use it freely in both commercial and
-non-commercial applications, bundle it with your software
-distribution, include it on a CD-ROM, list the source code in a book,
-mirror the documentation at your own web site, or use it in any other
-way you see fit.
-
-
-			     NO WARRANTY
-
-Because SAX is released to the public domain, there is no warranty for
-the design or for the software implementation, to the extent permitted
-by applicable law.  Except when otherwise stated in writing the
-copyright holders and/or other parties provide SAX "as is" without
-warranty of any kind, either expressed or implied, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose.  The entire risk as to the quality and
-performance of SAX is with you.  Should SAX prove defective, you
-assume the cost of all necessary servicing, repair or correction.
-
-In no event unless required by applicable law or agreed to in writing
-will any copyright holder, or any other party who may modify and/or
-redistribute SAX, be liable to you for damages, including any general,
-special, incidental or consequential damages arising out of the use or
-inability to use SAX (including but not limited to loss of data or
-data being rendered inaccurate or losses sustained by you or third
-parties or a failure of the SAX to operate with any other programs),
-even if such holder or other party has been advised of the possibility
-of such damages.
-
-
-David Megginson <sax@megginson.com>
-1998-05-11
-
--- a/jaxws/.hgtags	Mon Jun 02 15:49:53 2014 -0400
+++ b/jaxws/.hgtags	Mon Jun 02 13:53:52 2014 -0700
@@ -259,3 +259,5 @@
 1f953ba7db2b535e19f0354abfee6d67605e0684 jdk9-b11
 779f8b21c75f83e3918dac8499e4d0ecb3a54ed7 jdk9-b12
 3d42204854c9f703e3ccdc8891248e73057713ab jdk9-b13
+02e58850b7062825308413d420f2b02c1f25a724 jdk9-b14
+e9780330017a6b464a385356d77e5136f9de8d09 jdk9-b15
--- a/jaxws/src/share/jaxws_classes/com/sun/tools/etc/META-INF/services/com.sun.xml.internal.ws.spi.db.BindingContextFactory	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-com.sun.xml.internal.ws.db.glassfish.JAXBRIContextFactory
-# com.sun.xml.internal.ws.db.toplink.JAXBContextFactory
--- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/gen/config/config.rng	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,131 +0,0 @@
-<?xml version="1.0"?>
-<!--
- Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<grammar
- xmlns="http://relaxng.org/ns/structure/1.0"
- xmlns:r="http://relaxng.org/ns/structure/1.0"
- xmlns:a="http://relaxng.org/ns/annotation/1.0"
- xmlns:ref="urn:crossreference"
- xmlns:c="http://www.xml.gr.jp/xmlns/relaxngcc"
- c:runtime-type="com.sun.tools.internal.jxc.NGCCRuntimeEx"
- datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
- c:package="com.sun.tools.internal.jxc.gen.config">
-
-
-<start c:class="Config" c:access="public">
-
- <c:java-import>
-    import java.util.List;
-    import java.util.ArrayList;
-    import java.io.File;
- </c:java-import>
-
-<c:java-body>
-   private File baseDir;
-   private Classes classes;
-   private List schema = new ArrayList();
-   public Classes getClasses() { return this.classes;}
-   public File getBaseDir() { return baseDir;}
-   public List getSchema() { return this.schema;}
-</c:java-body>
-
-  <element name="config">
-     <attribute name="baseDir">
-        bd = <data type="string"/>
-        baseDir = $runtime.getBaseDir(bd);
-     </attribute>
-     <ref name="Classes" c:alias="classes"/>
-     <zeroOrMore>
-        <ref name="Schema" c:alias="_schema" />(baseDir);
-        this.schema.add (_schema);
-     </zeroOrMore>
-     </element>
-  </start>
-
-
-   <define name="Classes" c:access="public">
-   <c:java-import>
-    import java.util.List;
-    import java.util.ArrayList;
-    </c:java-import>
-     <c:java-body>
-       private List includes = new ArrayList();
-       public List getIncludes() { return $runtime.getIncludePatterns(this.includes);}
-       private List excludes = new ArrayList();
-       public List getExcludes() { return $runtime.getExcludePatterns(this.excludes);}
-       </c:java-body>
-     <element name="classes">
-
-        <element name="includes">
-            <list>
-               <oneOrMore>
-                <data type="string" c:alias="include_content"/>
-                <c:java> this.includes.add(include_content); </c:java>
-               </oneOrMore>
-            </list>
-
-         </element>
-        <optional>
-        <element name="excludes">
-            <list>
-               <zeroOrMore>
-                <data type="string" c:alias="exclude_content"/>
-                <c:java> this.excludes.add(exclude_content); </c:java>
-               </zeroOrMore>
-            </list>
-
-         </element>
-        </optional>
-     </element>
-    </define>
-
-
-   <define name="Schema" c:access="public" c:params="File baseDir">
-     <c:java-import>
-       import java.io.File;
-     </c:java-import>
-     <c:java-body>
-       private File location;
-       private String namespace;
-       public String getNamespace() { return this.namespace;}
-       public File getLocation() { return this.location;}
-     </c:java-body>
-     <element name="schema">
-       <optional>
-         <attribute name="namespace">
-           namespace = <data type="string" />
-         </attribute>
-       </optional>
-
-       <optional>
-         <attribute name="location">
-           loc = <data type="string" />
-           location = new File(baseDir,loc);
-         </attribute>
-       </optional>
-     </element>
-  </define>
-</grammar>
--- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/bindingfile.rng	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,317 +0,0 @@
-<?xml version="1.0"?>
-<!--
- Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<!--
-DTD binding information file which is supported by this version of XJC.
-
-- Changes from the EA1 is marked by "CHANGE:"
-- "ref:key" and "ref:keyref" are used to specify cross-reference
-  information.
-- "a:defaultValue" is used to specify the default behavior.
-  Note that default behaviors are hard-coded to the source code.
-  Values specified in this schema is not used in the actual processing.
--->
-<grammar
-  xmlns="http://relaxng.org/ns/structure/1.0"
-  xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
-  xmlns:a="http://relaxng.org/ns/annotation/1.0"
-  xmlns:ref="urn:crossreference"
-  datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
-
-  <start>
-    <element name="xml-java-binding-schema">
-      <optional>
-        <attribute name="version">
-          <value>1.0ea2</value>
-        </attribute>
-      </optional>
-
-      <interleave>
-        <optional>
-          <element name="options">
-            <optional>
-              <attribute name="package"/>
-            </optional>
-          </element>
-        </optional>
-        <optional>
-          <element name="xjc:serializable">
-            <optional>
-              <attribute name="uid">
-                <data type="long"/>
-              </attribute>
-            </optional>
-          </element>
-        </optional>
-        <optional>
-          <element name="xjc:superClass">
-            <attribute name="name"/>
-          </element>
-        </optional>
-        <!-- light-weight runtime -->
-        <optional>
-          <element name="xjc:noMarshaller">
-            <empty/>
-          </element>
-        </optional>
-        <optional>
-          <element name="xjc:noUnmarshaller">
-            <empty/>
-          </element>
-        </optional>
-        <optional>
-          <element name="xjc:noValidator">
-            <empty/>
-          </element>
-        </optional>
-        <optional>
-          <element name="xjc:noValidatingUnmarshaller">
-            <empty/>
-          </element>
-        </optional>
-        <zeroOrMore>
-          <choice>
-            <ref name="toplevel.declaration"/>
-            <ref name="global.or.local.declaration"/>
-          </choice>
-        </zeroOrMore>
-      </interleave>
-    </element>
-  </start>
- 
- 
- 
- 
-  <!-- element-class declaration -->
-  <define name="toplevel.declaration" combine="choice">
-    <element name="element">
-      <attribute name="name"/>
-      <attribute name="type">
-        <value>class</value>
-      </attribute>
-      <optional>
-        <attribute name="class">
-          <ref name="java.classname.datatype"/>
-        </attribute>
-      </optional>
-      <optional>
-        <attribute name="root" a:defaultValue="false">
-          <choice>
-            <value>true</value>
-            <value>false</value>
-          </choice>
-        </attribute>
-      </optional>
-
-      <interleave>
-        <!-- attribute-property declaration -->
-        <zeroOrMore>
-          <element name="attribute">
-            <attribute name="name"/>
-            <optional>
-              <attribute name="property"/>
-            </optional>
-            <optional>
-              <ref name="collection.att"/>
-            </optional>
-            <optional>
-              <attribute name="convert">
-                <text ref:keyref="conversion"/>
-              </attribute>
-            </optional>
-          </element>
-        </zeroOrMore>
-
-        <zeroOrMore>
-          <ref name="global.or.local.declaration"/>
-        </zeroOrMore>
-
-        <!-- element-local declarations -->
-        <zeroOrMore>
-          <element name="constructor">
-            <attribute name="properties">
-              <list>
-                <oneOrMore>
-                  <!-- point to a property defined in this element -->
-                  <data type="token"/>
-                </oneOrMore>
-              </list>
-            </attribute>
-          </element>
-        </zeroOrMore>
-
-        <optional>
-          <element name="content">
-            <interleave>
-              <choice>
-                <!-- general content-property declaration -->
-                <ref name="collection.particle.decl"/>
-
-                <!-- model-based content property declaration -->
-                <group>
-                  <zeroOrMore>
-                    <choice>
-                      <element name="element-ref">
-                        <attribute name="name"/>
-                        <optional>
-                          <attribute name="property"/>
-                        </optional>
-                        <optional>
-                          <ref name="collection.att"/>
-                        </optional>
-                      </element>
-                      <element>
-                        <choice>
-                          <name>sequence</name>
-                          <name>choice</name>
-                        </choice>
-                        <ref name="collection.particle.decl"/>
-                      </element>
-                    </choice>
-                  </zeroOrMore>
-                  <optional><!-- followed by an optional <rest> -->
-                    <element name="rest">
-                      <ref name="collection.particle.decl"/>
-                    </element>
-                  </optional>
-                </group>
-              </choice>
-            </interleave>
-          </element>
-        </optional>
-      </interleave>
-    </element>
-  </define>
-
-  <define name="collection.particle.decl">
-    <attribute name="property"/>
-    <optional>
-      <ref name="collection.att"/>
-    </optional>
-    <optional>
-      <attribute name="supertype"/>
-    </optional>
-  </define>
-
-  <define name="collection.att">
-    <attribute name="collection">
-      <!-- CHANGE: array is removed and set,vector are added -->
-      <choice>
-        <value>list</value>
-        <value>set</value>
-        <value>vector</value>
-      </choice>
-    </attribute>
-  </define>
-
- 
- 
-  <!-- conversion declaration -->
-  <define name="global.or.local.declaration" combine="choice">
-    <element name="conversion">
-      <attribute name="name" ref:key="conversion"/>
-      <optional>
-        <!-- defaults to @name -->
-        <attribute name="type"/>
-      </optional>
-      <optional>
-        <attribute name="parse" a:defaultValue="new"/>
-      </optional>
-      <optional>
-        <attribute name="print" a:defaultValue="toString"/>
-      </optional>
-      <optional>
-        <attribute name="whitespace" a:defaultValue="collapse">
-          <choice>
-            <value>preserve</value>
-            <value>replace</value><!-- CHANGE: it was normalize -->
-            <value>collapse</value>
-          </choice>
-        </attribute>
-      </optional>
-    </element>
-  </define>
- 
-  <!-- element-value declaration -->
-  <define name="toplevel.declaration" combine="choice">
-    <element name="element">
-      <attribute name="name"/>
-      <attribute name="type">
-        <value>value</value>
-      </attribute>
-      <optional>
-        <attribute name="convert">
-          <text ref:keyref="conversion"/>
-        </attribute>
-      </optional>
-    </element>
-  </define>
- 
-  <!-- interface declaration -->
-  <define name="toplevel.declaration" combine="choice">
-    <element name="interface">
-      <attribute name="name">
-        <ref name="java.classname.datatype"/>
-      </attribute>
-      <attribute name="members">
-        <list>
-          <oneOrMore>
-            <ref name="java.classname.datatype"/>
-          </oneOrMore>
-        </list>
-      </attribute>
-      <!-- CHANGE: TODO: @properties is not supported yet -->
-    </element>
-  </define>
- 
-  <!-- enumeration declaration -->
-  <define name="global.or.local.declaration" combine="choice">
-    <element name="enumeration">
-      <attribute name="name">
-        <ref name="java.classname.datatype"/>
-      </attribute>
-      <attribute name="members">
-        <list>
-          <oneOrMore>
-            <data type="token"/>
-          </oneOrMore>
-        </list>
-      </attribute>
-    </element>
-  </define>
- 
- 
- 
-  <!-- valid Java name -->
-  <define name="java.name.datatype">
-    <!-- TODO: add pattern facet or implement a custom datatype -->
-    <data type="token"/>
-  </define>
-
-  <define name="java.classname.datatype">
-    <ref name="java.name.datatype"/>
-  </define>
-</grammar>
--- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/binding.rng	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,913 +0,0 @@
-<?xml version="1.0"?>
-<!--
- Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<!DOCTYPE grammar [
-
-
-<!ENTITY XJCURI "http://java.sun.com/xml/ns/jaxb/xjc">
-]>
-<grammar
-  xmlns="http://relaxng.org/ns/structure/1.0"
-  xmlns:cc="http://www.xml.gr.jp/xmlns/relaxngcc"
-  xmlns:xs="http://www.w3.org/2001/XMLSchema"
-  xmlns:xjc="&XJCURI;"
-  xmlns:p="post-processor-to-build-schema-for-validation"
-  
-  ns="http://java.sun.com/xml/ns/jaxb"
-  
-  cc:runtime-type="com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.NGCCRuntimeEx"
-  cc:package="com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.parser"
-  datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
-<!--  cc:$runtime-type="com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx">-->
-  
-  <cc:java-import>
-    import com.sun.codemodel.internal.*;
-    import com.sun.tools.internal.xjc.generator.bean.field.*;
-    import com.sun.tools.internal.xjc.model.*;
-    import com.sun.xml.internal.bind.api.impl.NameConverter;
-    import com.sun.xml.internal.bind.v2.WellKnownNamespace;
-    import com.sun.xml.internal.bind.marshaller.SAX2DOMEx;
-    import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.*;
-    import com.sun.tools.internal.xjc.reader.Const;
-    import org.xml.sax.*;
-    import org.w3c.dom.Document;
-    import org.xml.sax.helpers.DefaultHandler;
-    import java.util.*;
-    import javax.xml.namespace.QName;
-    import javax.xml.parsers.ParserConfigurationException;
-  </cc:java-import>
-  
-  <start cc:class="Root">
-    <choice>
-      <!-- root of the external binding file. -->
-      <ref name="declaration"/>
-      <!-- root of the internal binding -->
-      <ref name="annotation"/>
-    </choice>
-  </start>
-  
-  <!--
-    in context of XML Schema annotation
-  -->
-  <define name="annotation" cc:access="public" cc:class="AnnotationState"
-    cc:return-type="BindInfo" cc:return-value="bi">
-    
-    <cc:java-import>
-      import java.io.StringWriter;
-      import com.sun.xml.internal.bind.marshaller.DataWriter;
-    </cc:java-import>
-    <cc:java-body>
-      // customization declarations
-      public BindInfo bi;
-      
-      private StringWriter w;
-
-      private SAX2DOMEx sax2dom;
-    </cc:java-body>
-    
-    <element name="xs:annotation">
-      bi = new BindInfo($runtime.copyLocator());
-      $runtime.currentBindInfo = bi;
-      
-      <p:ignore><ref name="anyAttributes"/></p:ignore>
-      <zeroOrMore>
-        <choice>
-          <element name="xs:appinfo">
-            <p:ignore><ref name="anyAttributes"/></p:ignore>
-            <zeroOrMore>
-              <choice>
-                <group>
-                  result = <ref name="declaration" />
-                  bi.addDecl(result);
-                </group>
-                <element>
-                  <anyName><except>
-                    <nsName ns="&XJCURI;"/>
-                    <nsName /><!-- JAXB namespace URI -->
-                    <nsName ns="http://www.w3.org/2001/XMLSchema" />
-                  </except></anyName>
-
-                  if($runtime.isExtensionURI($uri)) {
-                    // parse this sub-tree as an extension
-                    try {
-                      sax2dom = new SAX2DOMEx();
-                    } catch( ParserConfigurationException e ) {
-                      throw new Error(e); // impossible
-                    }
-                    $runtime.redirectSubtree(sax2dom,$uri,$localName,$qname);
-                  } else {
-                    // ignore this sub-tree
-                    sax2dom = null;
-                    $runtime.redirectSubtree(new DefaultHandler(),$uri,$localName,$qname);
-                  }
-                  <empty/>
-                  <p:ignore><ref name="anyContents"/></p:ignore>
-                  if(sax2dom!=null) {
-                    bi.addDecl(new BIXPluginCustomization(((Document)sax2dom.getDOM()).getDocumentElement(),$runtime.copyLocator()));
-                  }
-                </element>
-                <text/>
-              </choice>
-            </zeroOrMore>
-          </element>
-          <!-- ignore documentations -->
-          <element name="xs:documentation">
-            <p:ignore><ref name="anyAttributes"/></p:ignore>
-            <zeroOrMore>
-              <choice>
-                <group>
-                  msg = <text />
-                  bi.appendDocumentation($runtime.truncateDocComment(msg),true);
-                </group>
-                <group>
-                  <element>
-                    <anyName />
-                    w = new StringWriter();
-                    DataWriter xw = new DataWriter(w,"UTF-8");
-                    xw.setXmlDecl(false);
-                    $runtime.redirectSubtree(xw,$uri,$localName,$qname);
-                    <empty/>
-                    <p:ignore><ref name="anyContents"/></p:ignore>
-                  </element>
-                  <![CDATA[
-                  bi.appendDocumentation("<pre>"+
-                    $runtime.escapeMarkup($runtime.truncateDocComment(w.toString()))+
-                    "</pre>",
-                    false );
-                  w=null;
-                  ]]>
-                </group>
-              </choice>
-            </zeroOrMore>
-          </element>
-        </choice>
-      </zeroOrMore>
-    </element>
-  </define>
-  
-  
-  
-  <!--
-  
-    Individual customization declarations
-  
-  -->
-  
-  <define name="declaration"
-    cc:return-type="BIDeclaration" cc:return-value="result">
-    
-    <cc:java-body>
-      private BIDeclaration result;
-    </cc:java-body>
-    <!-- result field will have the parsed object -->
-    <choice>
-      result = <ref name="globalBindings" />
-      result = <ref name="schemaBindings" />
-      result = <ref name="class"/>
-      result = <ref name="conversion"/>
-      result = <ref name="property"/>
-      result = <ref name="typesafeEnum"/>
-      result = <ref name="enumMember"/>
-      <!-- result = <ref name="idSymbolSpace"/-->
-      <!-- result = <ref name="dom"/-->
-    </choice>
-  </define>
-  
-  
-  <define name="globalBindings"
-    cc:return-type="BIGlobalBinding" cc:return-value="makeResult()">
-    
-    <cc:java-body>
-      private Locator loc;
-      private Map globalConvs = new HashMap();
-      private NameConverter nameConverter = NameConverter.standard;
-      private String enableJavaNamingConvention = "true";
-      private String fixedAttrToConstantProperty = "false";
-      private String needIsSetMethod = "false";
-      private String simpleTypeSubstitution = "false";
-      private boolean flattenClasses = false;
-      private Set enumBaseTypes = new HashSet();
-      private int defaultEnumSizeCap = 256;
-      private boolean generateEnumMemberName = false;
-      private boolean choiceContentPropertyWithModelGroupBinding = false;
-      private boolean xSmartWildcardDefaultBinding = false;
-      private boolean xSimpleMode;
-      private boolean generateValueClass = true;
-      private boolean generateElementClass = false;
-      private boolean generateMixedExtensions = false;
-
-      public BIGlobalBinding makeResult() {
-        if( enumBaseTypes.size()==0 )
-          enumBaseTypes.add(new QName(WellKnownNamespace.XML_SCHEMA,"NCName")); // defaults to NCName
-        
-        return new BIGlobalBinding(
-          globalConvs,nameConverter,
-          choiceContentPropertyWithModelGroupBinding,
-          generateValueClass,
-          generateElementClass,
-          $runtime.parseBoolean(enableJavaNamingConvention),
-          $runtime.parseBoolean(fixedAttrToConstantProperty),
-          $runtime.parseBoolean(needIsSetMethod),
-          $runtime.parseBoolean(simpleTypeSubstitution),
-          generateEnumMemberName,
-          flattenClasses,
-          enumBaseTypes,
-          defaultEnumSizeCap,
-          ct,
-          serializable,
-          xSuperClass,
-          xSuperInterface,
-          xSimpleMode,
-          xSmartWildcardDefaultBinding,
-          loc);
-      }
-    </cc:java-body>
-    <element name="globalBindings">
-      loc = $runtime.copyLocator();
-      
-      <optional>
-        <attribute name="underscoreBinding">
-          <choice>
-            <value>asWordSeparator</value><!-- default -->
-            <group>
-              <value>asCharInWord</value>
-              nameConverter = NameConverter.jaxrpcCompatible;
-            </group>
-          </choice>
-        </attribute>
-      </optional>
-      
-      <optional>
-        <attribute name="enableJavaNamingConventions">
-          enableJavaNamingConvention = <data type="boolean"/>
-        </attribute>
-      </optional>
-      
-      <optional>
-        <attribute name="fixedAttributeAsConstantProperty">
-          fixedAttrToConstantProperty = <data type="boolean"/>
-        </attribute>
-      </optional>
-      
-      <optional>
-        <attribute name="generateIsSetMethod">
-          needIsSetMethod = <data type="boolean"/>
-        </attribute>
-      </optional>
-
-      <optional>
-        <attribute name="mapSimpleTypeDef">
-          simpleTypeSubstitution = <data type="boolean"/>
-        </attribute>
-      </optional>
-
-      <optional>
-        <attribute name="localScoping">
-          <choice>
-            <group>
-              <value>nested</value>
-              flattenClasses = false;
-            </group>
-            <group>
-              <value>toplevel</value>
-              flattenClasses = true;
-            </group>
-          </choice>
-        </attribute>
-      </optional>
-
-      <optional>
-        <attribute name="collectionType">
-          ct = <ref name="collectionType" />
-        </attribute>
-      </optional>
-      
-      <optional>
-        <attribute name="typesafeEnumMemberName">
-          <choice>
-            <value>generateError</value> <!-- default -->
-            <group>
-              <value>generateName</value>
-              generateEnumMemberName = true;
-            </group>
-          </choice>
-        </attribute>
-      </optional>
-      
-      <optional>
-        <attribute name="typesafeEnumBase">
-          <list>
-            <oneOrMore>
-              value = <data type="QName"/>
-              QName qn = $runtime.parseQName(value);
-              enumBaseTypes.add( qn );
-            </oneOrMore>
-          </list>
-        </attribute>
-      </optional>
-
-      <optional>
-        <attribute name="typesafeEnumMaxMembers">
-          <list>
-            <oneOrMore>
-              value = <data type="int"/>
-              defaultEnumSizeCap = Integer.parseInt(value);
-            </oneOrMore>
-          </list>
-        </attribute>
-      </optional>
-
-
-      <optional>
-        <attribute name="choiceContentProperty">
-          value = <data type="boolean"/>
-          choiceContentPropertyWithModelGroupBinding = $runtime.parseBoolean(value);
-        </attribute>
-      </optional>
-
-      <optional>
-        <attribute name="generateValueClass">
-          value = <data type="boolean"/>
-          generateValueClass = $runtime.parseBoolean(value);
-        </attribute>
-      </optional>
-
-      <optional>
-        <attribute name="generateElementClass">
-          value = <data type="boolean"/>
-          generateElementClass = $runtime.parseBoolean(value);
-        </attribute>
-      </optional>
-
-      <optional>
-        <attribute name="generateMixedExtensions">
-          value = <data type="boolean"/>
-          generateMixedExtensions = $runtime.parseBoolean(value);
-        </attribute>
-      </optional>
-
-      <!-- unimplemented attributes -->
-      <optional>
-        <attribute name="enableValidation">
-          value = <data type="boolean"/>
-          if( $runtime.parseBoolean(value)==true )
-            $runtime.reportUnsupportedFeature("enableValidation");
-        </attribute>
-      </optional>
-      <optional>
-        <attribute name="enableFailFastCheck">
-          value = <data type="boolean"/>
-          if( $runtime.parseBoolean(value)==true )
-            $runtime.reportUnsupportedFeature("enableFailFastCheck");
-        </attribute>
-      </optional>
-      
-      <!-- body -->
-      <zeroOrMore>
-        <choice>
-          <element name="javaType">
-            <attribute name="xmlType">
-              xmlType = <data type="QName"/>
-            </attribute>
-            conv = <ref name="conversionBody" />
-            
-            globalConvs.put( $runtime.parseQName(xmlType), conv );
-          </element>
-          <element name="serializable">
-            <optional>
-              <attribute name="uid">
-                serialuid = <data type="long"/>
-              </attribute>
-            </optional>
-            if(serialuid!=null)
-              serializable = new BISerializable(Long.parseLong(serialuid));
-            else
-              serializable = new BISerializable(null);
-          </element>
-
-          <!-- global vendor extensions -->
-          serializable = <ref name="serializable"/>
-          xSuperClass = <ref name="superClass"/>
-          xSuperInterface = <ref name="superInterface"/>
-          <ref name="typeSubstitution" />
-          <element name="xjc:smartWildcardDefaultBinding">
-            <!--
-              changes the default binding of wildcards so that unknown elements will be
-              bound to DOM. This feature is not publicly available, and we may change it
-              later.
-            -->
-            xSmartWildcardDefaultBinding = true;
-            <empty />
-          </element>
-
-          <element name="xjc:simple">
-            xSimpleMode = true;
-            <empty />
-          </element>
-
-          <!--
-            light-weight runtime. we no longer support them,
-            but we don't issue an error when we see them.
-          -->
-          <element name="xjc:noMarshaller">
-            <empty />
-          </element>
-          <element name="xjc:noUnmarshaller">
-            <empty />
-          </element>
-          <element name="xjc:noValidator">
-            <empty />
-          </element>
-          <element name="xjc:noValidatingUnmarshaller">
-            <empty />
-          </element>
-        </choice>
-      </zeroOrMore>
-    </element>
-  </define>
-  
-  
-  <define name="schemaBindings"
-    cc:return-type="BISchemaBinding" cc:return-value="makeResult()">
-    
-    <cc:java-body>
-      private Locator loc;
-      public BISchemaBinding makeResult() {
-        return new BISchemaBinding(packageName,javadoc,tt,et,at,mt,nt,loc);
-      }
-    </cc:java-body>
-    
-    <element name="schemaBindings">
-      loc = $runtime.copyLocator();
-      
-      <optional>
-        <element name="package">
-          <optional>
-            packageName = <attribute name="name"/>
-          </optional>
-          <optional>
-            javadoc = <ref name="javadoc"/>
-          </optional>
-        </element>
-      </optional>
-      
-      <optional>
-        <element name="nameXmlTransform">
-          <!-- use newer version of RELAXNGCC and wrap them by <interleave> -->
-          <zeroOrMore>
-            <choice>
-              <element name="typeName">
-                tt = <ref name="nameXmlTransformRule"/>
-              </element>
-              <element name="elementName">
-                et = <ref name="nameXmlTransformRule"/>
-              </element>
-              <element name="attributeName">
-                at = <ref name="nameXmlTransformRule"/>
-              </element>
-              <element name="modelGroupName">
-                mt = <ref name="nameXmlTransformRule"/>
-              </element>
-              <element name="anonymousTypeName">
-                nt = <ref name="nameXmlTransformRule"/>
-              </element>
-            </choice>
-          </zeroOrMore>
-        </element>
-      </optional>
-    </element>
-  </define>
-  
-  <define name="nameXmlTransformRule"
-    cc:return-type="BISchemaBinding.NamingRule"
-    cc:return-value="new BISchemaBinding.NamingRule(prefix,suffix)">
-    
-    <cc:java-body>
-      private String prefix="";
-      private String suffix="";
-    </cc:java-body>
-    
-    
-    <optional>
-      <attribute name="prefix">
-        prefix = <data type="NCName"/>
-      </attribute>
-    </optional>
-    <optional>
-      <attribute name="suffix">
-        suffix = <data type="NCName"/>
-      </attribute>
-    </optional>
-  </define>
-  
-  
-  
-  <define name="javadoc" cc:return-type="String" cc:return-value="javadoc">
-      <element name="javadoc">
-        javadoc = <text />
-        javadoc = $runtime.truncateDocComment(javadoc);
-      </element>
-  </define>
-  
-  <define name="collectionType" cc:class="CollectionTypeState"
-    cc:return-type="FieldRenderer" cc:return-value="r">
-    <cc:java-body>
-      private FieldRenderer r = null;
-    </cc:java-body>
-    type = <data type="token"/>
-    
-    if( type.equals("indexed") )
-      r = FieldRenderer.ARRAY;
-    else
-      try {
-        r = new UntypedListFieldRenderer( $runtime.codeModel.ref(type) );
-      } catch( ClassNotFoundException e ) {
-        throw new NoClassDefFoundError(e.getMessage());
-      }
-  </define>
-  
-  
-  
-  <define name="class" cc:class="BIClassState"
-    cc:return-type="BIClass" cc:return-value="makeResult()">
-    
-    <cc:java-body>
-      private Locator loc;
-      public BIClass makeResult() {
-        return new BIClass(loc,name,implClass,javadoc);
-      }
-    </cc:java-body>
-    
-    <element name="class">
-      loc = $runtime.copyLocator();
-      <optional>
-        javadoc = <ref name="javadoc"/>
-      </optional>
-      <optional>
-        <attribute name="name">
-          name = <data type="identifier" datatypeLibrary="http://java.sun.com/xml/ns/relaxng/java-datatypes"/>
-        </attribute>
-      </optional>
-      <optional>
-        implClass = <attribute name="implClass"/>
-      </optional>
-    </element>
-  </define>
-  
-  <define name="property"
-    cc:return-type="BIProperty" cc:return-value="makeResult()">
-    
-    <cc:java-body>
-      private Locator loc;
-      private Boolean isConst = null;
-      private Boolean isSet = null;
-      private Boolean genElemProp = null;
-
-      public BIProperty makeResult() throws SAXException {
-        JType baseTypeRef = null;
-        if(baseType!=null)
-          baseTypeRef = $runtime.getType(baseType);
-          
-        return new BIProperty(loc,name,javadoc,baseTypeRef,conv,ct,isConst,isSet,genElemProp);
-      }
-    </cc:java-body>
-    
-    <element name="property">
-      loc = $runtime.copyLocator();
-      <optional>
-        name = <attribute name="name"/>
-      </optional>
-      <optional>
-        baseType = <attribute name="baseType"/>
-      </optional>
-      <optional>
-        <attribute name="collectionType">
-          ct = <ref name="collectionType" />
-        </attribute>
-      </optional>
-      <optional>
-        <attribute name="fixedAttributeAsConstantProperty">
-          isConstStr = <data type="boolean"/>
-          isConst = $runtime.parseBoolean(isConstStr)?Boolean.TRUE:Boolean.FALSE;
-        </attribute>
-      </optional>
-      <optional>
-        <attribute name="generateIsSetMethod">
-          isSetStr = <data type="boolean"/>
-          isSet = $runtime.parseBoolean(isSetStr)?Boolean.TRUE:Boolean.FALSE;
-        </attribute>
-      </optional>
-      <optional>
-        <attribute name="generateElementProperty">
-          genElemPropStr = <data type="boolean"/>
-          genElemProp = $runtime.parseBoolean(genElemPropStr)?Boolean.TRUE:Boolean.FALSE;
-        </attribute>
-      </optional>
-      <optional>
-        <attribute name="generateFailFastSetterMethod">
-          failFast = <data type="boolean"/>
-        </attribute>
-        if( $runtime.parseBoolean(failFast) ) {
-          $runtime.reportUnimplementedFeature("generateFailFastSetterMethod");
-        }
-      </optional>
-
-
-      <interleave>
-        <optional>
-          javadoc = <ref name="javadoc"/>
-        </optional>
-        <optional>
-          <element name="baseType">
-            conv = <ref name="conversion"/>
-          </element>
-        </optional>
-      </interleave>
-    </element>
-  </define>
-  
-  <define name="conversion"
-    cc:return-type="BIConversion" cc:return-value="r">
-    <element name="javaType">
-      r = <ref name="conversionBody"/>
-    </element>
-  </define>
-  
-  
-  <define name="conversionBody"
-    cc:return-type="BIConversion" cc:return-value="makeResult()">
-    
-    <cc:java-import>
-      import com.sun.tools.internal.xjc.generator.util.WhitespaceNormalizer;
-    </cc:java-import>
-    <cc:java-body><![CDATA[
-      public BIConversion makeResult() throws SAXException {
-        return new BIConversion.User( $runtime.copyLocator(), parse, print, $runtime.getType(type) );
-      }
-
-      // initialize with default values.
-      private String type  = "java.lang.String"; // in case a schema has an error
-      private String parse = null;
-      private String print = null;
-      private boolean context = false;
-    ]]></cc:java-body>
-    
-    
-    <optional>
-      parse = <attribute name="parseMethod" />
-    </optional>
-    <optional>
-      print = <attribute name="printMethod" />
-    </optional>
-    <attribute name="name" cc:alias="type"/>
-    <optional>
-      <attribute name="hasNsContext">
-        _context = <data type="boolean"/>
-        context = $runtime.parseBoolean(_context);
-      </attribute>
-    </optional>
-  </define>
-  
-  
-  <!-- type safe enum customization -->
-  <define name="typesafeEnum"
-    cc:return-type="BIEnum" cc:return-value="makeResult()">
-    
-    <cc:java-import>
-      import java.util.HashMap;
-    </cc:java-import>
-    <cc:java-body>
-      private HashMap members = new HashMap();
-      private boolean dontBind = false;
-      private Locator loc,loc2;
-      
-      private BIEnum makeResult() {
-        return new BIEnum(loc,dontBind,name,javadoc,members);
-      }
-    </cc:java-body>
-    
-    <element name="typesafeEnumClass">
-      loc = $runtime.copyLocator();
-      <choice>
-        <attribute name="map">
-          <value>false</value>
-          dontBind = true;
-        </attribute>
-        <group>
-          <optional>
-            name = <attribute name="name"/>
-          </optional>
-          <optional>
-            javadoc = <ref name="javadoc" />
-          </optional>
-          <zeroOrMore>
-            jname = null;
-            javadoc = null;
-            <element name="typesafeEnumMember">
-              loc2 = $runtime.copyLocator();
-              <optional>
-                jname = <attribute name="name"/>
-              </optional>
-              value = <attribute name="value"/>
-              <optional>
-                javadoc = <ref name="javadoc" />
-              </optional>
-              members.put( value, new BIEnumMember(loc2,jname,javadoc) );
-            </element>
-          </zeroOrMore>
-        </group>
-      </choice>
-    </element>
-  </define>
-  
-  
-  <!-- stand-alone type safe enum member customization -->
-  <!--
-     Note that only the name attribute is allowed here, and the same element
-     under the typesafeEnumClass is handled differently.
-  -->
-  <define name="enumMember"
-    cc:return-type="BIEnumMember" cc:return-value="makeResult()">
-    <cc:java-body>
-      private Locator loc;
-      private BIEnumMember makeResult() {
-        return new BIEnumMember(loc,name,javadoc);
-      }
-    </cc:java-body>
-  
-    <element name="typesafeEnumMember">
-      loc = $runtime.copyLocator();
-      name = <attribute name="name"/>
-      <optional>
-        javadoc = <ref name="javadoc" />
-      </optional>
-    </element>
-  </define>
-  
-  
-  <!-- XJC-exntension: root class support -->
-  <define name="superClass" cc:return-type="JDefinedClass" cc:return-value="makeResult()">
-    <cc:java-body>
-      private JDefinedClass makeResult() {
-        try {
-          JDefinedClass c = $runtime.codeModel._class(name);
-          c.hide();
-          return c;
-        } catch( JClassAlreadyExistsException e ) {
-          return e.getExistingClass();
-        }
-      }
-    </cc:java-body>
-    
-    <element name="xjc:superClass">
-      name = <attribute name="name" />
-    </element>
-  </define>
-  
-  <!-- XJC-exntension: root interface support -->
-  <define name="superInterface" cc:return-type="JDefinedClass" cc:return-value="makeResult()">
-    <cc:java-body>
-      private JDefinedClass makeResult() {
-        try {
-          JDefinedClass c = $runtime.codeModel._class(name,ClassType.INTERFACE);
-          c.hide();
-          return c;
-        } catch( JClassAlreadyExistsException e ) {
-          return e.getExistingClass();
-        }
-      }
-    </cc:java-body>
-
-    <element name="xjc:superInterface">
-      name = <attribute name="name" />
-    </element>
-  </define>
-
-  <!-- XJC-exntension: serialization support -->
-  <define name="serializable" cc:return-type="BISerializable" cc:return-value="makeResult()">
-    <cc:java-body>
-      private long uid = 1;
-      private BISerializable makeResult() {
-        return new BISerializable(uid);
-      }
-    </cc:java-body>
-    
-    <element name="xjc:serializable">
-//      loc = $runtime.copyLocator();
-      <optional>
-        <attribute name="uid">
-          v = <data type="long"/>
-          uid = Long.parseLong(v);
-        </attribute>
-      </optional>
-    </element>
-  </define>
-  
-  
-  <!-- XJC extension: type substitution -->
-  <define name="typeSubstitution" cc:return-type="boolean" cc:return-value="true">
-    <element name="xjc:typeSubstitution">
-      <attribute name="type"><value>complex</value></attribute>
-    </element>
-  </define>
-  
-  
-  <!-- XJC extension: ID symbol space support -->
-  <!--define name="idSymbolSpace" cc:return-type="BIXIdSymbolSpace" cc:return-value="makeResult()">
-    <cc:java-body>
-      private Locator loc;
-      private BIXIdSymbolSpace makeResult() {
-        return new BIXIdSymbolSpace(loc,name);
-      }
-    </cc:java-body>
-    
-    <element name="xjc:idSymbolSpace">
-      loc = $runtime.copyLocator();
-      name = <attribute name="name"/>
-    </element>
-  </define-->
-  
-  
-  <!-- XJC extension: DOM support -->
-  <!--define name="dom" cc:return-type="BIXDom" cc:return-value="makeResult()">
-    <cc:java-import>
-      import com.sun.tools.internal.xjc.grammar.ext.*;
-    </cc:java-import>
-    <cc:java-body>
-      private String factoryName = "w3c";
-      private Locator loc;
-      private BIXDom makeResult() {
-        try {
-          return new BIXDom(DOMItemFactory.getInstance(factoryName),loc);
-        } catch( DOMItemFactory.UndefinedNameException e ) {
-          throw new InternalError(); // impossible since we use validation to reject incorrect values
-        }
-      }
-    </cc:java-body>
-    
-    <element name="xjc:dom">
-      loc = $runtime.copyLocator();
-      <optional>
-        <attribute name="type">
-          <choice>
-            factoryName = <value>dom4j</value>
-            factoryName = <value>w3c</value>
-          </choice>
-        </attribute>
-      </optional>
-    </element>
-  </define-->
-  
-  
-  
-  
-  
-  
-  <p:ignore>
-    <!-- these patterns are ignored when using RelaxNGCC -->
-    <define name="anyContents">
-      <zeroOrMore>
-        <choice>
-          <text/>
-          <ref name="anyAttributes"/>
-          <element>
-            <anyName/>
-            <ref name="anyContents"/>
-          </element>
-        </choice>
-      </zeroOrMore>
-    </define>
-    
-    <define name="anyAttributes">
-      <zeroOrMore>
-        <attribute>
-          <anyName/>
-          <text/>
-        </attribute>
-      </zeroOrMore>
-    </define>
-  </p:ignore>
-</grammar>
--- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/xmlschema-for-jaxb.rng	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1579 +0,0 @@
-<?xml version="1.0"?>
-<!--
- Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<grammar xmlns="http://relaxng.org/ns/structure/1.0"
-      datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
-      ns="http://www.w3.org/2001/XMLSchema"
-      xmlns:xs="http://www.w3.org/2001/XMLSchema"
-      xmlns:doc="http://www.jenitennison.com/doc"
-      xmlns:txw="http://java.sun.com/txw">
-
-<doc:p>
-  RELAX NG schema for XML Schema by <doc:link 
-  href="mailto:mail@jenitennison.com">Jeni Tennison</doc:link>. Based on 
-  <doc:link href="http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/">XML 
-  Schema Part I: Structures Recommendation</doc:link> and <doc:link 
-  href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/">XML Schema Part 
-  II: Datatypes</doc:link>.
-</doc:p>
-<doc:changes date="2001-11-24">
-  <doc:p>
-    Amended to comply with 10 August 2001 Tutorial.
-  </doc:p>
-  <doc:change>Removed key attributes.</doc:change>
-  <doc:change>Replaced not element with except elements.</doc:change>
-  <doc:change>
-    Replaced multiple consecutive optional attributes to use the 
-    zeroOrMore/choice pattern.
-  </doc:change>
-  <doc:change>
-    Removed interleave elements inside list elements (which are no longer 
-    permitted).
-  </doc:change>
-</doc:changes>
-
-<define name="openAttrs" txw:mode="inherit">
-  <doc:p>
-    This allows any number of attributes that are not in the XML Schema 
-    namespace or are in no namespace.  This is somewhat more complicated than 
-    the XML Schema anyAttribute equivalent. 
-  </doc:p>
-  <!-- KK don't care -->
-  <empty/>
-  <!--zeroOrMore>
-    <attribute>
-      <anyName>
-        <except>
-          <nsName />
-          <nsName ns="" />
-          <name>xml:lang</name>
-        </except>
-      </anyName>
-      <text />
-    </attribute>
-  </zeroOrMore-->
-</define>
-
-<define name="annotated" txw:mode="inherit">
-  <doc:p>
-    This allows any number of attributes that are not in the XML Schema 
-    namespace or are in no namespace, an optional id attribute of type ID, 
-    and an optional annotation element.  This is used as the basis for many 
-    element content models.
-  </doc:p>
-  <ref name="openAttrs" />
-  <optional>
-    <attribute name="id">
-      <data type="ID" />
-    </attribute>
-  </optional>
-  <optional>
-    <ref name="annotation" />
-  </optional>
-</define>
-
-<define name="schemaTop" txw:mode="inline">
-  <doc:p>
-    This gives the content model of the top level of the schema.
-  </doc:p>
-  <choice>
-    <ref name="redefinable" />
-    <ref name="topLevelElement" />
-    <ref name="topLevelAttribute" />
-    <!--ref name="notation" /-->
-  </choice>
-</define>
-
-<define name="redefinable" txw:mode="inline">
-  <doc:p>
-    This gives the components that can be redefined within the redefine 
-    element.  They also occur at the top level of the schema.
-  </doc:p>
-  <choice>
-    <ref name="simpleTypeHost" />
-    <ref name="complexTypeHost" />
-    <!--ref name="namedGroup" />
-    <ref name="namedAttributeGroup" /-->
-  </choice>
-</define>
-
-<define name="formChoice">
-  <doc:p>
-    This gives the values for the various form attributes: 
-    elementFormDefault and attributeFormDefault on the schema element, and
-    the form attributes on the element and attribute elements.
-  </doc:p>
-  <choice>
-    <value>qualified</value>
-    <value>unqualified</value>
-  </choice>
-</define>
-
-<!-- KK: merge the two -->
-<define name="reducedDerivationControl">
-  <doc:p>
-    This gives the values that can be taken in the lists used to control
-    derivation by extension or restriction (this is 'reduced' derivation
-    because some derivation can involve substitution).  This RELAX NG schema, 
-    like the XML Schema Recommendation here, allows the keywords 'extension' and 
-    'restriction' to be repeated any number of times.
-  </doc:p>
-  <list>
-    <oneOrMore>
-      <choice>
-        <value>extension</value>
-        <value>restriction</value>
-      </choice>
-    </oneOrMore>
-  </list>
-</define>
-
-<define name="derivationSet">
-  <doc:p>
-    This specifies the possible values for attributes that control derivation.
-  </doc:p>
-  <choice>
-    <value>#all</value>
-    <ref name="reducedDerivationControl" />
-  </choice>
-</define>
-
-<start>
-  <doc:p>
-    This is the beginning point for the schema, and defines the schema 
-    element.
-  </doc:p>
-  <element name="schema" 
-        doc:href="http://www.w3.org/TR/xmlschema-1/#element-schema">
-    <ref name="openAttrs" />
-    <zeroOrMore>
-      <choice>
-        <attribute name="version">
-          <data type="token" />
-        </attribute>
-        <attribute name="finalDefault">
-          <ref name="derivationSet" />
-        </attribute>
-        <attribute name="blockDefault">
-          <ref name="blockSet" />
-        </attribute>
-        <attribute name="attributeFormDefault">
-          <ref name="formChoice" />
-        </attribute>
-        <attribute name="elementFormDefault">
-          <ref name="formChoice" />
-        </attribute>
-        <attribute name="id">
-          <data type="ID" />
-        </attribute>
-        <attribute name="xml:lang">
-          <data type="language" />
-        </attribute>
-        <attribute name="targetNamespace">
-          <data type="anyURI" />
-        </attribute>
-      </choice>
-    </zeroOrMore>
-    <zeroOrMore>
-      <choice>
-        <!--ref name="include" /-->
-        <ref name="import" />
-        <!--ref name="redefine" /-->
-        <ref name="annotation" />
-      </choice>
-    </zeroOrMore>
-    <zeroOrMore>
-      <choice>
-        <ref name="schemaTop" />
-        <ref name="annotation" />
-      </choice>
-    </zeroOrMore>
-  </element>
-</start>
-
-<define name="allNNI">
-  <doc:p>
-    This gives the value type for the maxOccurs attribute, which may be a 
-    non-negative number or the keyword 'unbounded'.
-  </doc:p>
-  <choice>
-    <data type="nonNegativeInteger" />
-    <value type="token">unbounded</value>
-  </choice>
-</define>
-
-<define name="occurs" txw:mode="inherit">
-  <doc:p>
-    This specifies the occurs attributes, minOccurs and maxOccurs, as they 
-    are normally used.
-  </doc:p>
-  <zeroOrMore>
-    <choice>
-      <attribute name="minOccurs">
-        <data type="nonNegativeInteger" />
-      </attribute>
-      <attribute name="maxOccurs">
-        <ref name="allNNI" />
-      </attribute>
-    </choice>
-  </zeroOrMore>
-</define>
-
-<define name="typeDefParticle" txw:mode="inline">
-  <doc:p>
-    This gives the possible content of complex types.
-  </doc:p>
-  <choice>
-    <!--ref name="groupRef" /-->
-    <ref name="all" />
-    <ref name="choice" />
-    <ref name="sequence" />
-  </choice>
-</define>
-
-<define name="nestedParticle" txw:mode="inline">
-  <doc:p>
-    This gives the particles that can make up a model group.
-  </doc:p>
-  <choice>
-    <ref name="localElement" />
-    <!--ref name="groupRef" /-->
-    <ref name="choice" />
-    <ref name="sequence" />
-    <ref name="any" />
-  </choice>
-</define>
-
-<define name="fixedOrDefault" txw:mode="inline">
-  <doc:p>
-    This specifies the relationship between fixed and default attributes on 
-    element and attribute elements - if one is present, then the other cannot 
-    be.  This is a constraint that cannot be specified using XML Schema.
-  </doc:p>
-  <choice>
-    <empty />
-    <attribute name="fixed" />
-    <attribute name="default" />
-  </choice>
-</define>
-
-<define name="attributeType" txw:mode="inherit">
-  <doc:p>
-    This specifies the relationship between the type attribute and the 
-    simpleType element child of attribute elements - if one is present, then 
-    the other cannot be, although it is possible for neither to be allowed.
-  </doc:p>
-  <choice>
-    <empty />
-    <attribute name="type">
-      <data type="QName" />
-    </attribute>
-    <ref name="simpleTypeHost" />
-  </choice>
-</define>
-
-<define name="localAttribute">
-  <doc:p>
-    This describes attribute elements when used in a local context.  They 
-    have an optional use attribute, possibly a fixed or default attribute, 
-    and then can either have a ref attribute (referring to a top-level 
-    attribute) or a name attribute with an optional form attribute and 
-    specifying an attribute type.
-  </doc:p>
-  <element name="attribute" 
-        doc:href="http://www.w3.org/TR/xmlschema-1/#element-attribute">
-    <ref name="annotated" />
-    <optional>
-      <attribute name="use">
-        <choice>
-          <value type="token">optional</value>
-          <value type="token">prohibited</value>
-          <value type="token">required</value>
-        </choice>
-      </attribute>
-    </optional>
-    <ref name="fixedOrDefault" />
-    <choice>
-      <attribute name="ref">
-        <data type="QName" />
-      </attribute>
-      <group>
-        <attribute name="name">
-          <data type="NCName" />
-        </attribute>
-        <optional>
-          <attribute name="form">
-            <ref name="formChoice" />
-          </attribute>
-        </optional>        
-        <ref name="attributeType" />
-      </group>
-    </choice>
-  </element>
-</define>
-
-<define name="topLevelAttribute">
-  <doc:p>
-    This describes attribute elements when used at the top level of the 
-    schema.  They must have a name, may have a fixed or default attribute, 
-    and specify their type through a type attribute or child simpleType 
-    element.  The name attribute of each attribute element that appears at 
-    the top level of the schema is unique.
-  </doc:p>
-  <element name="attribute"
-        doc:href="http://www.w3.org/TR/xmlschema-1/#element-attribute">
-    <ref name="annotated" />
-    <attribute name="name">
-      <data type="NCName" />
-    </attribute>
-    <ref name="fixedOrDefault" />
-    <ref name="attributeType" />
-  </element>
-</define>
-
-<define name="attrDecls" txw:mode="inherit">
-  <doc:p>
-    This gives the model group for specifying the attributes in a complex 
-    type, an extension or restriction.
-  </doc:p>
-  <zeroOrMore>
-    <choice>
-      <ref name="localAttribute" />
-      <!--ref name="attributeGroupRef" /-->
-    </choice>
-  </zeroOrMore>
-  <optional>
-    <ref name="anyAttribute" />
-  </optional>
-</define>
-
-<define name="anyAttribute">
-  <doc:p>
-    This specifies the anyAttribute wildcard.
-  </doc:p>
-  <element name="anyAttribute"
-        doc:href="http://www.w3.org/TR/xmlschema-1/#element-anyAttribute">
-    <ref name="wildcard" />
-  </element>
-</define>
-
-<define name="complexTypeModel" txw:mode="inherit">
-  <doc:p>
-    This specifies the content of a complexType element.  As children, it can 
-    have a simpleContent, a complexContent or a model group.  Only if it has 
-    one of the latter two, may it have a mixed attribute.  This latter 
-    constraint is something that cannot be specified in XML Schema.
-  </doc:p>
-  <choice>
-    <ref name="simpleContent" />
-    <group>
-      <optional>
-        <attribute name="mixed">
-          <data type="boolean" />
-        </attribute>
-      </optional>
-      <choice>
-        <ref name="complexContent" />
-        <group>
-          <optional>
-            <ref name="typeDefParticle" />
-          </optional>
-          <ref name="attrDecls" />
-        </group>
-      </choice>
-    </group>
-  </choice>
-</define>
-
-<define name="complexTypeHost" txw:mode="inherit">
-  <ref name="typeHost" />
-  <ref name="complexType" />
-</define>
-
-<define name="typeHost" txw:mode="inherit"><empty/><empty/></define>
-
-<define name="complexType" txw:mode="inherit">
-  <element name="complexType"
-        doc:href="http://www.w3.org/TR/xmlschema-1/#element-complexType">
-    <doc:p>
-      This specifies the basic content of a complexType element.
-    </doc:p>
-    <ref name="annotated" />
-    <ref name="complexTypeModel" />
-    <optional>
-      <attribute name="name">
-        <data type="NCName" />
-      </attribute>
-    </optional>
-    <zeroOrMore>
-      <choice>
-        <attribute name="abstract">
-          <data type="boolean" />
-        </attribute>
-        <attribute name="block">
-          <ref name="derivationSet" />
-        </attribute>
-        <attribute name="final">
-          <ref name="derivationSet" />
-        </attribute>
-      </choice>
-    </zeroOrMore>
-  </element>
-</define>
-
-<define name="complexRestriction">
-  <doc:p>
-    This describes a restriction element within a complexContent element 
-    (i.e. one that restricts a complex type).  It has a base attribute, may 
-    contain a model group and may contain attribute declarations of various 
-    sorts.
-  </doc:p>
-  <element name="restriction"
-        doc:href="http://www.w3.org/TR/xmlschema-1/#element-complexContent::restriction">
-    <ref name="annotated" />
-    <attribute name="base">
-      <data type="QName" />
-    </attribute>
-    <optional>
-      <ref name="typeDefParticle" />
-    </optional>
-    <ref name="attrDecls" />
-  </element>
-</define>
-
-<define name="extensionType">
-  <doc:p>
-    This specifies the basic model for an extension element: adding a 
-    required base attribute to the model used for most components.
-  </doc:p>
-  <ref name="annotated" />
-  <attribute name="base">
-    <data type="QName" />
-  </attribute>
-</define>
-
-<define name="complexExtension">
-  <doc:p>
-    This describes an extension element within a complexContent element 
-    (i.e. one that restricts a complex type).  It may contain a model group 
-    and may contain attribute declarations of various sorts.
-  </doc:p>
-  <element name="extension"
-        doc:href="http://www.w3.org/TR/xmlschema-1/#element-complexContent::extension">
-    <ref name="extensionType" />
-    <optional>
-      <ref name="typeDefParticle" />
-    </optional>
-    <ref name="attrDecls" />
-  </element>
-</define>
-
-<define name="complexContent">
-  <doc:p>
-    This describes a complexContent element.  It may have a mixed attribute, 
-    and either a restriction or extension element as content.
-  </doc:p>
-  <element name="complexContent"
-        doc:href="http://www.w3.org/TR/xmlschema-1/#element-complexContent">
-    <ref name="annotated" />
-    <optional>
-      <attribute name="mixed">
-        <data type="boolean" />
-      </attribute>
-    </optional>
-    <choice>
-      <ref name="complexRestriction" />
-      <ref name="complexExtension" />
-    </choice>
-  </element>
-</define>
-
-<define name="simpleRestriction">
-  <doc:p>
-    This describes a restriction element that appears within a simpleContent 
-    or simpleType element (i.e. one that restricts a simple type).  Its 
-    content follows the simple restriction model that is detailed below, and 
-    may include attribute declarations.
-  </doc:p>
-  <element name="restriction"
-        doc:href="http://www.w3.org/TR/xmlschema-1/#element-simpleContent::restriction">
-    <ref name="annotated" />
-    <ref name="simpleRestrictionModel" />
-    <ref name="attrDecls" />
-  </element>
-</define>
-
-<define name="simpleExtension">
-  <doc:p>
-    This describes an extension element that appears within a simpleContent 
-    element (i.e. one that extends a simple type).  Like other extensions, it 
-    has a base type, but it can only be used to add attributes.
-  </doc:p>
-  <element name="extension"
-        doc:href="http://www.w3.org/TR/xmlschema-1/#element-simpleContent::extension">
-    <ref name="extensionType" />
-    <ref name="attrDecls" />
-  </element>
-</define>
-
-<define name="simpleContent">
-  <doc:p>
-    This describes a simpleContent element, whose content can either hold a 
-    restriction or extension element.
-  </doc:p>
-  <element name="simpleContent"
-        doc:href="http://www.w3.org/TR/xmlschema-1/#element-simpleContent">
-    <ref name="annotated" />
-    <choice>
-      <ref name="simpleRestriction" />
-      <ref name="simpleExtension" />
-    </choice>
-  </element>
-</define>
-
-<define name="blockSet">
-  <doc:p>
-    This gives the possible values for block attributes on element elements, 
-    which includes substitution amongst the list of possible values.  This 
-    RELAX NG schema, like the XML Schema Recommendation, allows each of the 
-    keywords 'extension', 'restriction' and 'substitution' to occur more than 
-    once within the list.
-  </doc:p>
-  <choice>
-    <value type="token">#all</value>
-    <list>
-      <oneOrMore>
-        <choice>
-          <value>extension</value>
-          <value>restriction</value>
-          <value>substitution</value>
-        </choice>
-      </oneOrMore>
-    </list>
-  </choice>
-</define>
-
-<define name="element" txw:mode="inherit">
-  <doc:p>
-    This describes the basic content model of an element element.  It is 
-    annotated, may have a fixed or default attribute, and may have nillable 
-    and/or block attributes.  Its type may be specified through a type 
-    attribute, a local simple type or a local complex type - the choice 
-    between these methods is something that cannot be indicated with XML 
-    Schema.  This content is optionally followed by some identify constraints.
-  </doc:p>
-  <ref name="annotated" />
-  <ref name="fixedOrDefault" />
-  <zeroOrMore>
-    <choice>
-      <attribute name="nillable">
-        <data type="boolean" />
-      </attribute>
-      <attribute name="block">
-        <ref name="blockSet" />
-      </attribute>
-    </choice>
-  </zeroOrMore>
-  <choice>
-    <empty />
-    <attribute name="type">
-      <data type="QName" />
-    </attribute>
-    <ref name="simpleTypeHost" />
-    <ref name="complexTypeHost" />
-  </choice>
-  <!--zeroOrMore>
-    <ref name="identityConstraint" />
-  </zeroOrMore-->
-</define>
-
-<define name="topLevelElement">
-  <doc:p>
-    This describes an element element that appears at the top level of the 
-    schema.  On top of the basic content for an element element, it has to 
-    have a name, which is a unique identifier in the element symbol space.  It 
-    may have substitutionGroup, abstract and/or final attributes.
-  </doc:p>
-  <element name="element"
-        doc:href="http://www.w3.org/TR/xmlschema-1/#element-element">
-    <ref name="element" />
-    <attribute name="name">
-      <data type="NCName" />
-    </attribute>
-    <zeroOrMore>
-      <choice>
-        <attribute name="substitutionGroup">
-          <data type="QName" />
-        </attribute>
-        <attribute name="abstract">
-          <data type="boolean" />
-        </attribute>
-        <attribute name="final">
-          <ref name="derivationSet" />
-        </attribute>
-      </choice>
-    </zeroOrMore>
-  </element>
-</define>
-
-<define name="localElement">
-  <doc:p>
-    This describes an element element that appears locally, within a 
-    complexType or group element.  It may have minOccurs and/or maxOccurs 
-    attributes.  If it has a ref attribute, then that&apos;s all it can 
-    have.  Otherwise, it must have a name and specifies its type in the same 
-    way as the basic element content model described above.  It may in this 
-    case also have a form element.  These constraints on local elements 
-    cannot be described within XML Schema.
-  </doc:p>
-  <element name="element"
-        doc:href="http://www.w3.org/TR/xmlschema-1/#element-element">
-    <ref name="occurs" />
-    <choice>
-      <attribute name="ref">
-        <data type="QName" />
-      </attribute>
-      <group>
-        <ref name="element" />
-        <attribute name="name">
-          <data type="NCName" />
-        </attribute>
-        <optional>
-          <attribute name="form">
-            <ref name="formChoice" />
-          </attribute>
-        </optional>
-      </group>
-    </choice>
-  </element>
-</define>
-
-<!--define name="namedGroup">
-  <doc:p>
-    This describes an group element that appears at the top level of the 
-    schema.  It must have a name attribute, and must have one of an all, 
-    choice or sequence element child.
-  </doc:p>
-  <element name="group"
-        doc:href="http://www.w3.org/TR/xmlschema-1/#element-group">
-    <ref name="annotated" />
-    <attribute name="name">
-      <data type="NCName" />
-    </attribute>
-    <choice>
-      <element name="all">
-        <ref name="simpleExplicitGroup" />  <!- - RS - relaxed all content model - ->
-      </element>
-      <element name="choice">
-        <ref name="simpleExplicitGroup" />
-      </element>
-      <element name="sequence">
-        <ref name="simpleExplicitGroup" />
-      </element>
-    </choice>
-  </element>
-</define-->
-
-<!--define name="groupRef">
-  <doc:p>
-    This describes group element that occurs locally, referring to a 
-    top-level named group.  It may have occurrence attributes, and must have 
-    a ref attribute.
-  </doc:p>
-  <element name="group"
-        doc:href="http://www.w3.org/TR/xmlschema-1/#element-group">
-    <ref name="annotated" />
-    <ref name="occurs" />
-    <attribute name="ref">
-      <data type="QName" />
-    </attribute>
-  </element>
-</define-->
-
-<define name="explicitGroup" txw:mode="inherit">
-  <doc:p>
-    This gives the content of a model group (not a group element) in the 
-    normal run of things.  It has occurrence attributes and any number of 
-    particles within it.
-  </doc:p>
-  <ref name="annotated" />
-  <ref name="occurs" />
-  <zeroOrMore>
-    <ref name="nestedParticle" />
-  </zeroOrMore>
-</define>
-
-<define name="simpleExplicitGroup">
-  <doc:p>
-    This gives the content of a model group (not a group element) within a 
-    named group - it differs from the above in that it doesn&apos;t have any 
-    occurrence attributes.
-  </doc:p>
-  <ref name="annotated" />
-  <zeroOrMore>
-    <ref name="nestedParticle" />
-  </zeroOrMore>
-</define>
-
-<define name="all">
-  <doc:p>
-    This describes an all element that appears outside a named group (i.e. as 
-    the content of a complexType element).  It has the standard model for an 
-    all element, but adds minOccurs and maxOccurs attributes which can only 
-    take certain values.
-  </doc:p>
-  <element name="all"
-        doc:href="http://www.w3.org/TR/xmlschema-1/#element-all">
-    <ref name="explicitGroup" />
-  </element>
-</define>
-
-<define name="choice">
-  <doc:p>
-    This describes a choice element that appears outside a named group.
-  </doc:p>
-  <element name="choice"
-        doc:href="http://www.w3.org/TR/xmlschema-1/#element-choice">
-    <ref name="explicitGroup" />
-  </element>
-</define>
-
-<define name="sequence">
-  <doc:p>
-    This describes a sequence element that appears outside a named group.
-  </doc:p>
-  <element name="sequence"
-        doc:href="http://www.w3.org/TR/xmlschema-1/#element-sequence">
-    <ref name="explicitGroup" />
-  </element>
-</define>
-
-<define name="wildcard" txw:mode="inherit">
-  <doc:p>
-    This describes a wildcard element (i.e. any or anyAttribute).  The 
-    namespace attribute can take a list URIs interspersed with the keywords 
-    '##targetNamespace' and/or '##local'.  This RELAX NG schema, like the XML 
-    Schema Recommendation, allows the keywords to be specified more than once 
-    each within the list, if they&apos;re given.  This model also specifies the 
-    processContents attribute.
-  </doc:p>
-  <ref name="annotated" />
-  <zeroOrMore>
-    <choice>
-      <attribute name="namespace">
-        <choice>
-          <value type="token">##any</value>
-          <value type="token">##other</value>
-          <list>
-            <zeroOrMore>
-              <choice>
-                <data type="anyURI" />
-                <value>##targetNamespace</value>
-                <value>##local</value>
-              </choice>
-            </zeroOrMore>
-          </list>
-        </choice>
-      </attribute>
-      <attribute name="processContents">
-        <choice>
-          <value type="token">lax</value>
-          <value type="token">skip</value>
-          <value type="token">strict</value>
-        </choice>
-      </attribute>
-    </choice>
-  </zeroOrMore>
-</define>
-
-<define name="any">
-  <doc:p>
-    This describes an any element as a wildcard.
-  </doc:p>
-  <element name="any"
-        doc:href="http://www.w3.org/TR/xmlschema-1/#element-any">
-    <ref name="wildcard" />
-    <ref name="occurs" />
-  </element>
-</define>
-
-<!--define name="namedAttributeGroup">
-  <doc:p>
-    This describes an attributeGroup element as it appears at the top level 
-    of the schema.  It must have a name attribute, and then contains 
-    attribute declarations.
-  </doc:p>
-  <element name="attributeGroup"
-        doc:href="http://www.w3.org/TR/xmlschema-1/#element-attributeGroup">
-    <ref name="annotated" />
-    <attribute name="name">
-      <data type="NCName" />
-    </attribute>
-    <ref name="attrDecls" />
-  </element>
-</define-->
-
-<!--define name="attributeGroupRef">
-  <doc:p>
-    This describes an attributeGroup element as it appears within a complex 
-    type.  It must have a ref attribute.
-  </doc:p>
-  <element name="attributeGroup"
-        doc:href="http://www.w3.org/TR/xmlschema-1/#element-attributeGroup">
-    <ref name="annotated" />
-    <attribute name="ref">
-      <data type="QName" />
-    </attribute>
-  </element>
-</define-->
-
-<!--define name="include">
-  <doc:p>
-    This describes an include element, which must have a schemaLocation 
-    attribute.
-  </doc:p>
-  <element name="include"
-        doc:href="http://www.w3.org/TR/xmlschema-1/#element-include">
-    <ref name="annotated" />
-    <attribute name="schemaLocation">
-      <data type="anyURI" />
-    </attribute>
-  </element>
-</define-->
-
-<!--define name="redefine">
-  <doc:p>
-    This describes a redefine element, which must have a schemaLocation 
-    attribute and can then contain any mix of annotations and redefinable 
-    components.
-  </doc:p>
-  <element name="redefine"
-        doc:href="http://www.w3.org/TR/xmlschema-1/#element-redefine">
-    <ref name="openAttrs" />
-    <optional>
-      <attribute name="id">
-        <data type="ID" />
-      </attribute>
-    </optional>
-    <attribute name="schemaLocation">
-      <data type="anyURI" />
-    </attribute>
-    <zeroOrMore>
-      <choice>
-        <ref name="annotation" />
-        <ref name="redefinable" />
-      </choice>
-    </zeroOrMore>
-  </element>
-</define-->
-
-<define name="import">
-  <doc:p>
-    This describes an import element that&apos;s used when its parent schema 
-    element specifies a targetNamespace.  In these cases, the namespace 
-    attribute on the import element is optional.
-  </doc:p>
-  <element name="import"
-        doc:href="http://www.w3.org/TR/xmlschema-1/#element-import">
-	  <ref name="annotated" />
-	  <optional>
-	    <attribute name="schemaLocation">
-	      <data type="anyURI" />
-	    </attribute>
-	  </optional>
-    <optional>
-      <attribute name="namespace">
-        <data type="anyURI" />
-      </attribute>
-    </optional>
-  </element>
-</define>
-
-<!--define name="selector">
-  <doc:p>
-    This describes a selector element.  The xpath attribute is a simplified 
-    XPath - the regular expression given here is the one from the XML Schema 
-    for XML Schema.
-  </doc:p>
-  <element name="selector"
-        doc:href="http://www.w3.org/TR/xmlschema-1/#element-selector">
-    <ref name="annotated" />
-    <attribute name="xpath">
-      <data type="token">
-        <param name="pattern">(\.//)?(((child::)?((\i\c*:)?(\i\c*|\*)))|\.)(/(((child::)?((\i\c*:)?(\i\c*|\*)))|\.))*(\|(\.//)?(((child::)?((\i\c*:)?(\i\c*|\*)))|\.)(/(((child::)?((\i\c*:)?(\i\c*|\*)))|\.))*)*</param>
-      </data>
-    </attribute>
-  </element>
-</define>
-
-<define name="field">
-  <doc:p>
-    This describes a field element.  The xpath attribute is a simplified 
-    XPath - the regular expression given here is the one from the XML Schema 
-    for XML Schema.
-  </doc:p>
-  <element name="field"
-        doc:href="http://www.w3.org/TR/xmlschema-1/#element-field">
-    <ref name="annotated" />
-    <attribute name="xpath">
-      <data type="token">
-        <param name="pattern">(\.//)?((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)/)*((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)|((attribute::|@)((\i\c*:)?(\i\c*|\*))))(\|(\.//)?((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)/)*((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)|((attribute::|@)((\i\c*:)?(\i\c*|\*)))))*</param>
-      </data>
-    </attribute>
-  </element>
-</define>
-
-<define name="keybase" txw:mode="inherit">
-  <doc:p>
-    This gives the basic content for identity constraints - a name attribute 
-    that uniquely identifies the identity constraint, a selector element and 
-    one or more field elements.
-  </doc:p>
-  <ref name="annotated" />
-  <attribute name="name">
-    <data type="NCName" />
-  </attribute>
-  <ref name="selector" />
-  <oneOrMore>
-    <ref name="field" />
-  </oneOrMore>
-</define>
-
-<define name="identityConstraint" txw:mode="inline">
-  <doc:p>
-    This gives a model group for the three identity constraint elements, used 
-    within the content of element elements.
-  </doc:p>
-  <choice>
-    <ref name="unique" />
-    <ref name="key" />
-    <ref name="keyref" />
-  </choice>
-</define>
-
-<define name="unique">
-  <doc:p>
-    This describes a unique element.
-  </doc:p>
-  <element name="unique"
-        doc:href="http://www.w3.org/TR/xmlschema-1/#element-unique">
-    <ref name="keybase" />
-  </element>  
-</define>
-
-<define name="key">
-  <doc:p>
-    This describes a key element.
-  </doc:p>
-  <element name="key"
-        doc:href="http://www.w3.org/TR/xmlschema-1/#element-key">
-    <ref name="keybase" />
-  </element>
-</define>
-
-<define name="keyref">
-  <doc:p>
-    This describes a keyref element.
-  </doc:p>
-  <element name="keyref"
-        doc:href="http://www.w3.org/TR/xmlschema-1/#element-keyref">
-    <ref name="keybase" />
-    <attribute name="refer">
-      <data type="QName" />
-    </attribute>
-  </element>
-</define-->
-
-<!--define name="notation">
-  <doc:p>
-    This describes a notation element.  The names of notation elements are 
-    unique in the notation symbol space.  The public attribute is required, 
-    and the system attribute is optional.
-  </doc:p>
-  <element name="notation"
-        doc:href="http://www.w3.org/TR/xmlschema-1/#element-notation">
-    <ref name="annotated" />
-    <attribute name="name">
-      <data type="NCName" />
-    </attribute>
-    <attribute name="public">
-      <data type="token" />
-    </attribute>
-    <optional>
-      <attribute name="system">
-        <data type="anyURI" />
-      </attribute>
-    </optional>
-  </element>
-</define-->
-
-<define name="appinfoContent">
-  <doc:p>
-    This is designed to describe the content of the appinfo elements in the 
-    schema.  At the moment this allows any mixed content without validation.  
-    Note that this is fairly complex compared to the XML Schema equivalent, 
-    which would be a single any element.
-  </doc:p>
-  <ref name="anyContent" />
-</define>
-
-<define name="anyContent">
-  <empty/>  <!-- KK don't care -->
-  <!--mixed>
-    <zeroOrMore>
-      <element>
-        <anyName />
-        <zeroOrMore>
-          <attribute>
-            <anyName />
-          </attribute>
-        </zeroOrMore>
-        <ref name="anyContent" />
-        <empty />
-      </element>
-    </zeroOrMore>
-  </mixed-->
-</define>
-
-<define name="appinfo">
-  <doc:p>
-    This describes an appinfo element.  It has an optional source attribute 
-    and can currently contain anything at all.
-  </doc:p>
-  <element name="appinfo"
-        doc:href="http://www.w3.org/TR/xmlschema-1/#element-appinfo">
-    <optional>
-      <attribute name="source">
-        <data type="anyURI" />
-      </attribute>
-    </optional>
-    <ref name="appinfoContent" />
-  </element>
-</define>
-
-<define name="documentationContent">
-  <doc:p>
-    This is designed to describe the content of the documentation elements in 
-    the schema.  At the moment this allows any mixed content without 
-    validation.  Note that this is fairly complex compared to the XML Schema 
-    equivalent, which would be a single any element.
-  </doc:p>
-  <ref name="anyContent" />
-</define>
-
-<define name="documentation">
-  <doc:p>
-    This describes a documentation element.  It has optional source 
-    and xml:lang attributes and can currently contain anything at all.
-  </doc:p>
-  <element name="documentation"
-        doc:href="http://www.w3.org/TR/xmlschema-1/#element-documentation">
-    <zeroOrMore>
-      <choice>
-        <attribute name="source">
-          <data type="anyURI" />
-        </attribute>
-        <attribute name="xml:lang">
-          <data type="language" />
-        </attribute>
-      </choice>
-    </zeroOrMore>
-    <ref name="documentationContent" />
-  </element>
-</define>
-
-<define name="annotation">
-  <doc:p>
-    This describes an annotation element.  It can have any attributes, may 
-    have an id attribute, and contains any number of documentation or appinfo 
-    elements.
-  </doc:p>
-  <element name="annotation"
-        doc:href="http://www.w3.org/TR/xmlschema-1/#element-annotation">
-    <ref name="openAttrs" />
-    <optional>
-      <attribute name="id">
-        <data type="ID" />
-      </attribute>
-    </optional>
-    <zeroOrMore>
-      <choice>
-        <ref name="documentation" />
-        <ref name="appinfo" />
-      </choice>
-    </zeroOrMore>
-  </element>
-</define>
-
-<define name="simpleDerivation" txw:mode="inline">
-  <doc:p>
-    This gives the various types of derivation of simple types.
-  </doc:p>
-  <choice>
-    <ref name="simpleRestriction" />
-    <ref name="list" />
-    <ref name="union" />
-  </choice>
-</define>
-
-<define name="simpleDerivationSet">
-  <doc:p>
-    This specifies the values of the final attribute for simple types.  This 
-    RELAX NG schema for XML Schema, like the XML Schema Recommendation, allows 
-    the keywords 'list', 'union' and 'restriction' to appear more than once 
-    within the list.
-  </doc:p>
-  <choice>
-    <value type="token">#all</value>
-    <list>
-      <zeroOrMore>
-        <choice>
-          <value>list</value>
-          <value>union</value>
-          <value>restriction</value>
-        </choice>
-      </zeroOrMore>
-    </list>
-  </choice>
-</define>
-
-<define name="simpleTypeHost" txw:mode="inherit">
-  <ref name="typeHost" />
-  <ref name="simpleType" />
-</define>
-
-<define name="simpleType" txw:mode="inherit">
-  <doc:p>
-    This gives the basic content of a simple type.
-  </doc:p>
-  <element name="simpleType"
-        doc:href="http://www.w3.org/TR/xmlschema-1/#element-simpleType">
-    <ref name="annotated" />
-    <ref name="simpleDerivation" />
-    <optional>
-      <attribute name="name">
-        <data type="NCName" />
-      </attribute>
-    </optional>
-    <optional>
-      <attribute name="final">
-        <ref name="simpleDerivationSet" />
-      </attribute>
-    </optional>
-  </element>
-</define>
-
-<!--define name="rangeFacets" txw:mode="inherit">
-  <doc:p>
-    This describes the relationship between the various range facets.  Only 
-    one of minExclusive and minInclusive can be present, and only one of 
-    maxExclusive and maxInclusive can be present.  This is a constraint that 
-    can&apos;t easily be expressed using XML Schema.  This RELAX NG schema 
-    for XML Schema is a little more restrictive than the XML Schema 
-    Recommendation in that it also forces there to be a maximum of one of 
-    each of these types of facets.
-  </doc:p>
-  <interleave>
-    <optional>
-      <choice>
-        <ref name="minExclusive" />
-        <ref name="minInclusive" />
-      </choice>
-    </optional>    
-    <optional>
-      <choice>
-        <ref name="maxExclusive" />
-        <ref name="maxInclusive" />
-      </choice>
-    </optional>
-  </interleave>
-</define>
-
-<define name="digitFacets" txw:mode="inherit">
-  <doc:p>
-    This specifies optional totalDigits and fractionDigits elements.  This 
-    RELAX NG schema for XML Schema is a little more restrictive than the XML 
-    Schema Recommendation in that it also forces there to be a maximum of one 
-    of each of these types of facets.
-  </doc:p>
-  <optional>
-    <ref name="totalDigits" />
-  </optional>
-  <optional>
-    <ref name="fractionDigits" />
-  </optional>
-</define>
-
-<define name="lengthFacets" txw:mode="inherit">
-  <doc:p>
-    This specifies optional length, minLength and maxLength elements.  This 
-    RELAX NG schema for XML Schema is a little more restrictive than the XML 
-    Schema Recommendation in that it also forces there to be a maximum of one 
-    of each of these types of facets, and says that if a length element is 
-    given, then neither minLength nor maxLength should be present.
-  </doc:p>
-  <choice>
-    <ref name="length" />
-    <interleave>
-      <optional>
-        <ref name="minLength" />
-      </optional>
-      <optional>
-        <ref name="maxLength" />        
-      </optional>
-    </interleave>
-  </choice>
-</define>
-
-<define name="commonFacets" txw:mode="inherit">
-  <doc:p>
-    This specifies zero or more enumeration or pattern elements and an 
-    optional whiteSpace element.  This RELAX NG schema for XML Schema is a 
-    little more restrictive than the XML Schema Recommendation in that it 
-    also forces there to be a maximum of one whiteSpace element within the 
-    facets.  Note that the whiteSpace facet is constrained to have a value of 
-    'collapse'.
-  </doc:p>
-  <zeroOrMore>
-    <ref name="enumeration" />
-  </zeroOrMore>
-  <optional>
-    <ref name="whiteSpaceCollapse" />
-  </optional>
-  <zeroOrMore>
-    <ref name="pattern" />
-  </zeroOrMore>
-</define-->
-
-<define name="simpleRestrictionModel">
-  <doc:p>
-    This specifies the types of facets that are valid in restrictions on the 
-    built-in data types.  This can only perform rudimentary checking, but 
-    should be enough in most circumstances.  Note that for xs:anySimpleType 
-    and xs:string, the whiteSpace facet can take any value, for 
-    xs:normalizedString it can be 'replace' or 'collapse', and for all other 
-    built-in types it has to be 'collapse'.
-  </doc:p>
-  <choice>
-    <attribute name="base">
-      <data type="QName" />
-    </attribute>
-    <ref name="simpleTypeHost" />
-  </choice>
-  <interleave>
-    <!--ref name="rangeFacets" />
-    <ref name="digitFacets" />
-    <ref name="lengthFacets" />
-    <optional>
-      <ref name="whiteSpace" />
-    </optional-->
-    <zeroOrMore>
-      <ref name="enumeration" />
-    </zeroOrMore>
-    <!--zeroOrMore>
-      <ref name="pattern" />
-    </zeroOrMore-->
-  </interleave>
-</define>
-
-<define name="list">
-  <doc:p>
-    This describes a list element.  It can either specify a local simple type 
-    or have a itemType attribute.  This constraint cannot be expressed in XML 
-    Schema.
-  </doc:p>
-  <element name="list"
-        doc:href="http://www.w3.org/TR/xmlschema-1/#element-list">
-    <ref name="annotated" />
-    <choice>      
-      <ref name="simpleTypeHost" />
-      <attribute name="itemType">
-        <data type="QName" />
-      </attribute>
-    </choice>
-  </element>
-</define>
-
-<define name="union">
-  <doc:p>
-    This describes a union element.  If the memberTypes attribute is missing 
-    or empty, then it must contain one or more simpleType elements; if 
-    it&apos;s present, then it can contain simpleType elements or list simple 
-    types in the memberTypes attribute.  This constraint cannot be expressed 
-    in XML Schema.
-  </doc:p>
-  <element name="union"
-        doc:href="http://www.w3.org/TR/xmlschema-1/#element-union">
-    <ref name="annotated" />
-    <choice>
-      <group>
-        <attribute name="memberTypes">
-          <list>
-            <oneOrMore>
-              <data type="QName" />
-            </oneOrMore>
-          </list>
-        </attribute>
-        <zeroOrMore>
-          <ref name="simpleTypeHost" />
-        </zeroOrMore>
-      </group>
-      <group>
-        <optional>
-          <attribute name="memberTypes">
-            <empty />
-          </attribute>
-        </optional>
-        <oneOrMore>
-          <ref name="simpleTypeHost" />
-        </oneOrMore>
-      </group>
-    </choice>
-  </element>
-</define>
-
-<define name="facet" txw:mode="inherit">
-  <doc:p>
-    This is the basic content of a facet.  It has an optional fixed attribute.
-  </doc:p>
-  <ref name="annotated" />
-  <optional>
-    <attribute name="fixed">
-      <data type="boolean" />
-    </attribute>
-  </optional>
-</define>
-
-<define name="noFixedFacet" txw:mode="inherit">
-  <doc:p>
-    This is the content of a facet that cannot be fixed (enumeration or 
-    pattern).  It has a value attribute that can take any kind of value.
-  </doc:p>
-  <ref name="annotated" />
-  <attribute name="value" />
-</define>
-
-<!--define name="rangeFacet">
-  <doc:p>
-    This is the content of a range facet.  The value must be one of the data 
-    types shown (as these are the only types of data that accept ranges).  I 
-    haven&apos;t gone so far as to indicate the data type of the value 
-    attribute of a range facet according to the base type as this would be 
-    very complicated (although it would be possible in RELAX NG).
-  </doc:p>
-  <ref name="facet" />
-  <attribute name="value">
-    <choice>
-      <data type="decimal" />
-      <data type="float" />
-      <data type="double" />
-      <data type="duration" />
-      <data type="dateTime" />
-      <data type="time" />
-      <data type="date" />
-      <data type="gYearMonth" />
-      <data type="gYear" />
-      <data type="gMonthDay" />
-      <data type="gMonth" />
-      <data type="gDay" />
-    </choice>
-  </attribute>
-</define>
-
-<define name="minExclusive">
-  <doc:p>
-    This describes a minExclusive element.
-  </doc:p>
-  <element name="minExclusive"
-        doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-minExclusive">
-    <ref name="rangeFacet" />
-  </element>
-</define>
-
-<define name="minInclusive">
-  <doc:p>
-    This describes a minInclusive element.
-  </doc:p>
-  <element name="minInclusive"
-        doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-minInclusive">
-    <ref name="rangeFacet" />
-  </element>
-</define>
-
-<define name="maxExclusive">
-  <doc:p>
-    This describes a maxExclusive element.
-  </doc:p>
-  <element name="maxExclusive"
-        doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-maxExclusive">
-    <ref name="rangeFacet" />
-  </element>
-</define>
-
-<define name="maxInclusive">
-  <doc:p>
-    This describes a maxInclusive element.
-  </doc:p>
-  <element name="maxInclusive"
-        doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-maxInclusive">
-    <ref name="rangeFacet" />
-  </element>
-</define>
-
-<define name="numFacet">
-  <doc:p>
-    This is the content of a numerical facet.
-  </doc:p>
-  <ref name="facet" />
-  <attribute name="value">
-    <data type="nonNegativeInteger" />
-  </attribute>
-</define>
-
-<define name="totalDigits">
-  <doc:p>
-    This describes a totalDigits element.  The value attribute must take a 
-    positive integer.
-  </doc:p>
-  <element name="totalDigits"
-        doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-totalDigits">
-    <ref name="facet" />
-    <attribute name="value">
-      <data type="positiveInteger" />
-    </attribute>
-  </element>
-</define>
-
-<define name="fractionDigits">
-  <doc:p>
-    This describes a fractionDigits element.
-  </doc:p>
-  <element name="fractionDigits"
-        doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-fractionDigits">
-    <ref name="numFacet" />
-  </element>
-</define>
-
-<define name="length">
-  <doc:p>
-    This describes a length element.
-  </doc:p>
-  <element name="length"
-        doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-length">
-    <ref name="numFacet" />
-  </element>
-</define>
-
-<define name="minLength">
-  <doc:p>
-    This describes a minLength element.
-  </doc:p>
-  <element name="minLength"
-        doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-minLength">
-    <ref name="numFacet" />
-  </element>
-</define>
-
-<define name="maxLength">
-  <doc:p>
-    This describes a maxLength element.
-  </doc:p>
-  <element name="maxLength"
-        doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-maxLength">
-    <ref name="numFacet" />
-  </element>
-</define-->
-
-<define name="enumeration">
-  <doc:p>
-    This describes an enumeration element.
-  </doc:p>
-  <element name="enumeration"
-        doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-enumeration">
-    <ref name="noFixedFacet" />
-  </element>
-</define>
-
-<!--define name="whiteSpace">
-  <doc:p>
-    This describes a whiteSpace element that can take any of the permitted 
-    values.
-  </doc:p>
-  <element name="whiteSpace"
-        doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-whiteSpace">
-    <ref name="facet" />
-    <attribute name="value">
-      <choice>
-        <value type="token">preserve</value>
-        <value type="token">replace</value>
-        <value type="token">collapse</value>
-      </choice>
-    </attribute>
-  </element>
-</define>
-
-<define name="whiteSpaceReplaceOrCollapse">
-  <doc:p>
-    This describes a whiteSpace element that can only take the values 
-    'replace' or 'collapse'.
-  </doc:p>
-  <element name="whiteSpace"
-        doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-whiteSpace">
-    <ref name="facet" />
-    <attribute name="value">
-      <choice>
-        <value type="token">replace</value>
-        <value type="token">collapse</value>
-      </choice>
-    </attribute>
-  </element>
-</define>
-
-<define name="whiteSpaceCollapse">
-  <doc:p>
-    This describes a whiteSpace element that can only take the value 
-    'collapse'.
-  </doc:p>
-  <element name="whiteSpace"
-        doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-whiteSpace">
-    <ref name="facet" />
-    <attribute name="value">
-      <value type="token">collapse</value>
-    </attribute>
-  </element>
-</define>
-
-<define name="pattern">
-  <doc:p>
-    This describes a pattern element.
-  </doc:p>
-  <element name="pattern"
-        doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-pattern">
-    <ref name="noFixedFacet" />
-  </element>
-</define-->
-
-</grammar>
--- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/AttachmentPartImpl.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/AttachmentPartImpl.java	Mon Jun 02 13:53:52 2014 -0700
@@ -582,7 +582,8 @@
                     mailMap.addMailcap("text/xml;;x-java-content-handler=com.sun.xml.internal.messaging.saaj.soap.XmlDataContentHandler");
                     mailMap.addMailcap("application/xml;;x-java-content-handler=com.sun.xml.internal.messaging.saaj.soap.XmlDataContentHandler");
                     mailMap.addMailcap("application/fastinfoset;;x-java-content-handler=com.sun.xml.internal.messaging.saaj.soap.FastInfosetDataContentHandler");
-                    mailMap.addMailcap("multipart/*;;x-java-content-handler=com.sun.xml.internal.messaging.saaj.soap.MultipartDataContentHandler");
+                    // this handler seems to be not used according VCS history ...
+                    // mailMap.addMailcap("multipart/*;;x-java-content-handler=com.sun.xml.internal.messaging.saaj.soap.MultipartDataContentHandler");
                     mailMap.addMailcap("image/*;;x-java-content-handler=com.sun.xml.internal.messaging.saaj.soap.ImageDataContentHandler");
                     mailMap.addMailcap("text/plain;;x-java-content-handler=com.sun.xml.internal.messaging.saaj.soap.StringDataContentHandler");
                 }
--- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/rngom/parse/compact/CompactSyntax.jj	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1963 +0,0 @@
-options {
-  STATIC = false;
-  UNICODE_INPUT = true;
-  JAVA_UNICODE_ESCAPE = true;
-}
-
-PARSER_BEGIN(CompactSyntax)
-
-package com.sun.xml.internal.rngom.parse.compact;
-
-import java.io.Reader;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Arrays;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.List;
-
-import com.sun.xml.internal.rngom.ast.builder.Annotations;
-import com.sun.xml.internal.rngom.ast.builder.BuildException;
-import com.sun.xml.internal.rngom.ast.builder.CommentList;
-import com.sun.xml.internal.rngom.ast.builder.DataPatternBuilder;
-import com.sun.xml.internal.rngom.ast.builder.Div;
-import com.sun.xml.internal.rngom.ast.builder.ElementAnnotationBuilder;
-import com.sun.xml.internal.rngom.ast.builder.Grammar;
-import com.sun.xml.internal.rngom.ast.builder.GrammarSection;
-import com.sun.xml.internal.rngom.ast.builder.Include;
-import com.sun.xml.internal.rngom.ast.builder.IncludedGrammar;
-import com.sun.xml.internal.rngom.ast.builder.NameClassBuilder;
-import com.sun.xml.internal.rngom.ast.builder.SchemaBuilder;
-import com.sun.xml.internal.rngom.ast.builder.Scope;
-import com.sun.xml.internal.rngom.ast.om.Location;
-import com.sun.xml.internal.rngom.ast.om.ParsedElementAnnotation;
-import com.sun.xml.internal.rngom.ast.om.ParsedNameClass;
-import com.sun.xml.internal.rngom.ast.om.ParsedPattern;
-import com.sun.xml.internal.rngom.parse.Context;
-import com.sun.xml.internal.rngom.parse.IllegalSchemaException;
-import com.sun.xml.internal.rngom.parse.Parseable;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.helpers.LocatorImpl;
-
-import com.sun.xml.internal.rngom.util.Localizer;
-import com.sun.xml.internal.rngom.xml.util.WellKnownNamespaces;
-
-
-public class CompactSyntax implements Context {
-  private static final int IN_ELEMENT = 0;
-  private static final int IN_ATTRIBUTE = 1;
-  private static final int IN_ANY_NAME = 2;
-  private static final int IN_NS_NAME = 4;
-
-  private String defaultNamespace;
-  private String compatibilityPrefix = null;
-  private SchemaBuilder sb;
-  private NameClassBuilder ncb;
-  private String sourceUri;
-  /**
-   * This is what we are parsing right now.
-   */
-  private CompactParseable parseable;
-  private ErrorHandler eh;
-  private final Hashtable namespaceTable = new Hashtable();
-  private final Hashtable datatypesTable = new Hashtable();
-  private boolean hadError = false;
-  private static final Localizer localizer = new Localizer(new Localizer(Parseable.class),CompactSyntax.class);
-  private final Hashtable attributeNameTable = new Hashtable();
-  private boolean annotationsIncludeElements = false;
-  
-  /**
-   * String that represents the inherited namespace.
-   * 
-   * <p>
-   * HACK: we always allocate a new String instance so that
-   * we can distinguish inherited value from the explicitly
-   * given value.
-   */
-  private /*final*/ String inheritedNs; // essentially final but JavaCC don't let us declare it as so.
-  
-  final class LocatedString {
-    private final String str;
-    private final Token tok;
-
-    LocatedString(String str, Token tok) {
-      this.str = str;
-      this.tok = tok;
-    }
-
-    String getString() {
-      return str;
-    }
-
-    Location getLocation() {
-      return makeLocation(tok);
-    }
-
-    Token getToken() {
-      return tok;
-    }
-
-  }
-
-  public CompactSyntax(CompactParseable parseable, Reader r, String sourceUri, SchemaBuilder sb, ErrorHandler eh, String inheritedNs) {
-    this(r);
-    this.sourceUri = sourceUri;
-    this.parseable = parseable;
-    this.sb = sb;
-    this.ncb = sb.getNameClassBuilder();
-    this.eh = eh;
-    // this causes the root pattern to have non-null annotations
-    // which is useful because it gives a context to trang
-    this.topLevelComments = sb.makeCommentList();
-    this.inheritedNs = defaultNamespace = new String(inheritedNs);
-  }
-
-  ParsedPattern parse(Scope scope) throws IllegalSchemaException {
-    try {
-      ParsedPattern p = Input(scope);
-      if (!hadError)
-        return p;
-    }
-    catch (ParseException e) {
-      error("syntax_error", e.getMessage(), e.currentToken.next);
-    }
-    catch (EscapeSyntaxException e) {
-      reportEscapeSyntaxException(e);
-    }
-    throw new IllegalSchemaException();
-  }
-
-  ParsedPattern parseInclude(IncludedGrammar g) throws IllegalSchemaException {
-    try {
-      ParsedPattern p = IncludedGrammar(g);
-      if (!hadError)
-        return p;
-    }
-    catch (ParseException e) {
-      error("syntax_error", e.getMessage(), e.currentToken.next);
-    }
-    catch (EscapeSyntaxException e) {
-      reportEscapeSyntaxException(e);
-    }
-    throw new IllegalSchemaException();
-  }
-
-  private void checkNsName(int context, LocatedString ns) {
-    if ((context & IN_NS_NAME) != 0)
-      error("ns_name_except_contains_ns_name", ns.getToken());
-  }
-
-  private void checkAnyName(int context, Token t) {
-    if ((context & IN_NS_NAME) != 0)
-      error("ns_name_except_contains_any_name", t);
-    if ((context & IN_ANY_NAME) != 0)
-      error("any_name_except_contains_any_name", t);
-  }
-
-  private void error(String key, Token tok) {
-    doError(localizer.message(key), tok);
-  }
-
-  private void error(String key, String arg, Token tok) {
-    doError(localizer.message(key, arg), tok);
-  }
-
-  private void error(String key, String arg1, String arg2, Token tok) {
-    doError(localizer.message(key, arg1, arg2), tok);
-  }
-
-  private void doError(String message, Token tok) {
-    hadError = true;
-    if (eh != null) {
-      LocatorImpl loc = new LocatorImpl();
-      loc.setLineNumber(tok.beginLine);
-      loc.setColumnNumber(tok.beginColumn);
-      loc.setSystemId(sourceUri);
-      try {
-	eh.error(new SAXParseException(message, loc));
-      }
-      catch (SAXException se) {
-	throw new BuildException(se);
-      }
-    }
-  }
-
-  private void reportEscapeSyntaxException(EscapeSyntaxException e) {
-    if (eh != null) {
-      LocatorImpl loc = new LocatorImpl();
-      loc.setLineNumber(e.getLineNumber());
-      loc.setColumnNumber(e.getColumnNumber());
-      loc.setSystemId(sourceUri);
-      try {
-	eh.error(new SAXParseException(localizer.message(e.getKey()), loc));
-      }
-      catch (SAXException se) {
-	throw new BuildException(se);
-      }
-    }
-  }
-
-  private static String unquote(String s) {
-    if (s.length() >= 6 && s.charAt(0) == s.charAt(1)) {
-      s = s.replace('\u0000', '\n');
-      return s.substring(3, s.length() - 3);
-    }
-    else
-      return s.substring(1, s.length() - 1);
-  }
-
-  Location makeLocation(Token t) {
-    return sb.makeLocation(sourceUri, t.beginLine, t.beginColumn);
-  }
-
-  private static ParsedPattern[] addPattern(ParsedPattern[] patterns, int i, ParsedPattern p) {
-    if (i >= patterns.length) {
-      ParsedPattern[] oldPatterns = patterns;
-      patterns = new ParsedPattern[oldPatterns.length*2];
-      System.arraycopy(oldPatterns, 0, patterns, 0, oldPatterns.length);
-    }
-    patterns[i] = p;
-    return patterns;
-  }
-
-  String getCompatibilityPrefix() {
-    if (compatibilityPrefix == null) {
-      compatibilityPrefix = "a";
-      while (namespaceTable.get(compatibilityPrefix) != null)
-        compatibilityPrefix = compatibilityPrefix + "a";
-    }
-    return compatibilityPrefix;
-  }
-
-  public String resolveNamespacePrefix(String prefix) {
-    String result = (String)namespaceTable.get(prefix);
-    if (result.length() == 0)
-      return null;
-    return result;
-  }
-
-  public Enumeration prefixes() {
-    return namespaceTable.keys();
-  }
-
-  public String getBaseUri() {
-    return sourceUri;
-  }
-
-  public boolean isUnparsedEntity(String entityName) {
-    return false;
-  }
-
-  public boolean isNotation(String notationName) {
-    return false;
-  }
-
-  public Context copy() {
-    return this;
-  }
-
-  private Context getContext() {
-    return this;
-  }
-
-  private CommentList getComments() {
-    return getComments(getTopLevelComments());
-  }
-
-  private CommentList topLevelComments;
-
-  private CommentList getTopLevelComments() {
-    CommentList tem = topLevelComments;
-    topLevelComments = null;
-    return tem;
-  }
-
-  private void noteTopLevelComments() {
-    topLevelComments = getComments(topLevelComments);
-  }
-
-  private void topLevelComments(GrammarSection section) {
-    section.topLevelComment(getComments(null));
-  }
-
-  private Token lastCommentSourceToken = null;
-
-  private CommentList getComments(CommentList comments) {
-    Token nextToken = getToken(1);
-    if (lastCommentSourceToken != nextToken) {
-      if (lastCommentSourceToken == null)
-        lastCommentSourceToken = token;
-      do {
-	lastCommentSourceToken = lastCommentSourceToken.next;
-	Token t = lastCommentSourceToken.specialToken;
-	if (t != null) {
-	  while (t.specialToken != null)
-	    t = t.specialToken;
-	  if (comments == null)
-	    comments = sb.makeCommentList();
-	  for (; t != null; t = t.next) {
-            String s = mungeComment(t.image);
-            Location loc = makeLocation(t);
-            if (t.next != null
-                && t.next.kind == CompactSyntaxConstants.SINGLE_LINE_COMMENT_CONTINUE) {
-              StringBuffer buf = new StringBuffer(s);
-              do {
-                t = t.next;
-                buf.append('\n');
-                buf.append(mungeComment(t.image));
-              } while (t.next != null
-                       && t.next.kind == CompactSyntaxConstants.SINGLE_LINE_COMMENT_CONTINUE);
-              s = buf.toString();
-            }
-	    comments.addComment(s, loc);
-          }
-	}
-      } while (lastCommentSourceToken != nextToken);
-    }
-    return comments;
-  }
-
-  private ParsedPattern afterComments(ParsedPattern p) {
-    CommentList comments = getComments(null);
-    if (comments == null)
-      return p;
-    return sb.commentAfter(p, comments);
-  }
-
-  private ParsedNameClass afterComments(ParsedNameClass nc) {
-    CommentList comments = getComments(null);
-    if (comments == null)
-      return nc;
-    return ncb.commentAfter(nc, comments);
-  }
-
-  private static String mungeComment(String image) {
-    int i = image.indexOf('#') + 1;
-    while (i < image.length() && image.charAt(i) == '#')
-      i++;
-    if (i < image.length() && image.charAt(i) == ' ')
-      i++;
-    return image.substring(i);
-  }
-
-  private Annotations getCommentsAsAnnotations() {
-    CommentList comments = getComments();
-    if (comments == null)
-      return null;
-    return sb.makeAnnotations(comments, getContext());
-  }
-
-  private Annotations addCommentsToChildAnnotations(Annotations a) {
-    CommentList comments = getComments();
-    if (comments == null)
-      return a;
-    if (a == null)
-      a = sb.makeAnnotations(null, getContext());
-    a.addComment(comments);
-    return a;
-  }
-
-  private Annotations addCommentsToLeadingAnnotations(Annotations a) {
-    CommentList comments = getComments();
-    if (comments == null)
-      return a;
-    if (a == null)
-      return sb.makeAnnotations(comments, getContext());
-    a.addLeadingComment(comments);
-    return a;
-  }
-
-  private Annotations getTopLevelCommentsAsAnnotations() {
-    CommentList comments = getTopLevelComments();
-    if (comments == null)
-      return null;
-    return sb.makeAnnotations(comments, getContext());
-  }
-
-  private void clearAttributeList() {
-    attributeNameTable.clear();
-  }
-
-  private void addAttribute(Annotations a, String ns, String localName, String prefix, String value, Token tok) {
-    String key = ns + "#" + localName;
-    if (attributeNameTable.get(key) != null)
-      error("duplicate_attribute", ns, localName, tok);
-    else {
-      attributeNameTable.put(key, key);
-      a.addAttribute(ns, localName, prefix, value, makeLocation(tok));
-    }
-  }
-
-  private void checkExcept(Token[] except) {
-    if (except[0] != null)
-      error("except_missing_parentheses", except[0]);
-  }
-
-  private String lookupPrefix(String prefix, Token t) {
-    String ns = (String)namespaceTable.get(prefix);
-    if (ns == null) {
-      error("undeclared_prefix", prefix, t);
-      return "#error";
-    }
-    return ns;
-  }
-  private String lookupDatatype(String prefix, Token t) {
-    String ns = (String)datatypesTable.get(prefix);
-    if (ns == null) {
-      error("undeclared_prefix", prefix, t);
-      return ""; // XXX
-    }
-    return ns;
-  }
-  private String resolve(String str) {
-    try {
-     return new URL(new URL(sourceUri), str).toString();
-    }
-    catch (MalformedURLException e) { }
-    return str;
-  }
-}
-
-PARSER_END(CompactSyntax)
-
-ParsedPattern Input(Scope scope) :
-{
-  ParsedPattern p;
-}
-{
-  Preamble()
-  (LOOKAHEAD(TopLevelLookahead()) p = TopLevelGrammar(scope)
-   | p = Expr(true, scope, null, null) { p = afterComments(p); } <EOF>)
-  { return p; }
-}
-
-void TopLevelLookahead() :
-{}
-{
-  <PREFIXED_NAME> "["
-  | Identifier() ("[" | "=" | "&=" | "|=")
-  | LookaheadGrammarKeyword()
-  | LookaheadBody() LookaheadAfterAnnotations()
-  | LookaheadDocumentation() (LookaheadBody())? LookaheadAfterAnnotations()
-}
-
-void LookaheadAfterAnnotations() :
-{}
-{
-  Identifier() ("=" | "&=" | "|=")
-  | LookaheadGrammarKeyword()
-}
-
-void LookaheadGrammarKeyword() :
-{}
-{
-  "start" | "div" | "include"
-}
-
-void LookaheadDocumentation() :
-{}
-{
-  ((<DOCUMENTATION> | <DOCUMENTATION_AFTER_SINGLE_LINE_COMMENT>) (<DOCUMENTATION_CONTINUE>)*)+
-}
-
-void LookaheadBody() :
-{}
-{
-  "["
-   (<PREFIXED_NAME> | UnprefixedName() | "=" | <LITERAL> | "~" | LookaheadBody() )*
-  "]"
-}
-
-ParsedPattern IncludedGrammar(IncludedGrammar g) :
-{
-  Annotations a;
-  ParsedPattern p;
-}
-{
-  Preamble()
-  (LOOKAHEAD(TopLevelLookahead()) a = GrammarBody(g, g, getTopLevelCommentsAsAnnotations())
-   | a = Annotations() "grammar" "{" a = GrammarBody(g, g, a) { topLevelComments(g); } "}")
-  { p = afterComments(g.endIncludedGrammar(sb.makeLocation(sourceUri, 1, 1), a)); }
-  <EOF>
-  { return p; }
-}
-
-ParsedPattern TopLevelGrammar(Scope scope) :
-{
-  Annotations a = getTopLevelCommentsAsAnnotations();
-  Grammar g;
-  ParsedPattern p;
-}
-{
-  { g = sb.makeGrammar(scope); }
-  a = GrammarBody(g, g, a)
-  { p = afterComments(g.endGrammar(sb.makeLocation(sourceUri, 1, 1), a)); }
-  <EOF>
-  { return p; }
-}
-
-void Preamble() :
-{}
-{
-  (NamespaceDecl() | DatatypesDecl())*
-  {
-    namespaceTable.put("xml", WellKnownNamespaces.XML);
-    if (datatypesTable.get("xsd") == null)
-      datatypesTable.put("xsd", WellKnownNamespaces.XML_SCHEMA_DATATYPES);
-  }
-}
-
-void NamespaceDecl() :
-{
-  LocatedString prefix = null;
-  boolean isDefault = false;
-  String namespaceName;
-}
-{
-  { noteTopLevelComments(); }
-  (("namespace" prefix = UnprefixedName())
-    | ("default" { isDefault = true; }
-      "namespace" (prefix = UnprefixedName())?))
-  "="
-  namespaceName = NamespaceName()
-  {
-    if (isDefault)
-      defaultNamespace = namespaceName;
-    if (prefix != null) {
-      if (prefix.getString().equals("xmlns"))
-        error("xmlns_prefix", prefix.getToken());
-      else if (prefix.getString().equals("xml")) {
-        if (!namespaceName.equals(WellKnownNamespaces.XML))
-          error("xml_prefix_bad_uri", prefix.getToken());
-      }
-      else if (namespaceName.equals(WellKnownNamespaces.XML))
-        error("xml_uri_bad_prefix", prefix.getToken());
-      else {
-        if (namespaceName.equals(WellKnownNamespaces.RELAX_NG_COMPATIBILITY_ANNOTATIONS))
-          compatibilityPrefix = prefix.getString();
-        namespaceTable.put(prefix.getString(), namespaceName);
-      }
-    }
-  }
-}
-
-String NamespaceName() :
-{
-  String r;
-}
-{
-  (r = Literal() | "inherit" { r = this.inheritedNs; })
-  { return r; }
-}
-
-void DatatypesDecl() :
-{
-  LocatedString prefix;
-  String uri;
-}
-{
-  { noteTopLevelComments(); }
-  "datatypes" prefix = UnprefixedName() "=" uri = Literal()
-  {
-    datatypesTable.put(prefix.getString(), uri);
-  }
-}
-
-ParsedPattern AnnotatedPrimaryExpr(boolean topLevel, Scope scope, Token[] except) :
-{
-  Annotations a;
-  ParsedPattern p;
-  ParsedElementAnnotation e;
-  Token t;
-}
-{
-  a = Annotations()
-  p = PrimaryExpr(topLevel, scope, a, except)
-  ( t = <FANNOTATE> e = AnnotationElement(false) {
-       if (topLevel)
-         error("top_level_follow_annotation", t);
-       else
-         p = sb.annotateAfter(p, e);
-     })*
-  { return p; }
-}
-
-
-ParsedPattern PrimaryExpr(boolean topLevel, Scope scope, Annotations a, Token[] except) :
-{
-  ParsedPattern p;
-}
-{
-  (p = ElementExpr(scope, a)
-   | p = AttributeExpr(scope, a)
-   | p = GrammarExpr(scope, a)
-   | p = ExternalRefExpr(scope, a)
-   | p = ListExpr(scope, a)
-   | p = MixedExpr(scope, a)
-   | p = ParenExpr(topLevel, scope, a)
-   | p = IdentifierExpr(scope, a)
-   | p = ParentExpr(scope, a)
-   | p = DataExpr(topLevel, scope, a, except)
-   | p = ValueExpr(topLevel, a)
-   | p = TextExpr(a)
-   | p = EmptyExpr(a)
-   | p = NotAllowedExpr(a))
-  { return p; }
-}
-
-ParsedPattern EmptyExpr(Annotations a) :
-{
-  Token t;
-}
-{
-  t = "empty"
-  { return sb.makeEmpty(makeLocation(t), a); }
-}
-
-ParsedPattern TextExpr(Annotations a) :
-{
-  Token t;
-}
-{
-  t = "text"
-  { return sb.makeText(makeLocation(t), a); }
-}
-
-ParsedPattern NotAllowedExpr(Annotations a) :
-{
-  Token t;
-}
-{
-  t = "notAllowed"
-  { return sb.makeNotAllowed(makeLocation(t), a); }
-}
-
-ParsedPattern Expr(boolean topLevel, Scope scope, Token t, Annotations a) :
-{
-  List patterns = new ArrayList();
-  ParsedPattern p;
-  boolean[] hadOccur = new boolean[1];
-  Token[] except = new Token[1];
-}
-{
-  p = UnaryExpr(topLevel, scope, hadOccur, except)
-  { patterns.add(p); }
-  (
-   { checkExcept(except); }
-   (t = "|" p = UnaryExpr(topLevel, scope, null, except)
-     { patterns.add(p); checkExcept(except); } )+
-    { p = sb.makeChoice(patterns, makeLocation(t), a); }
-    | (t = "&" p = UnaryExpr(topLevel, scope, null, except)
-     { patterns.add(p); checkExcept(except); } )+
-    { p = sb.makeInterleave(patterns, makeLocation(t), a); }
-    | (t = "," p = UnaryExpr(topLevel, scope, null, except)
-     { patterns.add(p); checkExcept(except); } )+
-    { p = sb.makeGroup(patterns, makeLocation(t), a); }
-  )?
-  {
-    if (patterns.size() == 1 && a != null) {
-      if (hadOccur[0])
-        p = sb.annotate(p, a);
-      else
-        p = sb.makeGroup(patterns, makeLocation(t), a);
-    }
-    return p;
-  }
-}
-
-ParsedPattern UnaryExpr(boolean topLevel, Scope scope, boolean[] hadOccur, Token[] except) :
-{
-  ParsedPattern p;
-  Token t;
-  ParsedElementAnnotation e;
-}
-{
-  p = AnnotatedPrimaryExpr(topLevel, scope, except)
-  (
-   {
-     if (hadOccur != null) hadOccur[0] = true;
-     p = afterComments(p);
-   }
-   (t = "+" { checkExcept(except); p = sb.makeOneOrMore(p, makeLocation(t), null); }
-    | t = "?" { checkExcept(except); p = sb.makeOptional(p, makeLocation(t), null); }
-    | t = "*" { checkExcept(except); p = sb.makeZeroOrMore(p, makeLocation(t), null); })
-   ( t = <FANNOTATE> e = AnnotationElement(false) {
-        if (topLevel)
-          error("top_level_follow_annotation", t);
-        else
-          p = sb.annotateAfter(p, e);
-     } )*
-  )?
-  { return p; }
-}
-
-ParsedPattern ElementExpr(Scope scope, Annotations a) :
-{
-  Token t;
-  ParsedNameClass nc;
-  ParsedPattern p;
-}
-{
-  t = "element"
-  nc = NameClass(IN_ELEMENT, null)
-  "{"
-  p = Expr(false, scope, null, null)
-  { p = afterComments(p); }
-  "}"
-  { return sb.makeElement(nc, p, makeLocation(t), a); }
-}
-
-ParsedPattern AttributeExpr(Scope scope, Annotations a) :
-{
-  Token t;
-  ParsedNameClass nc;
-  ParsedPattern p;
-}
-{
-  t = "attribute"
-  nc = NameClass(IN_ATTRIBUTE, null)
-  "{"
-  p = Expr(false, scope, null, null)
-  { p = afterComments(p); }
-  "}"
-  { return sb.makeAttribute(nc, p, makeLocation(t), a); }
-}
-
-ParsedNameClass NameClass(int context, Annotations[] pa) :
-{
-  Annotations a;
-  ParsedNameClass nc;
-}
-{
-  a = Annotations()
-  (nc = PrimaryNameClass(context, a) nc = AnnotateAfter(nc) nc = NameClassAlternatives(context, nc, pa)
-   | nc = AnyNameExceptClass(context, a, pa)
-   | nc = NsNameExceptClass(context, a, pa))
-  { return nc; }
-}
-
-ParsedNameClass AnnotateAfter(ParsedNameClass nc) :
-{
-  ParsedElementAnnotation e;
-}
-{
-  ( <FANNOTATE> e = AnnotationElement(false) { nc = ncb.annotateAfter(nc, e); })*
-  { return nc; }
-}
-
-ParsedNameClass NameClassAlternatives(int context, ParsedNameClass nc, Annotations[] pa) :
-{
-  Token t;
-  ParsedNameClass[] nameClasses;
-  int nNameClasses;
-}
-{
-  (
-    {
-      nameClasses = new ParsedNameClass[2];
-      nameClasses[0] = nc;
-      nNameClasses = 1;
-    }
-    (t = "|" nc = BasicNameClass(context) nc = AnnotateAfter(nc)
-    {
-      if (nNameClasses >= nameClasses.length) {
-	ParsedNameClass[] oldNameClasses = nameClasses;
-	nameClasses = new ParsedNameClass[oldNameClasses.length*2];
-	System.arraycopy(oldNameClasses, 0, nameClasses, 0, oldNameClasses.length);
-      }
-      nameClasses[nNameClasses++] = nc;
-    })+
-    {
-      Annotations a;
-      if (pa == null)
-        a = null;
-      else {
-        a = pa[0];
-        pa[0] = null;
-      }
-      nc = ncb.makeChoice(Arrays.asList(nameClasses).subList(0,nNameClasses), makeLocation(t), a);
-    }
-  )?
-  { return nc; }
-}
-
-ParsedNameClass BasicNameClass(int context) :
-{
-  Annotations a;
-  ParsedNameClass nc;
-}
-{
-  a = Annotations()
-  (nc = PrimaryNameClass(context, a)
-   | nc = OpenNameClass(context, a))
-  { return nc; }
-}
-
-ParsedNameClass PrimaryNameClass(int context, Annotations a) :
-{
-  ParsedNameClass nc;
-}
-{
-  (nc = UnprefixedNameClass(context, a)
-   | nc = PrefixedNameClass(a)
-   | nc = ParenNameClass(context, a))
-  { return nc; }
-}
-
-ParsedNameClass OpenNameClass(int context, Annotations a) :
-{
-  Token t;
-  LocatedString ns;
-}
-{
-  ns = NsName() { checkNsName(context, ns); return ncb.makeNsName(ns.getString(), ns.getLocation(), a); }
-  | t = "*" { checkAnyName(context, t); return ncb.makeAnyName(makeLocation(t), a); }
-}
-
-
-ParsedNameClass UnprefixedNameClass(int context, Annotations a) :
-{
-  LocatedString name;
-}
-{
-  name = UnprefixedName()
-  {
-    String ns;
-    if ((context & (IN_ATTRIBUTE|IN_ELEMENT)) == IN_ATTRIBUTE)
-      ns = "";
-    else
-      ns = defaultNamespace;
-    return ncb.makeName(ns, name.getString(), null, name.getLocation(), a);
-  }
-}
-
-ParsedNameClass PrefixedNameClass(Annotations a) :
-{
-  Token t;
-}
-{
-  t = <PREFIXED_NAME>
-  {
-    String qn = t.image;
-    int colon = qn.indexOf(':');
-    String prefix = qn.substring(0, colon);
-    return ncb.makeName(lookupPrefix(prefix, t), qn.substring(colon + 1), prefix, makeLocation(t), a);
-  }
-}
-
-ParsedNameClass NsNameExceptClass(int context, Annotations a, Annotations[] pa) :
-{
-  LocatedString ns;
-  ParsedNameClass nc;
-}
-{
-  ns = NsName()
-  { checkNsName(context, ns); }
-  (nc = ExceptNameClass(context | IN_NS_NAME)
-   { nc = ncb.makeNsName(ns.getString(), nc, ns.getLocation(), a); }
-   nc = AnnotateAfter(nc)
-  | { nc = ncb.makeNsName(ns.getString(), ns.getLocation(), a); }
-    nc = AnnotateAfter(nc)
-    nc = NameClassAlternatives(context, nc, pa))
-  { return nc; }
-}
-
-LocatedString NsName() :
-{
-  Token t;
-}
-{
-  t = <PREFIX_STAR>
-  {
-    String qn = t.image;
-    String prefix = qn.substring(0, qn.length() - 2);
-    return new LocatedString(lookupPrefix(prefix, t), t);
-  }
-}
-
-ParsedNameClass AnyNameExceptClass(int context, Annotations a, Annotations[] pa) :
-{
-  Token t;
-  ParsedNameClass nc;
-}
-{
-  t = "*"
-  { checkAnyName(context, t); }
-  (nc = ExceptNameClass(context | IN_ANY_NAME)
-   { nc = ncb.makeAnyName(nc, makeLocation(t), a); }
-   nc = AnnotateAfter(nc)
-  | { nc = ncb.makeAnyName(makeLocation(t), a); }
-    nc = AnnotateAfter(nc)
-    nc = NameClassAlternatives(context, nc, pa))
-  { return nc; }
-}
-
-ParsedNameClass ParenNameClass(int context, Annotations a) :
-{
-  Token t;
-  ParsedNameClass nc;
-  Annotations[] pa = new Annotations[]{ a };
-}
-{
-  t = "(" nc = NameClass(context, pa) { nc = afterComments(nc); } ")"
-  {
-    if (pa[0] != null)
-      nc = ncb.makeChoice(Collections.singletonList(nc), makeLocation(t), pa[0]);
-    return nc;
-  }
-}
-
-ParsedNameClass ExceptNameClass(int context) :
-{
-  ParsedNameClass nc;
-}
-{
-  "-" nc = BasicNameClass(context)
-  { return nc; }
-}
-
-ParsedPattern ListExpr(Scope scope, Annotations a) :
-{
-  Token t;
-  ParsedPattern p;
-}
-{
-  t = "list"
-  "{"
-  p = Expr(false, scope, null, null)
-  { p = afterComments(p); }
-  "}"
-  { return sb.makeList(p, makeLocation(t), a); }
-}
-
-ParsedPattern MixedExpr(Scope scope, Annotations a) :
-{
-  Token t;
-  ParsedPattern p;
-}
-{
-  t = "mixed"
-  "{"
-  p = Expr(false, scope, null, null)
-  { p = afterComments(p); }
-  "}"
-  { return sb.makeMixed(p, makeLocation(t), a); }
-}
-
-ParsedPattern GrammarExpr(Scope scope, Annotations a) :
-{
-  Token t;
-  Grammar g;
-}
-{
-  t = "grammar" { g = sb.makeGrammar(scope); }
-  "{" a = GrammarBody(g, g, a) { topLevelComments(g); } "}"
-  { return g.endGrammar(makeLocation(t), a); }
-}
-
-ParsedPattern ParenExpr(boolean topLevel, Scope scope, Annotations a) :
-{
-  Token t;
-  ParsedPattern p;
-}
-{
-  t = "(" p = Expr(topLevel, scope, t, a) { p = afterComments(p); } ")"
-  { return p; }
-}
-
-Annotations GrammarBody(GrammarSection section, Scope scope, Annotations a) :
-{
-  ParsedElementAnnotation e;
-}
-{
-  (LOOKAHEAD(2) e = AnnotationElementNotKeyword()
-   { if (a == null) a = sb.makeAnnotations(null, getContext()); a.addElement(e); })*
-  (GrammarComponent(section, scope))*
-  { return a; }
-}
-
-void GrammarComponent(GrammarSection section, Scope scope) :
-{
-  ParsedElementAnnotation e;
-  Annotations a;
-}
-{
-  (a = Annotations()
-   (Definition(section, scope, a)
-    | Include(section, scope, a)
-    | Div(section, scope, a)))
-  (LOOKAHEAD(2) e = AnnotationElementNotKeyword() { section.topLevelAnnotation(e); })*
-}
-
-void Definition(GrammarSection section, Scope scope, Annotations a) :
-{}
-{
-  (Define(section, scope, a) | Start(section, scope, a))
-}
-
-void Start(GrammarSection section, Scope scope, Annotations a) :
-{
-  Token t;
-  GrammarSection.Combine combine;
-  ParsedPattern p;
-}
-{
-  t = "start" combine = AssignOp() p = Expr(false, scope, null, null)
-  { section.define(GrammarSection.START, combine, p, makeLocation(t), a); }
-}
-
-void Define(GrammarSection section, Scope scope, Annotations a) :
-{
-  LocatedString name;
-  GrammarSection.Combine combine;
-  ParsedPattern p;
-}
-{
-  name = Identifier() combine = AssignOp() p = Expr(false, scope, null, null)
-  { section.define(name.getString(), combine, p, name.getLocation(), a); }
-}
-
-GrammarSection.Combine AssignOp() :
-{}
-{
-  "=" { return null; }
-  | "|=" { return GrammarSection.COMBINE_CHOICE; }
-  | "&=" { return GrammarSection.COMBINE_INTERLEAVE; }
-}
-
-void Include(GrammarSection section, Scope scope, Annotations a) :
-{
-  Token t;
-  String href;
-  String ns;
-  Include include = section.makeInclude();
-}
-{
-  t = "include" href = Literal()
-  ns = Inherit()
-  ("{" a = IncludeBody(include, scope, a) { topLevelComments(include); } "}")?
-  {
-    try {
-      include.endInclude(parseable, resolve(href), ns, makeLocation(t), a);
-    }
-    catch (IllegalSchemaException e) { }
-  }
-}
-
-Annotations IncludeBody(GrammarSection section, Scope scope, Annotations a) :
-{
-  ParsedElementAnnotation e;
-}
-{
-  (LOOKAHEAD(2) e = AnnotationElementNotKeyword()
-   { if (a == null) a = sb.makeAnnotations(null, getContext()); a.addElement(e); })*
-  (IncludeComponent(section, scope))*
-  { return a; }
-}
-
-
-void IncludeComponent(GrammarSection section, Scope scope) :
-{
-  ParsedElementAnnotation e;
-  Annotations a;
-}
-{
-  (a = Annotations() (Definition(section, scope, a)
-                      | IncludeDiv(section, scope, a)))
-  (LOOKAHEAD(2) e = AnnotationElementNotKeyword() { section.topLevelAnnotation(e); })*
-}
-
-void Div(GrammarSection section, Scope scope, Annotations a) :
-{
-  Token t;
-  Div div = section.makeDiv();
-}
-{
-  t = "div" "{" a = GrammarBody(div, scope, a) { topLevelComments(div); } "}"
-  { div.endDiv(makeLocation(t), a); }
-}
-
-void IncludeDiv(GrammarSection section, Scope scope, Annotations a) :
-{
-  Token t;
-  Div div = section.makeDiv();
-}
-{
-  t = "div" "{" a = IncludeBody(div, scope, a) { topLevelComments(div); } "}"
-  { div.endDiv(makeLocation(t), a); }
-}
-
-ParsedPattern ExternalRefExpr(Scope scope, Annotations a) :
-{
-  Token t;
-  String href;
-  String ns;
-}
-{
-  t = "external" href = Literal()
-  ns = Inherit()
-  {
-    try {
-      return sb.makeExternalRef(parseable, resolve(href), ns, scope, makeLocation(t), a);
-    }
-    catch (IllegalSchemaException e) {
-      return sb.makeErrorPattern();
-    }
-  }
-}
-
-String Inherit() :
-{
-  String ns = null;
-}
-{
-  ("inherit" "=" ns = Prefix())?
-  {
-    if (ns == null)
-      ns = defaultNamespace;
-    return ns;
-  }
-}
-
-ParsedPattern ParentExpr(Scope scope, Annotations a) :
-{
-  LocatedString name;
-}
-{
-  "parent" { a = addCommentsToChildAnnotations(a); } name = Identifier()
-  {
-    if(scope==null) {
-      error("parent_ref_outside_grammar",name.getToken());
-      return sb.makeErrorPattern();
-    } else {
-      return scope.makeParentRef(name.getString(), name.getLocation(), a);
-    }
-  }
-}
-
-ParsedPattern IdentifierExpr(Scope scope, Annotations a) :
-{
-  LocatedString name;
-}
-{
-  name = Identifier()
-  {
-    if(scope==null) {
-      error("ref_outside_grammar",name.getToken());
-      return sb.makeErrorPattern();
-    } else {
-      return scope.makeRef(name.getString(), name.getLocation(), a);
-    }
-  }
-}
-
-ParsedPattern ValueExpr(boolean topLevel, Annotations a) :
-{
-  LocatedString s;
-}
-{
-  s = LocatedLiteral()
-  {
-    if (topLevel && annotationsIncludeElements) {
-      error("top_level_follow_annotation", s.getToken());
-      a = null;
-    }
-    return sb.makeValue("", "token", s.getString(), getContext(), defaultNamespace, s.getLocation(), a);
-  }
-}
-
-ParsedPattern DataExpr(boolean topLevel, Scope scope, Annotations a, Token[] except) :
-{
-  Token datatypeToken;
-  Location loc;
-  String datatype;
-  String datatypeUri = null;
-  String s = null;
-  ParsedPattern e = null;
-  DataPatternBuilder dpb;
-}
-{
-  datatypeToken = DatatypeName()
-  {
-    datatype = datatypeToken.image;
-    loc = makeLocation(datatypeToken);
-    int colon = datatype.indexOf(':');
-    if (colon < 0)
-      datatypeUri = "";
-    else {
-      String prefix = datatype.substring(0, colon);
-      datatypeUri = lookupDatatype(prefix, datatypeToken);
-      datatype = datatype.substring(colon + 1);
-    }
-  }
-  ((s = Literal()
-    {
-      if (topLevel && annotationsIncludeElements) {
-        error("top_level_follow_annotation", datatypeToken);
-        a = null;
-      }
-      return sb.makeValue(datatypeUri, datatype, s, getContext(), defaultNamespace, loc, a);
-    }
-  )
-  | ( { dpb = sb.makeDataPatternBuilder(datatypeUri, datatype, loc); }
-      ( (Params(dpb) (e = Except(scope, except))?)
-        | (e = Except(scope, except))?)
-      { return e == null ? dpb.makePattern(loc, a) : dpb.makePattern(e, loc, a); }))
-}
-
-Token DatatypeName() :
-{
-  Token t;
-}
-{
-  (t = "string" | t = "token" | t = <PREFIXED_NAME>)
-  { return t; }
-}
-
-LocatedString Identifier() :
-{
-  LocatedString s;
-  Token t;
-}
-{
-  (t = <IDENTIFIER> { s = new LocatedString(t.image, t); }
-  | t = <ESCAPED_IDENTIFIER> { s = new LocatedString(t.image.substring(1), t); })
-  { return s; }
-}
-
-String Prefix() :
-{
-  Token t;
-  String prefix;
-}
-{
-  (t = <IDENTIFIER> { prefix = t.image; }
-  | t = <ESCAPED_IDENTIFIER> { prefix = t.image.substring(1); }
-  | t = Keyword() { prefix = t.image; })
-  { return lookupPrefix(prefix, t); }
-}
-
-LocatedString UnprefixedName() :
-{
-  LocatedString s;
-  Token t;
-}
-{
-  (s = Identifier()
-   | t = Keyword() { s = new LocatedString(t.image, t); })
-  { return s; }
-}
-
-void Params(DataPatternBuilder dpb) :
-{}
-{
-  "{" (Param(dpb))* "}"
-}
-
-void Param(DataPatternBuilder dpb) :
-{
-  LocatedString name;
-  Annotations a;
-  String value;
-}
-{
-  a = Annotations() name = UnprefixedName() "=" { a = addCommentsToLeadingAnnotations(a); } value = Literal()
-  { dpb.addParam(name.getString(), value, getContext(), defaultNamespace, name.getLocation(), a); }
-}
-
-ParsedPattern Except(Scope scope, Token[] except) :
-{
-  Annotations a;
-  ParsedPattern p;
-  Token t;
-  Token[] innerExcept = new Token[1];
-}
-{
-  t = "-" a = Annotations() p = PrimaryExpr(false, scope, a, innerExcept)
-  {
-    checkExcept(innerExcept);
-    except[0] = t;
-    return p;
-  }
-}
-
-ParsedElementAnnotation Documentation() :
-{
-  CommentList comments = getComments();
-  ElementAnnotationBuilder eab;
-  Token t;
-}
-{
-  (t = <DOCUMENTATION> | t = <DOCUMENTATION_AFTER_SINGLE_LINE_COMMENT>)
-  {
-    eab = sb.makeElementAnnotationBuilder(WellKnownNamespaces.RELAX_NG_COMPATIBILITY_ANNOTATIONS,
-                                          "documentation",
-                                          getCompatibilityPrefix(),
-                                          makeLocation(t),
-                                          comments,
-                                          getContext());
-    eab.addText(mungeComment(t.image), makeLocation(t), null);
-  }
-  (t = <DOCUMENTATION_CONTINUE> { eab.addText("\n" + mungeComment(t.image), makeLocation(t), null); })*
-  { return eab.makeElementAnnotation(); }
-}
-
-Annotations Annotations() :
-{
-  CommentList comments = getComments();
-  Annotations a = null;
-  ParsedElementAnnotation e;
-}
-{
-  ( { a = sb.makeAnnotations(comments, getContext()); }
-    (e = Documentation() { a.addElement(e); })+
-    {
-      comments = getComments();
-      if (comments != null)
-        a.addLeadingComment(comments);
-    }
-  )?
-  ("[" { if (a == null) a = sb.makeAnnotations(comments, getContext()); clearAttributeList(); annotationsIncludeElements = false; }
-       (LOOKAHEAD(2) PrefixedAnnotationAttribute(a, false) )*
-       ( e = AnnotationElement(false) { a.addElement(e); annotationsIncludeElements = true; } )*
-       { a.addComment(getComments()); }
-  "]")?
-  {
-    if (a == null && comments != null)
-      a = sb.makeAnnotations(comments, getContext());
-    return a;
-  }
-}
-
-void AnnotationAttribute(Annotations a) :
-{}
-{
-  PrefixedAnnotationAttribute(a, true) | UnprefixedAnnotationAttribute(a)
-}
-
-void PrefixedAnnotationAttribute(Annotations a, boolean nested) :
-{
-  Token t;
-  String value;
-}
-{
-  t = <PREFIXED_NAME> "=" value = Literal()
-  {
-    String qn = t.image;
-    int colon = qn.indexOf(':');
-    String prefix = qn.substring(0, colon);
-    String ns = lookupPrefix(prefix, t);
-    if (ns == this.inheritedNs)
-      error("inherited_annotation_namespace", t);
-    else if (ns.length() == 0 && !nested)
-      error("unqualified_annotation_attribute", t);
-    else if (ns.equals(WellKnownNamespaces.RELAX_NG) && !nested)
-      error("relax_ng_namespace", t);
-    /*else if (ns.length() == 0
-             && qn.length() - colon - 1 == 5
-             && qn.regionMatches(colon + 1, "xmlns", 0, 5))
-      error("xmlns_annotation_attribute", t);*/
-    else if (ns.equals(WellKnownNamespaces.XMLNS))
-      error("xmlns_annotation_attribute_uri", t);
-    else {
-      if (ns.length() == 0)
-	prefix = null;
-      addAttribute(a, ns, qn.substring(colon + 1), prefix, value, t);
-    }
-  }
-}
-
-void UnprefixedAnnotationAttribute(Annotations a) :
-{
-  LocatedString name;
-  String value;
-}
-{
-  name = UnprefixedName() "=" value = Literal()
-  {
-    if (name.getString().equals("xmlns"))
-      error("xmlns_annotation_attribute", name.getToken());
-    else
-      addAttribute(a, "", name.getString(), null, value, name.getToken());
-  }
-}
-
-ParsedElementAnnotation AnnotationElement(boolean nested) :
-{
-  ParsedElementAnnotation a;
-}
-{
-  (a = PrefixedAnnotationElement(nested)
-   | a = UnprefixedAnnotationElement())
-  { return a; }
-}
-
-ParsedElementAnnotation AnnotationElementNotKeyword() :
-{
-  ParsedElementAnnotation a;
-}
-{
-  (a = PrefixedAnnotationElement(false)
-   | a = IdentifierAnnotationElement())
-  { return a; }
-}
-
-ParsedElementAnnotation PrefixedAnnotationElement(boolean nested) :
-{
-  CommentList comments = getComments();
-  Token t;
-  ElementAnnotationBuilder eab;
-}
-{
-  t = <PREFIXED_NAME>
-  {
-    String qn = t.image;
-    int colon = qn.indexOf(':');
-    String prefix = qn.substring(0, colon);
-    String ns = lookupPrefix(prefix, t);
-    if (ns == this.inheritedNs) {
-      error("inherited_annotation_namespace", t);
-      ns = "";
-    }
-    else if (!nested && ns.equals(WellKnownNamespaces.RELAX_NG)) {
-      error("relax_ng_namespace", t);
-      ns = "";
-    }
-    else {
-      if (ns.length() == 0)
-        prefix = null;
-    }
-    eab = sb.makeElementAnnotationBuilder(ns, qn.substring(colon + 1), prefix,
-					  makeLocation(t), comments, getContext());
-  }
-  AnnotationElementContent(eab)
-  { return eab.makeElementAnnotation(); }
-}
-
-ParsedElementAnnotation UnprefixedAnnotationElement() :
-{
-  CommentList comments = getComments();
-  LocatedString name;
-  ElementAnnotationBuilder eab;
-}
-{
-  name = UnprefixedName()
-  {
-    eab = sb.makeElementAnnotationBuilder("", name.getString(), null,
-                                          name.getLocation(), comments, getContext());
-  }
-  AnnotationElementContent(eab)
-  { return eab.makeElementAnnotation(); }
-}
-
-ParsedElementAnnotation IdentifierAnnotationElement() :
-{
-  CommentList comments = getComments();
-  LocatedString name;
-  ElementAnnotationBuilder eab;
-}
-{
-  name = Identifier()
-  {
-    eab = sb.makeElementAnnotationBuilder("", name.getString(), null,
-                                          name.getLocation(), comments, getContext());
-  }
-  AnnotationElementContent(eab)
-  { return eab.makeElementAnnotation(); }
-}
-
-void AnnotationElementContent(ElementAnnotationBuilder eab) :
-{
-  ParsedElementAnnotation e;
-}
-{
-  "[" { clearAttributeList(); }
-  (LOOKAHEAD(2) AnnotationAttribute(eab))*
-  ((AnnotationElementLiteral(eab)
-    ("~" AnnotationElementLiteral(eab))*)
-   | e = AnnotationElement(true) { eab.addElement(e); })*
-  { eab.addComment(getComments()); }
-  "]"
-}
-
-void AnnotationElementLiteral(ElementAnnotationBuilder eab) :
-{
-  Token t;
-  CommentList comments = getComments();
-}
-{
-  t = <LITERAL> { eab.addText(unquote(t.image), makeLocation(t), comments); }
-}
-
-String Literal() :
-{
-  Token t;
-  String s;
-  StringBuffer buf;
-}
-{
-  t = <LITERAL>
-  {
-    s = unquote(t.image);
-  }
-  (
-    { buf = new StringBuffer(s); }
-    ("~" t = <LITERAL> { buf.append(unquote(t.image)); })+
-    { s = buf.toString(); }
-  )?
-  { return s; }
-}
-
-LocatedString LocatedLiteral() :
-{
-  Token t;
-  Token t2;
-  String s;
-  StringBuffer buf;
-}
-{
-  t = <LITERAL>
-  {
-    s = unquote(t.image);
-  }
-  (
-    { buf = new StringBuffer(s); }
-    ("~" t2 = <LITERAL> { buf.append(unquote(t2.image)); })+
-    { s = buf.toString(); }
-  )?
-  { return new LocatedString(s, t); }
-}
-
-Token Keyword() :
-{
-  Token t;
-}
-{
-  (t = "element"
-  | t = "attribute"
-  | t = "namespace"
-  | t = "list"
-  | t = "mixed"
-  | t = "grammar"
-  | t = "empty"
-  | t = "text"
-  | t = "parent"
-  | t = "external"
-  | t = "notAllowed"
-  | t = "start"
-  | t = "include"
-  | t = "default"
-  | t = "inherit"
-  | t = "string"
-  | t = "token"
-  | t = "datatypes"
-  | t = "div")
-  { return t; }
-}
-
-<*>
-SKIP: {
-  < #NEWLINE : [ "\u0000", "\n" ] >
-  | < #NOT_NEWLINE : ~[ "\u0000", "\n" ] >
-  | < WS: ([ "\u0000", " ", "\n", "\t" ])+ > : DEFAULT
-}
-
-TOKEN :
-{
-  < DOCUMENTATION: "##" (<NOT_NEWLINE>)* > : AFTER_DOCUMENTATION
-}
-
-<AFTER_DOCUMENTATION>
-TOKEN :
-{
-  < DOCUMENTATION_CONTINUE: <NEWLINE> ([" ", "\t"])* <DOCUMENTATION> >
-}
-
-SPECIAL_TOKEN:
-{
-  < SINGLE_LINE_COMMENT: "#" (<NOT_NEWLINE>)* > : AFTER_SINGLE_LINE_COMMENT
-}
-
-<AFTER_SINGLE_LINE_COMMENT>
-TOKEN :
-{
-  < DOCUMENTATION_AFTER_SINGLE_LINE_COMMENT: <NEWLINE> ([" ", "\t"])* <DOCUMENTATION> > : AFTER_DOCUMENTATION
-}
-
-<AFTER_SINGLE_LINE_COMMENT>
-SPECIAL_TOKEN :
-{
-  < SINGLE_LINE_COMMENT_CONTINUE: <NEWLINE> ([" ", "\t"])* <SINGLE_LINE_COMMENT> >
-}
-
-TOKEN :
-{
-  < #BASE_CHAR : [
-    "\u0041" - "\u005a",
-    "\u0061" - "\u007a",
-    "\u00c0" - "\u00d6",
-    "\u00d8" - "\u00f6",
-    "\u00f8" - "\u00ff",
-    "\u0100" - "\u0131",
-    "\u0134" - "\u013e",
-    "\u0141" - "\u0148",
-    "\u014a" - "\u017e",
-    "\u0180" - "\u01c3",
-    "\u01cd" - "\u01f0",
-    "\u01f4" - "\u01f5",
-    "\u01fa" - "\u0217",
-    "\u0250" - "\u02a8",
-    "\u02bb" - "\u02c1",
-    "\u0386",
-    "\u0388" - "\u038a",
-    "\u038c",
-    "\u038e" - "\u03a1",
-    "\u03a3" - "\u03ce",
-    "\u03d0" - "\u03d6",
-    "\u03da",
-    "\u03dc",
-    "\u03de",
-    "\u03e0",
-    "\u03e2" - "\u03f3",
-    "\u0401" - "\u040c",
-    "\u040e" - "\u044f",
-    "\u0451" - "\u045c",
-    "\u045e" - "\u0481",
-    "\u0490" - "\u04c4",
-    "\u04c7" - "\u04c8",
-    "\u04cb" - "\u04cc",
-    "\u04d0" - "\u04eb",
-    "\u04ee" - "\u04f5",
-    "\u04f8" - "\u04f9",
-    "\u0531" - "\u0556",
-    "\u0559",
-    "\u0561" - "\u0586",
-    "\u05d0" - "\u05ea",
-    "\u05f0" - "\u05f2",
-    "\u0621" - "\u063a",
-    "\u0641" - "\u064a",
-    "\u0671" - "\u06b7",
-    "\u06ba" - "\u06be",
-    "\u06c0" - "\u06ce",
-    "\u06d0" - "\u06d3",
-    "\u06d5",
-    "\u06e5" - "\u06e6",
-    "\u0905" - "\u0939",
-    "\u093d",
-    "\u0958" - "\u0961",
-    "\u0985" - "\u098c",
-    "\u098f" - "\u0990",
-    "\u0993" - "\u09a8",
-    "\u09aa" - "\u09b0",
-    "\u09b2",
-    "\u09b6" - "\u09b9",
-    "\u09dc" - "\u09dd",
-    "\u09df" - "\u09e1",
-    "\u09f0" - "\u09f1",
-    "\u0a05" - "\u0a0a",
-    "\u0a0f" - "\u0a10",
-    "\u0a13" - "\u0a28",
-    "\u0a2a" - "\u0a30",
-    "\u0a32" - "\u0a33",
-    "\u0a35" - "\u0a36",
-    "\u0a38" - "\u0a39",
-    "\u0a59" - "\u0a5c",
-    "\u0a5e",
-    "\u0a72" - "\u0a74",
-    "\u0a85" - "\u0a8b",
-    "\u0a8d",
-    "\u0a8f" - "\u0a91",
-    "\u0a93" - "\u0aa8",
-    "\u0aaa" - "\u0ab0",
-    "\u0ab2" - "\u0ab3",
-    "\u0ab5" - "\u0ab9",
-    "\u0abd",
-    "\u0ae0",
-    "\u0b05" - "\u0b0c",
-    "\u0b0f" - "\u0b10",
-    "\u0b13" - "\u0b28",
-    "\u0b2a" - "\u0b30",
-    "\u0b32" - "\u0b33",
-    "\u0b36" - "\u0b39",
-    "\u0b3d",
-    "\u0b5c" - "\u0b5d",
-    "\u0b5f" - "\u0b61",
-    "\u0b85" - "\u0b8a",
-    "\u0b8e" - "\u0b90",
-    "\u0b92" - "\u0b95",
-    "\u0b99" - "\u0b9a",
-    "\u0b9c",
-    "\u0b9e" - "\u0b9f",
-    "\u0ba3" - "\u0ba4",
-    "\u0ba8" - "\u0baa",
-    "\u0bae" - "\u0bb5",
-    "\u0bb7" - "\u0bb9",
-    "\u0c05" - "\u0c0c",
-    "\u0c0e" - "\u0c10",
-    "\u0c12" - "\u0c28",
-    "\u0c2a" - "\u0c33",
-    "\u0c35" - "\u0c39",
-    "\u0c60" - "\u0c61",
-    "\u0c85" - "\u0c8c",
-    "\u0c8e" - "\u0c90",
-    "\u0c92" - "\u0ca8",
-    "\u0caa" - "\u0cb3",
-    "\u0cb5" - "\u0cb9",
-    "\u0cde",
-    "\u0ce0" - "\u0ce1",
-    "\u0d05" - "\u0d0c",
-    "\u0d0e" - "\u0d10",
-    "\u0d12" - "\u0d28",
-    "\u0d2a" - "\u0d39",
-    "\u0d60" - "\u0d61",
-    "\u0e01" - "\u0e2e",
-    "\u0e30",
-    "\u0e32" - "\u0e33",
-    "\u0e40" - "\u0e45",
-    "\u0e81" - "\u0e82",
-    "\u0e84",
-    "\u0e87" - "\u0e88",
-    "\u0e8a",
-    "\u0e8d",
-    "\u0e94" - "\u0e97",
-    "\u0e99" - "\u0e9f",
-    "\u0ea1" - "\u0ea3",
-    "\u0ea5",
-    "\u0ea7",
-    "\u0eaa" - "\u0eab",
-    "\u0ead" - "\u0eae",
-    "\u0eb0",
-    "\u0eb2" - "\u0eb3",
-    "\u0ebd",
-    "\u0ec0" - "\u0ec4",
-    "\u0f40" - "\u0f47",
-    "\u0f49" - "\u0f69",
-    "\u10a0" - "\u10c5",
-    "\u10d0" - "\u10f6",
-    "\u1100",
-    "\u1102" - "\u1103",
-    "\u1105" - "\u1107",
-    "\u1109",
-    "\u110b" - "\u110c",
-    "\u110e" - "\u1112",
-    "\u113c",
-    "\u113e",
-    "\u1140",
-    "\u114c",
-    "\u114e",
-    "\u1150",
-    "\u1154" - "\u1155",
-    "\u1159",
-    "\u115f" - "\u1161",
-    "\u1163",
-    "\u1165",
-    "\u1167",
-    "\u1169",
-    "\u116d" - "\u116e",
-    "\u1172" - "\u1173",
-    "\u1175",
-    "\u119e",
-    "\u11a8",
-    "\u11ab",
-    "\u11ae" - "\u11af",
-    "\u11b7" - "\u11b8",
-    "\u11ba",
-    "\u11bc" - "\u11c2",
-    "\u11eb",
-    "\u11f0",
-    "\u11f9",
-    "\u1e00" - "\u1e9b",
-    "\u1ea0" - "\u1ef9",
-    "\u1f00" - "\u1f15",
-    "\u1f18" - "\u1f1d",
-    "\u1f20" - "\u1f45",
-    "\u1f48" - "\u1f4d",
-    "\u1f50" - "\u1f57",
-    "\u1f59",
-    "\u1f5b",
-    "\u1f5d",
-    "\u1f5f" - "\u1f7d",
-    "\u1f80" - "\u1fb4",
-    "\u1fb6" - "\u1fbc",
-    "\u1fbe",
-    "\u1fc2" - "\u1fc4",
-    "\u1fc6" - "\u1fcc",
-    "\u1fd0" - "\u1fd3",
-    "\u1fd6" - "\u1fdb",
-    "\u1fe0" - "\u1fec",
-    "\u1ff2" - "\u1ff4",
-    "\u1ff6" - "\u1ffc",
-    "\u2126",
-    "\u212a" - "\u212b",
-    "\u212e",
-    "\u2180" - "\u2182",
-    "\u3041" - "\u3094",
-    "\u30a1" - "\u30fa",
-    "\u3105" - "\u312c",
-    "\uac00" - "\ud7a3"
-    ] >
-  | < #IDEOGRAPHIC : [
-    "\u4e00" - "\u9fa5",
-    "\u3007",
-    "\u3021" - "\u3029"
-    ] >
-  | < #LETTER : (<BASE_CHAR> | <IDEOGRAPHIC>) >
-  | < #COMBINING_CHAR : [
-    "\u0300" - "\u0345",
-    "\u0360" - "\u0361",
-    "\u0483" - "\u0486",
-    "\u0591" - "\u05a1",
-    "\u05a3" - "\u05b9",
-    "\u05bb" - "\u05bd",
-    "\u05bf",
-    "\u05c1" - "\u05c2",
-    "\u05c4",
-    "\u064b" - "\u0652",
-    "\u0670",
-    "\u06d6" - "\u06dc",
-    "\u06dd" - "\u06df",
-    "\u06e0" - "\u06e4",
-    "\u06e7" - "\u06e8",
-    "\u06ea" - "\u06ed",
-    "\u0901" - "\u0903",
-    "\u093c",
-    "\u093e" - "\u094c",
-    "\u094d",
-    "\u0951" - "\u0954",
-    "\u0962" - "\u0963",
-    "\u0981" - "\u0983",
-    "\u09bc",
-    "\u09be",
-    "\u09bf",
-    "\u09c0" - "\u09c4",
-    "\u09c7" - "\u09c8",
-    "\u09cb" - "\u09cd",
-    "\u09d7",
-    "\u09e2" - "\u09e3",
-    "\u0a02",
-    "\u0a3c",
-    "\u0a3e",
-    "\u0a3f",
-    "\u0a40" - "\u0a42",
-    "\u0a47" - "\u0a48",
-    "\u0a4b" - "\u0a4d",
-    "\u0a70" - "\u0a71",
-    "\u0a81" - "\u0a83",
-    "\u0abc",
-    "\u0abe" - "\u0ac5",
-    "\u0ac7" - "\u0ac9",
-    "\u0acb" - "\u0acd",
-    "\u0b01" - "\u0b03",
-    "\u0b3c",
-    "\u0b3e" - "\u0b43",
-    "\u0b47" - "\u0b48",
-    "\u0b4b" - "\u0b4d",
-    "\u0b56" - "\u0b57",
-    "\u0b82" - "\u0b83",
-    "\u0bbe" - "\u0bc2",
-    "\u0bc6" - "\u0bc8",
-    "\u0bca" - "\u0bcd",
-    "\u0bd7",
-    "\u0c01" - "\u0c03",
-    "\u0c3e" - "\u0c44",
-    "\u0c46" - "\u0c48",
-    "\u0c4a" - "\u0c4d",
-    "\u0c55" - "\u0c56",
-    "\u0c82" - "\u0c83",
-    "\u0cbe" - "\u0cc4",
-    "\u0cc6" - "\u0cc8",
-    "\u0cca" - "\u0ccd",
-    "\u0cd5" - "\u0cd6",
-    "\u0d02" - "\u0d03",
-    "\u0d3e" - "\u0d43",
-    "\u0d46" - "\u0d48",
-    "\u0d4a" - "\u0d4d",
-    "\u0d57",
-    "\u0e31",
-    "\u0e34" - "\u0e3a",
-    "\u0e47" - "\u0e4e",
-    "\u0eb1",
-    "\u0eb4" - "\u0eb9",
-    "\u0ebb" - "\u0ebc",
-    "\u0ec8" - "\u0ecd",
-    "\u0f18" - "\u0f19",
-    "\u0f35",
-    "\u0f37",
-    "\u0f39",
-    "\u0f3e",
-    "\u0f3f",
-    "\u0f71" - "\u0f84",
-    "\u0f86" - "\u0f8b",
-    "\u0f90" - "\u0f95",
-    "\u0f97",
-    "\u0f99" - "\u0fad",
-    "\u0fb1" - "\u0fb7",
-    "\u0fb9",
-    "\u20d0" - "\u20dc",
-    "\u20e1",
-    "\u302a" - "\u302f",
-    "\u3099",
-    "\u309a"
-    ] >
-  | < #DIGIT : [
-    "\u0030" - "\u0039",
-    "\u0660" - "\u0669",
-    "\u06f0" - "\u06f9",
-    "\u0966" - "\u096f",
-    "\u09e6" - "\u09ef",
-    "\u0a66" - "\u0a6f",
-    "\u0ae6" - "\u0aef",
-    "\u0b66" - "\u0b6f",
-    "\u0be7" - "\u0bef",
-    "\u0c66" - "\u0c6f",
-    "\u0ce6" - "\u0cef",
-    "\u0d66" - "\u0d6f",
-    "\u0e50" - "\u0e59",
-    "\u0ed0" - "\u0ed9",
-    "\u0f20" - "\u0f29"
-    ] >
-  | < #EXTENDER : [
-    "\u00b7",
-    "\u02d0",
-    "\u02d1",
-    "\u0387",
-    "\u0640",
-    "\u0e46",
-    "\u0ec6",
-    "\u3005",
-    "\u3031" - "\u3035",
-    "\u309d" - "\u309e",
-    "\u30fc" - "\u30fe"
-    ] >
-  | < #NMSTART : (<LETTER> | "_") >
-  | < #NMCHAR : (<LETTER> | <COMBINING_CHAR> | <EXTENDER> | <DIGIT> | "." | "-" | "_") >
-  | < #NCNAME: <NMSTART> (<NMCHAR>)* >
-}
-
-TOKEN :
-{
-  < IDENTIFIER: <NCNAME> >
-  | < ESCAPED_IDENTIFIER: "\\" <NCNAME> >
-  | < PREFIX_STAR: <NCNAME> ":*" >
-  | < PREFIXED_NAME: <NCNAME> ":" <NCNAME> >
-  | < LITERAL : ("\"" (~["\u0000", "\""])* "\"")
-                | ("'" (~["\u0000", "'"])* "'")
-                | ("\"\"\"" (~["\""]
-                             | ("\"" ~["\""])
-                             | ("\"\"" ~["\""]))* "\"\"\"")
-                | ("'''" (~["'"]
-                             | ("'" ~["'"])
-                             | ("''" ~["'"]))* "'''") >
-  | < FANNOTATE : ">>" >
-}
-
-/* This avoids lexical errors from JavaCC. */
-<*>
-TOKEN :
-{
-  < ILLEGAL_CHAR : [ "\u0000" - "\u0008", "\u000b" - "\uffff" ] >
-}
--- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/pacakge-info.java	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/**
- * {@link SEIStub} and its supporting code.
- */
-package com.sun.xml.internal.ws.client.sei;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/package-info.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * {@link SEIStub} and its supporting code.
+ */
+package com.sun.xml.internal.ws.client.sei;
--- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/server/DefaultResourceInjector.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/server/DefaultResourceInjector.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -40,7 +40,7 @@
  */
 public final class DefaultResourceInjector extends ResourceInjector {
     public void inject(@NotNull WSWebServiceContext context, @NotNull Object instance) {
-        InjectionPlan.buildInjectionPlan(
+        InjectionPlan.<Object, WebServiceContext>buildInjectionPlan(
             instance.getClass(),WebServiceContext.class,false).inject(instance,context);
     }
 
--- a/jdk/.hgtags	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/.hgtags	Mon Jun 02 13:53:52 2014 -0700
@@ -256,3 +256,5 @@
 47feccd164b7187a0147693a922ee47c6629643c jdk9-b11
 83d9bc20973de232cae45b139fdff8a4549c130f jdk9-b12
 c7c8002d02721e02131d104549ebeb8b379fb8d2 jdk9-b13
+5c7a17a81afd0906b53ee31d95a3211c96ff6b25 jdk9-b14
+4537360f09fe23ab339ee588747b657feb12d0c8 jdk9-b15
--- a/jdk/make/CompileJavaClasses.gmk	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/make/CompileJavaClasses.gmk	Mon Jun 02 13:53:52 2014 -0700
@@ -38,7 +38,7 @@
 
 ##########################################################################################
 
-EXCLUDES += com/sun/pept \
+EXCLUDES += \
     com/sun/tools/example/trace \
     com/sun/tools/example/debug/bdi \
     com/sun/tools/example/debug/event \
--- a/jdk/make/CopyIntoClasses.gmk	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/make/CopyIntoClasses.gmk	Mon Jun 02 13:53:52 2014 -0700
@@ -30,7 +30,6 @@
 
 # These directories should not be copied at all
 EXCLUDES += \
-    com/sun/org/apache/xml/internal/security/resource/schema \
     java/awt/doc-files \
     java/lang/doc-files \
     javax/swing/doc-files \
@@ -111,20 +110,8 @@
   ALL_META-INF_DIRS := $(ALL_META-INF_DIRS_share)
 endif
 
-ifndef OPENJDK
-  ALL_META-INF_DIRS += $(JDK_TOPDIR)/src/closed/share/classes/sun/java2d/cmm/kcms/META-INF
-endif
-
 SRC_SERVICES_FILES := $(wildcard $(addsuffix /services/*, $(ALL_META-INF_DIRS)))
 
-ifdef OPENJDK
-  SRC_SERVICES_FILES := $(filter-out %sun/dc/META-INF/services/sun.java2d.pipe.RenderingEngine, $(SRC_SERVICES_FILES))
-  SRC_SERVICES_FILES := $(filter-out %sun/java2d/cmm/kcms/META-INF/services/sun.java2d.cmm.CMMServiceProvider, $(SRC_SERVICES_FILES))
-else
-  SRC_SERVICES_FILES := $(filter-out %sun/java2d/pisces/META-INF/services/sun.java2d.pipe.RenderingEngine, $(SRC_SERVICES_FILES))
-  SRC_SERVICES_FILES := $(filter-out %sun/java2d/cmm/lcms/META-INF/services/sun.java2d.cmm.CMMServiceProvider, $(SRC_SERVICES_FILES))
-endif
-
 # The number of services files are relatively few. If the increase in numbers, then
 # we have to use ListPathsSafelyNow here.
 # Change $(JDK_TOPDIR)/src/.../META-INF/services/yyyy into $(JDK_OUTPUTDIR)/classes/META-INF/services/yyyy
--- a/jdk/make/lib/Awt2dLibraries.gmk	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/make/lib/Awt2dLibraries.gmk	Mon Jun 02 13:53:52 2014 -0700
@@ -318,7 +318,7 @@
 endif
 
 ifeq ($(OPENJDK_TARGET_OS), macosx)
-  LIBAWT_FILES += awt_LoadLibrary.c img_colors.c
+  LIBAWT_FILES += awt_LoadLibrary.c
   LIBAWT_CFLAGS += -F/System/Library/Frameworks/JavaVM.framework/Frameworks
 endif
 
@@ -606,7 +606,6 @@
         debug_mem.c \
         debug_trace.c \
         debug_util.c \
-        awt_Plugin.c \
         gnome_interface.c \
         gtk2_interface.c \
         swing_GTKEngine.c \
@@ -657,17 +656,34 @@
 
 ##########################################################################################
 
+LIBLCMS_DIR := $(JDK_TOPDIR)/src/share/native/sun/java2d/cmm/lcms
+
+ifeq ($(USE_EXTERNAL_LCMS), true)
+  # If we're using an external library, we'll just need the wrapper part.
+  # By including it explicitely, all other files will be excluded.
+  BUILD_LIBLCMS_INCLUDE_FILES := LCMS.c
+  BUILD_LIBLCMS_HEADERS :=
+else
+  BUILD_LIBLCMS_INCLUDE_FILES :=
+  # If we're using the bundled library, we'll need to include it in the
+  # include path explicitly. Otherwise the system headers will be used.
+  BUILD_LIBLCMS_HEADERS := -I$(LIBLCMS_DIR)
+endif
+
 # TODO: Update awt lib path when awt is converted
 $(eval $(call SetupNativeCompilation,BUILD_LIBLCMS, \
     LIBRARY := lcms, \
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
-    SRC := $(JDK_TOPDIR)/src/share/native/sun/java2d/cmm/lcms, \
+    SRC := $(LIBLCMS_DIR), \
+    INCLUDE_FILES := $(BUILD_LIBLCMS_INCLUDE_FILES), \
     LANG := C, \
     OPTIMIZATION := HIGHEST, \
     CFLAGS := $(filter-out -xc99=%none, $(CFLAGS_JDKLIB)) \
         $(SHARED_LIBRARY_FLAGS) \
         -I$(JDK_TOPDIR)/src/share/native/sun/java2d \
-        -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug, \
+        -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
+        $(BUILD_LIBLCMS_HEADERS) \
+        $(LCMS_CFLAGS), \
     CFLAGS_solaris := -xc99=no_lib, \
     CFLAGS_windows := -DCMS_IS_WINDOWS_, \
     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/liblcms/mapfile-vers, \
@@ -675,10 +691,10 @@
         $(call SET_SHARED_LIBRARY_ORIGIN), \
     LDFLAGS_solaris := /usr/lib$(OPENJDK_TARGET_CPU_ISADIR)/libm.so.2, \
     LDFLAGS_windows := $(WIN_AWT_LIB) $(WIN_JAVA_LIB), \
-    LDFLAGS_SUFFIX_solaris := -lawt -ljava -ljvm -lc, \
-    LDFLAGS_SUFFIX_macosx := $(LIBM) -lawt -ljava -ljvm, \
-    LDFLAGS_SUFFIX_linux := -lm -lawt -ljava -ljvm, \
-    LDFLAGS_SUFFIX_aix := -lm -lawt -ljava -ljvm,\
+    LDFLAGS_SUFFIX_solaris := -lawt -ljava -ljvm -lc $(LCMS_LIBS), \
+    LDFLAGS_SUFFIX_macosx := $(LIBM) -lawt -ljava -ljvm $(LCMS_LIBS), \
+    LDFLAGS_SUFFIX_linux := -lm -lawt -ljava -ljvm $(LCMS_LIBS), \
+    LDFLAGS_SUFFIX_aix := -lm -lawt -ljava -ljvm $(LCMS_LIBS),\
     VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
     RC_FLAGS := $(RC_FLAGS) \
         -D "JDK_FNAME=lcms.dll" \
--- a/jdk/make/mapfiles/libawt/mapfile-mawt-vers	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/make/mapfiles/libawt/mapfile-mawt-vers	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -249,11 +249,6 @@
 		Java_sun_awt_motif_XsessionWMcommand;
 		Java_sun_awt_motif_XsessionWMcommand_New;
 
-		# Java Plugin
-		getAwtLockFunctions;
-		getAwtData;
-		getAwtDisplay;
-
 		# libfontmanager entry points
 		AWTIsHeadless;
 		AWTCountFonts;
--- a/jdk/make/mapfiles/libawt/mapfile-vers	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/make/mapfiles/libawt/mapfile-vers	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -173,13 +173,6 @@
 		Java_sun_awt_motif_XsessionWMcommand;
 		Java_sun_awt_motif_XsessionWMcommand_New;
 
-		# Java Plugin
-                # This is in awt_LoadLibrary.c and falls through to libmawt.
-                # Evidently plugin needs this for backward compatability.
-		getAwtLockFunctions;
-		getAwtData;
-		getAwtDisplay;
-
 		# libfontmanager entry points
 		AWTIsHeadless;
 		GrPrim_Sg2dGetCompInfo;
--- a/jdk/make/mapfiles/libawt/mapfile-vers-linux	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/make/mapfiles/libawt/mapfile-vers-linux	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -152,13 +152,6 @@
                 # Evidently CDE needs this for backward compatability.
 		Java_sun_awt_motif_XsessionWMcommand;
 
-		# Java Plugin
-                # This is in awt_LoadLibrary.c and falls through to libmawt.
-                # Evidently plugin needs this for backward compatability.
-		getAwtLockFunctions;
-		getAwtData;
-		getAwtDisplay;
-
 		# libfontmanager entry points
 		AWTIsHeadless;
 		GrPrim_Sg2dGetCompInfo;
@@ -283,11 +276,6 @@
 		# CDE private entry point
 		Java_sun_awt_motif_XsessionWMcommand;
 
-		# Java Plugin
-		getAwtLockFunctions;
-		getAwtData;
-		getAwtDisplay;
-
 		# libfontmanager entry points
 		AWTIsHeadless;
 		AWTCountFonts;
--- a/jdk/make/mapfiles/libawt_xawt/mapfile-vers	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/make/mapfiles/libawt_xawt/mapfile-vers	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -449,12 +449,6 @@
         awt_Lock;
         awt_GetComponent;
 
-        # Java Plugin
-        # This is in awt_LoadLibrary.c and falls through to libmawt.
-        # Evidently plugin needs this for backward compatability.
-        getAwtLockFunctions;
-        getAwtData;
-        getAwtDisplay;
         #XAWT entry point for CDE
         Java_sun_awt_motif_XsessionWMcommand;
         Java_sun_awt_motif_XsessionWMcommand_New;
--- a/jdk/make/mapfiles/libjava/mapfile-vers	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/make/mapfiles/libjava/mapfile-vers	Mon Jun 02 13:53:52 2014 -0700
@@ -270,7 +270,10 @@
                 Java_sun_misc_Version_getJvmVersionInfo;
                 Java_sun_misc_Version_getJvmSpecialVersion;
 		Java_sun_misc_VM_latestUserDefinedLoader;
-                Java_sun_misc_VM_isSetUID;
+                Java_sun_misc_VM_getuid;
+                Java_sun_misc_VM_geteuid;
+                Java_sun_misc_VM_getgid;
+                Java_sun_misc_VM_getegid;
                 Java_sun_misc_VM_initialize;
 		Java_sun_misc_VMSupport_initAgentProperties;
 		Java_sun_misc_VMSupport_getVMTemporaryDirectory;
--- a/jdk/make/mapfiles/libjpeg/mapfile-vers-closed	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/make/mapfiles/libjpeg/mapfile-vers-closed	Mon Jun 02 13:53:52 2014 -0700
@@ -31,10 +31,6 @@
 
 		Java_sun_awt_image_JPEGImageDecoder_initIDs;
 		Java_sun_awt_image_JPEGImageDecoder_readImage;
-		Java_sun_awt_image_codec_JPEGImageDecoderImpl_initDecoder;
-		Java_sun_awt_image_codec_JPEGImageDecoderImpl_readJPEGStream;
-		Java_sun_awt_image_codec_JPEGImageEncoderImpl_initEncoder;
-		Java_sun_awt_image_codec_JPEGImageEncoderImpl_writeJPEGStream;
 
                 Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_initReaderIDs;
                 Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_initJPEGImageReader;
--- a/jdk/make/profile-rtjar-includes.txt	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/make/profile-rtjar-includes.txt	Mon Jun 02 13:53:52 2014 -0700
@@ -239,6 +239,4 @@
     META-INF/services/javax.sound.sampled.spi.AudioFileReader \
     META-INF/services/javax.sound.sampled.spi.AudioFileWriter \
     META-INF/services/javax.sound.sampled.spi.FormatConversionProvider \
-    META-INF/services/javax.sound.sampled.spi.MixerProvider \
-    META-INF/services/sun.java2d.cmm.PCMM \
-    META-INF/services/sun.java2d.pipe.RenderingEngine
+    META-INF/services/javax.sound.sampled.spi.MixerProvider
--- a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxPopup.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxPopup.java	Mon Jun 02 13:53:52 2014 -0700
@@ -121,6 +121,10 @@
     public void show() {
         final int startItemCount = comboBox.getItemCount();
 
+        if (startItemCount == 0) {
+            return;
+        }
+
         final Rectangle popupBounds = adjustPopupAndGetBounds();
         if (popupBounds == null) return; // null means don't show
 
--- a/jdk/src/macosx/classes/com/apple/laf/AquaImageFactory.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaImageFactory.java	Mon Jun 02 13:53:52 2014 -0700
@@ -46,10 +46,8 @@
 import com.apple.laf.AquaIcon.SystemIcon;
 import com.apple.laf.AquaUtils.RecyclableObject;
 import com.apple.laf.AquaUtils.RecyclableSingleton;
-import java.util.Arrays;
-import java.util.List;
-import sun.awt.image.MultiResolutionBufferedImage;
 import sun.awt.image.MultiResolutionImage;
+import sun.awt.image.MultiResolutionCachedImage;
 
 public class AquaImageFactory {
     public static IconUIResource getConfirmImageIcon() {
@@ -57,7 +55,7 @@
 
         return new IconUIResource(new AquaIcon.CachingScalingIcon(kAlertIconSize, kAlertIconSize) {
             Image createImage() {
-                return getThisApplicationsIcon(kAlertIconSize, kAlertIconSize);
+                return getGenericJavaIcon();
             }
         });
     }
@@ -83,24 +81,6 @@
         return getAppIconCompositedOn(lockIcon);
     }
 
-    static Image getThisApplicationsIcon(final int width, final int height) {
-        final String path = getPathToThisApplication();
-
-        if (path == null) {
-            return getGenericJavaIcon();
-        }
-
-        if (path.endsWith("/Home/bin")) {
-            return getGenericJavaIcon();
-        }
-
-        if (path.startsWith("/usr/bin")) {
-            return getGenericJavaIcon();
-        }
-
-        return AquaUtils.getCImageCreator().createImageOfFile(path, height, width);
-    }
-
     static Image getGenericJavaIcon() {
         return java.security.AccessController.doPrivileged(new PrivilegedAction<Image>() {
             public Image run() {
@@ -125,9 +105,9 @@
     private static final int kAlertIconSize = 64;
     static IconUIResource getAppIconCompositedOn(final Image background) {
 
-        if (background instanceof MultiResolutionBufferedImage) {
+        if (background instanceof MultiResolutionCachedImage) {
             int width = background.getWidth(null);
-            Image mrIconImage = ((MultiResolutionBufferedImage) background).map(
+            Image mrIconImage = ((MultiResolutionCachedImage) background).map(
                     rv -> getAppIconImageCompositedOn(rv, rv.getWidth(null) / width));
             return new IconUIResource(new ImageIcon(mrIconImage));
         }
@@ -144,7 +124,7 @@
         final Icon smallAppIconScaled = new AquaIcon.CachingScalingIcon(
                 kAlertSubIconSize, kAlertSubIconSize) {
                     Image createImage() {
-                        return getThisApplicationsIcon(kAlertSubIconSize, kAlertSubIconSize);
+                        return getGenericJavaIcon();
                     }
                 };
 
@@ -306,21 +286,7 @@
     private static Image getNSIcon(String imageName) {
         Image icon = Toolkit.getDefaultToolkit()
                 .getImage("NSImage://" + imageName);
-
-        if (icon instanceof MultiResolutionImage) {
-            return icon;
-        }
-
-        int w = icon.getWidth(null);
-        int h = icon.getHeight(null);
-
-        Dimension[] sizes = new Dimension[]{
-            new Dimension(w, h), new Dimension(2 * w, 2 * h)
-        };
-
-        return new MultiResolutionBufferedImage(icon, sizes, (width, height) ->
-                AquaUtils.getCImageCreator().createImageFromName(
-                        imageName, width, height));
+        return icon;
     }
 
     public static class NineSliceMetrics {
@@ -530,4 +496,4 @@
     public static Color getSelectionInactiveForegroundColorUIResource() {
         return new SystemColorProxy(LWCToolkit.getAppleColor(LWCToolkit.INACTIVE_SELECTION_FOREGROUND_COLOR));
     }
-}
\ No newline at end of file
+}
--- a/jdk/src/macosx/classes/com/apple/laf/AquaPainter.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaPainter.java	Mon Jun 02 13:53:52 2014 -0700
@@ -174,11 +174,7 @@
                                                         bounds, controlState);
             Image img = cache.getImage(key);
             if (img == null) {
-
-                Image baseImage = createImage(imgX, imgY, imgW, imgH, bounds,
-                                              control, controlState);
-
-                img = new MultiResolutionBufferedImage(baseImage,
+                img = new MultiResolutionCachedImage(imgW, imgH,
                         (rvWidth, rvHeight) -> createImage(imgX, imgY,
                          rvWidth, rvHeight, bounds, control, controlState));
 
--- a/jdk/src/macosx/classes/com/apple/laf/AquaUtils.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaUtils.java	Mon Jun 02 13:53:52 2014 -0700
@@ -48,7 +48,7 @@
 import sun.swing.SwingUtilities2;
 
 import com.apple.laf.AquaImageFactory.SlicedImageControl;
-import sun.awt.image.MultiResolutionBufferedImage;
+import sun.awt.image.MultiResolutionCachedImage;
 
 final class AquaUtils {
 
@@ -124,8 +124,8 @@
 
     static Image generateLightenedImage(final Image image, final int percent) {
         final GrayFilter filter = new GrayFilter(true, percent);
-        return (image instanceof MultiResolutionBufferedImage)
-                ? ((MultiResolutionBufferedImage) image).map(
+        return (image instanceof MultiResolutionCachedImage)
+                ? ((MultiResolutionCachedImage) image).map(
                         rv -> generateLightenedImage(rv, filter))
                 : generateLightenedImage(image, filter);
     }
--- a/jdk/src/macosx/classes/sun/font/CFontManager.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/macosx/classes/sun/font/CFontManager.java	Mon Jun 02 13:53:52 2014 -0700
@@ -40,7 +40,7 @@
 
 import sun.awt.FontConfiguration;
 import sun.awt.HeadlessToolkit;
-import sun.misc.ThreadGroupUtils;
+import sun.awt.util.ThreadGroupUtils;
 import sun.lwawt.macosx.*;
 
 public class CFontManager extends SunFontManager {
--- a/jdk/src/macosx/classes/sun/lwawt/LWChoicePeer.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/macosx/classes/sun/lwawt/LWChoicePeer.java	Mon Jun 02 13:53:52 2014 -0700
@@ -171,7 +171,9 @@
             SwingUtilities.invokeLater(() -> {
                 JPopupMenu popupMenu = getPopupMenu();
                 // Need to override the invoker for proper grab handling
-                if (popupMenu != null && popupMenu.getInvoker() != getTarget()) {
+                if (popupMenu != null
+                        && popupMenu.isShowing()
+                        && popupMenu.getInvoker() != getTarget()) {
                     // The popup is now visible with correct location
                     // Save it and restore after toggling visibility and changing invoker
                     Point loc = popupMenu.getLocationOnScreen();
--- a/jdk/src/macosx/classes/sun/lwawt/LWComponentPeer.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/macosx/classes/sun/lwawt/LWComponentPeer.java	Mon Jun 02 13:53:52 2014 -0700
@@ -63,8 +63,6 @@
 import javax.swing.SwingUtilities;
 import javax.swing.RepaintManager;
 
-import sun.lwawt.macosx.CDropTarget;
-
 import com.sun.java.swing.SwingUtilities3;
 
 public abstract class LWComponentPeer<T extends Component, D extends JComponent>
@@ -137,7 +135,7 @@
     private final Object dropTargetLock = new Object();
 
     private int fNumDropTargets = 0;
-    private CDropTarget fDropTarget = null;
+    private PlatformDropTarget fDropTarget = null;
 
     private final PlatformComponent platformComponent;
 
@@ -1063,11 +1061,11 @@
                 // if it's the first (or last) one for the component. Otherwise this call is a no-op.
                 if (++fNumDropTargets == 1) {
                     // Having a non-null drop target would be an error but let's check just in case:
-                    if (fDropTarget != null)
-                        System.err.println("CComponent.addDropTarget(): current drop target is non-null.");
-
+                    if (fDropTarget != null) {
+                        throw new IllegalStateException("Current drop target is not null");
+                    }
                     // Create a new drop target:
-                    fDropTarget = CDropTarget.createDropTarget(dt, target, this);
+                    fDropTarget = LWToolkit.getLWToolkit().createDropTarget(dt, target, this);
                 }
             }
         }
--- a/jdk/src/macosx/classes/sun/lwawt/LWToolkit.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/macosx/classes/sun/lwawt/LWToolkit.java	Mon Jun 02 13:53:52 2014 -0700
@@ -28,6 +28,7 @@
 import java.awt.*;
 import java.awt.List;
 import java.awt.datatransfer.*;
+import java.awt.dnd.DropTarget;
 import java.awt.image.*;
 import java.awt.peer.*;
 import java.security.*;
@@ -35,7 +36,7 @@
 
 import sun.awt.*;
 import sun.print.*;
-import sun.misc.ThreadGroupUtils;
+import sun.awt.util.ThreadGroupUtils;
 
 import static sun.lwawt.LWWindowPeer.PeerType;
 
@@ -440,6 +441,10 @@
 
     protected abstract FileDialogPeer createFileDialogPeer(FileDialog target);
 
+    protected abstract PlatformDropTarget createDropTarget(DropTarget dropTarget,
+                                                           Component component,
+                                                           LWComponentPeer<?, ?> peer);
+
     // ---- UTILITY METHODS ---- //
 
     /*
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/macosx/classes/sun/lwawt/PlatformDropTarget.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.lwawt;
+
+public interface PlatformDropTarget {
+
+    /**
+     * Release native dragging destination, if any
+     */
+    void dispose();
+}
--- a/jdk/src/macosx/classes/sun/lwawt/macosx/CDataTransferer.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CDataTransferer.java	Mon Jun 02 13:53:52 2014 -0700
@@ -31,6 +31,7 @@
 
 import java.io.*;
 import java.net.URL;
+import java.nio.charset.Charset;
 import java.text.Normalizer;
 import java.text.Normalizer.Form;
 import java.util.*;
@@ -126,7 +127,7 @@
 
             if (format == CF_URL && URL.class.equals(flavor.getRepresentationClass()))
             {
-                String charset = getDefaultTextCharset();
+                String charset = Charset.defaultCharset().name();
                 if (transferable != null && transferable.isDataFlavorSupported(javaTextEncodingFlavor)) {
                     try {
                         charset = new String((byte[])transferable.getTransferData(javaTextEncodingFlavor), "UTF-8");
--- a/jdk/src/macosx/classes/sun/lwawt/macosx/CDropTarget.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CDropTarget.java	Mon Jun 02 13:53:52 2014 -0700
@@ -25,54 +25,37 @@
 
 package sun.lwawt.macosx;
 
-import java.awt.Component;
-import java.awt.peer.ComponentPeer;
+import sun.lwawt.LWComponentPeer;
+import sun.lwawt.PlatformDropTarget;
+
+import java.awt.*;
 import java.awt.dnd.DropTarget;
 
-import sun.lwawt.LWComponentPeer;
-import sun.lwawt.PlatformWindow;
-
 
-public final class CDropTarget {
-
-    Component        fComponent;
-    ComponentPeer    fPeer;
-    DropTarget        fDropTarget;
-    private long    fNativeDropTarget;
+final class CDropTarget implements PlatformDropTarget {
+    private long fNativeDropTarget;
 
-    public static CDropTarget createDropTarget(DropTarget dropTarget, Component component, ComponentPeer peer) {
-        return new CDropTarget(dropTarget, component, peer);
-    }
-
-    private CDropTarget(DropTarget dropTarget, Component component, ComponentPeer peer) {
-        super();
-
-        fDropTarget = dropTarget;
-        fComponent = component;
-        fPeer = peer;
-
-        long nativePeer = CPlatformWindow.getNativeViewPtr(((LWComponentPeer) peer).getPlatformWindow());
+    CDropTarget(DropTarget dropTarget, Component component, LWComponentPeer<?, ?> peer) {
+        long nativePeer = CPlatformWindow.getNativeViewPtr(peer.getPlatformWindow());
         if (nativePeer == 0L) return; // Unsupported for a window without a native view (plugin)
 
         // Create native dragging destination:
-        fNativeDropTarget = this.createNativeDropTarget(dropTarget, component, peer, nativePeer);
+        fNativeDropTarget = createNativeDropTarget(dropTarget, component, nativePeer);
         if (fNativeDropTarget == 0) {
             throw new IllegalStateException("CDropTarget.createNativeDropTarget() failed.");
         }
     }
 
-    public DropTarget getDropTarget() {
-        return fDropTarget;
-    }
-
+    @Override
     public void dispose() {
-        // Release native dragging destination, if any:
         if (fNativeDropTarget != 0) {
-            this.releaseNativeDropTarget(fNativeDropTarget);
+            releaseNativeDropTarget(fNativeDropTarget);
             fNativeDropTarget = 0;
         }
     }
 
-    protected native long createNativeDropTarget(DropTarget dropTarget, Component component, ComponentPeer peer, long nativePeer);
+    protected native long createNativeDropTarget(DropTarget dropTarget,
+                                                 Component component,
+                                                 long nativePeer);
     protected native void releaseNativeDropTarget(long nativeDropTarget);
 }
--- a/jdk/src/macosx/classes/sun/lwawt/macosx/CImage.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CImage.java	Mon Jun 02 13:53:52 2014 -0700
@@ -32,7 +32,7 @@
 import java.util.Arrays;
 import java.util.List;
 import sun.awt.image.MultiResolutionImage;
-import sun.awt.image.MultiResolutionBufferedImage;
+import sun.awt.image.MultiResolutionCachedImage;
 
 import sun.awt.image.SunWritableRaster;
 
@@ -62,41 +62,41 @@
         // This is used to create a CImage with an NSImage pointer. It MUST be a CFRetained
         // NSImage, and the CImage takes ownership of the non-GC retain. If callers need the
         // NSImage themselves, they MUST call retain on the NSImage themselves.
-        public BufferedImage createImageUsingNativeSize(final long image) {
+        public Image createImageUsingNativeSize(final long image) {
             if (image == 0) return null;
             final Dimension2D size = nativeGetNSImageSize(image);
-            return createBufferedImage(image, size.getWidth(), size.getHeight());
+            return createImage(image, size.getWidth(), size.getHeight());
         }
 
         // the width and height passed in as a parameter could differ than the width and the height of the NSImage (image), in that case, the image will be scaled
-        BufferedImage createBufferedImage(long image, double width, double height) {
+        Image createImage(long image, double width, double height) {
             if (image == 0) throw new Error("Unable to instantiate CImage with null native image reference.");
             return createImageWithSize(image, width, height);
         }
 
-        public BufferedImage createImageWithSize(final long image, final double width, final double height) {
+        public Image createImageWithSize(final long image, final double width, final double height) {
             final CImage img = new CImage(image);
             img.resize(width, height);
             return img.toImage();
         }
 
         // This is used to create a CImage that represents the icon of the given file.
-        public BufferedImage createImageOfFile(final String file, final int width, final int height) {
-            return createBufferedImage(nativeCreateNSImageOfFileFromLaunchServices(file), width, height);
+        public Image createImageOfFile(final String file, final int width, final int height) {
+            return createImage(nativeCreateNSImageOfFileFromLaunchServices(file), width, height);
         }
 
-        public BufferedImage createImageFromFile(final String file, final double width, final double height) {
+        public Image createImageFromFile(final String file, final double width, final double height) {
             final long image = nativeCreateNSImageFromFileContents(file);
             nativeSetNSImageSize(image, width, height);
-            return createBufferedImage(image, width, height);
+            return createImage(image, width, height);
         }
 
-        public BufferedImage createSystemImageFromSelector(final String iconSelector, final int width, final int height) {
-            return createBufferedImage(nativeCreateNSImageFromIconSelector(getSelectorAsInt(iconSelector)), width, height);
+        public Image createSystemImageFromSelector(final String iconSelector, final int width, final int height) {
+            return createImage(nativeCreateNSImageFromIconSelector(getSelectorAsInt(iconSelector)), width, height);
         }
 
         public Image createImageFromName(final String name, final int width, final int height) {
-            return createBufferedImage(nativeCreateNSImageFromImageName(name), width, height);
+            return createImage(nativeCreateNSImageFromImageName(name), width, height);
         }
 
         public Image createImageFromName(final String name) {
@@ -232,7 +232,7 @@
     }
 
     /** @return A MultiResolution image created from nsImagePtr, or null. */
-    private BufferedImage toImage() {
+    private Image toImage() {
         if (ptr == 0) return null;
 
         final Dimension2D size = nativeGetNSImageSize(ptr);
@@ -243,11 +243,11 @@
                 = nativeGetNSImageRepresentationSizes(ptr,
                         size.getWidth(), size.getHeight());
 
-        BufferedImage baseImage = toImage(w, h, w, h);
-
-        return sizes == null || sizes.length < 2 ? baseImage
-                : new MultiResolutionBufferedImage(baseImage, sizes,
-                        (width, height) -> toImage(w, h, width, height));
+        return sizes == null || sizes.length < 2 ?
+                new MultiResolutionCachedImage(w, h, (width, height)
+                        -> toImage(w, h, width, height))
+                : new MultiResolutionCachedImage(w, h, sizes, (width, height)
+                        -> toImage(w, h, width, height));
     }
 
     private BufferedImage toImage(int srcWidth, int srcHeight, int dstWidth, int dstHeight) {
--- a/jdk/src/macosx/classes/sun/lwawt/macosx/CWarningWindow.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CWarningWindow.java	Mon Jun 02 13:53:52 2014 -0700
@@ -309,6 +309,10 @@
     @Override
     public void dispose() {
         cancelTasks();
+        SurfaceData surfaceData = contentView.getSurfaceData();
+        if (surfaceData != null) {
+            surfaceData.invalidate();
+        }
         super.dispose();
     }
 
--- a/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java	Mon Jun 02 13:53:52 2014 -0700
@@ -611,19 +611,20 @@
     }
 
     /**
-     * Kicks an event over to the appropriate eventqueue and waits for it to
+     * Kicks an event over to the appropriate event queue and waits for it to
      * finish To avoid deadlocking, we manually run the NSRunLoop while waiting
      * Any selector invoked using ThreadUtilities performOnMainThread will be
      * processed in doAWTRunLoop The InvocationEvent will call
      * LWCToolkit.stopAWTRunLoop() when finished, which will stop our manual
-     * runloop Does not dispatch native events while in the loop
+     * run loop. Does not dispatch native events while in the loop
      */
     public static void invokeAndWait(Runnable runnable, Component component)
             throws InvocationTargetException {
-        final long mediator = createAWTRunLoopMediator();
+        Objects.requireNonNull(component, "Null component provided to invokeAndWait");
 
+        long mediator = createAWTRunLoopMediator();
         InvocationEvent invocationEvent =
-                new InvocationEvent(component != null ? component : Toolkit.getDefaultToolkit(),
+                new InvocationEvent(component,
                         runnable,
                         () -> {
                             if (mediator != 0) {
@@ -632,49 +633,42 @@
                         },
                         true);
 
-        if (component != null) {
-            AppContext appContext = SunToolkit.targetToAppContext(component);
-            SunToolkit.postEvent(appContext, invocationEvent);
-
-            // 3746956 - flush events from PostEventQueue to prevent them from getting stuck and causing a deadlock
-            SunToolkit.flushPendingEvents(appContext);
-        } else {
-            // This should be the equivalent to EventQueue.invokeAndWait
-            ((LWCToolkit)Toolkit.getDefaultToolkit()).getSystemEventQueueForInvokeAndWait().postEvent(invocationEvent);
-        }
-
+        AppContext appContext = SunToolkit.targetToAppContext(component);
+        SunToolkit.postEvent(appContext, invocationEvent);
+        // 3746956 - flush events from PostEventQueue to prevent them from getting stuck and causing a deadlock
+        SunToolkit.flushPendingEvents(appContext);
         doAWTRunLoop(mediator, false);
 
-        Throwable eventException = invocationEvent.getException();
-        if (eventException != null) {
-            if (eventException instanceof UndeclaredThrowableException) {
-                eventException = ((UndeclaredThrowableException)eventException).getUndeclaredThrowable();
-            }
-            throw new InvocationTargetException(eventException);
-        }
+        checkException(invocationEvent);
     }
 
     public static void invokeLater(Runnable event, Component component)
             throws InvocationTargetException {
-        final InvocationEvent invocationEvent =
-                new InvocationEvent(component != null ? component : Toolkit.getDefaultToolkit(), event);
+        Objects.requireNonNull(component, "Null component provided to invokeLater");
+
+        InvocationEvent invocationEvent = new InvocationEvent(component, event);
 
-        if (component != null) {
-            final AppContext appContext = SunToolkit.targetToAppContext(component);
-            SunToolkit.postEvent(appContext, invocationEvent);
+        AppContext appContext = SunToolkit.targetToAppContext(component);
+        SunToolkit.postEvent(SunToolkit.targetToAppContext(component), invocationEvent);
+        // 3746956 - flush events from PostEventQueue to prevent them from getting stuck and causing a deadlock
+        SunToolkit.flushPendingEvents(appContext);
 
-            // 3746956 - flush events from PostEventQueue to prevent them from getting stuck and causing a deadlock
-            SunToolkit.flushPendingEvents(appContext);
-        } else {
-            // This should be the equivalent to EventQueue.invokeAndWait
-            ((LWCToolkit)Toolkit.getDefaultToolkit()).getSystemEventQueueForInvokeAndWait().postEvent(invocationEvent);
-        }
+        checkException(invocationEvent);
+    }
 
-        final Throwable eventException = invocationEvent.getException();
+    /**
+     * Checks if exception occurred while {@code InvocationEvent} was processed and rethrows it as
+     * an {@code InvocationTargetException}
+     *
+     * @param event the event to check for an exception
+     * @throws InvocationTargetException if exception occurred when event was processed
+     */
+    private static void checkException(InvocationEvent event) throws InvocationTargetException {
+        Throwable eventException = event.getException();
         if (eventException == null) return;
 
         if (eventException instanceof UndeclaredThrowableException) {
-            throw new InvocationTargetException(((UndeclaredThrowableException)eventException).getUndeclaredThrowable());
+            eventException = ((UndeclaredThrowableException)eventException).getUndeclaredThrowable();
         }
         throw new InvocationTargetException(eventException);
     }
@@ -686,11 +680,6 @@
      */
     native static void performOnMainThreadAfterDelay(Runnable r, long delay);
 
-    // This exists purely to get around permissions issues with getSystemEventQueueImpl
-    EventQueue getSystemEventQueueForInvokeAndWait() {
-        return getSystemEventQueueImpl();
-    }
-
 // DnD support
 
     @Override
@@ -712,7 +701,14 @@
         return (T)dgr;
     }
 
-// InputMethodSupport Method
+    @Override
+    protected PlatformDropTarget createDropTarget(DropTarget dropTarget,
+                                                  Component component,
+                                                  LWComponentPeer<?, ?> peer) {
+        return new CDropTarget(dropTarget, component, peer);
+    }
+
+    // InputMethodSupport Method
     /**
      * Returns the default keyboard locale of the underlying operating system
      */
--- a/jdk/src/macosx/native/sun/awt/AWTView.m	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/macosx/native/sun/awt/AWTView.m	Mon Jun 02 13:53:52 2014 -0700
@@ -27,6 +27,7 @@
 
 #import <JavaNativeFoundation/JavaNativeFoundation.h>
 #import <JavaRuntimeSupport/JavaRuntimeSupport.h>
+#import "jni_util.h"
 
 #import "ThreadUtilities.h"
 #import "AWTView.h"
@@ -391,14 +392,12 @@
                                   (jint)absP.x, (jint)absP.y,
                                   [event deltaY],
                                   [event deltaX]);
-    if (jEvent == nil) {
-        // Unable to create event by some reason.
-        return;
-    }
+    CHECK_NULL(jEvent);
 
     static JNF_CLASS_CACHE(jc_PlatformView, "sun/lwawt/macosx/CPlatformView");
     static JNF_MEMBER_CACHE(jm_deliverMouseEvent, jc_PlatformView, "deliverMouseEvent", "(Lsun/lwawt/macosx/NSEvent;)V");
     JNFCallVoidMethod(env, m_cPlatformView, jm_deliverMouseEvent, jEvent);
+    (*env)->DeleteLocalRef(env, jEvent);
 }
 
 - (void) resetTrackingArea {
@@ -447,20 +446,22 @@
 
     static JNF_CLASS_CACHE(jc_NSEvent, "sun/lwawt/macosx/NSEvent");
     static JNF_CTOR_CACHE(jctor_NSEvent, jc_NSEvent, "(IISLjava/lang/String;)V");
-    jobject jevent = JNFNewObject(env, jctor_NSEvent,
+    jobject jEvent = JNFNewObject(env, jctor_NSEvent,
                                   [event type],
                                   [event modifierFlags],
                                   [event keyCode],
                                   characters);
+    CHECK_NULL(jEvent);
 
     static JNF_CLASS_CACHE(jc_PlatformView, "sun/lwawt/macosx/CPlatformView");
     static JNF_MEMBER_CACHE(jm_deliverKeyEvent, jc_PlatformView,
                             "deliverKeyEvent", "(Lsun/lwawt/macosx/NSEvent;)V");
-    JNFCallVoidMethod(env, m_cPlatformView, jm_deliverKeyEvent, jevent);
+    JNFCallVoidMethod(env, m_cPlatformView, jm_deliverKeyEvent, jEvent);
 
     if (characters != NULL) {
         (*env)->DeleteLocalRef(env, characters);
     }
+    (*env)->DeleteLocalRef(env, jEvent);
 }
 
 -(void) deliverResize: (NSRect) rect {
--- a/jdk/src/macosx/native/sun/awt/AWTWindow.m	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/macosx/native/sun/awt/AWTWindow.m	Mon Jun 02 13:53:52 2014 -0700
@@ -261,7 +261,8 @@
 
 // returns id for the topmost window under mouse
 + (NSInteger) getTopmostWindowUnderMouseID {
-
+    NSInteger result = -1;
+    
     NSRect screenRect = [[NSScreen mainScreen] frame];
     NSPoint nsMouseLocation = [NSEvent mouseLocation];
     CGPoint cgMouseLocation = CGPointMake(nsMouseLocation.x, screenRect.size.height - nsMouseLocation.y);
@@ -274,11 +275,13 @@
             CGRect rect;
             CGRectMakeWithDictionaryRepresentation((CFDictionaryRef)[window objectForKey:(id)kCGWindowBounds], &rect);
             if (CGRectContainsPoint(rect, cgMouseLocation)) {
-                return [[window objectForKey:(id)kCGWindowNumber] integerValue];
+                result = [[window objectForKey:(id)kCGWindowNumber] integerValue];
+                break;
             }
         }
     }
-    return -1;
+    [windows release];
+    return result;
 }
 
 // checks that this window is under the mouse cursor and this point is not overlapped by others windows
--- a/jdk/src/macosx/native/sun/awt/CDropTarget.h	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/macosx/native/sun/awt/CDropTarget.h	Mon Jun 02 13:53:52 2014 -0700
@@ -48,7 +48,7 @@
 + (CDropTarget *) currentDropTarget;
 
 // Common methods:
-- (id)init:(jobject)dropTarget component:(jobject)jcomponent peer:(jobject)jpeer control:(id)control;
+- (id)init:(jobject)dropTarget component:(jobject)jcomponent control:(id)control;
 - (void)controlModelControlValid;
 - (void)removeFromView:(JNIEnv *)env;
 
--- a/jdk/src/macosx/native/sun/awt/CDropTarget.m	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/macosx/native/sun/awt/CDropTarget.m	Mon Jun 02 13:53:52 2014 -0700
@@ -65,7 +65,7 @@
     return sCurrentDropTarget;
 }
 
-- (id)init:(jobject)jdropTarget component:(jobject)jcomponent peer:(jobject)jpeer control:(id)control
+- (id)init:(jobject)jdropTarget component:(jobject)jcomponent control:(id)control
 {
     self = [super init];
     DLog2(@"[CDropTarget init]: %@\n", self);
@@ -714,13 +714,13 @@
  * Signature: (Ljava/awt/dnd/DropTarget;Ljava/awt/Component;Ljava/awt/peer/ComponentPeer;J)J
  */
 JNIEXPORT jlong JNICALL Java_sun_lwawt_macosx_CDropTarget_createNativeDropTarget
-  (JNIEnv *env, jobject jthis, jobject jdroptarget, jobject jcomponent, jobject jpeer, jlong jnativepeer)
+  (JNIEnv *env, jobject jthis, jobject jdroptarget, jobject jcomponent, jlong jnativepeer)
 {
     CDropTarget* dropTarget = nil;
 
 JNF_COCOA_ENTER(env);
     id controlObj = (id) jlong_to_ptr(jnativepeer);
-    dropTarget = [[CDropTarget alloc] init:jdroptarget component:jcomponent peer:jpeer control:controlObj];
+    dropTarget = [[CDropTarget alloc] init:jdroptarget component:jcomponent control:controlObj];
 JNF_COCOA_EXIT(env);
 
     return ptr_to_jlong(dropTarget);
--- a/jdk/src/macosx/native/sun/awt/CGraphicsDevice.m	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/macosx/native/sun/awt/CGraphicsDevice.m	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -66,7 +66,8 @@
             CFArrayAppendValue(validModes, cRef);
         }
     }
-
+    CFRelease(allModes);
+    
     CGDisplayModeRef currentMode = CGDisplayCopyDisplayMode(displayID);
 
     BOOL containsCurrentMode = NO;
@@ -81,6 +82,7 @@
     if (!containsCurrentMode) {
         CFArrayAppendValue(validModes, currentMode);
     }
+    CGDisplayModeRelease(currentMode);
 
     return validModes;
 }
@@ -154,14 +156,12 @@
 Java_sun_awt_CGraphicsDevice_nativeGetXResolution
   (JNIEnv *env, jclass class, jint displayID)
 {
-    // TODO: this is the physically correct answer, but we probably want
-    // to use NSScreen API instead...
+    // CGDisplayScreenSize can return 0 if displayID is invalid
     CGSize size = CGDisplayScreenSize(displayID);
     CGRect rect = CGDisplayBounds(displayID);
     // 1 inch == 25.4 mm
     jfloat inches = size.width / 25.4f;
-    jfloat dpi = rect.size.width / inches;
-    return dpi;
+    return inches > 0 ? rect.size.width / inches : 72;
 }
 
 /*
@@ -173,14 +173,12 @@
 Java_sun_awt_CGraphicsDevice_nativeGetYResolution
   (JNIEnv *env, jclass class, jint displayID)
 {
-    // TODO: this is the physically correct answer, but we probably want
-    // to use NSScreen API instead...
+    // CGDisplayScreenSize can return 0 if displayID is invalid
     CGSize size = CGDisplayScreenSize(displayID);
     CGRect rect = CGDisplayBounds(displayID);
     // 1 inch == 25.4 mm
     jfloat inches = size.height / 25.4f;
-    jfloat dpi = rect.size.height / inches;
-    return dpi;
+    return inches > 0 ? rect.size.height / inches : 72;
 }
 
 /*
@@ -235,17 +233,19 @@
 {
     JNF_COCOA_ENTER(env);
     CFArrayRef allModes = getAllValidDisplayModes(displayID);
-
     CGDisplayModeRef closestMatch = getBestModeForParameters(allModes, (int)w, (int)h, (int)bpp, (int)refrate);
+    
     __block CGError retCode = kCGErrorSuccess;
     if (closestMatch != NULL) {
-        [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+        CGDisplayModeRetain(closestMatch);
+        [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
             CGDisplayConfigRef config;
             retCode = CGBeginDisplayConfiguration(&config);
             if (retCode == kCGErrorSuccess) {
                 CGConfigureDisplayWithDisplayMode(config, displayID, closestMatch, NULL);
                 retCode = CGCompleteDisplayConfiguration(config, kCGConfigureForAppOnly);
             }
+            CGDisplayModeRelease(closestMatch);
         }];
     } else {
         [JNFException raise:env as:kIllegalArgumentException reason:"Invalid display mode"];
@@ -253,8 +253,7 @@
 
     if (retCode != kCGErrorSuccess){
         [JNFException raise:env as:kIllegalArgumentException reason:"Unable to set display mode!"];
-    }    
-
+    }
     CFRelease(allModes);
     JNF_COCOA_EXIT(env);
 }
--- a/jdk/src/macosx/native/sun/awt/CImage.m	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/macosx/native/sun/awt/CImage.m	Mon Jun 02 13:53:52 2014 -0700
@@ -76,17 +76,17 @@
 
 static NSBitmapImageRep* CImage_CreateImageRep(JNIEnv *env, jintArray buffer, jint width, jint height)
 {
-    NSBitmapImageRep* imageRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL
-                                                                         pixelsWide:width
-                                                                         pixelsHigh:height
-                                                                      bitsPerSample:8
-                                                                    samplesPerPixel:4
-                                                                           hasAlpha:YES
-                                                                           isPlanar:NO
-                                                                     colorSpaceName:NSDeviceRGBColorSpace
-                                                                       bitmapFormat:NSAlphaFirstBitmapFormat
-                                                                        bytesPerRow:width*4 // TODO: use explicit scanStride
-                                                                       bitsPerPixel:32];
+    NSBitmapImageRep* imageRep = [[[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL
+                                                                          pixelsWide:width
+                                                                          pixelsHigh:height
+                                                                       bitsPerSample:8
+                                                                     samplesPerPixel:4
+                                                                            hasAlpha:YES
+                                                                            isPlanar:NO
+                                                                      colorSpaceName:NSDeviceRGBColorSpace
+                                                                        bitmapFormat:NSAlphaFirstBitmapFormat
+                                                                         bytesPerRow:width*4 // TODO: use explicit scanStride
+                                                                        bitsPerPixel:32] autorelease];
 
     jint *imgData = (jint *)[imageRep bitmapData];
     if (imgData == NULL) return 0L;
@@ -115,9 +115,8 @@
     
     NSBitmapImageRep* imageRep = CImage_CreateImageRep(env, buffer, width, height);
     if (imageRep) {
-        NSImage *nsImage = [[[NSImage alloc] initWithSize:NSMakeSize(width, height)] retain];
+        NSImage *nsImage = [[NSImage alloc] initWithSize:NSMakeSize(width, height)];
         [nsImage addRepresentation:imageRep];
-        [imageRep release];
         result = ptr_to_jlong(nsImage);
     }
 
@@ -160,7 +159,7 @@
         (*env)->ReleaseIntArrayElements(env, widths, ws, JNI_ABORT);
     }
     if ([reps count]) {
-        NSImage *nsImage = [[[NSImage alloc] initWithSize:NSMakeSize(0, 0)] retain];
+        NSImage *nsImage = [[NSImage alloc] initWithSize:NSMakeSize(0, 0)];
         [nsImage addRepresentations: reps];
         result = ptr_to_jlong(nsImage);
     }
@@ -184,7 +183,7 @@
 
     IconRef iconRef;
     if (noErr == GetIconRef(kOnSystemDisk, kSystemIconsCreator, selector, &iconRef)) {
-        image = [[[NSImage alloc] initWithIconRef:iconRef] retain];
+        image = [[NSImage alloc] initWithIconRef:iconRef];
         ReleaseIconRef(iconRef);
     }
 
@@ -206,7 +205,7 @@
 JNF_COCOA_ENTER(env);
 
     NSString *path = JNFNormalizedNSStringForPath(env, file);
-    image = [[[NSImage alloc] initByReferencingFile:path] retain];
+    image = [[NSImage alloc] initByReferencingFile:path];
 
 JNF_COCOA_EXIT(env);
 
@@ -435,7 +434,7 @@
 
     JNF_COCOA_ENTER(env);
 
-    NSBitmapImageRep* imageRep = [CImage_CreateImageRep(env, buffer, width, height) autorelease];
+    NSBitmapImageRep* imageRep = CImage_CreateImageRep(env, buffer, width, height);
     if (imageRep) {
         NSData *tiffImage = [imageRep TIFFRepresentation];
         jsize tiffSize = (jsize)[tiffImage length];
--- a/jdk/src/macosx/native/sun/awt/CTrayIcon.m	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/macosx/native/sun/awt/CTrayIcon.m	Mon Jun 02 13:53:52 2014 -0700
@@ -25,6 +25,7 @@
 
 #import <AppKit/AppKit.h>
 #import <JavaNativeFoundation/JavaNativeFoundation.h>
+#import "jni_util.h"
 
 #import "CTrayIcon.h"
 #import "ThreadUtilities.h"
@@ -146,14 +147,12 @@
                                   (jint)absP.x, (jint)absP.y,
                                   [event deltaY],
                                   [event deltaX]);
-    if (jEvent == nil) {
-        // Unable to create event by some reason.
-        return;
-    }
+    CHECK_NULL(jEvent);
 
     static JNF_CLASS_CACHE(jc_TrayIcon, "sun/lwawt/macosx/CTrayIcon");
     static JNF_MEMBER_CACHE(jm_handleMouseEvent, jc_TrayIcon, "handleMouseEvent", "(Lsun/lwawt/macosx/NSEvent;)V");
     JNFCallVoidMethod(env, peer, jm_handleMouseEvent, jEvent);
+    (*env)->DeleteLocalRef(env, jEvent);
 }
 
 @end //AWTTrayIcon
--- a/jdk/src/macosx/native/sun/awt/LWCToolkit.m	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/macosx/native/sun/awt/LWCToolkit.m	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -157,61 +157,6 @@
 JNF_COCOA_EXIT(env);
 }
 
-static JNF_CLASS_CACHE(jc_Component, "java/awt/Component");
-static JNF_MEMBER_CACHE(jf_Component_appContext, jc_Component, "appContext", "Lsun/awt/AppContext;");
-static JNF_CLASS_CACHE(jc_MenuComponent, "java/awt/MenuComponent");
-static JNF_MEMBER_CACHE(jf_MenuComponent_appContext, jc_MenuComponent, "appContext", "Lsun/awt/AppContext;");
-
-/*
- * Class:     sun_awt_SunToolkit
- * Method:    getAppContext
- * Signature: (Ljava/awt/Object;)Lsun/awt/AppContext;
- */
-JNIEXPORT jobject JNICALL
-Java_sun_awt_SunToolkit_getAppContext
-(JNIEnv *env, jclass cls, jobject obj)
-{
-    jobject appContext = NULL;
-
-JNF_COCOA_ENTER(env);
-
-    if (JNFIsInstanceOf(env, obj, &jc_Component)) {
-        appContext = JNFGetObjectField(env, obj, jf_Component_appContext);
-    } else if (JNFIsInstanceOf(env, obj, &jc_MenuComponent)) {
-        appContext = JNFGetObjectField(env, obj, jf_MenuComponent_appContext);
-    }
-
-JNF_COCOA_EXIT(env);
-
-    return appContext;
-}
-
-/*
- * Class:     sun_awt_SunToolkit
- * Method:    setAppContext
- * Signature: (Ljava/lang/Object;Lsun/awt/AppContext;)Z
- */
-JNIEXPORT jboolean JNICALL
-Java_sun_awt_SunToolkit_setAppContext
-(JNIEnv *env, jclass cls, jobject obj, jobject appContext)
-{
-    jboolean isComponent;
-
-JNF_COCOA_ENTER(env);
-
-    if (JNFIsInstanceOf(env, obj, &jc_Component)) {
-        JNFSetObjectField(env, obj, jf_Component_appContext, appContext);
-        isComponent = JNI_TRUE;
-    } else if (JNFIsInstanceOf(env, obj, &jc_MenuComponent)) {
-        JNFSetObjectField(env, obj, jf_MenuComponent_appContext, appContext);
-        isComponent = JNI_FALSE;
-    }
-
-JNF_COCOA_EXIT(env);
-
-    return isComponent;
-}
-
 /*
  * Class:     sun_lwawt_macosx_LWCToolkit
  * Method:    beep
--- a/jdk/src/macosx/native/sun/awt/awt.m	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/macosx/native/sun/awt/awt.m	Mon Jun 02 13:53:52 2014 -0700
@@ -435,7 +435,7 @@
         forceEmbeddedMode = YES;
     }
     JNIEnv* env = [ThreadUtilities getJNIEnvUncached];
-    jclass jc_ThreadGroupUtils = (*env)->FindClass(env, "sun/misc/ThreadGroupUtils");
+    jclass jc_ThreadGroupUtils = (*env)->FindClass(env, "sun/awt/util/ThreadGroupUtils");
     jmethodID sjm_getRootThreadGroup = (*env)->GetStaticMethodID(env, jc_ThreadGroupUtils, "getRootThreadGroup", "()Ljava/lang/ThreadGroup;");
     jobject rootThreadGroup = (*env)->CallStaticObjectMethod(env, jc_ThreadGroupUtils, sjm_getRootThreadGroup);
     [ThreadUtilities setAppkitThreadGroup:(*env)->NewGlobalRef(env, rootThreadGroup)];
--- a/jdk/src/macosx/native/sun/osxapp/AWT_debug.h	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/macosx/native/sun/osxapp/AWT_debug.h	Mon Jun 02 13:53:52 2014 -0700
@@ -32,9 +32,10 @@
 #define kInternalError "java/lang/InternalError"
 
 #define AWT_DEBUG_LOG(str) \
-    NSLog(@"Cocoa AWT: %@ %@", str, [NSThread callStackSymbols])
+    NSLog(@"\tCocoa AWT: %@ %@", str, [NSThread callStackSymbols])
 
 #define AWT_DEBUG_BUG_REPORT_MESSAGE \
-    NSLog(@"\tPlease file a bug report at http://java.net/jira/browse/MACOSX_PORT with this message and a reproducible test case.")
+    NSLog(@"\tPlease file a bug report at http://bugreport.java.com/bugreport \
+with this message and a reproducible test case.")
 
 #endif
--- a/jdk/src/share/bin/java.c	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/bin/java.c	Mon Jun 02 13:53:52 2014 -0700
@@ -739,6 +739,9 @@
     if (s == NULL)
         return;
     s = JLI_WildcardExpandClasspath(s);
+    if (sizeof(format) - 2 + JLI_StrLen(s) < JLI_StrLen(s))
+        // s is became corrupted after expanding wildcards
+        return;
     def = JLI_MemAlloc(sizeof(format)
                        - 2 /* strlen("%s") */
                        + JLI_StrLen(s));
@@ -1358,9 +1361,11 @@
         if (s) {
             s = (char *) JLI_WildcardExpandClasspath(s);
             /* 40 for -Denv.class.path= */
-            envcp = (char *)JLI_MemAlloc(JLI_StrLen(s) + 40);
-            sprintf(envcp, "-Denv.class.path=%s", s);
-            AddOption(envcp, NULL);
+            if (JLI_StrLen(s) + 40 > JLI_StrLen(s)) { // Safeguard from overflow
+                envcp = (char *)JLI_MemAlloc(JLI_StrLen(s) + 40);
+                sprintf(envcp, "-Denv.class.path=%s", s);
+                AddOption(envcp, NULL);
+            }
         }
     }
 
--- a/jdk/src/share/classes/com/sun/crypto/provider/DHParameters.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/com/sun/crypto/provider/DHParameters.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -131,14 +131,14 @@
     protected String engineToString() {
         String LINE_SEP = System.getProperty("line.separator");
 
-        StringBuffer strbuf
-            = new StringBuffer("SunJCE Diffie-Hellman Parameters:"
+        StringBuilder sb
+            = new StringBuilder("SunJCE Diffie-Hellman Parameters:"
                                + LINE_SEP + "p:" + LINE_SEP
                                + Debug.toHexString(this.p)
                                + LINE_SEP + "g:" + LINE_SEP
                                + Debug.toHexString(this.g));
         if (this.l != 0)
-            strbuf.append(LINE_SEP + "l:" + LINE_SEP + "    " + this.l);
-        return strbuf.toString();
+            sb.append(LINE_SEP + "l:" + LINE_SEP + "    " + this.l);
+        return sb.toString();
     }
 }
--- a/jdk/src/share/classes/com/sun/crypto/provider/DHPublicKey.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/com/sun/crypto/provider/DHPublicKey.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -260,8 +260,8 @@
     public String toString() {
         String LINE_SEP = System.getProperty("line.separator");
 
-        StringBuffer strbuf
-            = new StringBuffer("SunJCE Diffie-Hellman Public Key:"
+        StringBuilder sb
+            = new StringBuilder("SunJCE Diffie-Hellman Public Key:"
                                + LINE_SEP + "y:" + LINE_SEP
                                + Debug.toHexString(this.y)
                                + LINE_SEP + "p:" + LINE_SEP
@@ -269,8 +269,8 @@
                                + LINE_SEP + "g:" + LINE_SEP
                                + Debug.toHexString(this.g));
         if (this.l != 0)
-            strbuf.append(LINE_SEP + "l:" + LINE_SEP + "    " + this.l);
-        return strbuf.toString();
+            sb.append(LINE_SEP + "l:" + LINE_SEP + "    " + this.l);
+        return sb.toString();
     }
 
     private void parseKeyBits() throws InvalidKeyException {
--- a/jdk/src/share/classes/com/sun/crypto/provider/OAEPParameters.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/com/sun/crypto/provider/OAEPParameters.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -238,7 +238,7 @@
     }
 
     protected String engineToString() {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         sb.append("MD: " + mdName + "\n");
         sb.append("MGF: MGF1" + mgfSpec.getDigestAlgorithm() + "\n");
         sb.append("PSource: PSpecified " +
--- a/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java	Mon Jun 02 13:53:52 2014 -0700
@@ -664,6 +664,12 @@
             try {
                 while (true) {
                     int chunkLength = stream.readInt();
+
+                    // verify the chunk length first
+                    if (chunkLength < 0 || chunkLength + 4 < 0) {
+                        throw new IIOException("Invalid chunk length " + chunkLength);
+                    }
+
                     int chunkType = stream.readInt();
 
                     if (chunkType == IDAT_TYPE) {
@@ -692,7 +698,7 @@
 
                 // verify the chunk length
                 if (chunkLength < 0) {
-                    throw new IIOException("Invalid chunk lenght " + chunkLength);
+                    throw new IIOException("Invalid chunk length " + chunkLength);
                 };
 
                 try {
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1683,6 +1683,7 @@
      * adjustments that windows/metal do.  This is because gtk doesn't
      * provide margins/insets for checkbox/radiobuttons.
      */
+    @SuppressWarnings("fallthrough")
     private static class GnomeLayoutStyle extends DefaultLayoutStyle {
         private static GnomeLayoutStyle INSTANCE = new GnomeLayoutStyle();
 
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java	Mon Jun 02 13:53:52 2014 -0700
@@ -2409,6 +2409,7 @@
 
     // Windows LayoutStyle.  From:
     // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwue/html/ch14e.asp
+    @SuppressWarnings("fallthrough")
     private class WindowsLayoutStyle extends DefaultLayoutStyle {
         @Override
         public int getPreferredGap(JComponent component1,
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsScrollBarUI.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsScrollBarUI.java	Mon Jun 02 13:53:52 2014 -0700
@@ -51,6 +51,8 @@
 public class WindowsScrollBarUI extends BasicScrollBarUI {
     private Grid thumbGrid;
     private Grid highlightGrid;
+    private Dimension horizontalThumbSize;
+    private Dimension verticalThumbSize;
 
     /**
      * Creates a UI for a JScrollBar.
@@ -65,11 +67,32 @@
     protected void installDefaults() {
         super.installDefaults();
 
-        if (XPStyle.getXP() != null) {
+        XPStyle xp = XPStyle.getXP();
+        if (xp != null) {
             scrollbar.setBorder(null);
+            horizontalThumbSize = getSize(scrollbar, xp, Part.SBP_THUMBBTNHORZ);
+            verticalThumbSize = getSize(scrollbar, xp, Part.SBP_THUMBBTNVERT);
+        } else {
+            horizontalThumbSize = null;
+            verticalThumbSize = null;
         }
     }
 
+    private static Dimension getSize(Component component, XPStyle xp, Part part) {
+        Skin skin = xp.getSkin(component, part);
+        return new Dimension(skin.getWidth(), skin.getHeight());
+    }
+
+    @Override
+    protected Dimension getMinimumThumbSize() {
+        if ((horizontalThumbSize == null) || (verticalThumbSize == null)) {
+            return super.getMinimumThumbSize();
+        }
+        return JScrollBar.HORIZONTAL == scrollbar.getOrientation()
+                ? horizontalThumbSize
+                : verticalThumbSize;
+    }
+
     public void uninstallUI(JComponent c) {
         super.uninstallUI(c);
         thumbGrid = highlightGrid = null;
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsTableHeaderUI.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsTableHeaderUI.java	Mon Jun 02 13:53:52 2014 -0700
@@ -182,7 +182,6 @@
                 if (sortOrder != null) {
                      switch(sortOrder) {
                      case ASCENDING:
-                         /* falls through */
                      case DESCENDING:
                          switch (state) {
                          case NORMAL:
@@ -197,6 +196,7 @@
                          default:
                              /* do nothing */
                          }
+                         break;
                      default :
                          /* do nothing */
                      }
--- a/jdk/src/share/classes/com/sun/jndi/ldap/Connection.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/Connection.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -459,10 +459,10 @@
                             // will be woken up before readTimeout only if reply is
                             // available
                             ldr.wait(readTimeout);
-                            waited = true;
                         } else {
                             ldr.wait(15 * 1000); // 15 second timeout
                         }
+                        waited = true;
                     } else {
                         break;
                     }
@@ -474,7 +474,7 @@
         }
 
         if ((rber == null) && waited) {
-            removeRequest(ldr);
+            abandonRequest(ldr, null);
             throw new NamingException("LDAP response read timed out, timeout used:"
                             + readTimeout + "ms." );
 
--- a/jdk/src/share/classes/com/sun/media/sound/AbstractLine.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/com/sun/media/sound/AbstractLine.java	Mon Jun 02 13:53:52 2014 -0700
@@ -48,7 +48,7 @@
     protected Control[] controls;
     AbstractMixer mixer;
     private boolean open     = false;
-    private final Vector listeners = new Vector();
+    private final Vector<Object> listeners = new Vector<>();
 
     /**
      * Contains event dispatcher per thread group.
--- a/jdk/src/share/classes/com/sun/media/sound/AbstractMidiDevice.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/com/sun/media/sound/AbstractMidiDevice.java	Mon Jun 02 13:53:52 2014 -0700
@@ -70,7 +70,7 @@
 
     /** List of Receivers and Transmitters that opened the device implicitely.
      */
-    private List openKeepingObjects;
+    private List<Object> openKeepingObjects;
 
     /**
      * This is the device handle returned from native code
@@ -284,6 +284,7 @@
     }
 
 
+    @SuppressWarnings("unchecked") // Cast of result of clone
     public final List<Receiver> getReceivers() {
         List<Receiver> recs;
         synchronized (traRecLock) {
@@ -313,6 +314,7 @@
     }
 
 
+    @SuppressWarnings("unchecked") // Cast of result of clone
     public final List<Transmitter> getTransmitters() {
         List<Transmitter> tras;
         synchronized (traRecLock) {
@@ -372,9 +374,9 @@
 
     /** Return the list of objects that have opened the device implicitely.
      */
-    private synchronized List getOpenKeepingObjects() {
+    private synchronized List<Object> getOpenKeepingObjects() {
         if (openKeepingObjects == null) {
-            openKeepingObjects = new ArrayList();
+            openKeepingObjects = new ArrayList<>();
         }
         return openKeepingObjects;
     }
--- a/jdk/src/share/classes/com/sun/media/sound/AbstractMixer.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/com/sun/media/sound/AbstractMixer.java	Mon Jun 02 13:53:52 2014 -0700
@@ -90,13 +90,13 @@
     /**
      * Source lines (ports) currently open
      */
-    private final Vector sourceLines = new Vector();
+    private final Vector<Line> sourceLines = new Vector<>();
 
 
     /**
      * Target lines currently open.
      */
-    private final Vector targetLines = new Vector();
+    private final Vector<Line> targetLines = new Vector<>();
 
 
     /**
@@ -151,7 +151,7 @@
     public final Line.Info[] getSourceLineInfo(Line.Info info) {
 
         int i;
-        Vector vec = new Vector();
+        Vector<Line.Info> vec = new Vector<>();
 
         for (i = 0; i < sourceLineInfo.length; i++) {
 
@@ -162,7 +162,7 @@
 
         Line.Info[] returnedArray = new Line.Info[vec.size()];
         for (i = 0; i < returnedArray.length; i++) {
-            returnedArray[i] = (Line.Info)vec.elementAt(i);
+            returnedArray[i] = vec.elementAt(i);
         }
 
         return returnedArray;
@@ -172,7 +172,7 @@
     public final Line.Info[] getTargetLineInfo(Line.Info info) {
 
         int i;
-        Vector vec = new Vector();
+        Vector<Line.Info> vec = new Vector<>();
 
         for (i = 0; i < targetLineInfo.length; i++) {
 
@@ -183,7 +183,7 @@
 
         Line.Info[] returnedArray = new Line.Info[vec.size()];
         for (i = 0; i < returnedArray.length; i++) {
-            returnedArray[i] = (Line.Info)vec.elementAt(i);
+            returnedArray[i] = vec.elementAt(i);
         }
 
         return returnedArray;
@@ -231,7 +231,7 @@
             localLines = new Line[sourceLines.size()];
 
             for (int i = 0; i < localLines.length; i++) {
-                localLines[i] = (Line)sourceLines.elementAt(i);
+                localLines[i] = sourceLines.elementAt(i);
             }
         }
 
@@ -248,7 +248,7 @@
             localLines = new Line[targetLines.size()];
 
             for (int i = 0; i < localLines.length; i++) {
-                localLines[i] = (Line)targetLines.elementAt(i);
+                localLines[i] = targetLines.elementAt(i);
             }
         }
 
@@ -453,7 +453,8 @@
             return;
         }
 
-        Vector localSourceLines = (Vector)sourceLines.clone();
+        @SuppressWarnings("unchecked")
+        Vector<Line> localSourceLines = (Vector<Line>)sourceLines.clone();
         for (int i = 0; i < localSourceLines.size(); i++) {
 
             // if any other open line is running, return
@@ -468,7 +469,8 @@
             }
         }
 
-        Vector localTargetLines = (Vector)targetLines.clone();
+        @SuppressWarnings("unchecked")
+        Vector<Line> localTargetLines = (Vector<Line>)targetLines.clone();
         for (int i = 0; i < localTargetLines.size(); i++) {
 
             // if any other open line is running, return
--- a/jdk/src/share/classes/com/sun/media/sound/AlawCodec.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/com/sun/media/sound/AlawCodec.java	Mon Jun 02 13:53:52 2014 -0700
@@ -213,7 +213,7 @@
     private AudioFormat[] getOutputFormats(AudioFormat inputFormat) {
 
 
-        Vector formats = new Vector();
+        Vector<AudioFormat> formats = new Vector<>();
         AudioFormat format;
 
         if ( AudioFormat.Encoding.PCM_SIGNED.equals(inputFormat.getEncoding())) {
@@ -248,7 +248,7 @@
 
         AudioFormat[] formatArray = new AudioFormat[formats.size()];
         for (int i = 0; i < formatArray.length; i++) {
-            formatArray[i] = (AudioFormat)(formats.elementAt(i));
+            formatArray[i] = formats.elementAt(i);
         }
         return formatArray;
     }
--- a/jdk/src/share/classes/com/sun/media/sound/AudioSynthesizerPropertyInfo.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/com/sun/media/sound/AudioSynthesizerPropertyInfo.java	Mon Jun 02 13:53:52 2014 -0700
@@ -68,7 +68,7 @@
      * The <code>valueClass</code> field specifies class
      * used in <code>value</code> field.
      */
-    public Class valueClass = null;
+    public Class<?> valueClass = null;
     /**
      * An array of possible values if the value for the field
      * <code>AudioSynthesizerPropertyInfo.value</code> may be selected
--- a/jdk/src/share/classes/com/sun/media/sound/DirectAudioDevice.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/com/sun/media/sound/DirectAudioDevice.java	Mon Jun 02 13:53:52 2014 -0700
@@ -94,7 +94,7 @@
     }
 
     private DirectDLI createDataLineInfo(boolean isSource) {
-        Vector formats = new Vector();
+        Vector<AudioFormat> formats = new Vector<>();
         AudioFormat[] hardwareFormatArray = null;
         AudioFormat[] formatArray = null;
 
@@ -107,7 +107,7 @@
                 int formatArraySize = size;
                 hardwareFormatArray = new AudioFormat[size];
                 for (int i = 0; i < size; i++) {
-                    AudioFormat format = (AudioFormat)formats.elementAt(i);
+                    AudioFormat format = formats.elementAt(i);
                     hardwareFormatArray[i] = format;
                     int bits = format.getSampleSizeInBits();
                     boolean isSigned = format.getEncoding().equals(AudioFormat.Encoding.PCM_SIGNED);
@@ -265,7 +265,7 @@
         return ((DirectAudioDeviceProvider.DirectAudioDeviceInfo) getMixerInfo()).getMaxSimulLines();
     }
 
-    private static void addFormat(Vector v, int bits, int frameSizeInBytes, int channels, float sampleRate,
+    private static void addFormat(Vector<AudioFormat> v, int bits, int frameSizeInBytes, int channels, float sampleRate,
                                   int encoding, boolean signed, boolean bigEndian) {
         AudioFormat.Encoding enc = null;
         switch (encoding) {
@@ -338,7 +338,7 @@
     private static final class DirectDLI extends DataLine.Info {
         final AudioFormat[] hardwareFormats;
 
-        private DirectDLI(Class clazz, AudioFormat[] formatArray,
+        private DirectDLI(Class<?> clazz, AudioFormat[] formatArray,
                           AudioFormat[] hardwareFormatArray,
                           int minBuffer, int maxBuffer) {
             super(clazz, formatArray, minBuffer, maxBuffer);
@@ -1457,7 +1457,7 @@
 
     } // class DirectBAOS
 
-
+    @SuppressWarnings("rawtypes")
     private static native void nGetFormats(int mixerIndex, int deviceID,
                                            boolean isSource, Vector formats);
 
--- a/jdk/src/share/classes/com/sun/media/sound/EventDispatcher.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/com/sun/media/sound/EventDispatcher.java	Mon Jun 02 13:53:52 2014 -0700
@@ -57,7 +57,7 @@
     /**
      * List of events
      */
-    private final ArrayList eventQueue = new ArrayList();
+    private final ArrayList<EventInfo> eventQueue = new ArrayList<>();
 
 
     /**
@@ -186,7 +186,7 @@
             }
             if (eventQueue.size() > 0) {
                 // Remove the event from the queue and dispatch it to the listeners.
-                eventInfo = (EventInfo) eventQueue.remove(0);
+                eventInfo = eventQueue.remove(0);
             }
 
         } // end of synchronized
@@ -230,7 +230,7 @@
     /**
      * Send audio and MIDI events.
      */
-    void sendAudioEvents(Object event, List listeners) {
+    void sendAudioEvents(Object event, List<Object> listeners) {
         if ((listeners == null)
             || (listeners.size() == 0)) {
             // nothing to do
@@ -392,7 +392,7 @@
          * @param event the event to be dispatched
          * @param listeners listener list; will be copied
          */
-        EventInfo(Object event, List listeners) {
+        EventInfo(Object event, List<Object> listeners) {
             this.event = event;
             this.listeners = listeners.toArray();
         }
--- a/jdk/src/share/classes/com/sun/media/sound/JDK13Services.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/com/sun/media/sound/JDK13Services.java	Mon Jun 02 13:53:52 2014 -0700
@@ -118,7 +118,7 @@
         (the part before the hash sign), if available. If the property is
         not set or the value has no provider class name part, null is returned.
      */
-    public static synchronized String getDefaultProviderClassName(Class typeClass) {
+    public static synchronized String getDefaultProviderClassName(Class<?> typeClass) {
         String value = null;
         String defaultProviderSpec = getDefaultProvider(typeClass);
         if (defaultProviderSpec != null) {
@@ -144,7 +144,7 @@
         part after the hash sign), if available. If the property is not set
         or the value has no instance name part, null is returned.
      */
-    public static synchronized String getDefaultInstanceName(Class typeClass) {
+    public static synchronized String getDefaultInstanceName(Class<?> typeClass) {
         String value = null;
         String defaultProviderSpec = getDefaultProvider(typeClass);
         if (defaultProviderSpec != null) {
@@ -165,7 +165,7 @@
         @return The complete value of the property, if available.
         If the property is not set, null is returned.
      */
-    private static synchronized String getDefaultProvider(Class typeClass) {
+    private static synchronized String getDefaultProvider(Class<?> typeClass) {
         if (!SourceDataLine.class.equals(typeClass)
                 && !TargetDataLine.class.equals(typeClass)
                 && !Clip.class.equals(typeClass)
--- a/jdk/src/share/classes/com/sun/media/sound/MidiInDeviceProvider.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/com/sun/media/sound/MidiInDeviceProvider.java	Mon Jun 02 13:53:52 2014 -0700
@@ -106,9 +106,9 @@
      * the new instance will not reflect that state...
      */
     static final class MidiInDeviceInfo extends AbstractMidiDeviceProvider.Info {
-        private final Class providerClass;
+        private final Class<?> providerClass;
 
-        private MidiInDeviceInfo(int index, Class providerClass) {
+        private MidiInDeviceInfo(int index, Class<?> providerClass) {
             super(nGetName(index), nGetVendor(index), nGetDescription(index), nGetVersion(index), index);
             this.providerClass = providerClass;
         }
--- a/jdk/src/share/classes/com/sun/media/sound/MidiOutDeviceProvider.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/com/sun/media/sound/MidiOutDeviceProvider.java	Mon Jun 02 13:53:52 2014 -0700
@@ -104,9 +104,9 @@
      * the new instance will not reflect that state...
      */
     static final class MidiOutDeviceInfo extends AbstractMidiDeviceProvider.Info {
-        private final Class providerClass;
+        private final Class<?> providerClass;
 
-        private MidiOutDeviceInfo(int index, Class providerClass) {
+        private MidiOutDeviceInfo(int index, Class<?> providerClass) {
             super(nGetName(index), nGetVendor(index), nGetDescription(index), nGetVersion(index), index);
             this.providerClass = providerClass;
         }
--- a/jdk/src/share/classes/com/sun/media/sound/MidiUtils.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/com/sun/media/sound/MidiUtils.java	Mon Jun 02 13:53:52 2014 -0700
@@ -295,7 +295,7 @@
 
 
         public synchronized void refresh(Sequence seq) {
-            ArrayList list = new ArrayList();
+            ArrayList<MidiEvent> list = new ArrayList<>();
             Track[] tracks = seq.getTracks();
             if (tracks.length > 0) {
                 // tempo events only occur in track 0
@@ -313,7 +313,7 @@
             int size = list.size() + 1;
             firstTempoIsFake = true;
             if ((size > 1)
-                && (((MidiEvent) list.get(0)).getTick() == 0)) {
+                && (list.get(0).getTick() == 0)) {
                 // do not need to add an initial tempo event at the beginning
                 size--;
                 firstTempoIsFake = false;
@@ -328,7 +328,7 @@
                 e++;
             }
             for (int i = 0; i < list.size(); i++, e++) {
-                MidiEvent evt = (MidiEvent) list.get(i);
+                MidiEvent evt = list.get(i);
                 ticks[e] = evt.getTick();
                 tempos[e] = getTempoMPQ(evt.getMessage());
             }
--- a/jdk/src/share/classes/com/sun/media/sound/PCMtoPCMCodec.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/com/sun/media/sound/PCMtoPCMCodec.java	Mon Jun 02 13:53:52 2014 -0700
@@ -91,7 +91,7 @@
         // filter out targetEncoding from the old getOutputFormats( sourceFormat ) method
 
         AudioFormat[] formats = getOutputFormats( sourceFormat );
-        Vector newFormats = new Vector();
+        Vector<AudioFormat> newFormats = new Vector<>();
         for(int i=0; i<formats.length; i++ ) {
             if( formats[i].getEncoding().equals( targetEncoding ) ) {
                 newFormats.addElement( formats[i] );
@@ -101,7 +101,7 @@
         AudioFormat[] formatArray = new AudioFormat[newFormats.size()];
 
         for (int i = 0; i < formatArray.length; i++) {
-            formatArray[i] = (AudioFormat)(newFormats.elementAt(i));
+            formatArray[i] = newFormats.elementAt(i);
         }
 
         return formatArray;
@@ -181,7 +181,7 @@
     /*  public AudioFormat[] getOutputFormats(AudioFormat inputFormat) { */
     private AudioFormat[] getOutputFormats(AudioFormat inputFormat) {
 
-        Vector formats = new Vector();
+        Vector<AudioFormat> formats = new Vector<>();
         AudioFormat format;
 
         int sampleSize = inputFormat.getSampleSizeInBits();
@@ -335,7 +335,7 @@
 
             for (int i = 0; i < formatArray.length; i++) {
 
-                formatArray[i] = (AudioFormat)(formats.elementAt(i));
+                formatArray[i] = formats.elementAt(i);
             }
         }
 
--- a/jdk/src/share/classes/com/sun/media/sound/PortMixer.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/com/sun/media/sound/PortMixer.java	Mon Jun 02 13:53:52 2014 -0700
@@ -253,12 +253,12 @@
             long newID = ((PortMixer) mixer).getID();
             if ((id == 0) || (newID != id) || (controls.length == 0)) {
                 id = newID;
-                Vector vector = new Vector();
+                Vector<Control> vector = new Vector<>();
                 synchronized (vector) {
                     nGetControls(id, portIndex, vector);
                     controls = new Control[vector.size()];
                     for (int i = 0; i < controls.length; i++) {
-                        controls[i] = (Control) vector.elementAt(i);
+                        controls[i] = vector.elementAt(i);
                     }
                 }
             } else {
@@ -494,6 +494,7 @@
     private static native String nGetPortName(long id, int portIndex);
 
     // fills the vector with the controls for this port
+    @SuppressWarnings("rawtypes")
     private static native void nGetControls(long id, int portIndex, Vector vector);
 
     // getters/setters for controls
--- a/jdk/src/share/classes/com/sun/media/sound/RealTimeSequencer.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/com/sun/media/sound/RealTimeSequencer.java	Mon Jun 02 13:53:52 2014 -0700
@@ -122,7 +122,7 @@
     /**
      * List of tracks to which we're recording
      */
-    private final List recordingTracks = new ArrayList();
+    private final List<RecordingTrack> recordingTracks = new ArrayList<>();
 
 
     private long loopStart = 0;
@@ -133,13 +133,13 @@
     /**
      * Meta event listeners
      */
-    private final ArrayList metaEventListeners = new ArrayList();
+    private final ArrayList<Object> metaEventListeners = new ArrayList<>();
 
 
     /**
      * Control change listeners
      */
-    private final ArrayList controllerEventListeners = new ArrayList();
+    private final ArrayList<ControllerListElement> controllerEventListeners = new ArrayList<>();
 
 
     /** automatic connection support */
@@ -645,7 +645,7 @@
             boolean flag = false;
             for(int i=0; i < controllerEventListeners.size(); i++) {
 
-                cve = (ControllerListElement) controllerEventListeners.get(i);
+                cve = controllerEventListeners.get(i);
 
                 if (cve.listener.equals(listener)) {
                     cve.addControllers(controllers);
@@ -669,7 +669,7 @@
             ControllerListElement cve = null;
             boolean flag = false;
             for (int i=0; i < controllerEventListeners.size(); i++) {
-                cve = (ControllerListElement) controllerEventListeners.get(i);
+                cve = controllerEventListeners.get(i);
                 if (cve.listener.equals(listener)) {
                     cve.removeControllers(controllers);
                     flag = true;
@@ -940,9 +940,9 @@
         }
         ShortMessage msg = (ShortMessage) message;
         int controller = msg.getData1();
-        List sendToListeners = new ArrayList();
+        List<Object> sendToListeners = new ArrayList<>();
         for (int i = 0; i < size; i++) {
-            ControllerListElement cve = (ControllerListElement) controllerEventListeners.get(i);
+            ControllerListElement cve = controllerEventListeners.get(i);
             for(int j = 0; j < cve.controllers.length; j++) {
                 if (cve.controllers[j] == controller) {
                     sendToListeners.add(cve.listener);
@@ -1213,13 +1213,13 @@
             this.channel = channel;
         }
 
-        static RecordingTrack get(List recordingTracks, Track track) {
+        static RecordingTrack get(List<RecordingTrack> recordingTracks, Track track) {
 
             synchronized(recordingTracks) {
                 int size = recordingTracks.size();
 
                 for (int i = 0; i < size; i++) {
-                    RecordingTrack current = (RecordingTrack)recordingTracks.get(i);
+                    RecordingTrack current = recordingTracks.get(i);
                     if (current.track == track) {
                         return current;
                     }
@@ -1228,12 +1228,12 @@
             return null;
         }
 
-        static Track get(List recordingTracks, int channel) {
+        static Track get(List<RecordingTrack> recordingTracks, int channel) {
 
             synchronized(recordingTracks) {
                 int size = recordingTracks.size();
                 for (int i = 0; i < size; i++) {
-                    RecordingTrack current = (RecordingTrack)recordingTracks.get(i);
+                    RecordingTrack current = recordingTracks.get(i);
                     if ((current.channel == channel) || (current.channel == -1)) {
                         return current.track;
                     }
--- a/jdk/src/share/classes/com/sun/media/sound/SoftSynthesizer.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/com/sun/media/sound/SoftSynthesizer.java	Mon Jun 02 13:53:52 2014 -0700
@@ -949,7 +949,7 @@
             Object v = (info == null) ? null : info.get(item2.name);
             v = (v != null) ? v : storedProperties.getProperty(item2.name);
             if (v != null) {
-                Class c = (item2.valueClass);
+                Class<?> c = (item2.valueClass);
                 if (c.isInstance(v))
                     item2.value = v;
                 else if (v instanceof String) {
--- a/jdk/src/share/classes/com/sun/media/sound/UlawCodec.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/com/sun/media/sound/UlawCodec.java	Mon Jun 02 13:53:52 2014 -0700
@@ -198,7 +198,7 @@
     /*  public AudioFormat[] getOutputFormats(AudioFormat inputFormat) { */
     private AudioFormat[] getOutputFormats(AudioFormat inputFormat) {
 
-        Vector formats = new Vector();
+        Vector<AudioFormat> formats = new Vector<>();
         AudioFormat format;
 
         if ((inputFormat.getSampleSizeInBits() == 16)
@@ -235,7 +235,7 @@
 
         AudioFormat[] formatArray = new AudioFormat[formats.size()];
         for (int i = 0; i < formatArray.length; i++) {
-            formatArray[i] = (AudioFormat)(formats.elementAt(i));
+            formatArray[i] = formats.elementAt(i);
         }
         return formatArray;
     }
--- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/resource/schema/etsi.xsd	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,347 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- edited with XML Spy v4.3 U (http://www.xmlspy.com) by XMLSpy v4 (Altova) -->
-<xsd:schema targetNamespace="http://uri.etsi.org/01903/v1.1.1#" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://uri.etsi.org/01903/v1.1.1#" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" elementFormDefault="qualified" xsi:schemaLocation="http://www.w3.org/2000/09/xmldsig# xmldsig-core-schema.xsd">
-	<xsd:element name="Any" type="AnyType"/>
-	<xsd:complexType name="AnyType" mixed="true">
-		<xsd:sequence>
-			<xsd:any namespace="##any"/>
-		</xsd:sequence>
-		<xsd:anyAttribute namespace="##any"/>
-	</xsd:complexType>
-	<xsd:element name="ObjectIdentifier" type="ObjectIdentifierType"/>
-	<xsd:complexType name="ObjectIdentifierType">
-		<xsd:sequence>
-			<xsd:element name="Identifier" type="IdentifierType"/>
-			<xsd:element name="Description" type="xsd:string" minOccurs="0"/>
-			<xsd:element name="DocumentationReferences" type="DocumentationReferencesType" minOccurs="0"/>
-		</xsd:sequence>
-	</xsd:complexType>
-	<xsd:complexType name="IdentifierType">
-		<xsd:simpleContent>
-			<xsd:extension base="xsd:anyURI">
-				<xsd:attribute name="Qualifier" type="QualifierType" use="optional"/>
-			</xsd:extension>
-		</xsd:simpleContent>
-	</xsd:complexType>
-	<xsd:simpleType name="QualifierType">
-		<xsd:restriction base="xsd:string">
-			<xsd:enumeration value="OIDAsURI"/>
-			<xsd:enumeration value="OIDAsURN"/>
-		</xsd:restriction>
-	</xsd:simpleType>
-	<xsd:complexType name="DocumentationReferencesType">
-		<xsd:sequence maxOccurs="unbounded">
-			<xsd:element name="DocumentationReference" type="xsd:anyURI"/>
-		</xsd:sequence>
-	</xsd:complexType>
-	<xsd:element name="EncapsulatedPKIData" type="EncapsulatedPKIDataType"/>
-	<xsd:complexType name="EncapsulatedPKIDataType">
-		<xsd:simpleContent>
-			<xsd:extension base="xsd:base64Binary">
-				<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
-			</xsd:extension>
-		</xsd:simpleContent>
-	</xsd:complexType>
-	<xsd:element name="TimeStamp" type="TimeStampType"/>
-	<xsd:complexType name="TimeStampType">
-		<xsd:sequence>
-			<xsd:element name="HashDataInfo" type="HashDataInfoType" maxOccurs="unbounded"/>
-			<xsd:choice>
-				<xsd:element name="EncapsulatedTimeStamp" type="EncapsulatedPKIDataType"/>
-				<xsd:element name="XMLTimeStamp" type="AnyType"/>
-			</xsd:choice>
-		</xsd:sequence>
-	</xsd:complexType>
-	<xsd:complexType name="HashDataInfoType">
-		<xsd:sequence>
-			<xsd:element name="Transforms" type="ds:TransformsType" minOccurs="0"/>
-		</xsd:sequence>
-		<xsd:attribute name="uri" type="xsd:anyURI" use="required"/>
-	</xsd:complexType>
-	<xsd:element name="QualifyingProperties" type="QualifyingPropertiesType"/>
-	<xsd:complexType name="QualifyingPropertiesType">
-		<xsd:sequence>
-			<xsd:element name="SignedProperties" type="SignedPropertiesType" minOccurs="0"/>
-			<xsd:element name="UnsignedProperties" type="UnsignedPropertiesType" minOccurs="0"/>
-		</xsd:sequence>
-		<xsd:attribute name="Target" type="xsd:anyURI" use="required"/>
-		<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
-	</xsd:complexType>
-	<xsd:element name="SignedProperties" type="SignedPropertiesType"/>
-	<xsd:complexType name="SignedPropertiesType">
-		<xsd:sequence>
-			<xsd:element name="SignedSignatureProperties" type="SignedSignaturePropertiesType"/>
-			<xsd:element name="SignedDataObjectProperties" type="SignedDataObjectPropertiesType" minOccurs="0"/>
-		</xsd:sequence>
-		<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
-	</xsd:complexType>
-	<xsd:element name="UnsignedProperties" type="UnsignedPropertiesType"/>
-	<xsd:complexType name="UnsignedPropertiesType">
-		<xsd:sequence>
-			<xsd:element name="UnsignedSignatureProperties" type="UnsignedSignaturePropertiesType" minOccurs="0"/>
-			<xsd:element name="UnsignedDataObjectProperties" type="UnsignedDataObjectPropertiesType" minOccurs="0"/>
-		</xsd:sequence>
-		<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
-	</xsd:complexType>
-	<xsd:element name="SignedSignatureProperties" type="SignedSignaturePropertiesType"/>
-	<xsd:complexType name="SignedSignaturePropertiesType">
-		<xsd:sequence>
-			<xsd:element name="SigningTime" type="xsd:dateTime"/>
-			<xsd:element name="SigningCertificate" type="CertIDListType"/>
-			<xsd:element name="SignaturePolicyIdentifier" type="SignaturePolicyIdentifierType"/>
-			<xsd:element name="SignatureProductionPlace" type="SignatureProductionPlaceType" minOccurs="0"/>
-			<xsd:element name="SignerRole" type="SignerRoleType" minOccurs="0"/>
-		</xsd:sequence>
-	</xsd:complexType>
-	<xsd:element name="SignedDataObjectProperties" type="SignedDataObjectPropertiesType"/>
-	<xsd:complexType name="SignedDataObjectPropertiesType">
-		<xsd:sequence>
-			<xsd:element name="DataObjectFormat" type="DataObjectFormatType" minOccurs="0" maxOccurs="unbounded"/>
-			<xsd:element name="CommitmentTypeIndication" type="CommitmentTypeIndicationType" minOccurs="0" maxOccurs="unbounded"/>
-			<xsd:element name="AllDataObjectsTimeStamp" type="TimeStampType" minOccurs="0" maxOccurs="unbounded"/>
-			<xsd:element name="IndividualDataObjectsTimeStamp" type="TimeStampType" minOccurs="0" maxOccurs="unbounded"/>
-		</xsd:sequence>
-	</xsd:complexType>
-	<xsd:element name="UnsignedSignatureProperties" type="UnsignedSignaturePropertiesType"/>
-	<xsd:complexType name="UnsignedSignaturePropertiesType">
-		<xsd:sequence>
-			<xsd:element name="CounterSignature" type="CounterSignatureType" minOccurs="0" maxOccurs="unbounded"/>
-			<xsd:element name="SignatureTimeStamp" type="TimeStampType" minOccurs="0" maxOccurs="unbounded"/>
-			<xsd:element name="CompleteCertificateRefs" type="CompleteCertificateRefsType" minOccurs="0"/>
-			<xsd:element name="CompleteRevocationRefs" type="CompleteRevocationRefsType" minOccurs="0"/>
-			<xsd:choice>
-				<xsd:element name="SigAndRefsTimeStamp" type="TimeStampType" minOccurs="0" maxOccurs="unbounded"/>
-				<xsd:element name="RefsOnlyTimeStamp" type="TimeStampType" minOccurs="0" maxOccurs="unbounded"/>
-			</xsd:choice>
-			<xsd:element name="CertificateValues" type="CertificateValuesType" minOccurs="0"/>
-			<xsd:element name="RevocationValues" type="RevocationValuesType" minOccurs="0"/>
-			<xsd:element name="ArchiveTimeStamp" type="TimeStampType" minOccurs="0" maxOccurs="unbounded"/>
-		</xsd:sequence>
-	</xsd:complexType>
-	<xsd:element name="UnsignedDataObjectProperties" type="UnsignedDataObjectPropertiesType"/>
-	<xsd:complexType name="UnsignedDataObjectPropertiesType">
-		<xsd:sequence>
-			<xsd:element name="UnsignedDataObjectProperty" type="AnyType" minOccurs="0" maxOccurs="unbounded"/>
-		</xsd:sequence>
-	</xsd:complexType>
-	<xsd:element name="QualifyingPropertiesReference" type="QualifyingPropertiesReferenceType"/>
-	<xsd:complexType name="QualifyingPropertiesReferenceType">
-		<xsd:sequence>
-			<xsd:element name="Transforms" type="ds:TransformsType" minOccurs="0"/>
-		</xsd:sequence>
-		<xsd:attribute name="URI" type="xsd:anyURI" use="required"/>
-		<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
-	</xsd:complexType>
-	<xsd:element name="SigningTime" type="xsd:dateTime"/>
-	<xsd:element name="SigningCertificate" type="CertIDListType"/>
-	<xsd:complexType name="CertIDListType">
-		<xsd:sequence>
-			<xsd:element name="Cert" type="CertIDType" maxOccurs="unbounded"/>
-		</xsd:sequence>
-	</xsd:complexType>
-	<xsd:complexType name="CertIDType">
-		<xsd:sequence>
-			<xsd:element name="CertDigest" type="DigestAlgAndValueType"/>
-			<xsd:element name="IssuerSerial" type="ds:X509IssuerSerialType"/>
-		</xsd:sequence>
-	</xsd:complexType>
-	<xsd:complexType name="DigestAlgAndValueType">
-		<xsd:sequence>
-			<xsd:element name="DigestMethod" type="ds:DigestMethodType"/>
-			<xsd:element name="DigestValue" type="ds:DigestValueType"/>
-		</xsd:sequence>
-	</xsd:complexType>
-	<xsd:element name="SignaturePolicyIdentifier" type="SignaturePolicyIdentifierType"/>
-	<xsd:complexType name="SignaturePolicyIdentifierType">
-		<xsd:choice>
-			<xsd:element name="SignaturePolicyId" type="SignaturePolicyIdType"/>
-			<xsd:element name="SignaturePolicyImplied"/>
-		</xsd:choice>
-	</xsd:complexType>
-	<xsd:complexType name="SignaturePolicyIdType">
-		<xsd:sequence>
-			<xsd:element name="SigPolicyId" type="ObjectIdentifierType"/>
-			<xsd:element ref="ds:Transforms" minOccurs="0"/>
-			<xsd:element name="SigPolicyHash" type="DigestAlgAndValueType"/>
-			<xsd:element name="SigPolicyQualifiers" type="SigPolicyQualifiersListType" minOccurs="0"/>
-		</xsd:sequence>
-	</xsd:complexType>
-	<xsd:complexType name="SigPolicyQualifiersListType">
-		<xsd:sequence>
-			<xsd:element name="SigPolicyQualifier" type="AnyType" maxOccurs="unbounded"/>
-		</xsd:sequence>
-	</xsd:complexType>
-	<xsd:element name="SPURI" type="xsd:anyURI"/>
-	<xsd:element name="SPUserNotice" type="SPUserNoticeType"/>
-	<xsd:complexType name="SPUserNoticeType">
-		<xsd:sequence>
-			<xsd:element name="NoticeRef" type="NoticeReferenceType" minOccurs="0"/>
-			<xsd:element name="ExplicitText" type="xsd:string" minOccurs="0"/>
-		</xsd:sequence>
-	</xsd:complexType>
-	<xsd:complexType name="NoticeReferenceType">
-		<xsd:sequence>
-			<xsd:element name="Organization" type="xsd:string"/>
-			<xsd:element name="NoticeNumbers" type="IntegerListType"/>
-		</xsd:sequence>
-	</xsd:complexType>
-	<xsd:complexType name="IntegerListType">
-		<xsd:sequence>
-			<xsd:element name="int" type="xsd:integer" minOccurs="0" maxOccurs="unbounded"/>
-		</xsd:sequence>
-	</xsd:complexType>
-	<xsd:element name="CounterSignature" type="CounterSignatureType"/>
-	<xsd:complexType name="CounterSignatureType">
-		<xsd:sequence>
-			<xsd:element ref="ds:Signature"/>
-		</xsd:sequence>
-	</xsd:complexType>
-	<xsd:element name="DataObjectFormat" type="DataObjectFormatType"/>
-	<xsd:complexType name="DataObjectFormatType">
-		<xsd:sequence>
-			<xsd:element name="Description" type="xsd:string" minOccurs="0"/>
-			<xsd:element name="ObjectIdentifier" type="ObjectIdentifierType" minOccurs="0"/>
-			<xsd:element name="MimeType" type="xsd:string" minOccurs="0"/>
-			<xsd:element name="Encoding" type="xsd:anyURI" minOccurs="0"/>
-		</xsd:sequence>
-		<xsd:attribute name="ObjectReference" type="xsd:anyURI" use="required"/>
-	</xsd:complexType>
-	<xsd:element name="CommitmentTypeIndication" type="CommitmentTypeIndicationType"/>
-	<xsd:complexType name="CommitmentTypeIndicationType">
-		<xsd:sequence>
-			<xsd:element name="CommitmentTypeId" type="ObjectIdentifierType"/>
-			<xsd:choice>
-				<xsd:element name="ObjectReference" type="xsd:anyURI" minOccurs="0" maxOccurs="unbounded"/>
-				<xsd:element name="AllSignedDataObjects"/>
-			</xsd:choice>
-			<xsd:element name="CommitmentTypeQualifiers" type="CommitmentTypeQualifiersListType" minOccurs="0"/>
-		</xsd:sequence>
-	</xsd:complexType>
-	<xsd:complexType name="CommitmentTypeQualifiersListType">
-		<xsd:sequence>
-			<xsd:element name="CommitmentTypeQualifier" type="AnyType" minOccurs="0" maxOccurs="unbounded"/>
-		</xsd:sequence>
-	</xsd:complexType>
-	<xsd:element name="SignatureProductionPlace" type="SignatureProductionPlaceType"/>
-	<xsd:complexType name="SignatureProductionPlaceType">
-		<xsd:sequence>
-			<xsd:element name="City" type="xsd:string" minOccurs="0"/>
-			<xsd:element name="StateOrProvince" type="xsd:string" minOccurs="0"/>
-			<xsd:element name="PostalCode" type="xsd:string" minOccurs="0"/>
-			<xsd:element name="CountryName" type="xsd:string" minOccurs="0"/>
-		</xsd:sequence>
-	</xsd:complexType>
-	<xsd:element name="SignerRole" type="SignerRoleType"/>
-	<xsd:complexType name="SignerRoleType">
-		<xsd:sequence>
-			<xsd:element name="ClaimedRoles" type="ClaimedRolesListType" minOccurs="0"/>
-			<xsd:element name="CertifiedRoles" type="CertifiedRolesListType" minOccurs="0"/>
-		</xsd:sequence>
-	</xsd:complexType>
-	<xsd:complexType name="ClaimedRolesListType">
-		<xsd:sequence>
-			<xsd:element name="ClaimedRole" type="AnyType" maxOccurs="unbounded"/>
-		</xsd:sequence>
-	</xsd:complexType>
-	<xsd:complexType name="CertifiedRolesListType">
-		<xsd:sequence>
-			<xsd:element name="CertifiedRole" type="EncapsulatedPKIDataType" maxOccurs="unbounded"/>
-		</xsd:sequence>
-	</xsd:complexType>
-	<xsd:element name="AllDataObjectsTimeStamp" type="TimeStampType"/>
-	<xsd:element name="IndividualDataObjectsTimeStamp" type="TimeStampType"/>
-	<xsd:element name="SignatureTimeStamp" type="TimeStampType"/>
-	<xsd:element name="CompleteCertificateRefs" type="CompleteCertificateRefsType"/>
-	<xsd:complexType name="CompleteCertificateRefsType">
-		<xsd:sequence>
-			<xsd:element name="CertRefs" type="CertIDListType"/>
-		</xsd:sequence>
-		<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
-	</xsd:complexType>
-	<xsd:element name="CompleteRevocationRefs" type="CompleteRevocationRefsType"/>
-	<xsd:complexType name="CompleteRevocationRefsType">
-		<xsd:sequence>
-			<xsd:element name="CRLRefs" type="CRLRefsType" minOccurs="0"/>
-			<xsd:element name="OCSPRefs" type="OCSPRefsType" minOccurs="0"/>
-			<xsd:element name="OtherRefs" type="OtherCertStatusRefsType" minOccurs="0"/>
-		</xsd:sequence>
-		<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
-	</xsd:complexType>
-	<xsd:complexType name="CRLRefsType">
-		<xsd:sequence>
-			<xsd:element name="CRLRef" type="CRLRefType" maxOccurs="unbounded"/>
-		</xsd:sequence>
-	</xsd:complexType>
-	<xsd:complexType name="CRLRefType">
-		<xsd:sequence>
-			<xsd:element name="DigestAlgAndValue" type="DigestAlgAndValueType"/>
-			<xsd:element name="CRLIdentifier" type="CRLIdentifierType" minOccurs="0"/>
-		</xsd:sequence>
-	</xsd:complexType>
-	<xsd:complexType name="CRLIdentifierType">
-		<xsd:sequence>
-			<xsd:element name="Issuer" type="xsd:string"/>
-			<xsd:element name="IssueTime" type="xsd:dateTime"/>
-			<xsd:element name="Number" type="xsd:integer" minOccurs="0"/>
-		</xsd:sequence>
-		<xsd:attribute name="URI" type="xsd:anyURI" use="optional"/>
-	</xsd:complexType>
-	<xsd:complexType name="OCSPRefsType">
-		<xsd:sequence>
-			<xsd:element name="OCSPRef" type="OCSPRefType" maxOccurs="unbounded"/>
-		</xsd:sequence>
-	</xsd:complexType>
-	<xsd:complexType name="OCSPRefType">
-		<xsd:sequence>
-			<xsd:element name="OCSPIdentifier" type="OCSPIdentifierType"/>
-			<xsd:element name="DigestAlgAndValue" type="DigestAlgAndValueType" minOccurs="0"/>
-		</xsd:sequence>
-	</xsd:complexType>
-	<xsd:complexType name="OCSPIdentifierType">
-		<xsd:sequence>
-			<xsd:element name="ResponderID" type="xsd:string"/>
-			<xsd:element name="ProducedAt" type="xsd:dateTime"/>
-		</xsd:sequence>
-		<xsd:attribute name="URI" type="xsd:anyURI" use="optional"/>
-	</xsd:complexType>
-	<xsd:complexType name="OtherCertStatusRefsType">
-		<xsd:sequence>
-			<xsd:element name="OtherRef" type="AnyType" maxOccurs="unbounded"/>
-		</xsd:sequence>
-	</xsd:complexType>
-	<xsd:element name="SigAndRefsTimeStamp" type="TimeStampType"/>
-	<xsd:element name="RefsOnlyTimeStamp" type="TimeStampType"/>
-	<xsd:element name="CertificateValues" type="CertificateValuesType"/>
-	<xsd:complexType name="CertificateValuesType">
-		<xsd:choice minOccurs="0" maxOccurs="unbounded">
-			<xsd:element name="EncapsulatedX509Certificate" type="EncapsulatedPKIDataType"/>
-			<xsd:element name="OtherCertificate" type="AnyType"/>
-		</xsd:choice>
-		<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
-	</xsd:complexType>
-	<xsd:element name="RevocationValues" type="RevocationValuesType"/>
-	<xsd:complexType name="RevocationValuesType">
-		<xsd:sequence>
-			<xsd:element name="CRLValues" type="CRLValuesType" minOccurs="0"/>
-			<xsd:element name="OCSPValues" type="OCSPValuesType" minOccurs="0"/>
-			<xsd:element name="OtherValues" type="OtherCertStatusValuesType" minOccurs="0"/>
-		</xsd:sequence>
-		<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
-	</xsd:complexType>
-	<xsd:complexType name="CRLValuesType">
-		<xsd:sequence>
-			<xsd:element name="EncapsulatedCRLValue" type="EncapsulatedPKIDataType" maxOccurs="unbounded"/>
-		</xsd:sequence>
-	</xsd:complexType>
-	<xsd:complexType name="OCSPValuesType">
-		<xsd:sequence>
-			<xsd:element name="EncapsulatedOCSPValue" type="EncapsulatedPKIDataType" maxOccurs="unbounded"/>
-		</xsd:sequence>
-	</xsd:complexType>
-	<xsd:complexType name="OtherCertStatusValuesType">
-		<xsd:sequence>
-			<xsd:element name="OtherValue" type="AnyType" maxOccurs="unbounded"/>
-		</xsd:sequence>
-	</xsd:complexType>
-	<xsd:element name="ArchiveTimeStamp" type="TimeStampType"/>
-</xsd:schema>
--- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/resource/schema/xenc-schema.rng	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,219 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- http://www.xml.com/lpt/a/2002/01/23/relaxng.html -->
-<!-- http://www.oasis-open.org/committees/relax-ng/tutorial-20011203.html -->
-<!-- http://www.zvon.org/xxl/XMLSchemaTutorial/Output/ser_wildcards_st8.html -->
-<!-- http://lists.oasis-open.org/archives/relax-ng-comment/200206/maillist.html -->
-
-<grammar xmlns='http://relaxng.org/ns/structure/1.0'
-        xmlns:ds='http://www.w3.org/2000/09/xmldsig#'
-        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-        ns="http://www.w3.org/2001/04/xmlenc#"
-        datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
-
-    <include href="http://www.w3.org/Signature/Drafts/xmldsig-core/xmldsig-core-schema.rng">
-    <!-- Used for DigestMethod, KeyInfoType and anyThing -->
-    <!-- Since xmldsig-core also has a start, I have to include it
-        in the include for redefinition. -->
-        <start>
-            <choice>
-                <!-- We get to define the permissible root elements! -->
-                <element name="EncryptedData"><ref name="EncryptedDataType"/></element>
-                <element name="EncryptedKey"><ref name="EncryptedKeyType"/></element>
-            </choice>
-        </start>   
-        
-        <define name='anyThing'>
-            <zeroOrMore>
-                <choice>
-                    <text/>
-                    <element>
-                        <anyName>
-                            <except>
-                                <nsName/>
-                                <nsName ns='http://www.w3.org/2000/09/xmldsig#'/>
-                            </except>
-                        </anyName>
-                        <ref name='anyThing'/>
-                        <zeroOrMore>
-                            <attribute>
-                              <anyName/>
-                            </attribute>
-                        </zeroOrMore>
-                    </element>
-                </choice>
-            </zeroOrMore>
-            </define>
-        
-        
-    </include>
-    
-        <!-- Import definitions from the xmldsig rng -->
-
-        <define name="KeyInfoType" combine="interleave">
-            <zeroOrMore>
-                <choice>
-                    <element name="EncryptedKey"><ref name="EncryptedKeyType"/></element>
-                    <element name="AgreementMethod"><ref name="AgreementMethodType"/></element>
-                </choice>
-            </zeroOrMore>    
-        </define>
-
-        <define name="DigestMethodType" combine="choice">
-            <notAllowed/>
-         </define>
-
-        <define name="TransformType" combine="choice">
-            <notAllowed/>
-         </define>
-
-    <!-- Now redefined in the include statement
-        <define name="anyThing" combine="choice">
-            <notAllowed/>
-         </define>
-    -->
-
-    <!-- End import -->
-        
-  
-    <define name="EncryptedDataType">
-          <ref name="EncryptedType"/>
-    </define>
-  
-  
-    <define name="EncryptedKeyType">
-            <ref name="EncryptedType"/>
-            <optional><element name='ReferenceList'>
-                <ref name="ReferenceListType"/></element>
-            </optional>
-            <optional><element name='CarriedKeyName'><data type="string"/></element></optional>
-            <optional><attribute name='Recipient'> <data type="string"/></attribute></optional>
-    </define>
-
-    
-     <define name="EncryptedType">
-        <element name="EncryptionMethod"><ref name="EncryptionMethodType"/></element>
-        <optional>
-            <element name="KeyInfo" ns="http://www.w3.org/2000/09/xmldsig#">
-                <ref name="KeyInfoType"/>
-            </element>
-        </optional>
-        <optional>
-            <element name="CipherData"><ref name="CipherDataType"/></element>
-        </optional> 
-        <optional>
-             <element name="EncryptionProperties"><ref name="EncryptionPropertiesType"/></element>
-        </optional>
-        <optional><attribute name="Id"><data type="ID"/></attribute></optional>
-        <optional><attribute name="Type"><data type="anyURI"/></attribute></optional>
-        <optional><attribute name="MimeType"><data type="string"/></attribute></optional>
-        <optional><attribute name="Encoding"><data type="anyURI"/></attribute></optional>
-        <optional><attribute name='xsi:schemaLocation'/></optional>
-    </define> 
-
-    <define name="EncryptionMethodType">
-        <zeroOrMore>
-            <choice>
-                <element name="KeySize">
-                    <data type="integer"/>
-                </element>
-                <element name="OAEPparams">
-                    <data type="base64Binary"/>
-                </element>
-                <text/>
-                <element name='DigestMethod' ns="http://www.w3.org/2000/09/xmldsig#">
-                    <ref name="DigestMethodType"/>
-                </element>
-            </choice>
-        </zeroOrMore>
-        <attribute name="Algorithm"><data type="anyURI"/></attribute>
-    </define>
-
-            
-    <define name="AgreementMethodType">
-        <zeroOrMore>
-            <choice>
-                <element name="KA-Nonce">
-                    <data type="base64Binary"/>
-                </element>
-                <element name='DigestMethod' ns="http://www.w3.org/2000/09/xmldsig#">
-                    <ref name="DigestMethodType"/>
-                </element>
-                <text/>
-                <element>
-                    <nsName ns="http://www.w3.org/2000/09/xmldsig#"/>
-                    <ref name="anyThing"/>
-                </element>
-                <element name="OriginatorKeyInfo"><ref name="KeyInfoType"/></element>
-                <element name="RecipientKeyInfo"><ref name="KeyInfoType"/></element>
-            </choice>
-        </zeroOrMore>
-        <attribute name="Algorithm"><data type="anyURI"/></attribute>
-    </define>            
-            
-            
-    <define name="ReferenceListType">
-        <oneOrMore>
-            <choice>
-                <element name="DataReference">
-                    <text/>
-                    <attribute name="URI"><data type="anyURI"/></attribute>
-                </element>
-                <element name="KeyReference">
-                    <text/>
-                    <attribute name="URI"><data type="anyURI"/></attribute>
-                </element>
-            </choice>
-        </oneOrMore>
-    </define>
-    
-    
-    <define name="CipherDataType">
-        <choice>
-            <element name="CipherValue"><data type="base64Binary"/></element>
-            <element name="CipherReference">
-                <element name="Transforms">
-                  <oneOrMore>
-                      <element name='Transform' ns="http://www.w3.org/2000/09/xmldsig#">
-                          <ref name='TransformType'/>
-                        </element>
-                    </oneOrMore>
-                </element>
-                <attribute name="URI">
-                    <data type="anyURI"/>
-                </attribute>      
-            </element>
-        </choice>
-    </define>
-    
-    
-    <define name="EncryptionPropertiesType">        
-        <element name="EncryptionProperty">
-          <zeroOrMore>
-                <element>
-                    <anyName/>
-                    <text/>
-                </element>
-            </zeroOrMore>
-            <optional>
-                <attribute name="Target">
-                    <data type="anyURI"/>
-                </attribute>  
-            </optional>
-            <optional>                
-                <attribute name="Id">
-                    <data type="ID"/>
-                </attribute>    
-            </optional>
-        </element>
-        
-        <optional>
-            <attribute name="Id">
-                <data type="ID"/>
-            </attribute>    
-        </optional>
-        <zeroOrMore>
-            <attribute><nsName ns="http://www.w3.org/XML/1998/namespace"/></attribute>
-        </zeroOrMore>
-    </define>
-
-</grammar>
\ No newline at end of file
--- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/resource/schema/xenc-schema.xsd	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,146 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE schema  PUBLIC "-//W3C//DTD XMLSchema 200102//EN"
- "http://www.w3.org/2001/XMLSchema.dtd"
- [
-   <!ATTLIST schema
-     xmlns:xenc CDATA #FIXED 'http://www.w3.org/2001/04/xmlenc#'
-     xmlns:ds CDATA #FIXED 'http://www.w3.org/2000/09/xmldsig#'>
-   <!ENTITY xenc 'http://www.w3.org/2001/04/xmlenc#'>
-   <!ENTITY % p ''>
-   <!ENTITY % s ''>
-  ]>
-
-<schema xmlns='http://www.w3.org/2001/XMLSchema' version='1.0'
-        xmlns:xenc='http://www.w3.org/2001/04/xmlenc#'
-        xmlns:ds='http://www.w3.org/2000/09/xmldsig#'
-        targetNamespace='http://www.w3.org/2001/04/xmlenc#'
-        elementFormDefault='qualified'>
-
-  <import namespace='http://www.w3.org/2000/09/xmldsig#'
-          schemaLocation='http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd'/>
-
-  <complexType name='EncryptedType' abstract='true'>
-    <sequence>
-      <element name='EncryptionMethod' type='xenc:EncryptionMethodType'
-       minOccurs='0'/>
-      <element ref='ds:KeyInfo' minOccurs='0'/>
-      <element ref='xenc:CipherData'/>
-      <element ref='xenc:EncryptionProperties' minOccurs='0'/>
-    </sequence>
-    <attribute name='Id' type='ID' use='optional'/>
-    <attribute name='Type' type='anyURI' use='optional'/>
-    <attribute name='MimeType' type='string' use='optional'/>
-    <attribute name='Encoding' type='anyURI' use='optional'/>
-  </complexType>
-  
-  <complexType name='EncryptionMethodType' mixed='true'>
-    <sequence>
-      <element name='KeySize' minOccurs='0' type='xenc:KeySizeType'/>
-      <element name='OAEPparams' minOccurs='0' type='base64Binary'/>
-      <any namespace='##other' minOccurs='0' maxOccurs='unbounded'/>
-    </sequence>
-    <attribute name='Algorithm' type='anyURI' use='required'/>
-  </complexType>
-
-    <simpleType name='KeySizeType'>
-      <restriction base="integer"/>
-    </simpleType>
-
-  <element name='CipherData' type='xenc:CipherDataType'/>
-  <complexType name='CipherDataType'>
-     <choice>
-       <element name='CipherValue' type='base64Binary'/>
-       <element ref='xenc:CipherReference'/>
-     </choice>
-    </complexType>
-
-   <element name='CipherReference' type='xenc:CipherReferenceType'/>
-   <complexType name='CipherReferenceType'>
-       <choice>
-         <element name='Transforms' type='xenc:TransformsType' minOccurs='0'/>
-       </choice>
-       <attribute name='URI' type='anyURI' use='required'/>
-   </complexType>
-
-     <complexType name='TransformsType'>
-       <sequence>
-         <element ref='ds:Transform' maxOccurs='unbounded'/>
-       </sequence>
-     </complexType>
-
-
-  <element name='EncryptedData' type='xenc:EncryptedDataType'/>
-  <complexType name='EncryptedDataType'>
-    <complexContent>
-      <extension base='xenc:EncryptedType'>
-       </extension>
-    </complexContent>
-  </complexType>
-
-  <!-- Children of ds:KeyInfo -->
-
-  <element name='EncryptedKey' type='xenc:EncryptedKeyType'/>
-  <complexType name='EncryptedKeyType'>
-    <complexContent>
-      <extension base='xenc:EncryptedType'>
-        <sequence>
-          <element ref='xenc:ReferenceList' minOccurs='0'/>
-          <element name='CarriedKeyName' type='string' minOccurs='0'/>
-        </sequence>
-        <attribute name='Recipient' type='string'
-         use='optional'/>
-      </extension>
-    </complexContent>
-  </complexType>
-
-    <element name="AgreementMethod" type="xenc:AgreementMethodType"/>
-    <complexType name="AgreementMethodType" mixed="true">
-      <sequence>
-        <element name="KA-Nonce" minOccurs="0" type="base64Binary"/>
-        <!-- <element ref="ds:DigestMethod" minOccurs="0"/> -->
-        <any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
-        <element name="OriginatorKeyInfo" minOccurs="0" type="ds:KeyInfoType"/>
-        <element name="RecipientKeyInfo" minOccurs="0" type="ds:KeyInfoType"/>
-      </sequence>
-      <attribute name="Algorithm" type="anyURI" use="required"/>
-    </complexType>
-
-  <!-- End Children of ds:KeyInfo -->
-
-  <element name='ReferenceList'>
-    <complexType>
-      <choice minOccurs='1' maxOccurs='unbounded'>
-        <element name='DataReference' type='xenc:ReferenceType'/>
-        <element name='KeyReference' type='xenc:ReferenceType'/>
-      </choice>
-    </complexType>
-  </element>
-
-  <complexType name='ReferenceType'>
-    <sequence>
-      <any namespace='##other' minOccurs='0' maxOccurs='unbounded'/>
-    </sequence>
-    <attribute name='URI' type='anyURI' use='required'/>
-  </complexType>
-
-
-  <element name='EncryptionProperties' type='xenc:EncryptionPropertiesType'/>
-  <complexType name='EncryptionPropertiesType'>
-    <sequence>
-      <element ref='xenc:EncryptionProperty' maxOccurs='unbounded'/>
-    </sequence>
-    <attribute name='Id' type='ID' use='optional'/>
-  </complexType>
-
-    <element name='EncryptionProperty' type='xenc:EncryptionPropertyType'/>
-    <complexType name='EncryptionPropertyType' mixed='true'>
-      <choice maxOccurs='unbounded'>
-        <any namespace='##other' processContents='lax'/>
-      </choice>
-      <attribute name='Target' type='anyURI' use='optional'/>
-      <attribute name='Id' type='ID' use='optional'/>
-      <anyAttribute namespace="http://www.w3.org/XML/1998/namespace"/>
-    </complexType>
-
-</schema>
-
--- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/resource/schema/xmldsig-core-schema.dtd	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,171 +0,0 @@
-<!-- DTD for XML Signatures
-    http://www.w3.org/2000/09/xmldsig#
-    Joseph Reagle $last changed 20001215$
-
-    http://www.w3.org/2000/09/xmldsig#
-    $Revision: 1.6 $ on $Date: 2008/07/24 16:15:03 $ by $Author: mullan $
-
-    Copyright 2001 The Internet Society and W3C (Massachusetts Institute
-    of Technology, Institut National de Recherche en Informatique et en
-    Automatique, Keio University). All Rights Reserved.
-    http://www.w3.org/Consortium/Legal/
-
-    This document is governed by the W3C Software License [1] as described
-    in the FAQ [2].
-
-    [1] http://www.w3.org/Consortium/Legal/copyright-software-19980720
-    [2] http://www.w3.org/Consortium/Legal/IPR-FAQ-20000620.html#DTD
--->
-
-
-<!--
-
-The following entity declarations enable external/flexible content in
-the Signature content model.
-
-#PCDATA emulates schema string; when combined with element types it
-emulates schema's mixed content type.
-
-%foo.ANY permits the user to include their own element types from
-other namespaces, for example:
- <!ENTITY % KeyValue.ANY '| ecds:ECDSAKeyValue'>
- ...
- <!ELEMENT ecds:ECDSAKeyValue (#PCDATA)  >
-
--->
-
-<!ENTITY % Object.ANY ''>
-<!ENTITY % Method.ANY ''>
-<!ENTITY % Transform.ANY ''>
-<!ENTITY % SignatureProperty.ANY ''>
-<!ENTITY % KeyInfo.ANY ''>
-<!ENTITY % KeyValue.ANY ''>
-<!ENTITY % PGPData.ANY ''>
-<!ENTITY % X509Data.ANY ''>
-<!ENTITY % SPKIData.ANY ''>
-
-
-
-<!-- Start Core Signature declarations, these should NOT be altered -->
-
-<!ELEMENT Signature (SignedInfo, SignatureValue, KeyInfo?, Object*)  >
-<!ATTLIST Signature  
-	xmlns	CDATA	#FIXED 'http://www.w3.org/2000/09/xmldsig#'
-	Id  	ID	#IMPLIED >
-
-<!ELEMENT SignatureValue (#PCDATA) >
-<!ATTLIST SignatureValue  
-         Id  ID      #IMPLIED>
-
-<!ELEMENT SignedInfo (CanonicalizationMethod, 
-	SignatureMethod,  Reference+)  >
-<!ATTLIST SignedInfo  
-	Id	 ID 	 #IMPLIED 
->
-
-<!ELEMENT CanonicalizationMethod (#PCDATA %Method.ANY;)* > 
-<!ATTLIST CanonicalizationMethod 
-	Algorithm CDATA #REQUIRED > 
-
-<!ELEMENT SignatureMethod (#PCDATA|HMACOutputLength %Method.ANY;)* >
-<!ATTLIST SignatureMethod 
-	Algorithm CDATA #REQUIRED > 
-
-<!ELEMENT Reference (Transforms?, DigestMethod, DigestValue)  >
-<!ATTLIST Reference
-	Id	ID	#IMPLIED
-	URI	CDATA	#IMPLIED
-	Type	CDATA	#IMPLIED>
-
-
-<!ELEMENT Transforms (Transform+)>
-
-<!ELEMENT Transform (#PCDATA|XPath %Transform.ANY;)* >
-<!ATTLIST Transform 
-	Algorithm    CDATA    #REQUIRED >
-
-<!ELEMENT XPath (#PCDATA) >
-
-<!ELEMENT DigestMethod (#PCDATA %Method.ANY;)* >
-<!ATTLIST DigestMethod  
-	Algorithm		CDATA	#REQUIRED >
-
-<!ELEMENT DigestValue  (#PCDATA)  >
-
-<!ELEMENT KeyInfo	(#PCDATA|KeyName|KeyValue|RetrievalMethod|
-           X509Data|PGPData|SPKIData|MgmtData %KeyInfo.ANY;)* >
-<!ATTLIST KeyInfo
-	Id	ID	 #IMPLIED >
-
-<!-- Key Information -->
-
-<!ELEMENT KeyName (#PCDATA) >
-<!ELEMENT KeyValue (#PCDATA|DSAKeyValue|RSAKeyValue %KeyValue.ANY;)* >
-<!ELEMENT MgmtData (#PCDATA) >
-
-<!ELEMENT RetrievalMethod (Transforms?) >
-<!ATTLIST RetrievalMethod
-  URI	CDATA #REQUIRED 
-  Type	CDATA #IMPLIED > 
-
-<!-- X.509 Data -->
-
-<!ELEMENT X509Data ((X509IssuerSerial | X509SKI | X509SubjectName |
-                    X509Certificate | X509CRL )+ %X509Data.ANY;)>
-<!ELEMENT X509IssuerSerial (X509IssuerName, X509SerialNumber) >
-<!ELEMENT X509IssuerName (#PCDATA) >
-<!ELEMENT X509SubjectName (#PCDATA) >
-<!ELEMENT X509SerialNumber (#PCDATA) >
-<!ELEMENT X509SKI (#PCDATA) >
-<!ELEMENT X509Certificate (#PCDATA) >
-<!ELEMENT X509CRL (#PCDATA) >
-
-<!-- PGPData -->
-
-<!ELEMENT PGPData ((PGPKeyID, PGPKeyPacket?) | (PGPKeyPacket) %PGPData.ANY;) >
-<!ELEMENT PGPKeyPacket  (#PCDATA)  >
-<!ELEMENT PGPKeyID  (#PCDATA)  >
-
-<!-- SPKI Data -->
-
-<!ELEMENT SPKIData (SPKISexp %SPKIData.ANY;)  >
-<!ELEMENT SPKISexp  (#PCDATA)  >
-
-<!-- Extensible Content -->
-
-<!ELEMENT Object (#PCDATA|Signature|SignatureProperties|Manifest %Object.ANY;)* >
-<!ATTLIST Object  
-	Id	ID	#IMPLIED
-	MimeType	CDATA	#IMPLIED
-	Encoding	CDATA	#IMPLIED >
-
-<!ELEMENT Manifest (Reference+)  >
-<!ATTLIST Manifest  
-	Id	ID	#IMPLIED >
-
-<!ELEMENT SignatureProperties (SignatureProperty+)  >
-<!ATTLIST SignatureProperties  
-	Id	ID	 #IMPLIED  >
-
-<!ELEMENT SignatureProperty (#PCDATA %SignatureProperty.ANY;)* >
-<!ATTLIST SignatureProperty  
-	Target 	CDATA	 #REQUIRED
-	Id	ID	 #IMPLIED  >
-
-<!-- Algorithm Parameters -->
-
-<!ELEMENT HMACOutputLength (#PCDATA) >
-
-<!ELEMENT DSAKeyValue ((P, Q)?, G?, Y, J?, (Seed, PgenCounter)?) >
-<!ELEMENT P (#PCDATA) >
-<!ELEMENT Q (#PCDATA) >
-<!ELEMENT G (#PCDATA) >
-<!ELEMENT Y (#PCDATA) >
-<!ELEMENT J (#PCDATA) >
-<!ELEMENT Seed (#PCDATA) >
-<!ELEMENT PgenCounter (#PCDATA) >
-
-<!ELEMENT RSAKeyValue (Modulus, Exponent) > 
-<!ELEMENT Modulus (#PCDATA) >
-<!ELEMENT Exponent (#PCDATA) >
-
--- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/resource/schema/xmldsig-core-schema.rng	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,339 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- http://www.xml.com/lpt/a/2002/01/23/relaxng.html -->
-<!-- http://www.oasis-open.org/committees/relax-ng/tutorial-20011203.html -->
-<!-- http://www.zvon.org/xxl/XMLSchemaTutorial/Output/ser_wildcards_st8.html -->
-<!-- http://lists.oasis-open.org/archives/relax-ng-comment/200206/maillist.html -->
-
-<grammar xmlns='http://relaxng.org/ns/structure/1.0'
-        xmlns:ds='http://www.w3.org/2000/09/xmldsig#'
-        xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
-        ns='http://www.w3.org/2000/09/xmldsig#'
-        datatypeLibrary='http://www.w3.org/2001/XMLSchema-datatypes'>
-
-    <start>
-            <element name='Signature'><ref name='SignatureType'/></element>
-    </start>   
-    
-    <define name='CryptoBinary'>
-        <data type='base64Binary'/>
-    </define>
-    
-    <define name='SignatureType'>
-        <element name='SignedInfo'><ref name='SignedInfoType'/></element>
-        <element name='SignatureValue'><ref name='SignatureValueType'/></element>
-        <optional><element name='KeyInfo'><ref name='KeyInfoType'/></element></optional>
-        <zeroOrMore><element name='Object'><ref name='ObjectType'/></element></zeroOrMore>
-        <optional><attribute name='Id'><data type='ID'/></attribute></optional>
-        <optional><attribute name='xsi:schemaLocation'/></optional>
-    </define>
-
-    <define name='SignatureValueType'>
-        <data type='base64Binary'/>
-        <optional><attribute name='Id'><data type='ID'/></attribute></optional>
-    </define>
-    
-<!-- Start SignedInfo -->
-    
-    <define name='SignedInfoType'>
-        <element name='CanonicalizationMethod'><ref name='CanonicalizationMethodType'/></element>
-        <element name='SignatureMethod'><ref name='SignatureMethodType'/></element>
-        <optional><element name='KeyInfo'><ref name='KeyInfoType'/></element></optional>
-        <oneOrMore><element name='Reference'><ref name='ReferenceType'/></element></oneOrMore>
-        <optional><attribute name='Id'><data type='ID'/></attribute></optional>
-    </define>    
-
-    <define name='CanonicalizationMethodType'>
-        <zeroOrMore><ref name='anyThing'/></zeroOrMore>
-        <optional><attribute name='Algorithm'><data type='anyURI'/></attribute></optional>
-    </define>    
-
-
-    <define name='SignatureMethodType'>
-        <optional><element name='HMACOutputLength'><data type='integer'/></element></optional>
-        <zeroOrMore><ref name='anyThing'/></zeroOrMore>
-        <optional><attribute name='Algorithm'><data type='anyURI'/></attribute></optional>
-    </define>    
-        
-<!-- Start Reference -->
-    
-    <define name='ReferenceType'>
-        <optional><element name='Transforms'><ref name='TransformsType'/></element></optional>
-        <element name='DigestMethod'><ref name='DigestMethodType'/></element>
-        <element name='DigestValue'><ref name='DigestValueType'/></element>
-        <optional><attribute name='Type'><data type='anyURI'/></attribute></optional>
-        <optional><attribute name='URI'><data type='anyURI'/></attribute></optional>
-        <optional><attribute name='Id'><data type='ID'/></attribute></optional>
-     </define>
-
-    <define name='TransformsType'>
-        <oneOrMore><element name='Transform'><ref name='TransformType'/></element></oneOrMore>
-    </define>
-
-    <define name='TransformType'>
-        <optional><element name='XPath'><data type='string'/></element></optional>
-        <zeroOrMore><ref name='anyThing'/></zeroOrMore>
-        <attribute name='Algorithm'><data type='anyURI'/></attribute>
-    </define>    
-
-<!-- End Reference -->
-
-    <define name='DigestMethodType'>
-        <zeroOrMore><ref name='anyThing'/></zeroOrMore>
-        <attribute name='Algorithm'><data type='anyURI'/></attribute>
-    </define>   
-
-    <define name='DigestValueType'>
-        <data type='base64Binary'/>
-    </define>  
-    
-<!-- End SignedInfo -->
-
-<!-- Start KeyInfo -->
-    
-    <define name='KeyInfoType'>
-        <oneOrMore>
-            <choice>
-                <element name='KeyName'><data type='string'/></element>
-                <element name='KeyValue'><ref name='KeyValueType'/></element>
-                <element name='RetrievalMethod'><ref name='RetrievalMethodType'/></element>
-                <element name='X509Data'><ref name='X509DataType'/></element>
-                <element name='PGPData'><ref name='PGPDataType'/></element>
-                <element name='SPKIData'><ref name='SPKIDataType'/></element>
-                <element name='MgmtData'><data type='string'/></element>
-                <ref name='anyThing'/>
-            </choice>
-        </oneOrMore>
-        <optional><attribute name='Id'><data type='ID'/></attribute></optional>
-</define>
-
-    <define name='KeyValueType'>
-            <choice>
-                <text/>
-                <element name='DSAKeyValue'><ref name='DSAKeyValueType'/></element>
-                <element name='RSAKeyValue'><ref name='RSAKeyValueType'/></element>
-                <ref name='anyThing'/>
-            </choice>
-    </define>
-
-    <define name='RetrievalMethodType'>
-        <optional><element name='Transforms'><ref name='TransformsType'/></element></optional>
-        <optional><attribute name='Type'><data type='anyURI'/></attribute></optional>
-        <optional><attribute name='URI'><data type='anyURI'/></attribute></optional>
-    </define>
-
-<!-- Start X509Data -->
-
-    <define name='X509DataType'>
-        <oneOrMore>
-            <choice>
-                <element name='X509IssuerSerial'>
-                    <element name='X509IssuerName'>
-                        <data type='string'/>
-                    </element>
-                    <element name='X509SerialNumber'>
-                        <data type='integer'/>
-                    </element>
-                </element>
-                <element name='X509SKI'>
-                    <data type='base64Binary'/>
-                </element>
-                <element name='X509SubjectName'>
-                    <data type='string'/>
-                </element>
-                <element name='X509Certificate'>
-                    <data type='base64Binary'/>
-                </element>
-                <element name='X509CRL'>
-                    <data type='base64Binary'/>
-                </element>
-                <ref name='anyThing'/>
-            </choice>
-        </oneOrMore>
-    </define>
-
-<!-- End X509Data -->
-
-<!-- Begin PGPData -->
-
-    <define name='PGPDataType'>
-        <choice>
-            <group>
-                <element name='PGPKeyID'>
-                    <data type='base64Binary'/>
-                </element>
-                <optional>
-                    <element name='PGPKeyPacket'>
-                        <data type='base64Binary'/>
-                    </element>
-                </optional>
-                <zeroOrMore>
-                    <ref name='anyThing'/>
-                </zeroOrMore>
-            </group>
-            <group>
-                <element name='PGPKeyPacket'>
-                    <data type='base64Binary'/>
-                </element>
-                <zeroOrMore>
-                    <ref name='anyThing'/>
-                </zeroOrMore>
-            </group>
-        </choice>
-    </define>
-
-<!-- End PGPData -->
-
-<!-- Begin SPKIData -->
-
-    <define name='SPKIDataType'>
-        <oneOrMore>
-            <element name='SPKISexp'>
-                <data type='base64Binary'/>
-            </element>
-            <optional>
-                <ref name='anyThing'/>
-            </optional>
-        </oneOrMore>
-    </define>
-    
-<!-- End SPKIData -->
-
-<!-- End KeyInfo -->
-
-
-<!-- Start Object (Manifest, SignatureProperty) -->
-
-    <define name='ObjectType'>
-        <zeroOrMore>
-            <choice>
-                <element name='Manifest'><ref name='ManifestType'/></element>
-                <element name='SignatureProperties'><ref name='SignaturePropertiesType'/></element>                
-                <ref name='anyThing'/>
-            </choice>
-        </zeroOrMore>
-        <optional>
-            <attribute name='Encoding'>
-                <data type='anyURI'/>
-            </attribute>
-        </optional>
-        <optional>
-            <attribute name='MimeType'>
-                <data type='string'/>
-            </attribute>
-        </optional>
-        <optional>
-            <attribute name='Id'>
-                <data type='ID'/>
-            </attribute>
-        </optional>
-    </define>
-
-    <define name='ManifestType'>
-        <oneOrMore>
-            <element name='Reference'><ref name='ReferenceType'/></element>
-        </oneOrMore>
-        <optional><attribute name='Id'><data type='ID'/></attribute></optional>
-    </define>
-
-    <define name='SignaturePropertiesType'>
-        <oneOrMore>
-            <element name='SignatureProperty'><ref name='SignaturePropertyType'/></element>
-        </oneOrMore>
-        <optional>
-            <attribute name='Id'>
-                <data type='ID'/>
-            </attribute>
-        </optional>
-    </define>
-
-    <define name='SignaturePropertyType'>
-        <oneOrMore><ref name='anyThing'/></oneOrMore>
-        <optional>
-            <attribute name='Id'>
-                <data type='ID'/>
-            </attribute>
-        </optional>
-        <attribute name='Target'>
-            <data type='anyURI'/>
-        </attribute>
-    </define>
-
-<!-- End Object (Manifest, SignatureProperty) -->
-
-
-<!-- Start KeyValue Element-types -->
-
-    <define name='DSAKeyValueType'>
-        <optional>
-            <element name='P'>
-                <ref name='CryptoBinary'/>
-            </element>
-            <element name='Q'>
-                <ref name='CryptoBinary'/>
-            </element>
-        </optional>
-        <optional>
-            <element name='G'>
-                <ref name='CryptoBinary'/>
-            </element>
-        </optional>
-        <element name='Y'>
-            <ref name='CryptoBinary'/>
-        </element>
-        <optional>
-            <element name='J'>
-                <ref name='CryptoBinary'/>
-            </element>
-        </optional>
-        <optional>
-            <element name='Seed'>
-                <ref name='CryptoBinary'/>
-            </element>
-            <element name='PgenCounter'>
-                <ref name='CryptoBinary'/>
-            </element>
-        </optional>
-    </define>
-
-    <define name='RSAKeyValueType'>
-        <element name='Modulus'>
-            <ref name='CryptoBinary'/>
-        </element>
-        <element name='Exponent'>
-            <ref name='CryptoBinary'/>
-        </element>
-    </define>
-
-
-<!-- End KeyValue Element-types -->
-
-<!-- End Signature -->
-
-
-        <!-- This should emulate the ANY content model under lax validation -->
-        <define name='anyThing'>
-            <zeroOrMore>
-                <choice>
-                    <text/>
-                    <element>
-                        <!-- "except" provided for DTD compatibility -->
-                        <!-- [1] ns='http://www.oasis-open.org/committees/relax-ng/compatibility.html#id' -->
-                        <anyName>
-                            <except>
-                                <nsName/>
-                                <!--  <nsName ns='http://www.w3.org/2001/04/xmlenc#'/>  -->
-                            </except>
-                        </anyName>
-                        <ref name='anyThing'/>
-                        <zeroOrMore>
-                            <attribute>
-                              <anyName/>
-                            </attribute>
-                        </zeroOrMore>
-                    </element>
-                </choice>
-            </zeroOrMore>
-            </define>
-            
-
-</grammar>
\ No newline at end of file
--- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/resource/schema/xmldsig-core-schema.xsd	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,318 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE schema
-  PUBLIC "-//W3C//DTD XMLSchema 200102//EN" "http://www.w3.org/2001/XMLSchema.dtd"
- [
-   <!ATTLIST schema 
-     xmlns:ds CDATA #FIXED "http://www.w3.org/2000/09/xmldsig#">
-   <!ENTITY dsig 'http://www.w3.org/2000/09/xmldsig#'>
-   <!ENTITY % p ''>
-   <!ENTITY % s ''>
-  ]>
-
-<!-- Schema for XML Signatures
-    http://www.w3.org/2000/09/xmldsig#
-    $Revision: 1.6 $ on $Date: 2008/07/24 16:15:03 $ by $Author: mullan $
-
-    Copyright 2001 The Internet Society and W3C (Massachusetts Institute
-    of Technology, Institut National de Recherche en Informatique et en
-    Automatique, Keio University). All Rights Reserved.
-    http://www.w3.org/Consortium/Legal/
-
-    This document is governed by the W3C Software License [1] as described
-    in the FAQ [2].
-
-    [1] http://www.w3.org/Consortium/Legal/copyright-software-19980720
-    [2] http://www.w3.org/Consortium/Legal/IPR-FAQ-20000620.html#DTD
--->
-
-
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
-        xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
-        targetNamespace="http://www.w3.org/2000/09/xmldsig#"
-        version="0.1" elementFormDefault="qualified"> 
-
-<!-- Basic Types Defined for Signatures -->
-
-<simpleType name="CryptoBinary">
-  <restriction base="base64Binary">
-  </restriction>
-</simpleType>
-
-<!-- Start Signature -->
-
-<element name="Signature" type="ds:SignatureType"/>
-<complexType name="SignatureType">
-  <sequence> 
-    <element ref="ds:SignedInfo"/> 
-    <element ref="ds:SignatureValue"/> 
-    <element ref="ds:KeyInfo" minOccurs="0"/> 
-    <element ref="ds:Object" minOccurs="0" maxOccurs="unbounded"/> 
-  </sequence>  
-  <attribute name="Id" type="ID" use="optional"/>
-</complexType>
-
-  <element name="SignatureValue" type="ds:SignatureValueType"/> 
-  <complexType name="SignatureValueType">
-    <simpleContent>
-      <extension base="base64Binary">
-        <attribute name="Id" type="ID" use="optional"/>
-      </extension>
-    </simpleContent>
-  </complexType>
-
-<!-- Start SignedInfo -->
-
-<element name="SignedInfo" type="ds:SignedInfoType"/>
-<complexType name="SignedInfoType">
-  <sequence> 
-    <element ref="ds:CanonicalizationMethod"/> 
-    <element ref="ds:SignatureMethod"/> 
-    <element ref="ds:Reference" maxOccurs="unbounded"/> 
-  </sequence>  
-  <attribute name="Id" type="ID" use="optional"/> 
-</complexType>
-
-  <element name="CanonicalizationMethod" type="ds:CanonicalizationMethodType"/> 
-  <complexType name="CanonicalizationMethodType" mixed="true">
-    <sequence>
-      <any namespace="##any" minOccurs="0" maxOccurs="unbounded"/>
-      <!-- (0,unbounded) elements from (1,1) namespace -->
-    </sequence>
-    <attribute name="Algorithm" type="anyURI" use="required"/> 
-  </complexType>
-
-  <element name="SignatureMethod" type="ds:SignatureMethodType"/>
-  <complexType name="SignatureMethodType" mixed="true">
-    <sequence>
-      <element name="HMACOutputLength" minOccurs="0" type="ds:HMACOutputLengthType"/>
-      <any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
-      <!-- (0,unbounded) elements from (1,1) external namespace -->
-    </sequence>
-    <attribute name="Algorithm" type="anyURI" use="required"/> 
-  </complexType>
-
-<!-- Start Reference -->
-
-<element name="Reference" type="ds:ReferenceType"/>
-<complexType name="ReferenceType">
-  <sequence> 
-    <element ref="ds:Transforms" minOccurs="0"/> 
-    <element ref="ds:DigestMethod"/> 
-    <element ref="ds:DigestValue"/> 
-  </sequence>
-  <attribute name="Id" type="ID" use="optional"/> 
-  <attribute name="URI" type="anyURI" use="optional"/> 
-  <attribute name="Type" type="anyURI" use="optional"/> 
-</complexType>
-
-  <element name="Transforms" type="ds:TransformsType"/>
-  <complexType name="TransformsType">
-    <sequence>
-      <element ref="ds:Transform" maxOccurs="unbounded"/>  
-    </sequence>
-  </complexType>
-
-  <element name="Transform" type="ds:TransformType"/>
-  <complexType name="TransformType" mixed="true">
-    <choice minOccurs="0" maxOccurs="unbounded"> 
-      <any namespace="##other" processContents="lax"/>
-      <!-- (1,1) elements from (0,unbounded) namespaces -->
-      <element name="XPath" type="string"/> 
-    </choice>
-    <attribute name="Algorithm" type="anyURI" use="required"/> 
-  </complexType>
-
-<!-- End Reference -->
-
-<element name="DigestMethod" type="ds:DigestMethodType"/>
-<complexType name="DigestMethodType" mixed="true"> 
-  <sequence>
-    <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
-  </sequence>    
-  <attribute name="Algorithm" type="anyURI" use="required"/> 
-</complexType>
-
-<element name="DigestValue" type="ds:DigestValueType"/>
-<simpleType name="DigestValueType">
-  <restriction base="base64Binary"/>
-</simpleType>
-
-<!-- End SignedInfo -->
-
-<!-- Start KeyInfo -->
-
-<element name="KeyInfo" type="ds:KeyInfoType"/> 
-<complexType name="KeyInfoType" mixed="true">
-  <choice maxOccurs="unbounded">     
-    <element ref="ds:KeyName"/> 
-    <element ref="ds:KeyValue"/> 
-    <element ref="ds:RetrievalMethod"/> 
-    <element ref="ds:X509Data"/> 
-    <element ref="ds:PGPData"/> 
-    <element ref="ds:SPKIData"/>
-    <element ref="ds:MgmtData"/>
-    <any processContents="lax" namespace="##other"/>
-    <!-- (1,1) elements from (0,unbounded) namespaces -->
-  </choice>
-  <attribute name="Id" type="ID" use="optional"/> 
-</complexType>
-
-  <element name="KeyName" type="string"/>
-  <element name="MgmtData" type="string"/>
-
-  <element name="KeyValue" type="ds:KeyValueType"/> 
-  <complexType name="KeyValueType" mixed="true">
-   <choice>
-     <element ref="ds:DSAKeyValue"/>
-     <element ref="ds:RSAKeyValue"/>
-     <any namespace="##other" processContents="lax"/>
-   </choice>
-  </complexType>
-
-  <element name="RetrievalMethod" type="ds:RetrievalMethodType"/> 
-  <complexType name="RetrievalMethodType">
-    <sequence>
-      <element ref="ds:Transforms" minOccurs="0"/> 
-    </sequence>  
-    <attribute name="URI" type="anyURI"/>
-    <attribute name="Type" type="anyURI" use="optional"/>
-  </complexType>
-
-<!-- Start X509Data -->
-
-<element name="X509Data" type="ds:X509DataType"/> 
-<complexType name="X509DataType">
-  <sequence maxOccurs="unbounded">
-    <choice>
-      <element name="X509IssuerSerial" type="ds:X509IssuerSerialType"/>
-      <element name="X509SKI" type="base64Binary"/>
-      <element name="X509SubjectName" type="string"/>
-      <element name="X509Certificate" type="base64Binary"/>
-      <element name="X509CRL" type="base64Binary"/>
-      <any namespace="##other" processContents="lax"/>
-    </choice>
-  </sequence>
-</complexType>
-
-<complexType name="X509IssuerSerialType"> 
-  <sequence> 
-    <element name="X509IssuerName" type="string"/> 
-    <element name="X509SerialNumber" type="integer"/> 
-  </sequence>
-</complexType>
-
-<!-- End X509Data -->
-
-<!-- Begin PGPData -->
-
-<element name="PGPData" type="ds:PGPDataType"/> 
-<complexType name="PGPDataType"> 
-  <choice>
-    <sequence>
-      <element name="PGPKeyID" type="base64Binary"/> 
-      <element name="PGPKeyPacket" type="base64Binary" minOccurs="0"/> 
-      <any namespace="##other" processContents="lax" minOccurs="0"
-       maxOccurs="unbounded"/>
-    </sequence>
-    <sequence>
-      <element name="PGPKeyPacket" type="base64Binary"/> 
-      <any namespace="##other" processContents="lax" minOccurs="0"
-       maxOccurs="unbounded"/>
-    </sequence>
-  </choice>
-</complexType>
-
-<!-- End PGPData -->
-
-<!-- Begin SPKIData -->
-
-<element name="SPKIData" type="ds:SPKIDataType"/> 
-<complexType name="SPKIDataType">
-  <sequence maxOccurs="unbounded">
-    <element name="SPKISexp" type="base64Binary"/>
-    <any namespace="##other" processContents="lax" minOccurs="0"/>
-  </sequence>
-</complexType> 
-
-<!-- End SPKIData -->
-
-<!-- End KeyInfo -->
-
-<!-- Start Object (Manifest, SignatureProperty) -->
-
-<element name="Object" type="ds:ObjectType"/> 
-<complexType name="ObjectType" mixed="true">
-  <sequence minOccurs="0" maxOccurs="unbounded">
-    <any namespace="##any" processContents="lax"/>
-  </sequence>
-  <attribute name="Id" type="ID" use="optional"/> 
-  <attribute name="MimeType" type="string" use="optional"/> <!-- add a grep facet -->
-  <attribute name="Encoding" type="anyURI" use="optional"/> 
-</complexType>
-
-<element name="Manifest" type="ds:ManifestType"/> 
-<complexType name="ManifestType">
-  <sequence>
-    <element ref="ds:Reference" maxOccurs="unbounded"/> 
-  </sequence>
-  <attribute name="Id" type="ID" use="optional"/> 
-</complexType>
-
-<element name="SignatureProperties" type="ds:SignaturePropertiesType"/> 
-<complexType name="SignaturePropertiesType">
-  <sequence>
-    <element ref="ds:SignatureProperty" maxOccurs="unbounded"/> 
-  </sequence>
-  <attribute name="Id" type="ID" use="optional"/> 
-</complexType>
-
-   <element name="SignatureProperty" type="ds:SignaturePropertyType"/> 
-   <complexType name="SignaturePropertyType" mixed="true">
-     <choice maxOccurs="unbounded">
-       <any namespace="##other" processContents="lax"/>
-       <!-- (1,1) elements from (1,unbounded) namespaces -->
-     </choice>
-     <attribute name="Target" type="anyURI" use="required"/> 
-     <attribute name="Id" type="ID" use="optional"/> 
-   </complexType>
-
-<!-- End Object (Manifest, SignatureProperty) -->
-
-<!-- Start Algorithm Parameters -->
-
-<simpleType name="HMACOutputLengthType">
-  <restriction base="integer"/>
-</simpleType>
-
-<!-- Start KeyValue Element-types -->
-
-<element name="DSAKeyValue" type="ds:DSAKeyValueType"/>
-<complexType name="DSAKeyValueType">
-  <sequence>
-    <sequence minOccurs="0">
-      <element name="P" type="ds:CryptoBinary"/>
-      <element name="Q" type="ds:CryptoBinary"/>
-    </sequence>
-    <element name="G" type="ds:CryptoBinary" minOccurs="0"/>
-    <element name="Y" type="ds:CryptoBinary"/>
-    <element name="J" type="ds:CryptoBinary" minOccurs="0"/>
-    <sequence minOccurs="0">
-      <element name="Seed" type="ds:CryptoBinary"/>
-      <element name="PgenCounter" type="ds:CryptoBinary"/>
-    </sequence>
-  </sequence>
-</complexType>
-
-<element name="RSAKeyValue" type="ds:RSAKeyValueType"/>
-<complexType name="RSAKeyValueType">
-  <sequence>
-    <element name="Modulus" type="ds:CryptoBinary"/> 
-    <element name="Exponent" type="ds:CryptoBinary"/> 
-  </sequence>
-</complexType> 
-
-<!-- End KeyValue Element-types -->
-
-<!-- End Signature -->
-
-</schema>
--- a/jdk/src/share/classes/com/sun/pept/Delegate.java	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/** Java interface "Delegate.java" generated from Poseidon for UML.
- *  Poseidon for UML is developed by <A HREF="http://www.gentleware.com">Gentleware</A>.
- *  Generated with <A HREF="http://jakarta.apache.org/velocity/">velocity</A> template engine.
- */
-package com.sun.pept;
-
-import com.sun.pept.presentation.MessageStruct;
-import java.util.*;
-
-/**
- * <p>
- *
- * @author Dr. Harold Carr
- * </p>
- */
-public interface Delegate {
-
-  ///////////////////////////////////////
-  // operations
-
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a MessageStruct with ...
- * </p>
- */
-    public MessageStruct getMessageStruct();
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * </p><p>
- *
- * @param message ...
- * </p>
- */
-    public void send(MessageStruct message);
-
-} // end Delegate
--- a/jdk/src/share/classes/com/sun/pept/encoding/Decoder.java	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/** Java interface "Decoder.java" generated from Poseidon for UML.
- *  Poseidon for UML is developed by <A HREF="http://www.gentleware.com">Gentleware</A>.
- *  Generated with <A HREF="http://jakarta.apache.org/velocity/">velocity</A> template engine.
- */
-package com.sun.pept.encoding;
-
-import com.sun.pept.ept.MessageInfo;
-import java.util.*;
-
-/**
- * <p>
- *
- * @author Dr. Harold Carr
- * </p>
- */
-public interface Decoder {
-
-  ///////////////////////////////////////
-  // operations
-
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * </p><p>
- *
- * @param messageInfo ...
- * </p>
- */
-    public void decode(MessageInfo messageInfo);
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * </p><p>
- *
- * @param messageInfo ...
- * </p>
- */
-    public void receiveAndDecode(MessageInfo messageInfo);
-
-} // end Decoder
--- a/jdk/src/share/classes/com/sun/pept/encoding/Encoder.java	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/** Java interface "Encoder.java" generated from Poseidon for UML.
- *  Poseidon for UML is developed by <A HREF="http://www.gentleware.com">Gentleware</A>.
- *  Generated with <A HREF="http://jakarta.apache.org/velocity/">velocity</A> template engine.
- */
-package com.sun.pept.encoding;
-
-import com.sun.pept.ept.MessageInfo;
-import java.nio.ByteBuffer;
-import java.util.*;
-
-/**
- * <p>
- *
- * @author Arun Gupta
- * </p>
- */
-public interface Encoder {
-
-  ///////////////////////////////////////
-  // operations
-
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * </p><p>
- *
- * @param messageInfo ...
- * </p>
- */
-    public void encodeAndSend(MessageInfo messageInfo);
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a ByteBuffer with ...
- * </p><p>
- * @param messageInfo ...
- * </p>
- */
-    public ByteBuffer encode(MessageInfo messageInfo);
-
-} // end Encoder
--- a/jdk/src/share/classes/com/sun/pept/ept/Acceptor.java	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/** Java interface "Acceptor.java" generated from Poseidon for UML.
- *  Poseidon for UML is developed by <A HREF="http://www.gentleware.com">Gentleware</A>.
- *  Generated with <A HREF="http://jakarta.apache.org/velocity/">velocity</A> template engine.
- */
-package com.sun.pept.ept;
-
-import java.util.*;
-
-/**
- * <p>
- *
- * @author Dr. Harold Carr
- * </p>
- */
-public interface Acceptor extends EPTFactory {
-
-  ///////////////////////////////////////
-  // operations
-
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * </p>
- */
-    public void accept();
-
-} // end Acceptor
--- a/jdk/src/share/classes/com/sun/pept/ept/ContactInfo.java	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/** Java interface "ContactInfo.java" generated from Poseidon for UML.
- *  Poseidon for UML is developed by <A HREF="http://www.gentleware.com">Gentleware</A>.
- *  Generated with <A HREF="http://jakarta.apache.org/velocity/">velocity</A> template engine.
- */
-package com.sun.pept.ept;
-
-import com.sun.pept.transport.Connection;
-import java.util.*;
-
-/**
- * <p>
- *
- * @author Dr. Harold Carr
- * </p>
- */
-public interface ContactInfo extends EPTFactory {
-
-  ///////////////////////////////////////
-  // operations
-
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a Connection with ...
- * </p><p>
- * @param messageInfo ...
- * </p>
- */
-    public Connection getConnection(MessageInfo messageInfo);
-
-} // end ContactInfo
--- a/jdk/src/share/classes/com/sun/pept/ept/ContactInfoList.java	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/** Java interface "ContactInfoList.java" generated from Poseidon for UML.
- *  Poseidon for UML is developed by <A HREF="http://www.gentleware.com">Gentleware</A>.
- *  Generated with <A HREF="http://jakarta.apache.org/velocity/">velocity</A> template engine.
- */
-package com.sun.pept.ept;
-
-import java.util.*;
-
-/**
- * <p>
- *
- * @author Dr. Harold Carr
- * </p>
- */
-public interface ContactInfoList {
-
-  ///////////////////////////////////////
-  // operations
-
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a ContactInfoListIterator with ...
- * </p>
- */
-    public ContactInfoListIterator iterator();
-
-} // end ContactInfoList
--- a/jdk/src/share/classes/com/sun/pept/ept/ContactInfoListIterator.java	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/** Java interface "ContactInfoListIterator.java" generated from Poseidon for UML.
- *  Poseidon for UML is developed by <A HREF="http://www.gentleware.com">Gentleware</A>.
- *  Generated with <A HREF="http://jakarta.apache.org/velocity/">velocity</A> template engine.
- */
-package com.sun.pept.ept;
-
-import java.util.*;
-
-/**
- * <p>
- *
- * @author Dr. Harold Carr
- * </p>
- */
-public interface ContactInfoListIterator {
-
-  ///////////////////////////////////////
-  // operations
-
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a boolean with ...
- * </p>
- */
-    public boolean hasNext();
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a ContactInfo with ...
- * </p>
- */
-    public ContactInfo next();
-
-} // end ContactInfoListIterator
--- a/jdk/src/share/classes/com/sun/pept/ept/EPTFactory.java	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/** Java interface "EPTFactory.java" generated from Poseidon for UML.
- *  Poseidon for UML is developed by <A HREF="http://www.gentleware.com">Gentleware</A>.
- *  Generated with <A HREF="http://jakarta.apache.org/velocity/">velocity</A> template engine.
- */
-package com.sun.pept.ept;
-
-import com.sun.pept.encoding.Decoder;
-import com.sun.pept.encoding.Encoder;
-import com.sun.pept.presentation.TargetFinder;
-import com.sun.pept.protocol.Interceptors;
-import com.sun.pept.protocol.MessageDispatcher;
-import java.util.*;
-
-/**
- * <p>
- *
- * @author Dr. Harold Carr
- * </p>
- */
-public interface EPTFactory {
-
-  ///////////////////////////////////////
-  // operations
-
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a MessageDispatcher with ...
- * </p><p>
- * @param messageInfo ...
- * </p>
- */
-    public MessageDispatcher getMessageDispatcher(MessageInfo messageInfo);
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a Encoder with ...
- * </p><p>
- * @param messageInfo ...
- * </p>
- */
-    public Encoder getEncoder(MessageInfo messageInfo);
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a Decoder with ...
- * </p><p>
- * @param messageInfo ...
- * </p>
- */
-    public Decoder getDecoder(MessageInfo messageInfo);
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a Interceptors with ...
- * </p><p>
- * @param x ...
- * </p>
- */
-    public Interceptors getInterceptors(MessageInfo x);
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a TargetFinder with ...
- * </p><p>
- * @param x ...
- * </p>
- */
-    public TargetFinder getTargetFinder(MessageInfo x);
-
-} // end EPTFactory
--- a/jdk/src/share/classes/com/sun/pept/ept/MessageInfo.java	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,151 +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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/** Java interface "MessageInfo.java" generated from Poseidon for UML.
- *  Poseidon for UML is developed by <A HREF="http://www.gentleware.com">Gentleware</A>.
- *  Generated with <A HREF="http://jakarta.apache.org/velocity/">velocity</A> template engine.
- */
-package com.sun.pept.ept;
-
-import com.sun.pept.encoding.Decoder;
-import com.sun.pept.encoding.Encoder;
-import com.sun.pept.presentation.MessageStruct;
-import com.sun.pept.protocol.MessageDispatcher;
-import com.sun.pept.transport.Connection;
-import java.util.*;
-
-/**
- * <p>
- *
- * @author Dr. Harold Carr
- * </p>
- */
-public interface MessageInfo extends MessageStruct {
-
-  ///////////////////////////////////////
-  // operations
-
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a EPTFactory with ...
- * </p>
- */
-    public EPTFactory getEPTFactory();
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a MessageDispatcher with ...
- * </p>
- */
-    public MessageDispatcher getMessageDispatcher();
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a Encoder with ...
- * </p>
- */
-    public Encoder getEncoder();
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a Decoder with ...
- * </p>
- */
-    public Decoder getDecoder();
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a Connection with ...
- * </p>
- */
-    public Connection getConnection();
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * </p><p>
- *
- * @param eptFactory ...
- * </p>
- */
-    public void setEPTFactory(EPTFactory eptFactory);
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * </p><p>
- *
- * @param messageDispatcher ...
- * </p>
- */
-    public void setMessageDispatcher(MessageDispatcher messageDispatcher);
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * </p><p>
- *
- * @param encoder ...
- * </p>
- */
-    public void setEncoder(Encoder encoder);
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * </p><p>
- *
- * @param decoder ...
- * </p>
- */
-    public void setDecoder(Decoder decoder);
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * </p><p>
- *
- * @param connection ...
- * </p>
- */
-    public void setConnection(Connection connection);
-
-} // end MessageInfo
--- a/jdk/src/share/classes/com/sun/pept/presentation/MessageStruct.java	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,223 +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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/** Java interface "MessageStruct.java" generated from Poseidon for UML.
- *  Poseidon for UML is developed by <A HREF="http://www.gentleware.com">Gentleware</A>.
- *  Generated with <A HREF="http://jakarta.apache.org/velocity/">velocity</A> template engine.
- */
-package com.sun.pept.presentation;
-
-import java.util.*;
-import java.lang.reflect.Method;
-/**
- * <p>
- *
- * @author Dr. Harold Carr
- * </p>
- */
-public interface MessageStruct {
-
-  ///////////////////////////////////////
-  //attributes
-
-
-/**
- * <p>
- * Represents ...
- * </p>
- */
-    public static final int NORMAL_RESPONSE = 0;
-
-/**
- * <p>
- * Represents ...
- * </p>
- */
-    public static final int CHECKED_EXCEPTION_RESPONSE = 1;
-
-/**
- * <p>
- * Represents ...
- * </p>
- */
-    public static final int UNCHECKED_EXCEPTION_RESPONSE = 2;
-
-/**
- * <p>
- * Represents ...
- * </p>
- */
-    public static final int REQUEST_RESPONSE_MEP = 1;
-
-/**
- * <p>
- * Represents ...
- * </p>
- */
-    public static final int ONE_WAY_MEP = 2;
-
-/**
- * <p>
- * Represents ...
- * </p>
- */
-    public static final int ASYNC_POLL_MEP = 3;
-
-/**
- * <p>
- * Represents ...
- * </p>
- */
-    public static final int ASYNC_CALLBACK_MEP = 4;
-
-  ///////////////////////////////////////
-  // operations
-
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @param data ...
- * </p><p>
- *
- * </p>
- */
-    public void setData(Object[] data);
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a Object[] with ...
- * </p>
- */
-    public Object[] getData();
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * </p><p>
- *
- * @param name ...
- * </p><p>
- * @param value ...
- * </p>
- */
-    public void setMetaData(Object name, Object value);
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a Object with ...
- * </p><p>
- * @param name ...
- * </p>
- */
-    public Object getMetaData(Object name);
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * </p><p>
- *
- * @param messageExchangePattern ...
- * </p>
- */
-    public void setMEP(int messageExchangePattern);
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a int with ...
- * </p>
- */
-    public int getMEP();
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a int with ...
- * </p>
- */
-    public int getResponseType();
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * </p><p>
- *
- * @param responseType ...
- * </p>
- */
-    public void setResponseType(int responseType);
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a Object with ...
- * </p>
- */
-    public Object getResponse();
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * </p><p>
- *
- * @param response ...
- * </p>
- */
-    public void setResponse(Object response);
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * </p><p>
- *
- * @param method ...
- * </p>
- */
-    public void setMethod(Method method);
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a Method with ...
- * </p>
- */
-    public Method getMethod();
-
-} // end MessageStruct
--- a/jdk/src/share/classes/com/sun/pept/presentation/Stub.java	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/** Java interface "Stub.java" generated from Poseidon for UML.
- *  Poseidon for UML is developed by <A HREF="http://www.gentleware.com">Gentleware</A>.
- *  Generated with <A HREF="http://jakarta.apache.org/velocity/">velocity</A> template engine.
- */
-package com.sun.pept.presentation;
-
-import com.sun.pept.Delegate;
-import java.util.*;
-
-/**
- * <p>
- *
- * @author Dr. Harold Carr
- * </p>
- */
-public interface Stub {
-
-  ///////////////////////////////////////
-  // operations
-
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * </p><p>
- *
- * @param delegate ...
- * </p>
- */
-    public void _setDelegate(Delegate delegate);
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a Delegate with ...
- * </p>
- */
-    public Delegate _getDelegate();
-
-} // end Stub
--- a/jdk/src/share/classes/com/sun/pept/presentation/TargetFinder.java	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/** Java interface "TargetFinder.java" generated from Poseidon for UML.
- *  Poseidon for UML is developed by <A HREF="http://www.gentleware.com">Gentleware</A>.
- *  Generated with <A HREF="http://jakarta.apache.org/velocity/">velocity</A> template engine.
- */
-package com.sun.pept.presentation;
-
-import com.sun.pept.ept.MessageInfo;
-import java.util.*;
-
-/**
- * <p>
- *
- * @author Dr. Harold Carr
- * </p>
- */
-public interface TargetFinder {
-
-  ///////////////////////////////////////
-  // operations
-
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a Tie with ...
- * </p><p>
- * @param x ...
- * </p>
- */
-    public Tie findTarget(MessageInfo x);
-
-} // end TargetFinder
--- a/jdk/src/share/classes/com/sun/pept/presentation/Tie.java	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/** Java interface "Tie.java" generated from Poseidon for UML.
- *  Poseidon for UML is developed by <A HREF="http://www.gentleware.com">Gentleware</A>.
- *  Generated with <A HREF="http://jakarta.apache.org/velocity/">velocity</A> template engine.
- */
-package com.sun.pept.presentation;
-
-import com.sun.pept.ept.MessageInfo;
-import java.util.*;
-
-/**
- * <p>
- *
- * @author Dr. Harold Carr
- * </p>
- */
-public interface Tie {
-
-  ///////////////////////////////////////
-  // operations
-
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * </p><p>
- *
- * @param servant ...
- * </p>
- */
-    public void _setServant(Object servant);
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a Object with ...
- * </p>
- */
-    public Object _getServant();
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * </p><p>
- *
- * @param messageInfo ...
- * </p>
- */
-    public void _invoke(MessageInfo messageInfo);
-
-} // end Tie
--- a/jdk/src/share/classes/com/sun/pept/protocol/Interceptors.java	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/**
- * $Id: Interceptors.java,v 1.1 2005/05/23 22:09:18 bbissett Exp $
- */
-
-/** Java interface "Interceptors.java" generated from Poseidon for UML.
- *  Poseidon for UML is developed by <A HREF="http://www.gentleware.com">Gentleware</A>.
- *  Generated with <A HREF="http://jakarta.apache.org/velocity/">velocity</A> template engine.
- */
-package com.sun.pept.protocol;
-
-import com.sun.pept.ept.MessageInfo;
-import java.util.*;
-
-/**
- * <p>
- *
- * @author Dr. Harold Carr
- * </p>
- */
-public interface Interceptors {
-
-  ///////////////////////////////////////
-  // operations
-
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * </p><p>
- *
- * @param messageInfo ...
- * </p>
- */
-    public void interceptMessage(MessageInfo messageInfo);
-
-} // end Interceptors
--- a/jdk/src/share/classes/com/sun/pept/protocol/MessageDispatcher.java	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/**
- * $Id: MessageDispatcher.java,v 1.1 2005/05/23 22:09:18 bbissett Exp $
- */
-
-/** Java interface "MessageDispatcher.java" generated from Poseidon for UML.
- *  Poseidon for UML is developed by <A HREF="http://www.gentleware.com">Gentleware</A>.
- *  Generated with <A HREF="http://jakarta.apache.org/velocity/">velocity</A> template engine.
- */
-package com.sun.pept.protocol;
-
-import com.sun.pept.ept.MessageInfo;
-import java.util.*;
-
-/**
- * <p>
- *
- * @author Dr. Harold Carr
- * </p>
- */
-public interface MessageDispatcher {
-
-  ///////////////////////////////////////
-  // operations
-
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * </p><p>
- *
- * @param messageInfo ...
- * </p>
- */
-    public void send(MessageInfo messageInfo);
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * </p><p>
- *
- * @param messageInfo ...
- * </p>
- */
-    public void receive(MessageInfo messageInfo);
-
-} // end MessageDispatcher
--- a/jdk/src/share/classes/com/sun/pept/transport/Connection.java	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,91 +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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/**
- * $Id: Connection.java,v 1.2 2005/07/23 04:09:58 kohlert Exp $
- */
-
-/** Java interface "Connection.java" generated from Poseidon for UML.
- *  Poseidon for UML is developed by <A HREF="http://www.gentleware.com">Gentleware</A>.
- *  Generated with <A HREF="http://jakarta.apache.org/velocity/">velocity</A> template engine.
- */
-package com.sun.pept.transport;
-
-import com.sun.pept.ept.EPTFactory;
-import java.nio.ByteBuffer;
-import java.util.*;
-
-/**
- * <p>
- *
- * @author Dr. Harold Carr
- * </p>
- */
-public interface Connection {
-
-  ///////////////////////////////////////
-  // operations
-
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * </p><p>
- *
- * @param byteBuffer ...
- * </p>
- */
-    public void write(ByteBuffer byteBuffer);
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a EPTFactory with ...
- * </p>
- */
-    public EPTFactory getEPTFactory();
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a int with ...
- * </p><p>
- * @param byteBuffer ...
- * </p>
- */
-    public int read(ByteBuffer byteBuffer);
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * </p>
- */
-    public ByteBuffer readUntilEnd();
-
-} // end Connection
--- a/jdk/src/share/classes/com/sun/tools/hat/MANIFEST.mf	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-Manifest-Version: 1.0
-Main-Class: com.sun.tools.hat.Main
--- a/jdk/src/share/classes/com/sun/tools/hat/README.txt	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
---------------
-This HAT source originally came from the http://hat.dev.java.net site.
-
-The utility has been named 'jhat' in the JDK, it is basically the same tool.
-
-Q: Where do I make changes? In the JDK or hat.dev.java.net?
-
-A: It depends on whether the change is intended for the JDK jhat version only,
-   or expected to be given back to the java.net project.
-   In general, we should putback changes to the java.net project and
-   bringover those changes to the JDK.
-
-Q: I want to build just jhat.jar instead of building entire JDK. What should I do?
-
-A: Use ant makefile (build.xml) in the current directory. This builds just the
-jhat sources and creates jhat.jar under ./build directory.
-
-To run the built jhat.jar, you can use the command:
-
-    java -jar build/jhat.jar heap_dump
--- a/jdk/src/share/classes/com/sun/tools/hat/build.xml	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<!-- 
-
- The Original Code is HAT. The Initial Developer of the
- Original Code is Bill Foote, with contributions from others
- at JavaSoft/Sun.
-
--->
-
-<!-- This is an Ant project file to build Heap Analysis Tool (HAT).
-     For more information on Ant, please see http://ant.apache.org/ 
-
-     To build jhat.jar, run ant in current directory. jhat.jar is
-     built in ./build directory.
--->
-
-<project name="Java Heap Analysis Tool" default="all" basedir=".">
-
-  <!-- Property Definitions -->
-
-  <property name="app.name" value="jhat"/>
-  <property name="src.dir"  value="."/>
-  <property name="build.dir"  value="build"/>
-  <property name="classes.dir"  value="${build.dir}/classes"/>
-  <property name="dist.jar" value="${app.name}.jar"/>
-
-  <target name="prepare">
-    <mkdir dir="${build.dir}"/>
-    <mkdir dir="${classes.dir}"/>
-  </target>
-
-  <target name="clean">
-     <delete dir="${build.dir}"/>
-  </target>
-
-  <target name="compile" depends="prepare" description="Compiles the sources">
-    <javac srcdir="${src.dir}" destdir="${classes.dir}"
-           debug="on" deprecation="on">
-    </javac>
-
-  </target>
-
-  <target name="deploy" depends="compile" description="Creates a deployment bundle">
-    <delete file="${build.dir}/${dist.jar}" />
-    <mkdir dir="${classes.dir}/com/sun/tools/hat/resources" />
-    <copy todir="${classes.dir}/com/sun/tools/hat/resources">
-      <fileset dir="${src.dir}/resources" includes="*" />
-    </copy>
-
-    <jar jarfile="${build.dir}/${dist.jar}"
-         manifest="${src.dir}/MANIFEST.mf" basedir="${classes.dir}"/>
-  </target>
-
-  <target name="all" depends="deploy" description="Builds sources and deployment jar"/>
-
-</project>
--- a/jdk/src/share/classes/com/sun/tools/jdi/SocketAttachingConnector.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/com/sun/tools/jdi/SocketAttachingConnector.java	Mon Jun 02 13:53:52 2014 -0700
@@ -44,12 +44,7 @@
     public SocketAttachingConnector() {
         super(new SocketTransportService());
 
-        String defaultHostName;
-        try {
-            defaultHostName = InetAddress.getLocalHost().getHostName();
-        } catch (UnknownHostException e) {
-            defaultHostName = "";
-        }
+        String defaultHostName = "localhost";
 
         addStringArgument(
             ARG_HOST,
--- a/jdk/src/share/classes/com/sun/tools/jdi/SocketTransportService.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/com/sun/tools/jdi/SocketTransportService.java	Mon Jun 02 13:53:52 2014 -0700
@@ -198,13 +198,17 @@
         String host;
         String portStr;
         if (splitIndex < 0) {
-            host = InetAddress.getLocalHost().getHostName();
+            host = "localhost";
             portStr = address;
         } else {
             host = address.substring(0, splitIndex);
             portStr = address.substring(splitIndex+1);
         }
 
+        if (host.equals("*")) {
+            host = InetAddress.getLocalHost().getHostName();
+        }
+
         int port;
         try {
             port = Integer.decode(portStr).intValue();
@@ -215,7 +219,6 @@
 
 
         // open TCP connection to VM
-
         InetSocketAddress sa = new InetSocketAddress(host, port);
         Socket s = new Socket();
         try {
--- a/jdk/src/share/classes/java/awt/AWTKeyStroke.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/java/awt/AWTKeyStroke.java	Mon Jun 02 13:53:52 2014 -0700
@@ -86,7 +86,8 @@
      * Must be called under locked AWTKeyStro
      */
     private static Class<AWTKeyStroke> getAWTKeyStrokeClass() {
-        Class<AWTKeyStroke> clazz = (Class)AppContext.getAppContext().get(AWTKeyStroke.class);
+        @SuppressWarnings("unchecked")
+        Class<AWTKeyStroke> clazz = (Class<AWTKeyStroke>)AppContext.getAppContext().get(AWTKeyStroke.class);
         if (clazz == null) {
             clazz = AWTKeyStroke.class;
             AppContext.getAppContext().put(AWTKeyStroke.class, AWTKeyStroke.class);
@@ -182,6 +183,7 @@
             throw new IllegalArgumentException("subclass cannot be null");
         }
         synchronized (AWTKeyStroke.class) {
+            @SuppressWarnings("unchecked")
             Class<AWTKeyStroke> keyStrokeClass = (Class)AppContext.getAppContext().get(AWTKeyStroke.class);
             if (keyStrokeClass != null && keyStrokeClass.equals(subclass)){
                 // Already registered
@@ -192,7 +194,7 @@
             throw new ClassCastException("subclass is not derived from AWTKeyStroke");
         }
 
-        Constructor ctor = getCtor(subclass);
+        Constructor<?> ctor = getCtor(subclass);
 
         String couldNotInstantiate = "subclass could not be instantiated";
 
@@ -227,12 +229,12 @@
        threat as accessible flag is set only for this Constructor object,
        not for Class constructor.
      */
-    private static Constructor getCtor(final Class clazz)
+    private static Constructor<?> getCtor(final Class<?> clazz)
     {
-        Constructor ctor = AccessController.doPrivileged(new PrivilegedAction<Constructor>() {
-            public Constructor run() {
+        Constructor<?> ctor = AccessController.doPrivileged(new PrivilegedAction<Constructor<?>>() {
+            public Constructor<?> run() {
                 try {
-                    Constructor ctor = clazz.getDeclaredConstructor((Class[]) null);
+                    Constructor<?> ctor = clazz.getDeclaredConstructor((Class<?>[]) null);
                     if (ctor != null) {
                         ctor.setAccessible(true);
                     }
@@ -249,6 +251,7 @@
     private static synchronized AWTKeyStroke getCachedStroke
         (char keyChar, int keyCode, int modifiers, boolean onKeyRelease)
     {
+        @SuppressWarnings("unchecked")
         Map<AWTKeyStroke, AWTKeyStroke> cache = (Map)AppContext.getAppContext().get(APP_CONTEXT_CACHE_KEY);
         AWTKeyStroke cacheKey = (AWTKeyStroke)AppContext.getAppContext().get(APP_CONTEXT_KEYSTROKE_KEY);
 
--- a/jdk/src/share/classes/java/awt/CardLayout.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/java/awt/CardLayout.java	Mon Jun 02 13:53:52 2014 -0700
@@ -560,6 +560,7 @@
     /**
      * Reads serializable fields from stream.
      */
+    @SuppressWarnings("unchecked")
     private void readObject(ObjectInputStream s)
         throws ClassNotFoundException, IOException
     {
--- a/jdk/src/share/classes/java/awt/Component.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/java/awt/Component.java	Mon Jun 02 13:53:52 2014 -0700
@@ -6184,7 +6184,7 @@
     /**
      * Parameter types of coalesceEvents(AWTEvent,AWTEVent).
      */
-    private static final Class[] coalesceEventsParams = {
+    private static final Class<?>[] coalesceEventsParams = {
         AWTEvent.class, AWTEvent.class
     };
 
--- a/jdk/src/share/classes/java/awt/GraphicsEnvironment.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/java/awt/GraphicsEnvironment.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -95,18 +95,18 @@
         String nm = AccessController.doPrivileged(new GetPropertyAction("java.awt.graphicsenv", null));
         try {
 //          long t0 = System.currentTimeMillis();
-            Class<GraphicsEnvironment> geCls;
+            Class<?> geCls;
             try {
                 // First we try if the bootclassloader finds the requested
                 // class. This way we can avoid to run in a privileged block.
-                geCls = (Class<GraphicsEnvironment>)Class.forName(nm);
+                geCls = Class.forName(nm);
             } catch (ClassNotFoundException ex) {
                 // If the bootclassloader fails, we try again with the
                 // application classloader.
                 ClassLoader cl = ClassLoader.getSystemClassLoader();
-                geCls = (Class<GraphicsEnvironment>)Class.forName(nm, true, cl);
+                geCls = Class.forName(nm, true, cl);
             }
-            ge = geCls.newInstance();
+            ge = (GraphicsEnvironment)geCls.newInstance();
 //          long t1 = System.currentTimeMillis();
 //          System.out.println("GE creation took " + (t1-t0)+ "ms.");
             if (isHeadless()) {
--- a/jdk/src/share/classes/java/awt/KeyboardFocusManager.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/java/awt/KeyboardFocusManager.java	Mon Jun 02 13:53:52 2014 -0700
@@ -348,6 +348,7 @@
      * Component of those Windows that has no such array of its own explicitly
      * set.
      */
+    @SuppressWarnings({"unchecked", "rawtypes"})
     private Set<AWTKeyStroke>[] defaultFocusTraversalKeys = new Set[4];
 
     /**
@@ -422,7 +423,7 @@
             targetSet.add(AWTKeyStroke.getAWTKeyStroke(tokens.nextToken()));
         }
         return (targetSet.isEmpty())
-            ? Collections.EMPTY_SET
+            ? Collections.emptySet()
             : Collections.unmodifiableSet(targetSet);
     }
 
@@ -436,7 +437,7 @@
                 work_set.add(defaultFocusTraversalKeyStrokes[i][j]);
             }
             defaultFocusTraversalKeys[i] = (work_set.isEmpty())
-                ? Collections.EMPTY_SET
+                ? Collections.emptySet()
                 : Collections.unmodifiableSet(work_set);
         }
         initPeer();
@@ -1750,11 +1751,12 @@
      * @see #addKeyEventDispatcher
      * @see #removeKeyEventDispatcher
      */
+    @SuppressWarnings("unchecked") // Cast of result of clone
     protected synchronized java.util.List<KeyEventDispatcher>
         getKeyEventDispatchers()
     {
         return (keyEventDispatchers != null)
-            ? (java.util.List)keyEventDispatchers.clone()
+            ? (java.util.List<KeyEventDispatcher>)keyEventDispatchers.clone()
             : null;
     }
 
@@ -1841,11 +1843,12 @@
      * @see #addKeyEventPostProcessor
      * @see #removeKeyEventPostProcessor
      */
+    @SuppressWarnings("unchecked") // Cast of result of clone
     protected java.util.List<KeyEventPostProcessor>
         getKeyEventPostProcessors()
     {
         return (keyEventPostProcessors != null)
-            ? (java.util.List)keyEventPostProcessors.clone()
+            ? (java.util.List<KeyEventPostProcessor>)keyEventPostProcessors.clone()
             : null;
     }
 
@@ -1907,8 +1910,7 @@
      * javax.swing.JComponent.runInputVerifier() using reflection.
      */
     static synchronized Component getMostRecentFocusOwner(Window window) {
-        WeakReference<Component> weakValue =
-            (WeakReference)mostRecentFocusOwners.get(window);
+        WeakReference<Component> weakValue = mostRecentFocusOwners.get(window);
         return weakValue == null ? null : weakValue.get();
     }
 
--- a/jdk/src/share/classes/java/awt/Menu.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/java/awt/Menu.java	Mon Jun 02 13:53:52 2014 -0700
@@ -66,7 +66,7 @@
 
         AWTAccessor.setMenuAccessor(
             new AWTAccessor.MenuAccessor() {
-                public Vector<MenuComponent> getItems(Menu menu) {
+                public Vector<MenuItem> getItems(Menu menu) {
                     return menu.items;
                 }
             });
@@ -78,7 +78,7 @@
      * @serial
      * @see #countItems()
      */
-    Vector<MenuComponent> items = new Vector<>();
+    Vector<MenuItem> items = new Vector<>();
 
     /**
      * This field indicates whether the menu has the
@@ -252,7 +252,7 @@
      * be called on the toolkit thread.
      */
     final MenuItem getItemImpl(int index) {
-        return (MenuItem)items.elementAt(index);
+        return items.elementAt(index);
     }
 
     /**
@@ -544,7 +544,7 @@
       // HeadlessException will be thrown from MenuComponent's readObject
       s.defaultReadObject();
       for(int i = 0; i < items.size(); i++) {
-        MenuItem item = (MenuItem)items.elementAt(i);
+        MenuItem item = items.elementAt(i);
         item.parent = this;
       }
     }
--- a/jdk/src/share/classes/java/awt/SystemTray.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/java/awt/SystemTray.java	Mon Jun 02 13:53:52 2014 -0700
@@ -259,7 +259,9 @@
         Vector<TrayIcon> icons = null;
         synchronized (this) {
             oldArray = systemTray.getTrayIcons();
-            icons = (Vector<TrayIcon>)AppContext.getAppContext().get(TrayIcon.class);
+            @SuppressWarnings("unchecked")
+            Vector<TrayIcon> tmp = (Vector<TrayIcon>)AppContext.getAppContext().get(TrayIcon.class);
+            icons = tmp;
             if (icons == null) {
                 icons = new Vector<TrayIcon>(3);
                 AppContext.getAppContext().put(TrayIcon.class, icons);
@@ -304,6 +306,7 @@
         TrayIcon[] oldArray = null, newArray = null;
         synchronized (this) {
             oldArray = systemTray.getTrayIcons();
+            @SuppressWarnings("unchecked")
             Vector<TrayIcon> icons = (Vector<TrayIcon>)AppContext.getAppContext().get(TrayIcon.class);
             // TrayIcon with no peer is not contained in the array.
             if (icons == null || !icons.remove(trayIcon)) {
@@ -335,6 +338,7 @@
      * @see TrayIcon
      */
     public TrayIcon[] getTrayIcons() {
+        @SuppressWarnings("unchecked")
         Vector<TrayIcon> icons = (Vector<TrayIcon>)AppContext.getAppContext().get(TrayIcon.class);
         if (icons != null) {
             return icons.toArray(new TrayIcon[icons.size()]);
--- a/jdk/src/share/classes/java/awt/datatransfer/MimeTypeParameterList.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/java/awt/datatransfer/MimeTypeParameterList.java	Mon Jun 02 13:53:52 2014 -0700
@@ -296,14 +296,14 @@
     /**
      * @return a clone of this object
      */
-
+    @SuppressWarnings("unchecked") // Cast from clone
      public Object clone() {
          MimeTypeParameterList newObj = null;
          try {
              newObj = (MimeTypeParameterList)super.clone();
          } catch (CloneNotSupportedException cannotHappen) {
          }
-         newObj.parameters = (Hashtable)parameters.clone();
+         newObj.parameters = (Hashtable<String, String>)parameters.clone();
          return newObj;
      }
 
--- a/jdk/src/share/classes/java/awt/datatransfer/SystemFlavorMap.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/java/awt/datatransfer/SystemFlavorMap.java	Mon Jun 02 13:53:52 2014 -0700
@@ -38,13 +38,14 @@
 import java.net.MalformedURLException;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 import java.util.Set;
-import java.util.WeakHashMap;
 
 import sun.awt.AppContext;
 import sun.awt.datatransfer.DataTransferer;
@@ -102,19 +103,11 @@
     private static final String HTML_TEXT_BASE_TYPE = "text/html";
 
     /**
-     * This constant is passed to flavorToNativeLookup() to indicate that a
-     * a native should be synthesized, stored, and returned by encoding the
-     * DataFlavor's MIME type in case if the DataFlavor is not found in
-     * 'flavorToNative' map.
-     */
-    private static final boolean SYNTHESIZE_IF_NOT_FOUND = true;
-
-    /**
      * Maps native Strings to Lists of DataFlavors (or base type Strings for
      * text DataFlavors).
      * Do not use the field directly, use getNativeToFlavor() instead.
      */
-    private final Map<String, List<DataFlavor>> nativeToFlavor = new HashMap<>();
+    private final Map<String, LinkedHashSet<DataFlavor>> nativeToFlavor = new HashMap<>();
 
     /**
      * Accessor to nativeToFlavor map.  Since we use lazy initialization we must
@@ -123,7 +116,7 @@
      *
      * @return nativeToFlavor
      */
-    private Map<String, List<DataFlavor>> getNativeToFlavor() {
+    private Map<String, LinkedHashSet<DataFlavor>> getNativeToFlavor() {
         if (!isMapInitialized) {
             initSystemFlavorMap();
         }
@@ -135,7 +128,7 @@
      * native Strings.
      * Do not use the field directly, use getFlavorToNative() instead.
      */
-    private final Map<DataFlavor, List<String>> flavorToNative = new HashMap<>();
+    private final Map<DataFlavor, LinkedHashSet<String>> flavorToNative = new HashMap<>();
 
     /**
      * Accessor to flavorToNative map.  Since we use lazy initialization we must
@@ -144,7 +137,7 @@
      *
      * @return flavorToNative
      */
-    private synchronized Map<DataFlavor, List<String>> getFlavorToNative() {
+    private synchronized Map<DataFlavor, LinkedHashSet<String>> getFlavorToNative() {
         if (!isMapInitialized) {
             initSystemFlavorMap();
         }
@@ -152,21 +145,44 @@
     }
 
     /**
+     * Maps a text DataFlavor primary mime-type to the native. Used only to store
+     * standard mappings registered in the flavormap.properties
+     * Do not use this field directly, use getTextTypeToNative() instead.
+     */
+    private Map<String, LinkedHashSet<String>> textTypeToNative = new HashMap<>();
+
+    /**
      * Shows if the object has been initialized.
      */
     private boolean isMapInitialized = false;
 
     /**
+     * An accessor to textTypeToNative map.  Since we use lazy initialization we
+     * must use this accessor instead of direct access to the field which may not
+     * be initialized yet. This method will initialize the field if needed.
+     *
+     * @return textTypeToNative
+     */
+    private synchronized Map<String, LinkedHashSet<String>> getTextTypeToNative() {
+        if (!isMapInitialized) {
+            initSystemFlavorMap();
+            // From this point the map should not be modified
+            textTypeToNative = Collections.unmodifiableMap(textTypeToNative);
+        }
+        return textTypeToNative;
+    }
+
+    /**
      * Caches the result of getNativesForFlavor(). Maps DataFlavors to
-     * SoftReferences which reference Lists of String natives.
+     * SoftReferences which reference LinkedHashSet of String natives.
      */
-    private Map<DataFlavor, SoftReference<List<String>>> getNativesForFlavorCache = new HashMap<>();
+    private final SoftCache<DataFlavor, String> nativesForFlavorCache = new SoftCache<>();
 
     /**
      * Caches the result getFlavorsForNative(). Maps String natives to
-     * SoftReferences which reference Lists of DataFlavors.
+     * SoftReferences which reference LinkedHashSet of DataFlavors.
      */
-    private Map<String, SoftReference<List<DataFlavor>>> getFlavorsForNativeCache = new HashMap<>();
+    private final SoftCache<String, DataFlavor> flavorsForNativeCache = new SoftCache<>();
 
     /**
      * Dynamic mapping generation used for text mappings should not be applied
@@ -174,7 +190,7 @@
      * explicitly specified with setFlavorsForNative() or
      * setNativesForFlavor(). This keeps all such keys.
      */
-    private Set disabledMappingGenerationKeys = new HashSet();
+    private Set<Object> disabledMappingGenerationKeys = new HashSet<>();
 
     /**
      * Returns the default FlavorMap for this thread's ClassLoader.
@@ -404,7 +420,7 @@
                         flavor = new DataFlavor(value);
                     } catch (Exception e) {
                         try {
-                            flavor = new DataFlavor(value, (String)null);
+                            flavor = new DataFlavor(value, null);
                         } catch (Exception ee) {
                             ee.printStackTrace();
                             continue;
@@ -412,11 +428,11 @@
                     }
 
                     final LinkedHashSet<DataFlavor> dfs = new LinkedHashSet<>();
-
                     dfs.add(flavor);
 
                     if ("text".equals(flavor.getPrimaryType())) {
                         dfs.addAll(convertMimeTypeToDataFlavors(value));
+                        store(flavor.mimeType.getBaseType(), key, getTextTypeToNative());
                     }
 
                     for (DataFlavor df : dfs) {
@@ -505,10 +521,10 @@
      * the appropriate Map location, but rather will be appended to a List
      * stored in that location.
      */
-    private <H, L> void store(H hashed, L listed, Map<H, List<L>> map) {
-        List<L> list = map.get(hashed);
+    private <H, L> void store(H hashed, L listed, Map<H, LinkedHashSet<L>> map) {
+        LinkedHashSet<L> list = map.get(hashed);
         if (list == null) {
-            list = new ArrayList<>(1);
+            list = new LinkedHashSet<>(1);
             map.put(hashed, list);
         }
         if (!list.contains(listed)) {
@@ -522,17 +538,16 @@
      * case, a new DataFlavor is synthesized, stored, and returned, if and
      * only if the specified native is encoded as a Java MIME type.
      */
-    private List<DataFlavor> nativeToFlavorLookup(String nat) {
-        List<DataFlavor> flavors = getNativeToFlavor().get(nat);
+    private LinkedHashSet<DataFlavor> nativeToFlavorLookup(String nat) {
+        LinkedHashSet<DataFlavor> flavors = getNativeToFlavor().get(nat);
 
         if (nat != null && !disabledMappingGenerationKeys.contains(nat)) {
             DataTransferer transferer = DataTransferer.getInstance();
             if (transferer != null) {
-                List<DataFlavor> platformFlavors =
+                LinkedHashSet<DataFlavor> platformFlavors =
                         transferer.getPlatformMappingsForNative(nat);
                 if (!platformFlavors.isEmpty()) {
                     if (flavors != null) {
-                        platformFlavors.removeAll(new HashSet<>(flavors));
                         // Prepending the platform-specific mappings ensures
                         // that the flavors added with
                         // addFlavorForUnencodedNative() are at the end of
@@ -558,24 +573,22 @@
             }
 
             if (flavor != null) {
-                flavors = new ArrayList<>(1);
+                flavors = new LinkedHashSet<>(1);
                 getNativeToFlavor().put(nat, flavors);
                 flavors.add(flavor);
-                getFlavorsForNativeCache.remove(nat);
-                getFlavorsForNativeCache.remove(null);
+                flavorsForNativeCache.remove(nat);
 
-                List<String> natives = getFlavorToNative().get(flavor);
+                LinkedHashSet<String> natives = getFlavorToNative().get(flavor);
                 if (natives == null) {
-                    natives = new ArrayList<>(1);
+                    natives = new LinkedHashSet<>(1);
                     getFlavorToNative().put(flavor, natives);
                 }
                 natives.add(nat);
-                getNativesForFlavorCache.remove(flavor);
-                getNativesForFlavorCache.remove(null);
+                nativesForFlavorCache.remove(flavor);
             }
         }
 
-        return (flavors != null) ? flavors : new ArrayList<>(0);
+        return (flavors != null) ? flavors : new LinkedHashSet<>(0);
     }
 
     /**
@@ -586,18 +599,18 @@
      * encoding the DataFlavor's MIME type. Otherwise an empty List is returned
      * and 'flavorToNative' remains unaffected.
      */
-    private List<String> flavorToNativeLookup(final DataFlavor flav,
-                                              final boolean synthesize) {
-        List<String> natives = getFlavorToNative().get(flav);
+    private LinkedHashSet<String> flavorToNativeLookup(final DataFlavor flav,
+                                                       final boolean synthesize) {
+
+        LinkedHashSet<String> natives = getFlavorToNative().get(flav);
 
         if (flav != null && !disabledMappingGenerationKeys.contains(flav)) {
             DataTransferer transferer = DataTransferer.getInstance();
             if (transferer != null) {
-                List<String> platformNatives =
+                LinkedHashSet<String> platformNatives =
                     transferer.getPlatformMappingsForFlavor(flav);
                 if (!platformNatives.isEmpty()) {
                     if (natives != null) {
-                        platformNatives.removeAll(new HashSet<>(natives));
                         // Prepend the platform-specific mappings to ensure
                         // that the natives added with
                         // addUnencodedNativeForFlavor() are at the end of
@@ -612,26 +625,25 @@
         if (natives == null) {
             if (synthesize) {
                 String encoded = encodeDataFlavor(flav);
-                natives = new ArrayList<>(1);
+                natives = new LinkedHashSet<>(1);
                 getFlavorToNative().put(flav, natives);
                 natives.add(encoded);
-                getNativesForFlavorCache.remove(flav);
-                getNativesForFlavorCache.remove(null);
 
-                List<DataFlavor> flavors = getNativeToFlavor().get(encoded);
+                LinkedHashSet<DataFlavor> flavors = getNativeToFlavor().get(encoded);
                 if (flavors == null) {
-                    flavors = new ArrayList<>(1);
+                    flavors = new LinkedHashSet<>(1);
                     getNativeToFlavor().put(encoded, flavors);
                 }
                 flavors.add(flav);
-                getFlavorsForNativeCache.remove(encoded);
-                getFlavorsForNativeCache.remove(null);
+
+                nativesForFlavorCache.remove(flav);
+                flavorsForNativeCache.remove(encoded);
             } else {
-                natives = new ArrayList<>(0);
+                natives = new LinkedHashSet<>(0);
             }
         }
 
-        return natives;
+        return new LinkedHashSet<>(natives);
     }
 
     /**
@@ -659,103 +671,63 @@
      * @see #encodeDataFlavor
      * @since 1.4
      */
+    @Override
     public synchronized List<String> getNativesForFlavor(DataFlavor flav) {
-        List<String> retval = null;
-
-        // Check cache, even for null flav
-        SoftReference<List<String>> ref = getNativesForFlavorCache.get(flav);
-        if (ref != null) {
-            retval = ref.get();
-            if (retval != null) {
-                // Create a copy, because client code can modify the returned
-                // list.
-                return new ArrayList<>(retval);
-            }
+        LinkedHashSet<String> retval = nativesForFlavorCache.check(flav);
+        if (retval != null) {
+            return new ArrayList<>(retval);
         }
 
         if (flav == null) {
-            retval = new ArrayList<>(getNativeToFlavor().keySet());
+            retval = new LinkedHashSet<>(getNativeToFlavor().keySet());
         } else if (disabledMappingGenerationKeys.contains(flav)) {
             // In this case we shouldn't synthesize a native for this flavor,
             // since its mappings were explicitly specified.
-            retval = flavorToNativeLookup(flav, !SYNTHESIZE_IF_NOT_FOUND);
+            retval = flavorToNativeLookup(flav, false);
         } else if (DataTransferer.isFlavorCharsetTextType(flav)) {
+            retval = new LinkedHashSet<>(0);
 
             // For text/* flavors, flavor-to-native mappings specified in
             // flavormap.properties are stored per flavor's base type.
             if ("text".equals(flav.getPrimaryType())) {
-                retval = getAllNativesForType(flav.mimeType.getBaseType());
-                if (retval != null) {
-                    // To prevent the List stored in the map from modification.
-                    retval = new ArrayList(retval);
+                LinkedHashSet<String> textTypeNatives =
+                        getTextTypeToNative().get(flav.mimeType.getBaseType());
+                if (textTypeNatives != null) {
+                    retval.addAll(textTypeNatives);
                 }
             }
 
             // Also include text/plain natives, but don't duplicate Strings
-            List<String> textPlainList = getAllNativesForType(TEXT_PLAIN_BASE_TYPE);
-
-            if (textPlainList != null && !textPlainList.isEmpty()) {
-                // To prevent the List stored in the map from modification.
-                // This also guarantees that removeAll() is supported.
-                textPlainList = new ArrayList<>(textPlainList);
-                if (retval != null && !retval.isEmpty()) {
-                    // Use HashSet to get constant-time performance for search.
-                    textPlainList.removeAll(new HashSet<>(retval));
-                    retval.addAll(textPlainList);
-                } else {
-                    retval = textPlainList;
-                }
+            LinkedHashSet<String> textTypeNatives =
+                    getTextTypeToNative().get(TEXT_PLAIN_BASE_TYPE);
+            if (textTypeNatives != null) {
+                retval.addAll(textTypeNatives);
             }
 
-            if (retval == null || retval.isEmpty()) {
-                retval = flavorToNativeLookup(flav, SYNTHESIZE_IF_NOT_FOUND);
+            if (retval.isEmpty()) {
+                retval = flavorToNativeLookup(flav, true);
             } else {
                 // In this branch it is guaranteed that natives explicitly
                 // listed for flav's MIME type were added with
                 // addUnencodedNativeForFlavor(), so they have lower priority.
-                List<String> explicitList =
-                    flavorToNativeLookup(flav, !SYNTHESIZE_IF_NOT_FOUND);
-
-                // flavorToNativeLookup() never returns null.
-                // It can return an empty List, however.
-                if (!explicitList.isEmpty()) {
-                    // To prevent the List stored in the map from modification.
-                    // This also guarantees that removeAll() is supported.
-                    explicitList = new ArrayList<>(explicitList);
-                    // Use HashSet to get constant-time performance for search.
-                    explicitList.removeAll(new HashSet<>(retval));
-                    retval.addAll(explicitList);
-                }
+                retval.addAll(flavorToNativeLookup(flav, false));
             }
         } else if (DataTransferer.isFlavorNoncharsetTextType(flav)) {
-            retval = getAllNativesForType(flav.mimeType.getBaseType());
+            retval = getTextTypeToNative().get(flav.mimeType.getBaseType());
 
             if (retval == null || retval.isEmpty()) {
-                retval = flavorToNativeLookup(flav, SYNTHESIZE_IF_NOT_FOUND);
+                retval = flavorToNativeLookup(flav, true);
             } else {
                 // In this branch it is guaranteed that natives explicitly
                 // listed for flav's MIME type were added with
                 // addUnencodedNativeForFlavor(), so they have lower priority.
-                List<String> explicitList =
-                    flavorToNativeLookup(flav, !SYNTHESIZE_IF_NOT_FOUND);
-
-                // flavorToNativeLookup() never returns null.
-                // It can return an empty List, however.
-                if (!explicitList.isEmpty()) {
-                    // To prevent the List stored in the map from modification.
-                    // This also guarantees that add/removeAll() are supported.
-                    retval = new ArrayList<>(retval);
-                    explicitList = new ArrayList<>(explicitList);
-                    // Use HashSet to get constant-time performance for search.
-                    explicitList.removeAll(new HashSet<>(retval));
-                    retval.addAll(explicitList);
-                }
+                retval.addAll(flavorToNativeLookup(flav, false));
             }
         } else {
-            retval = flavorToNativeLookup(flav, SYNTHESIZE_IF_NOT_FOUND);
+            retval = flavorToNativeLookup(flav, true);
         }
 
-        getNativesForFlavorCache.put(flav, new SoftReference<>(retval));
+        nativesForFlavorCache.put(flav, retval);
         // Create a copy, because client code can modify the returned list.
         return new ArrayList<>(retval);
     }
@@ -791,62 +763,38 @@
      * @see #encodeJavaMIMEType
      * @since 1.4
      */
+    @Override
     public synchronized List<DataFlavor> getFlavorsForNative(String nat) {
-
-        // Check cache, even for null nat
-        SoftReference<List<DataFlavor>> ref = getFlavorsForNativeCache.get(nat);
-        if (ref != null) {
-            List<DataFlavor> retval = ref.get();
-            if (retval != null) {
-                return new ArrayList<>(retval);
-            }
+        LinkedHashSet<DataFlavor> returnValue = flavorsForNativeCache.check(nat);
+        if (returnValue != null) {
+            return new ArrayList<>(returnValue);
+        } else {
+            returnValue = new LinkedHashSet<>();
         }
 
-        final LinkedHashSet <DataFlavor> returnValue =
-            new LinkedHashSet<>();
-
         if (nat == null) {
-            final List<String> natives = getNativesForFlavor(null);
-
-            for (String n : natives)
-            {
-                final List<DataFlavor> flavors = getFlavorsForNative(n);
-
-                for (DataFlavor df : flavors)
-                {
-                    returnValue.add(df);
-                }
+            for (String n : getNativesForFlavor(null)) {
+                returnValue.addAll(getFlavorsForNative(n));
             }
         } else {
-
-            final List<DataFlavor> flavors = nativeToFlavorLookup(nat);
-
+            final LinkedHashSet<DataFlavor> flavors = nativeToFlavorLookup(nat);
             if (disabledMappingGenerationKeys.contains(nat)) {
-                return flavors;
+                return new ArrayList<>(flavors);
             }
 
-            final List<DataFlavor> flavorsAndBaseTypes =
-                nativeToFlavorLookup(nat);
+            final LinkedHashSet<DataFlavor> flavorsWithSynthesized =
+                    nativeToFlavorLookup(nat);
 
-            for (DataFlavor df : flavorsAndBaseTypes) {
+            for (DataFlavor df : flavorsWithSynthesized) {
                 returnValue.add(df);
                 if ("text".equals(df.getPrimaryType())) {
-                    try {
-                        returnValue.addAll(
-                                convertMimeTypeToDataFlavors(
-                                        new MimeType(df.getMimeType()
-                                        ).getBaseType()));
-                    } catch (MimeTypeParseException e) {
-                        e.printStackTrace();
-                    }
+                    String baseType = df.mimeType.getBaseType();
+                    returnValue.addAll(convertMimeTypeToDataFlavors(baseType));
                 }
             }
-
         }
-
-        final List<DataFlavor> arrayList = new ArrayList<>(returnValue);
-        getFlavorsForNativeCache.put(nat, new SoftReference<>(arrayList));
-        return new ArrayList<>(arrayList);
+        flavorsForNativeCache.put(nat, returnValue);
+        return new ArrayList<>(returnValue);
     }
 
     private static Set<DataFlavor> convertMimeTypeToDataFlavors(
@@ -862,7 +810,6 @@
         } catch (MimeTypeParseException mtpe) {
             // Cannot happen, since we checked all mappings
             // on load from flavormap.properties.
-            assert(false);
         }
 
         if (DataTransferer.doesSubtypeSupportCharset(subType, null)) {
@@ -941,10 +888,10 @@
     }
 
     private static final String [] htmlDocumntTypes =
-        new String [] {"all", "selection", "fragment"};
+            new String [] {"all", "selection", "fragment"};
 
-    private static LinkedHashSet<String> handleHtmlMimeTypes(
-        String baseType, String mimeType) {
+    private static LinkedHashSet<String> handleHtmlMimeTypes(String baseType,
+                                                             String mimeType) {
 
         LinkedHashSet<String> returnValues = new LinkedHashSet<>();
 
@@ -981,14 +928,14 @@
      * @see #getNativesForFlavor
      * @see #encodeDataFlavor
      */
-    public synchronized Map<DataFlavor,String>
-        getNativesForFlavors(DataFlavor[] flavors)
+    @Override
+    public synchronized Map<DataFlavor,String> getNativesForFlavors(DataFlavor[] flavors)
     {
         // Use getNativesForFlavor to generate extra natives for text flavors
         // and stringFlavor
 
         if (flavors == null) {
-            List flavor_list = getFlavorsForNative(null);
+            List<DataFlavor> flavor_list = getFlavorsForNative(null);
             flavors = new DataFlavor[flavor_list.size()];
             flavor_list.toArray(flavors);
         }
@@ -1027,15 +974,14 @@
      * @see #getFlavorsForNative
      * @see #encodeJavaMIMEType
      */
-    public synchronized Map<String,DataFlavor>
-        getFlavorsForNatives(String[] natives)
+    @Override
+    public synchronized Map<String,DataFlavor> getFlavorsForNatives(String[] natives)
     {
         // Use getFlavorsForNative to generate extra flavors for text natives
-
         if (natives == null) {
-            List native_list = getNativesForFlavor(null);
-            natives = new String[native_list.size()];
-            native_list.toArray(natives);
+            List<String> nativesList = getNativesForFlavor(null);
+            natives = new String[nativesList.size()];
+            nativesList.toArray(natives);
         }
 
         Map<String, DataFlavor> retval = new HashMap<>(natives.length, 1.0f);
@@ -1044,7 +990,6 @@
             DataFlavor flav = (flavors.isEmpty())? null : flavors.get(0);
             retval.put(aNative, flav);
         }
-
         return retval;
     }
 
@@ -1070,20 +1015,16 @@
      */
     public synchronized void addUnencodedNativeForFlavor(DataFlavor flav,
                                                          String nat) {
-        if (flav == null || nat == null) {
-            throw new NullPointerException("null arguments not permitted");
-        }
+        Objects.requireNonNull(nat, "Null native not permitted");
+        Objects.requireNonNull(flav, "Null flavor not permitted");
 
-        List<String> natives = getFlavorToNative().get(flav);
+        LinkedHashSet<String> natives = getFlavorToNative().get(flav);
         if (natives == null) {
-            natives = new ArrayList<>(1);
+            natives = new LinkedHashSet<>(1);
             getFlavorToNative().put(flav, natives);
-        } else if (natives.contains(nat)) {
-            return;
         }
         natives.add(nat);
-        getNativesForFlavorCache.remove(flav);
-        getNativesForFlavorCache.remove(null);
+        nativesForFlavorCache.remove(flav);
     }
 
     /**
@@ -1116,18 +1057,15 @@
      */
     public synchronized void setNativesForFlavor(DataFlavor flav,
                                                  String[] natives) {
-        if (flav == null || natives == null) {
-            throw new NullPointerException("null arguments not permitted");
-        }
+        Objects.requireNonNull(natives, "Null natives not permitted");
+        Objects.requireNonNull(flav, "Null flavors not permitted");
 
         getFlavorToNative().remove(flav);
         for (String aNative : natives) {
             addUnencodedNativeForFlavor(flav, aNative);
         }
         disabledMappingGenerationKeys.add(flav);
-        // Clear the cache to handle the case of empty natives.
-        getNativesForFlavorCache.remove(flav);
-        getNativesForFlavorCache.remove(null);
+        nativesForFlavorCache.remove(flav);
     }
 
     /**
@@ -1150,20 +1088,16 @@
      */
     public synchronized void addFlavorForUnencodedNative(String nat,
                                                          DataFlavor flav) {
-        if (nat == null || flav == null) {
-            throw new NullPointerException("null arguments not permitted");
-        }
+        Objects.requireNonNull(nat, "Null native not permitted");
+        Objects.requireNonNull(flav, "Null flavor not permitted");
 
-        List<DataFlavor> flavors = getNativeToFlavor().get(nat);
+        LinkedHashSet<DataFlavor> flavors = getNativeToFlavor().get(nat);
         if (flavors == null) {
-            flavors = new ArrayList<>(1);
+            flavors = new LinkedHashSet<>(1);
             getNativeToFlavor().put(nat, flavors);
-        } else if (flavors.contains(flav)) {
-            return;
         }
         flavors.add(flav);
-        getFlavorsForNativeCache.remove(nat);
-        getFlavorsForNativeCache.remove(null);
+        flavorsForNativeCache.remove(nat);
     }
 
     /**
@@ -1195,18 +1129,15 @@
      */
     public synchronized void setFlavorsForNative(String nat,
                                                  DataFlavor[] flavors) {
-        if (nat == null || flavors == null) {
-            throw new NullPointerException("null arguments not permitted");
-        }
+        Objects.requireNonNull(nat, "Null native not permitted");
+        Objects.requireNonNull(flavors, "Null flavors not permitted");
 
         getNativeToFlavor().remove(nat);
         for (DataFlavor flavor : flavors) {
             addFlavorForUnencodedNative(nat, flavor);
         }
         disabledMappingGenerationKeys.add(nat);
-        // Clear the cache to handle the case of empty flavors.
-        getFlavorsForNativeCache.remove(nat);
-        getFlavorsForNativeCache.remove(null);
+        flavorsForNativeCache.remove(nat);
     }
 
     /**
@@ -1307,17 +1238,29 @@
             : null;
     }
 
-    private List<String> getAllNativesForType(String type) {
-        Set<String> retval = null;
-        for (DataFlavor dataFlavor : convertMimeTypeToDataFlavors(type)) {
-            List<String> natives = getFlavorToNative().get(dataFlavor);
-            if (natives != null && !natives.isEmpty()) {
-                if (retval == null) {
-                    retval = new LinkedHashSet<>();
-                }
-                retval.addAll(natives);
+    private static final class SoftCache<K, V> {
+        Map<K, SoftReference<LinkedHashSet<V>>> cache;
+
+        public void put(K key, LinkedHashSet<V> value) {
+            if (cache == null) {
+                cache = new HashMap<>(1);
             }
+            cache.put(key, new SoftReference<>(value));
         }
-        return retval == null ? null : new ArrayList<>(retval);
+
+        public void remove(K key) {
+            if (cache == null) return;
+            cache.remove(null);
+            cache.remove(key);
+        }
+
+        public LinkedHashSet<V> check(K key) {
+            if (cache == null) return null;
+            SoftReference<LinkedHashSet<V>> ref = cache.get(key);
+            if (ref != null) {
+                return ref.get();
+            }
+            return null;
+        }
     }
 }
--- a/jdk/src/share/classes/java/awt/dnd/DragGestureEvent.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/java/awt/dnd/DragGestureEvent.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -357,6 +357,7 @@
         action = newAction;
 
         // Pre-1.4 support. 'events' was previously non-transient
+        @SuppressWarnings("rawtypes")
         List newEvents;
         try {
             newEvents = (List)f.get("events", null);
--- a/jdk/src/share/classes/java/awt/geom/Area.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/java/awt/geom/Area.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -97,9 +97,9 @@
  * @since 1.2
  */
 public class Area implements Shape, Cloneable {
-    private static Vector EmptyCurves = new Vector();
+    private static Vector<Curve> EmptyCurves = new Vector<>();
 
-    private Vector curves;
+    private Vector<Curve> curves;
 
     /**
      * Default constructor which creates an empty area.
@@ -127,8 +127,8 @@
         }
     }
 
-    private static Vector pathToCurves(PathIterator pi) {
-        Vector curves = new Vector();
+    private static Vector<Curve> pathToCurves(PathIterator pi) {
+        Vector<Curve> curves = new Vector<>();
         int windingRule = pi.getWindingRule();
         // coords array is big enough for holding:
         //     coordinates returned from currentSegment (6)
@@ -334,7 +334,7 @@
      * @since 1.2
      */
     public void reset() {
-        curves = new Vector();
+        curves = new Vector<>();
         invalidateBounds();
     }
 
@@ -357,9 +357,9 @@
      * @since 1.2
      */
     public boolean isPolygonal() {
-        Enumeration enum_ = curves.elements();
+        Enumeration<Curve> enum_ = curves.elements();
         while (enum_.hasMoreElements()) {
-            if (((Curve) enum_.nextElement()).getOrder() > 1) {
+            if (enum_.nextElement().getOrder() > 1) {
                 return false;
             }
         }
@@ -381,8 +381,8 @@
         if (size > 3) {
             return false;
         }
-        Curve c1 = (Curve) curves.get(1);
-        Curve c2 = (Curve) curves.get(2);
+        Curve c1 = curves.get(1);
+        Curve c2 = curves.get(2);
         if (c1.getOrder() != 1 || c2.getOrder() != 1) {
             return false;
         }
@@ -411,10 +411,10 @@
         if (curves.size() < 3) {
             return true;
         }
-        Enumeration enum_ = curves.elements();
+        Enumeration<Curve> enum_ = curves.elements();
         enum_.nextElement(); // First Order0 "moveto"
         while (enum_.hasMoreElements()) {
-            if (((Curve) enum_.nextElement()).getOrder() == 0) {
+            if (enum_.nextElement().getOrder() == 0) {
                 return false;
             }
         }
@@ -431,11 +431,11 @@
         }
         Rectangle2D r = new Rectangle2D.Double();
         if (curves.size() > 0) {
-            Curve c = (Curve) curves.get(0);
+            Curve c = curves.get(0);
             // First point is always an order 0 curve (moveto)
             r.setRect(c.getX0(), c.getY0(), 0, 0);
             for (int i = 1; i < curves.size(); i++) {
-                ((Curve) curves.get(i)).enlarge(r);
+                curves.get(i).enlarge(r);
             }
         }
         return (cachedBounds = r);
@@ -507,7 +507,7 @@
         if (other == null) {
             return false;
         }
-        Vector c = new AreaOp.XorOp().calculate(this.curves, other.curves);
+        Vector<Curve> c = new AreaOp.XorOp().calculate(this.curves, other.curves);
         return c.isEmpty();
     }
 
@@ -555,10 +555,10 @@
         if (!getCachedBounds().contains(x, y)) {
             return false;
         }
-        Enumeration enum_ = curves.elements();
+        Enumeration<Curve> enum_ = curves.elements();
         int crossings = 0;
         while (enum_.hasMoreElements()) {
-            Curve c = (Curve) enum_.nextElement();
+            Curve c = enum_.nextElement();
             crossings += c.crossingsFor(x, y);
         }
         return ((crossings & 1) == 1);
@@ -658,16 +658,16 @@
 
 class AreaIterator implements PathIterator {
     private AffineTransform transform;
-    private Vector curves;
+    private Vector<Curve> curves;
     private int index;
     private Curve prevcurve;
     private Curve thiscurve;
 
-    public AreaIterator(Vector curves, AffineTransform at) {
+    public AreaIterator(Vector<Curve> curves, AffineTransform at) {
         this.curves = curves;
         this.transform = at;
         if (curves.size() >= 1) {
-            thiscurve = (Curve) curves.get(0);
+            thiscurve = curves.get(0);
         }
     }
 
@@ -689,7 +689,7 @@
             prevcurve = thiscurve;
             index++;
             if (index < curves.size()) {
-                thiscurve = (Curve) curves.get(index);
+                thiscurve = curves.get(index);
                 if (thiscurve.getOrder() != 0 &&
                     prevcurve.getX1() == thiscurve.getX0() &&
                     prevcurve.getY1() == thiscurve.getY0())
--- a/jdk/src/share/classes/java/awt/image/BufferedImage.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/java/awt/image/BufferedImage.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -76,7 +76,7 @@
     ColorModel colorModel;
     WritableRaster raster;
     OffScreenImageSource osis;
-    Hashtable properties;
+    Hashtable<?, ?> properties;
 
     boolean    isAlphaPremultiplied;// If true, alpha has been premultiplied in
     // color channels
@@ -1106,7 +1106,7 @@
     public ImageProducer getSource() {
         if (osis == null) {
             if (properties == null) {
-                properties = new Hashtable();
+                properties = new Hashtable<>();
             }
             osis = new OffScreenImageSource(this, properties);
         }
--- a/jdk/src/share/classes/java/awt/image/CropImageFilter.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/java/awt/image/CropImageFilter.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -79,6 +79,7 @@
      * with the filtering operation.
      */
     public void setProperties(Hashtable<?,?> props) {
+        @SuppressWarnings("unchecked")
         Hashtable<Object,Object> p = (Hashtable<Object,Object>)props.clone();
         p.put("croprect", new Rectangle(cropX, cropY, cropW, cropH));
         super.setProperties(p);
--- a/jdk/src/share/classes/java/awt/image/FilteredImageSource.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/java/awt/image/FilteredImageSource.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -68,7 +68,7 @@
         filter = imgf;
     }
 
-    private Hashtable proxies;
+    private Hashtable<ImageConsumer, ImageFilter> proxies;
 
     /**
      * Adds the specified <code>ImageConsumer</code>
@@ -94,7 +94,7 @@
      */
     public synchronized void addConsumer(ImageConsumer ic) {
         if (proxies == null) {
-            proxies = new Hashtable();
+            proxies = new Hashtable<>();
         }
         if (!proxies.containsKey(ic)) {
             ImageFilter imgf = filter.getFilterInstance(ic);
@@ -137,7 +137,7 @@
      */
     public synchronized void removeConsumer(ImageConsumer ic) {
         if (proxies != null) {
-            ImageFilter imgf = (ImageFilter) proxies.get(ic);
+            ImageFilter imgf =  proxies.get(ic);
             if (imgf != null) {
                 src.removeConsumer(imgf);
                 proxies.remove(ic);
@@ -173,9 +173,9 @@
      */
     public void startProduction(ImageConsumer ic) {
         if (proxies == null) {
-            proxies = new Hashtable();
+            proxies = new Hashtable<>();
         }
-        ImageFilter imgf = (ImageFilter) proxies.get(ic);
+        ImageFilter imgf = proxies.get(ic);
         if (imgf == null) {
             imgf = filter.getFilterInstance(ic);
             proxies.put(ic, imgf);
@@ -200,7 +200,7 @@
      */
     public void requestTopDownLeftRightResend(ImageConsumer ic) {
         if (proxies != null) {
-            ImageFilter imgf = (ImageFilter) proxies.get(ic);
+            ImageFilter imgf = proxies.get(ic);
             if (imgf != null) {
                 imgf.resendTopDownLeftRight(src);
             }
--- a/jdk/src/share/classes/java/awt/image/ImageFilter.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/java/awt/image/ImageFilter.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -104,6 +104,7 @@
      * @exception NullPointerException if <code>props</code> is null
      */
     public void setProperties(Hashtable<?,?> props) {
+        @SuppressWarnings("unchecked")
         Hashtable<Object,Object> p = (Hashtable<Object,Object>)props.clone();
         Object o = p.get("filters");
         if (o == null) {
--- a/jdk/src/share/classes/java/awt/image/MemoryImageSource.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/java/awt/image/MemoryImageSource.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -111,8 +111,8 @@
     Object pixels;
     int pixeloffset;
     int pixelscan;
-    Hashtable properties;
-    Vector theConsumers = new Vector();
+    Hashtable<?, ?> properties;
+    Vector<ImageConsumer> theConsumers = new Vector<>();
     boolean animating;
     boolean fullbuffers;
 
@@ -197,7 +197,7 @@
     }
 
     private void initialize(int w, int h, ColorModel cm,
-                            Object pix, int off, int scan, Hashtable props) {
+                            Object pix, int off, int scan, Hashtable<?,?> props) {
         width = w;
         height = h;
         model = cm;
@@ -205,7 +205,7 @@
         pixeloffset = off;
         pixelscan = scan;
         if (props == null) {
-            props = new Hashtable();
+            props = new Hashtable<>();
         }
         properties = props;
     }
@@ -343,9 +343,9 @@
     public synchronized void setAnimated(boolean animated) {
         this.animating = animated;
         if (!animating) {
-            Enumeration enum_ = theConsumers.elements();
+            Enumeration<ImageConsumer> enum_ = theConsumers.elements();
             while (enum_.hasMoreElements()) {
-                ImageConsumer ic = (ImageConsumer) enum_.nextElement();
+                ImageConsumer ic = enum_.nextElement();
                 ic.imageComplete(ImageConsumer.STATICIMAGEDONE);
                 if (isConsumer(ic)) {
                     ic.imageComplete(ImageConsumer.IMAGEERROR);
@@ -376,9 +376,9 @@
         }
         this.fullbuffers = fullbuffers;
         if (animating) {
-            Enumeration enum_ = theConsumers.elements();
+            Enumeration<ImageConsumer> enum_ = theConsumers.elements();
             while (enum_.hasMoreElements()) {
-                ImageConsumer ic = (ImageConsumer) enum_.nextElement();
+                ImageConsumer ic = enum_.nextElement();
                 ic.setHints(fullbuffers
                             ? (ImageConsumer.TOPDOWNLEFTRIGHT |
                                ImageConsumer.COMPLETESCANLINES)
@@ -474,9 +474,9 @@
             if ((w <= 0 || h <= 0) && !framenotify) {
                 return;
             }
-            Enumeration enum_ = theConsumers.elements();
+            Enumeration<ImageConsumer> enum_ = theConsumers.elements();
             while (enum_.hasMoreElements()) {
-                ImageConsumer ic = (ImageConsumer) enum_.nextElement();
+                ImageConsumer ic = enum_.nextElement();
                 if (w > 0 && h > 0) {
                     sendPixels(ic, x, y, w, h);
                 }
--- a/jdk/src/share/classes/java/awt/image/ReplicateScaleFilter.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/java/awt/image/ReplicateScaleFilter.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -121,6 +121,7 @@
      * with the filtering operation.
      */
     public void setProperties(Hashtable<?,?> props) {
+        @SuppressWarnings("unchecked")
         Hashtable<Object,Object> p = (Hashtable<Object,Object>)props.clone();
         String key = "rescale";
         String val = destWidth + "x" + destHeight;
--- a/jdk/src/share/classes/java/awt/image/renderable/ParameterBlock.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/java/awt/image/renderable/ParameterBlock.java	Mon Jun 02 13:53:52 2014 -0700
@@ -153,6 +153,7 @@
      *
      * @return an Object clone of the <code>ParameterBlock</code>.
      */
+    @SuppressWarnings("unchecked") // casts from clone
     public Object clone() {
         ParameterBlock theClone;
 
@@ -164,10 +165,10 @@
         }
 
         if (sources != null) {
-            theClone.setSources((Vector)sources.clone());
+            theClone.setSources((Vector<Object>)sources.clone());
         }
         if (parameters != null) {
-            theClone.setParameters((Vector)parameters.clone());
+            theClone.setParameters((Vector<Object>)parameters.clone());
         }
         return (Object) theClone;
     }
@@ -280,7 +281,7 @@
 
     /** Clears the list of source images. */
     public void removeSources() {
-        sources = new Vector();
+        sources = new Vector<>();
     }
 
     /**
@@ -313,7 +314,7 @@
 
     /** Clears the list of parameters. */
     public void removeParameters() {
-        parameters = new Vector();
+        parameters = new Vector<>();
     }
 
     /**
@@ -696,9 +697,9 @@
      * of the parameters.
      * @return an array of <code>Class</code> objects.
      */
-    public Class [] getParamClasses() {
+    public Class<?>[] getParamClasses() {
         int numParams = getNumParameters();
-        Class [] classes = new Class[numParams];
+        Class<?>[] classes = new Class<?>[numParams];
         int i;
 
         for (i = 0; i < numParams; i++) {
--- a/jdk/src/share/classes/java/awt/image/renderable/RenderableImageOp.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/java/awt/image/renderable/RenderableImageOp.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -87,11 +87,11 @@
         return getRenderableSources();
     }
 
-    private Vector getRenderableSources() {
-        Vector sources = null;
+    private Vector<RenderableImage> getRenderableSources() {
+        Vector<RenderableImage> sources = null;
 
         if (paramBlock.getNumSources() > 0) {
-            sources = new Vector();
+            sources = new Vector<>();
             int i = 0;
             while (i < paramBlock.getNumSources()) {
                 Object o = paramBlock.getSource(i);
@@ -314,19 +314,19 @@
         // contains RenderableImage sources, they will be replaced by
         // RenderedImages.
         ParameterBlock renderedParamBlock = (ParameterBlock)paramBlock.clone();
-        Vector sources = getRenderableSources();
+        Vector<? extends Object> sources = getRenderableSources();
 
         try {
             // This assumes that if there is no renderable source, that there
             // is a rendered source in paramBlock
 
             if (sources != null) {
-                Vector renderedSources = new Vector();
+                Vector<Object> renderedSources = new Vector<>();
                 for (int i = 0; i < sources.size(); i++) {
                     rcOut = myCRIF.mapRenderContext(i, renderContext,
                                                     paramBlock, this);
                     RenderedImage rdrdImage =
-                       ((RenderableImage)sources.elementAt(i)).createRendering(rcOut);
+                        ((RenderableImage)sources.elementAt(i)).createRendering(rcOut);
                     if (rdrdImage == null) {
                         return null;
                     }
--- a/jdk/src/share/classes/java/awt/image/renderable/RenderableImageProducer.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/java/awt/image/renderable/RenderableImageProducer.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -68,7 +68,7 @@
     RenderContext rc;
 
     /** A Vector of image consumers. */
-    Vector ics = new Vector();
+    Vector<ImageConsumer> ics = new Vector<>();
 
     /**
      * Constructs a new RenderableImageProducer from a RenderableImage
@@ -177,12 +177,12 @@
         int width = raster.getWidth();
         int height = raster.getHeight();
 
-        Enumeration icList;
+        Enumeration<ImageConsumer> icList;
         ImageConsumer ic;
         // Set up the ImageConsumers
         icList = ics.elements();
         while (icList.hasMoreElements()) {
-            ic = (ImageConsumer)icList.nextElement();
+            ic = icList.nextElement();
             ic.setDimensions(width,height);
             ic.setHints(ImageConsumer.TOPDOWNLEFTRIGHT |
                         ImageConsumer.COMPLETESCANLINES |
@@ -204,7 +204,7 @@
             // Now send the scanline to the Consumers
             icList = ics.elements();
             while (icList.hasMoreElements()) {
-                ic = (ImageConsumer)icList.nextElement();
+                ic = icList.nextElement();
                 ic.setPixels(0, j, width, 1, colorModel, pix, 0, width);
             }
         }
@@ -212,7 +212,7 @@
         // Now tell the consumers we're done.
         icList = ics.elements();
         while (icList.hasMoreElements()) {
-            ic = (ImageConsumer)icList.nextElement();
+            ic = icList.nextElement();
             ic.imageComplete(ImageConsumer.STATICIMAGEDONE);
         }
     }
--- a/jdk/src/share/classes/java/awt/print/Book.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/java/awt/print/Book.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -47,7 +47,7 @@
     /**
      * The set of pages that make up the Book.
      */
-    private Vector mPages;
+    private Vector<BookPage> mPages;
 
  /* Instance Methods */
 
@@ -55,7 +55,7 @@
      *  Creates a new, empty <code>Book</code>.
      */
     public Book() {
-        mPages = new Vector();
+        mPages = new Vector<>();
     }
 
     /**
@@ -167,7 +167,7 @@
     private BookPage getPage(int pageIndex)
         throws ArrayIndexOutOfBoundsException
     {
-        return (BookPage) mPages.elementAt(pageIndex);
+        return mPages.elementAt(pageIndex);
     }
 
     /**
--- a/jdk/src/share/classes/java/awt/print/PrinterJob.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/java/awt/print/PrinterJob.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -74,9 +74,9 @@
         if (security != null) {
             security.checkPrintJobAccess();
         }
-        return (PrinterJob) java.security.AccessController.doPrivileged(
-            new java.security.PrivilegedAction() {
-            public Object run() {
+        return java.security.AccessController.doPrivileged(
+            new java.security.PrivilegedAction<PrinterJob>() {
+            public PrinterJob run() {
                 String nm = System.getProperty("java.awt.printerjob", null);
                 try {
                     return (PrinterJob)Class.forName(nm).newInstance();
--- a/jdk/src/share/classes/java/beans/MethodDescriptor.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/java/beans/MethodDescriptor.java	Mon Jun 02 13:53:52 2014 -0700
@@ -162,6 +162,16 @@
                 : null;
     }
 
+    private static Method resolve(Method oldMethod, Method newMethod) {
+        if (oldMethod == null) {
+            return newMethod;
+        }
+        if (newMethod == null) {
+            return oldMethod;
+        }
+        return !oldMethod.isSynthetic() && newMethod.isSynthetic() ? oldMethod : newMethod;
+    }
+
     /*
      * Package-private constructor
      * Merge two method descriptors.  Where they conflict, give the
@@ -173,8 +183,7 @@
     MethodDescriptor(MethodDescriptor x, MethodDescriptor y) {
         super(x, y);
 
-        Method method = y.methodRef.get();
-        this.methodRef.set(null != method ? method : x.methodRef.get());
+        this.methodRef.set(resolve(x.methodRef.get(), y.methodRef.get()));
         params = x.params;
         if (y.params != null) {
             params = y.params;
--- a/jdk/src/share/classes/java/lang/ClassValue.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/java/lang/ClassValue.java	Mon Jun 02 13:53:52 2014 -0700
@@ -25,7 +25,6 @@
 
 package java.lang;
 
-import java.lang.ClassValue.ClassValueMap;
 import java.util.WeakHashMap;
 import java.lang.ref.WeakReference;
 import java.util.concurrent.atomic.AtomicInteger;
@@ -375,10 +374,10 @@
         synchronized (CRITICAL_SECTION) {  // private object to avoid deadlocks
             // happens about once per type
             if ((map = type.classValueMap) == null)
-                type.classValueMap = map = new ClassValueMap(type);
+                type.classValueMap = map = new ClassValueMap();
         }
-            return map;
-        }
+        return map;
+    }
 
     static <T> Entry<T> makeEntry(Version<T> explicitVersion, T value) {
         // Note that explicitVersion might be different from this.version.
@@ -398,12 +397,11 @@
 
     // The following class could also be top level and non-public:
 
-    /** A backing map for all ClassValues, relative a single given type.
+    /** A backing map for all ClassValues.
      *  Gives a fully serialized "true state" for each pair (ClassValue cv, Class type).
      *  Also manages an unserialized fast-path cache.
      */
     static class ClassValueMap extends WeakHashMap<ClassValue.Identity, Entry<?>> {
-        private final Class<?> type;
         private Entry<?>[] cacheArray;
         private int cacheLoad, cacheLoadLimit;
 
@@ -413,11 +411,10 @@
          */
         private static final int INITIAL_ENTRIES = 32;
 
-        /** Build a backing map for ClassValues, relative the given type.
+        /** Build a backing map for ClassValues.
          *  Also, create an empty cache array and install it on the class.
          */
-        ClassValueMap(Class<?> type) {
-            this.type = type;
+        ClassValueMap() {
             sizeCache(INITIAL_ENTRIES);
         }
 
--- a/jdk/src/share/classes/java/lang/Process.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/java/lang/Process.java	Mon Jun 02 13:53:52 2014 -0700
@@ -262,4 +262,18 @@
             return true;
         }
     }
+
+    /**
+     * Returns the native process id of the subprocess.
+     * The native process id is an identification number that the operating
+     * system assigns to the process.
+     *
+     * @return the native process id of the subprocess
+     * @throws UnsupportedOperationException if the Process implementation
+     *     does not support this operation
+     * @since 1.9
+     */
+    public long getPid() {
+        throw new UnsupportedOperationException();
+    }
 }
--- a/jdk/src/share/classes/java/lang/invoke/BoundMethodHandle.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/java/lang/invoke/BoundMethodHandle.java	Mon Jun 02 13:53:52 2014 -0700
@@ -26,11 +26,10 @@
 package java.lang.invoke;
 
 import static jdk.internal.org.objectweb.asm.Opcodes.*;
-import static java.lang.invoke.LambdaForm.basicTypes;
-import static java.lang.invoke.MethodHandleNatives.Constants.REF_invokeStatic;
+import static java.lang.invoke.LambdaForm.*;
+import static java.lang.invoke.LambdaForm.BasicType.*;
 import static java.lang.invoke.MethodHandleStatics.*;
 
-import java.lang.invoke.LambdaForm.Name;
 import java.lang.invoke.LambdaForm.NamedFunction;
 import java.lang.invoke.MethodHandles.Lookup;
 import java.lang.reflect.Field;
@@ -61,22 +60,22 @@
     // BMH API and internals
     //
 
-    static MethodHandle bindSingle(MethodType type, LambdaForm form, char xtype, Object x) {
+    static MethodHandle bindSingle(MethodType type, LambdaForm form, BasicType xtype, Object x) {
         // for some type signatures, there exist pre-defined concrete BMH classes
         try {
             switch (xtype) {
-            case 'L':
+            case L_TYPE:
                 if (true)  return bindSingle(type, form, x);  // Use known fast path.
-                return (BoundMethodHandle) SpeciesData.EMPTY.extendWithType('L').constructor[0].invokeBasic(type, form, x);
-            case 'I':
-                return (BoundMethodHandle) SpeciesData.EMPTY.extendWithType('I').constructor[0].invokeBasic(type, form, ValueConversions.widenSubword(x));
-            case 'J':
-                return (BoundMethodHandle) SpeciesData.EMPTY.extendWithType('J').constructor[0].invokeBasic(type, form, (long) x);
-            case 'F':
-                return (BoundMethodHandle) SpeciesData.EMPTY.extendWithType('F').constructor[0].invokeBasic(type, form, (float) x);
-            case 'D':
-                return (BoundMethodHandle) SpeciesData.EMPTY.extendWithType('D').constructor[0].invokeBasic(type, form, (double) x);
-            default : throw new InternalError("unexpected xtype: " + xtype);
+                return (BoundMethodHandle) SpeciesData.EMPTY.extendWith(L_TYPE).constructor[0].invokeBasic(type, form, x);
+            case I_TYPE:
+                return (BoundMethodHandle) SpeciesData.EMPTY.extendWith(I_TYPE).constructor[0].invokeBasic(type, form, ValueConversions.widenSubword(x));
+            case J_TYPE:
+                return (BoundMethodHandle) SpeciesData.EMPTY.extendWith(J_TYPE).constructor[0].invokeBasic(type, form, (long) x);
+            case F_TYPE:
+                return (BoundMethodHandle) SpeciesData.EMPTY.extendWith(F_TYPE).constructor[0].invokeBasic(type, form, (float) x);
+            case D_TYPE:
+                return (BoundMethodHandle) SpeciesData.EMPTY.extendWith(D_TYPE).constructor[0].invokeBasic(type, form, (double) x);
+            default : throw newInternalError("unexpected xtype: " + xtype);
             }
         } catch (Throwable t) {
             throw newInternalError(t);
@@ -87,23 +86,23 @@
             return new Species_L(type, form, x);
     }
 
-    MethodHandle cloneExtend(MethodType type, LambdaForm form, char xtype, Object x) {
+    MethodHandle cloneExtend(MethodType type, LambdaForm form, BasicType xtype, Object x) {
         try {
             switch (xtype) {
-            case 'L': return cloneExtendL(type, form, x);
-            case 'I': return cloneExtendI(type, form, ValueConversions.widenSubword(x));
-            case 'J': return cloneExtendJ(type, form, (long) x);
-            case 'F': return cloneExtendF(type, form, (float) x);
-            case 'D': return cloneExtendD(type, form, (double) x);
+            case L_TYPE: return copyWithExtendL(type, form, x);
+            case I_TYPE: return copyWithExtendI(type, form, ValueConversions.widenSubword(x));
+            case J_TYPE: return copyWithExtendJ(type, form, (long) x);
+            case F_TYPE: return copyWithExtendF(type, form, (float) x);
+            case D_TYPE: return copyWithExtendD(type, form, (double) x);
             }
         } catch (Throwable t) {
             throw newInternalError(t);
         }
-        throw new InternalError("unexpected type: " + xtype);
+        throw newInternalError("unexpected type: " + xtype);
     }
 
     @Override
-    MethodHandle bindArgument(int pos, char basicType, Object value) {
+    MethodHandle bindArgument(int pos, BasicType basicType, Object value) {
         MethodType type = type().dropParameterTypes(pos, pos+1);
         LambdaForm form = internalForm().bind(1+pos, speciesData());
         return cloneExtend(type, form, basicType, value);
@@ -111,9 +110,9 @@
 
     @Override
     MethodHandle dropArguments(MethodType srcType, int pos, int drops) {
-        LambdaForm form = internalForm().addArguments(pos, srcType.parameterList().subList(pos, pos+drops));
+        LambdaForm form = internalForm().addArguments(pos, srcType.parameterList().subList(pos, pos + drops));
         try {
-             return clone(srcType, form);
+             return copyWith(srcType, form);
          } catch (Throwable t) {
              throw newInternalError(t);
          }
@@ -122,26 +121,23 @@
     @Override
     MethodHandle permuteArguments(MethodType newType, int[] reorder) {
         try {
-             return clone(newType, form.permuteArguments(1, reorder, basicTypes(newType.parameterList())));
+             return copyWith(newType, form.permuteArguments(1, reorder, basicTypes(newType.parameterList())));
          } catch (Throwable t) {
              throw newInternalError(t);
          }
     }
 
-    static final String EXTENSION_TYPES = "LIJFD";
-    static final byte INDEX_L = 0, INDEX_I = 1, INDEX_J = 2, INDEX_F = 3, INDEX_D = 4;
-    static byte extensionIndex(char type) {
-        int i = EXTENSION_TYPES.indexOf(type);
-        if (i < 0)  throw new InternalError();
-        return (byte) i;
-    }
-
     /**
      * Return the {@link SpeciesData} instance representing this BMH species. All subclasses must provide a
      * static field containing this value, and they must accordingly implement this method.
      */
     /*non-public*/ abstract SpeciesData speciesData();
 
+    /**
+     * Return the number of fields in this BMH.  Equivalent to speciesData().fieldCount().
+     */
+    /*non-public*/ abstract int fieldCount();
+
     @Override
     final Object internalProperties() {
         return "/BMH="+internalValues();
@@ -159,38 +155,33 @@
     /*non-public*/ final Object arg(int i) {
         try {
             switch (speciesData().fieldType(i)) {
-            case 'L': return argL(i);
-            case 'I': return argI(i);
-            case 'F': return argF(i);
-            case 'D': return argD(i);
-            case 'J': return argJ(i);
+            case L_TYPE: return          speciesData().getters[i].invokeBasic(this);
+            case I_TYPE: return (int)    speciesData().getters[i].invokeBasic(this);
+            case J_TYPE: return (long)   speciesData().getters[i].invokeBasic(this);
+            case F_TYPE: return (float)  speciesData().getters[i].invokeBasic(this);
+            case D_TYPE: return (double) speciesData().getters[i].invokeBasic(this);
             }
         } catch (Throwable ex) {
             throw newInternalError(ex);
         }
-        throw new InternalError("unexpected type: " + speciesData().types+"."+i);
+        throw new InternalError("unexpected type: " + speciesData().typeChars+"."+i);
     }
-    /*non-public*/ final Object argL(int i) throws Throwable { return          speciesData().getters[i].invokeBasic(this); }
-    /*non-public*/ final int    argI(int i) throws Throwable { return (int)    speciesData().getters[i].invokeBasic(this); }
-    /*non-public*/ final float  argF(int i) throws Throwable { return (float)  speciesData().getters[i].invokeBasic(this); }
-    /*non-public*/ final double argD(int i) throws Throwable { return (double) speciesData().getters[i].invokeBasic(this); }
-    /*non-public*/ final long   argJ(int i) throws Throwable { return (long)   speciesData().getters[i].invokeBasic(this); }
 
     //
     // cloning API
     //
 
-    /*non-public*/ abstract BoundMethodHandle clone(MethodType mt, LambdaForm lf) throws Throwable;
-    /*non-public*/ abstract BoundMethodHandle cloneExtendL(MethodType mt, LambdaForm lf, Object narg) throws Throwable;
-    /*non-public*/ abstract BoundMethodHandle cloneExtendI(MethodType mt, LambdaForm lf, int    narg) throws Throwable;
-    /*non-public*/ abstract BoundMethodHandle cloneExtendJ(MethodType mt, LambdaForm lf, long   narg) throws Throwable;
-    /*non-public*/ abstract BoundMethodHandle cloneExtendF(MethodType mt, LambdaForm lf, float  narg) throws Throwable;
-    /*non-public*/ abstract BoundMethodHandle cloneExtendD(MethodType mt, LambdaForm lf, double narg) throws Throwable;
+    /*non-public*/ abstract BoundMethodHandle copyWith(MethodType mt, LambdaForm lf);
+    /*non-public*/ abstract BoundMethodHandle copyWithExtendL(MethodType mt, LambdaForm lf, Object narg);
+    /*non-public*/ abstract BoundMethodHandle copyWithExtendI(MethodType mt, LambdaForm lf, int    narg);
+    /*non-public*/ abstract BoundMethodHandle copyWithExtendJ(MethodType mt, LambdaForm lf, long   narg);
+    /*non-public*/ abstract BoundMethodHandle copyWithExtendF(MethodType mt, LambdaForm lf, float  narg);
+    /*non-public*/ abstract BoundMethodHandle copyWithExtendD(MethodType mt, LambdaForm lf, double narg);
 
     // The following is a grossly irregular hack:
     @Override MethodHandle reinvokerTarget() {
         try {
-            return (MethodHandle) argL(0);
+            return (MethodHandle) arg(0);
         } catch (Throwable ex) {
             throw newInternalError(ex);
         }
@@ -203,7 +194,7 @@
     private  // make it private to force users to access the enclosing class first
     static final class Species_L extends BoundMethodHandle {
         final Object argL0;
-        /*non-public*/ Species_L(MethodType mt, LambdaForm lf, Object argL0) {
+        private Species_L(MethodType mt, LambdaForm lf, Object argL0) {
             super(mt, lf);
             this.argL0 = argL0;
         }
@@ -213,140 +204,95 @@
         /*non-public*/ SpeciesData speciesData() {
             return SPECIES_DATA;
         }
-        /*non-public*/ static final SpeciesData SPECIES_DATA = SpeciesData.getForClass("L", Species_L.class);
         @Override
-        /*non-public*/ final BoundMethodHandle clone(MethodType mt, LambdaForm lf) throws Throwable {
+        /*non-public*/ int fieldCount() {
+            return 1;
+        }
+        /*non-public*/ static final SpeciesData SPECIES_DATA = SpeciesData.getForClass("L", Species_L.class);
+        /*non-public*/ static BoundMethodHandle make(MethodType mt, LambdaForm lf, Object argL0) {
+            return new Species_L(mt, lf, argL0);
+        }
+        @Override
+        /*non-public*/ final BoundMethodHandle copyWith(MethodType mt, LambdaForm lf) {
             return new Species_L(mt, lf, argL0);
         }
         @Override
-        /*non-public*/ final BoundMethodHandle cloneExtendL(MethodType mt, LambdaForm lf, Object narg) throws Throwable {
-            return (BoundMethodHandle) SPECIES_DATA.extendWithIndex(INDEX_L).constructor[0].invokeBasic(mt, lf, argL0, narg);
-        }
-        @Override
-        /*non-public*/ final BoundMethodHandle cloneExtendI(MethodType mt, LambdaForm lf, int narg) throws Throwable {
-            return (BoundMethodHandle) SPECIES_DATA.extendWithIndex(INDEX_I).constructor[0].invokeBasic(mt, lf, argL0, narg);
-        }
-        @Override
-        /*non-public*/ final BoundMethodHandle cloneExtendJ(MethodType mt, LambdaForm lf, long narg) throws Throwable {
-            return (BoundMethodHandle) SPECIES_DATA.extendWithIndex(INDEX_J).constructor[0].invokeBasic(mt, lf, argL0, narg);
-        }
-        @Override
-        /*non-public*/ final BoundMethodHandle cloneExtendF(MethodType mt, LambdaForm lf, float narg) throws Throwable {
-            return (BoundMethodHandle) SPECIES_DATA.extendWithIndex(INDEX_F).constructor[0].invokeBasic(mt, lf, argL0, narg);
+        /*non-public*/ final BoundMethodHandle copyWithExtendL(MethodType mt, LambdaForm lf, Object narg) {
+            try {
+                return (BoundMethodHandle) SPECIES_DATA.extendWith(L_TYPE).constructor[0].invokeBasic(mt, lf, argL0, narg);
+            } catch (Throwable ex) {
+                throw uncaughtException(ex);
+            }
         }
         @Override
-        /*non-public*/ final BoundMethodHandle cloneExtendD(MethodType mt, LambdaForm lf, double narg) throws Throwable {
-            return (BoundMethodHandle) SPECIES_DATA.extendWithIndex(INDEX_D).constructor[0].invokeBasic(mt, lf, argL0, narg);
-        }
-    }
-
-/*
-    static final class Species_LL extends BoundMethodHandle {
-        final Object argL0;
-        final Object argL1;
-        public Species_LL(MethodType mt, LambdaForm lf, Object argL0, Object argL1) {
-            super(mt, lf);
-            this.argL0 = argL0;
-            this.argL1 = argL1;
-        }
-        @Override
-        public SpeciesData speciesData() {
-            return SPECIES_DATA;
-        }
-        public static final SpeciesData SPECIES_DATA = SpeciesData.getForClass("LL", Species_LL.class);
-        @Override
-        public final BoundMethodHandle clone(MethodType mt, LambdaForm lf) throws Throwable {
-            return new Species_LL(mt, lf, argL0, argL1);
-        }
-        @Override
-        public final BoundMethodHandle cloneExtendL(MethodType mt, LambdaForm lf, Object narg) throws Throwable {
-            return (BoundMethodHandle) SPECIES_DATA.extendWithIndex(INDEX_L).constructor[0].invokeBasic(mt, lf, argL0, argL1, narg);
-        }
-        @Override
-        public final BoundMethodHandle cloneExtendI(MethodType mt, LambdaForm lf, int narg) throws Throwable {
-            return (BoundMethodHandle) SPECIES_DATA.extendWithIndex(INDEX_I).constructor[0].invokeBasic(mt, lf, argL0, argL1, narg);
+        /*non-public*/ final BoundMethodHandle copyWithExtendI(MethodType mt, LambdaForm lf, int narg) {
+            try {
+                return (BoundMethodHandle) SPECIES_DATA.extendWith(I_TYPE).constructor[0].invokeBasic(mt, lf, argL0, narg);
+            } catch (Throwable ex) {
+                throw uncaughtException(ex);
+            }
         }
         @Override
-        public final BoundMethodHandle cloneExtendJ(MethodType mt, LambdaForm lf, long narg) throws Throwable {
-            return (BoundMethodHandle) SPECIES_DATA.extendWithIndex(INDEX_J).constructor[0].invokeBasic(mt, lf, argL0, argL1, narg);
-        }
-        @Override
-        public final BoundMethodHandle cloneExtendF(MethodType mt, LambdaForm lf, float narg) throws Throwable {
-            return (BoundMethodHandle) SPECIES_DATA.extendWithIndex(INDEX_F).constructor[0].invokeBasic(mt, lf, argL0, argL1, narg);
-        }
-        @Override
-        public final BoundMethodHandle cloneExtendD(MethodType mt, LambdaForm lf, double narg) throws Throwable {
-            return (BoundMethodHandle) SPECIES_DATA.extendWithIndex(INDEX_D).constructor[0].invokeBasic(mt, lf, argL0, argL1, narg);
-        }
-    }
-
-    static final class Species_JL extends BoundMethodHandle {
-        final long argJ0;
-        final Object argL1;
-        public Species_JL(MethodType mt, LambdaForm lf, long argJ0, Object argL1) {
-            super(mt, lf);
-            this.argJ0 = argJ0;
-            this.argL1 = argL1;
+        /*non-public*/ final BoundMethodHandle copyWithExtendJ(MethodType mt, LambdaForm lf, long narg) {
+            try {
+                return (BoundMethodHandle) SPECIES_DATA.extendWith(J_TYPE).constructor[0].invokeBasic(mt, lf, argL0, narg);
+            } catch (Throwable ex) {
+                throw uncaughtException(ex);
+            }
         }
         @Override
-        public SpeciesData speciesData() {
-            return SPECIES_DATA;
-        }
-        public static final SpeciesData SPECIES_DATA = SpeciesData.getForClass("JL", Species_JL.class);
-        @Override public final long   argJ0() { return argJ0; }
-        @Override public final Object argL1() { return argL1; }
-        @Override
-        public final BoundMethodHandle clone(MethodType mt, LambdaForm lf) throws Throwable {
-            return new Species_JL(mt, lf, argJ0, argL1);
-        }
-        @Override
-        public final BoundMethodHandle cloneExtendL(MethodType mt, LambdaForm lf, Object narg) throws Throwable {
-            return (BoundMethodHandle) SPECIES_DATA.extendWithIndex(INDEX_L).constructor[0].invokeBasic(mt, lf, argJ0, argL1, narg);
+        /*non-public*/ final BoundMethodHandle copyWithExtendF(MethodType mt, LambdaForm lf, float narg) {
+            try {
+                return (BoundMethodHandle) SPECIES_DATA.extendWith(F_TYPE).constructor[0].invokeBasic(mt, lf, argL0, narg);
+            } catch (Throwable ex) {
+                throw uncaughtException(ex);
+            }
         }
         @Override
-        public final BoundMethodHandle cloneExtendI(MethodType mt, LambdaForm lf, int narg) throws Throwable {
-            return (BoundMethodHandle) SPECIES_DATA.extendWithIndex(INDEX_I).constructor[0].invokeBasic(mt, lf, argJ0, argL1, narg);
-        }
-        @Override
-        public final BoundMethodHandle cloneExtendJ(MethodType mt, LambdaForm lf, long narg) throws Throwable {
-            return (BoundMethodHandle) SPECIES_DATA.extendWithIndex(INDEX_J).constructor[0].invokeBasic(mt, lf, argJ0, argL1, narg);
-        }
-        @Override
-        public final BoundMethodHandle cloneExtendF(MethodType mt, LambdaForm lf, float narg) throws Throwable {
-            return (BoundMethodHandle) SPECIES_DATA.extendWithIndex(INDEX_F).constructor[0].invokeBasic(mt, lf, argJ0, argL1, narg);
-        }
-        @Override
-        public final BoundMethodHandle cloneExtendD(MethodType mt, LambdaForm lf, double narg) throws Throwable {
-            return (BoundMethodHandle) SPECIES_DATA.extendWithIndex(INDEX_D).constructor[0].invokeBasic(mt, lf, argJ0, argL1, narg);
+        /*non-public*/ final BoundMethodHandle copyWithExtendD(MethodType mt, LambdaForm lf, double narg) {
+            try {
+                return (BoundMethodHandle) SPECIES_DATA.extendWith(D_TYPE).constructor[0].invokeBasic(mt, lf, argL0, narg);
+            } catch (Throwable ex) {
+                throw uncaughtException(ex);
+            }
         }
     }
-*/
 
     //
     // BMH species meta-data
     //
 
     /**
-     * Meta-data wrapper for concrete BMH classes.
+     * Meta-data wrapper for concrete BMH types.
+     * Each BMH type corresponds to a given sequence of basic field types (LIJFD).
+     * The fields are immutable; their values are fully specified at object construction.
+     * Each BMH type supplies an array of getter functions which may be used in lambda forms.
+     * A BMH is constructed by cloning a shorter BMH and adding one or more new field values.
+     * As a degenerate and common case, the "shorter BMH" can be missing, and contributes zero prior fields.
      */
     static class SpeciesData {
-        final String                             types;
+        final String                             typeChars;
+        final BasicType[]                        typeCodes;
         final Class<? extends BoundMethodHandle> clazz;
         // Bootstrapping requires circular relations MH -> BMH -> SpeciesData -> MH
         // Therefore, we need a non-final link in the chain.  Use array elements.
         final MethodHandle[]                     constructor;
         final MethodHandle[]                     getters;
+        final NamedFunction[]                    nominalGetters;
         final SpeciesData[]                      extensions;
 
         /*non-public*/ int fieldCount() {
-            return types.length();
+            return typeCodes.length;
         }
-        /*non-public*/ char fieldType(int i) {
-            return types.charAt(i);
+        /*non-public*/ BasicType fieldType(int i) {
+            return typeCodes[i];
+        }
+        /*non-public*/ char fieldTypeChar(int i) {
+            return typeChars.charAt(i);
         }
 
         public String toString() {
-            return "SpeciesData["+(isPlaceholder() ? "<placeholder>" : clazz.getSimpleName())+":"+types+"]";
+            return "SpeciesData["+(isPlaceholder() ? "<placeholder>" : clazz.getSimpleName())+":"+typeChars+"]";
         }
 
         /**
@@ -354,45 +300,46 @@
          * represents a MH bound to a generic invoker, which in turn forwards to the corresponding
          * getter.
          */
-        Name getterName(Name mhName, int i) {
-            MethodHandle mh = getters[i];
-            assert(mh != null) : this+"."+i;
-            return new Name(mh, mhName);
-        }
-
         NamedFunction getterFunction(int i) {
-            return new NamedFunction(getters[i]);
+            return nominalGetters[i];
         }
 
         static final SpeciesData EMPTY = new SpeciesData("", BoundMethodHandle.class);
 
         private SpeciesData(String types, Class<? extends BoundMethodHandle> clazz) {
-            this.types = types;
+            this.typeChars = types;
+            this.typeCodes = basicTypes(types);
             this.clazz = clazz;
             if (!INIT_DONE) {
-                this.constructor = new MethodHandle[1];
+                this.constructor = new MethodHandle[1];  // only one ctor
                 this.getters = new MethodHandle[types.length()];
+                this.nominalGetters = new NamedFunction[types.length()];
             } else {
                 this.constructor = Factory.makeCtors(clazz, types, null);
                 this.getters = Factory.makeGetters(clazz, types, null);
+                this.nominalGetters = Factory.makeNominalGetters(types, null, this.getters);
             }
-            this.extensions = new SpeciesData[EXTENSION_TYPES.length()];
+            this.extensions = new SpeciesData[ARG_TYPE_LIMIT];
         }
 
         private void initForBootstrap() {
             assert(!INIT_DONE);
             if (constructor[0] == null) {
+                String types = typeChars;
                 Factory.makeCtors(clazz, types, this.constructor);
                 Factory.makeGetters(clazz, types, this.getters);
+                Factory.makeNominalGetters(types, this.nominalGetters, this.getters);
             }
         }
 
-        private SpeciesData(String types) {
+        private SpeciesData(String typeChars) {
             // Placeholder only.
-            this.types = types;
+            this.typeChars = typeChars;
+            this.typeCodes = basicTypes(typeChars);
             this.clazz = null;
             this.constructor = null;
             this.getters = null;
+            this.nominalGetters = null;
             this.extensions = null;
         }
         private boolean isPlaceholder() { return clazz == null; }
@@ -401,18 +348,15 @@
         static { CACHE.put("", EMPTY); }  // make bootstrap predictable
         private static final boolean INIT_DONE;  // set after <clinit> finishes...
 
-        SpeciesData extendWithType(char type) {
-            int i = extensionIndex(type);
-            SpeciesData d = extensions[i];
-            if (d != null)  return d;
-            extensions[i] = d = get(types+type);
-            return d;
+        SpeciesData extendWith(byte type) {
+            return extendWith(BasicType.basicType(type));
         }
 
-        SpeciesData extendWithIndex(byte index) {
-            SpeciesData d = extensions[index];
+        SpeciesData extendWith(BasicType type) {
+            int ord = type.ordinal();
+            SpeciesData d = extensions[ord];
             if (d != null)  return d;
-            extensions[index] = d = get(types+EXTENSION_TYPES.charAt(index));
+            extensions[ord] = d = get(typeChars+type.basicTypeChar());
             return d;
         }
 
@@ -456,8 +400,6 @@
         static {
             // pre-fill the BMH speciesdata cache with BMH's inner classes
             final Class<BoundMethodHandle> rootCls = BoundMethodHandle.class;
-            SpeciesData d0 = BoundMethodHandle.SPECIES_DATA;  // trigger class init
-            assert(d0 == null || d0 == lookupCache("")) : d0;
             try {
                 for (Class<?> c : rootCls.getDeclaredClasses()) {
                     if (rootCls.isAssignableFrom(c)) {
@@ -465,7 +407,7 @@
                         SpeciesData d = Factory.speciesDataFromConcreteBMHClass(cbmh);
                         assert(d != null) : cbmh.getName();
                         assert(d.clazz == cbmh);
-                        assert(d == lookupCache(d.types));
+                        assert(d == lookupCache(d.typeChars));
                     }
                 }
             } catch (Throwable e) {
@@ -516,11 +458,10 @@
         static final String BMHSPECIES_DATA_GFC_SIG = "(" + JLS_SIG + JLC_SIG + ")" + SPECIES_DATA_SIG;
         static final String MYSPECIES_DATA_SIG = "()" + SPECIES_DATA_SIG;
         static final String VOID_SIG   = "()V";
+        static final String INT_SIG    = "()I";
 
         static final String SIG_INCIPIT = "(Ljava/lang/invoke/MethodType;Ljava/lang/invoke/LambdaForm;";
 
-        static final Class<?>[] TYPES = new Class<?>[] { Object.class, int.class, long.class, float.class, double.class };
-
         static final String[] E_THROWABLE = new String[] { "java/lang/Throwable" };
 
         /**
@@ -551,31 +492,35 @@
          *     final Object argL0;
          *     final Object argL1;
          *     final int argI2;
-         *     Species_LLI(MethodType mt, LambdaForm lf, Object argL0, Object argL1, int argI2) {
+         *     private Species_LLI(MethodType mt, LambdaForm lf, Object argL0, Object argL1, int argI2) {
          *         super(mt, lf);
          *         this.argL0 = argL0;
          *         this.argL1 = argL1;
          *         this.argI2 = argI2;
          *     }
          *     final SpeciesData speciesData() { return SPECIES_DATA; }
+         *     final int fieldCount() { return 3; }
          *     static final SpeciesData SPECIES_DATA = SpeciesData.getForClass("LLI", Species_LLI.class);
-         *     final BoundMethodHandle clone(MethodType mt, LambdaForm lf) {
-         *         return SPECIES_DATA.constructor[0].invokeBasic(mt, lf, argL0, argL1, argI2);
+         *     static BoundMethodHandle make(MethodType mt, LambdaForm lf, Object argL0, Object argL1, int argI2) {
+         *         return new Species_LLI(mt, lf, argL0, argL1, argI2);
          *     }
-         *     final BoundMethodHandle cloneExtendL(MethodType mt, LambdaForm lf, Object narg) {
-         *         return SPECIES_DATA.extendWithIndex(INDEX_L).constructor[0].invokeBasic(mt, lf, argL0, argL1, argI2, narg);
+         *     final BoundMethodHandle copyWith(MethodType mt, LambdaForm lf) {
+         *         return new Species_LLI(mt, lf, argL0, argL1, argI2);
+         *     }
+         *     final BoundMethodHandle copyWithExtendL(MethodType mt, LambdaForm lf, Object narg) {
+         *         return SPECIES_DATA.extendWith(L_TYPE).constructor[0].invokeBasic(mt, lf, argL0, argL1, argI2, narg);
          *     }
-         *     final BoundMethodHandle cloneExtendI(MethodType mt, LambdaForm lf, int narg) {
-         *         return SPECIES_DATA.extendWithIndex(INDEX_I).constructor[0].invokeBasic(mt, lf, argL0, argL1, argI2, narg);
+         *     final BoundMethodHandle copyWithExtendI(MethodType mt, LambdaForm lf, int narg) {
+         *         return SPECIES_DATA.extendWith(I_TYPE).constructor[0].invokeBasic(mt, lf, argL0, argL1, argI2, narg);
          *     }
-         *     final BoundMethodHandle cloneExtendJ(MethodType mt, LambdaForm lf, long narg) {
-         *         return SPECIES_DATA.extendWithIndex(INDEX_J).constructor[0].invokeBasic(mt, lf, argL0, argL1, argI2, narg);
+         *     final BoundMethodHandle copyWithExtendJ(MethodType mt, LambdaForm lf, long narg) {
+         *         return SPECIES_DATA.extendWith(J_TYPE).constructor[0].invokeBasic(mt, lf, argL0, argL1, argI2, narg);
          *     }
-         *     final BoundMethodHandle cloneExtendF(MethodType mt, LambdaForm lf, float narg) {
-         *         return SPECIES_DATA.extendWithIndex(INDEX_F).constructor[0].invokeBasic(mt, lf, argL0, argL1, argI2, narg);
+         *     final BoundMethodHandle copyWithExtendF(MethodType mt, LambdaForm lf, float narg) {
+         *         return SPECIES_DATA.extendWith(F_TYPE).constructor[0].invokeBasic(mt, lf, argL0, argL1, argI2, narg);
          *     }
-         *     final BoundMethodHandle cloneExtendD(MethodType mt, LambdaForm lf, double narg) {
-         *         return SPECIES_DATA.extendWithIndex(INDEX_D).constructor[0].invokeBasic(mt, lf, argL0, argL1, argI2, narg);
+         *     public final BoundMethodHandle copyWithExtendD(MethodType mt, LambdaForm lf, double narg) {
+         *         return SPECIES_DATA.extendWith(D_TYPE).constructor[0].invokeBasic(mt, lf, argL0, argL1, argI2, narg);
          *     }
          * }
          * </pre>
@@ -586,8 +531,9 @@
         static Class<? extends BoundMethodHandle> generateConcreteBMHClass(String types) {
             final ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS + ClassWriter.COMPUTE_FRAMES);
 
-            final String className  = SPECIES_PREFIX_PATH + types;
-            final String sourceFile = SPECIES_PREFIX_NAME + types;
+            String shortTypes = LambdaForm.shortenSignature(types);
+            final String className  = SPECIES_PREFIX_PATH + shortTypes;
+            final String sourceFile = SPECIES_PREFIX_NAME + shortTypes;
             final int NOT_ACC_PUBLIC = 0;  // not ACC_PUBLIC
             cw.visit(V1_6, NOT_ACC_PUBLIC + ACC_FINAL + ACC_SUPER, className, null, BMH, null);
             cw.visitSource(sourceFile, null);
@@ -606,11 +552,11 @@
             MethodVisitor mv;
 
             // emit constructor
-            mv = cw.visitMethod(NOT_ACC_PUBLIC, "<init>", makeSignature(types, true), null, null);
+            mv = cw.visitMethod(ACC_PRIVATE, "<init>", makeSignature(types, true), null, null);
             mv.visitCode();
-            mv.visitVarInsn(ALOAD, 0);
-            mv.visitVarInsn(ALOAD, 1);
-            mv.visitVarInsn(ALOAD, 2);
+            mv.visitVarInsn(ALOAD, 0); // this
+            mv.visitVarInsn(ALOAD, 1); // type
+            mv.visitVarInsn(ALOAD, 2); // form
 
             mv.visitMethodInsn(INVOKESPECIAL, BMH, "<init>", makeSignature("", true), false);
 
@@ -647,39 +593,73 @@
             mv.visitMaxs(0, 0);
             mv.visitEnd();
 
-            // emit clone()
-            mv = cw.visitMethod(NOT_ACC_PUBLIC + ACC_FINAL, "clone", makeSignature("", false), null, E_THROWABLE);
+            // emit implementation of fieldCount()
+            mv = cw.visitMethod(NOT_ACC_PUBLIC + ACC_FINAL, "fieldCount", INT_SIG, null, null);
+            mv.visitCode();
+            int fc = types.length();
+            if (fc <= (ICONST_5 - ICONST_0)) {
+                mv.visitInsn(ICONST_0 + fc);
+            } else {
+                mv.visitIntInsn(SIPUSH, fc);
+            }
+            mv.visitInsn(IRETURN);
+            mv.visitMaxs(0, 0);
+            mv.visitEnd();
+            // emit make()  ...factory method wrapping constructor
+            mv = cw.visitMethod(NOT_ACC_PUBLIC + ACC_STATIC, "make", makeSignature(types, false), null, null);
             mv.visitCode();
-            // return speciesData().constructor[0].invokeBasic(mt, lf, argL0, ...)
-            // obtain constructor
-            mv.visitVarInsn(ALOAD, 0);
-            mv.visitFieldInsn(GETSTATIC, className, "SPECIES_DATA", SPECIES_DATA_SIG);
-            mv.visitFieldInsn(GETFIELD, SPECIES_DATA, "constructor", "[" + MH_SIG);
-            mv.visitInsn(ICONST_0);
-            mv.visitInsn(AALOAD);
+            // make instance
+            mv.visitTypeInsn(NEW, className);
+            mv.visitInsn(DUP);
+            // load mt, lf
+            mv.visitVarInsn(ALOAD, 0);  // type
+            mv.visitVarInsn(ALOAD, 1);  // form
+            // load factory method arguments
+            for (int i = 0, j = 0; i < types.length(); ++i, ++j) {
+                // i counts the arguments, j counts corresponding argument slots
+                char t = types.charAt(i);
+                mv.visitVarInsn(typeLoadOp(t), j + 2); // parameters start at 3
+                if (t == 'J' || t == 'D') {
+                    ++j; // adjust argument register access
+                }
+            }
+
+            // finally, invoke the constructor and return
+            mv.visitMethodInsn(INVOKESPECIAL, className, "<init>", makeSignature(types, true), false);
+            mv.visitInsn(ARETURN);
+            mv.visitMaxs(0, 0);
+            mv.visitEnd();
+
+            // emit copyWith()
+            mv = cw.visitMethod(NOT_ACC_PUBLIC + ACC_FINAL, "copyWith", makeSignature("", false), null, null);
+            mv.visitCode();
+            // make instance
+            mv.visitTypeInsn(NEW, className);
+            mv.visitInsn(DUP);
             // load mt, lf
             mv.visitVarInsn(ALOAD, 1);
             mv.visitVarInsn(ALOAD, 2);
             // put fields on the stack
             emitPushFields(types, className, mv);
             // finally, invoke the constructor and return
-            mv.visitMethodInsn(INVOKEVIRTUAL, MH, "invokeBasic", makeSignature(types, false), false);
+            mv.visitMethodInsn(INVOKESPECIAL, className, "<init>", makeSignature(types, true), false);
             mv.visitInsn(ARETURN);
             mv.visitMaxs(0, 0);
             mv.visitEnd();
 
-            // for each type, emit cloneExtendT()
-            for (Class<?> c : TYPES) {
-                char t = Wrapper.basicTypeChar(c);
-                mv = cw.visitMethod(NOT_ACC_PUBLIC + ACC_FINAL, "cloneExtend" + t, makeSignature(String.valueOf(t), false), null, E_THROWABLE);
+            // for each type, emit copyWithExtendT()
+            for (BasicType type : BasicType.ARG_TYPES) {
+                int ord = type.ordinal();
+                char btChar = type.basicTypeChar();
+                mv = cw.visitMethod(NOT_ACC_PUBLIC + ACC_FINAL, "copyWithExtend" + btChar, makeSignature(String.valueOf(btChar), false), null, E_THROWABLE);
                 mv.visitCode();
-                // return SPECIES_DATA.extendWithIndex(extensionIndex(t)).constructor[0].invokeBasic(mt, lf, argL0, ..., narg)
+                // return SPECIES_DATA.extendWith(t).constructor[0].invokeBasic(mt, lf, argL0, ..., narg)
                 // obtain constructor
                 mv.visitFieldInsn(GETSTATIC, className, "SPECIES_DATA", SPECIES_DATA_SIG);
-                int iconstInsn = ICONST_0 + extensionIndex(t);
+                int iconstInsn = ICONST_0 + ord;
                 assert(iconstInsn <= ICONST_5);
                 mv.visitInsn(iconstInsn);
-                mv.visitMethodInsn(INVOKEVIRTUAL, SPECIES_DATA, "extendWithIndex", BMHSPECIES_DATA_EWI_SIG, false);
+                mv.visitMethodInsn(INVOKEVIRTUAL, SPECIES_DATA, "extendWith", BMHSPECIES_DATA_EWI_SIG, false);
                 mv.visitFieldInsn(GETFIELD, SPECIES_DATA, "constructor", "[" + MH_SIG);
                 mv.visitInsn(ICONST_0);
                 mv.visitInsn(AALOAD);
@@ -689,9 +669,9 @@
                 // put fields on the stack
                 emitPushFields(types, className, mv);
                 // put narg on stack
-                mv.visitVarInsn(typeLoadOp(t), 3);
+                mv.visitVarInsn(typeLoadOp(btChar), 3);
                 // finally, invoke the constructor and return
-                mv.visitMethodInsn(INVOKEVIRTUAL, MH, "invokeBasic", makeSignature(types + t, false), false);
+                mv.visitMethodInsn(INVOKEVIRTUAL, MH, "invokeBasic", makeSignature(types + btChar, false), false);
                 mv.visitInsn(ARETURN);
                 mv.visitMaxs(0, 0);
                 mv.visitEnd();
@@ -730,7 +710,7 @@
             case 'J': return LLOAD;
             case 'F': return FLOAD;
             case 'D': return DLOAD;
-            default : throw new InternalError("unrecognized type " + t);
+            default : throw newInternalError("unrecognized type " + t);
             }
         }
 
@@ -771,10 +751,19 @@
 
         static MethodHandle[] makeCtors(Class<? extends BoundMethodHandle> cbmh, String types, MethodHandle mhs[]) {
             if (mhs == null)  mhs = new MethodHandle[1];
+            if (types.equals(""))  return mhs;  // hack for empty BMH species
             mhs[0] = makeCbmhCtor(cbmh, types);
             return mhs;
         }
 
+        static NamedFunction[] makeNominalGetters(String types, NamedFunction[] nfs, MethodHandle[] getters) {
+            if (nfs == null)  nfs = new NamedFunction[types.length()];
+            for (int i = 0; i < nfs.length; ++i) {
+                nfs[i] = new NamedFunction(getters[i]);
+            }
+            return nfs;
+        }
+
         //
         // Auxiliary methods.
         //
@@ -808,52 +797,11 @@
 
         static MethodHandle makeCbmhCtor(Class<? extends BoundMethodHandle> cbmh, String types) {
             try {
-                return linkConstructor(LOOKUP.findConstructor(cbmh, MethodType.fromMethodDescriptorString(makeSignature(types, true), null)));
+                return LOOKUP.findStatic(cbmh, "make", MethodType.fromMethodDescriptorString(makeSignature(types, false), null));
             } catch (NoSuchMethodException | IllegalAccessException | IllegalArgumentException | TypeNotPresentException e) {
                 throw newInternalError(e);
             }
         }
-
-        /**
-         * Wrap a constructor call in a {@link LambdaForm}.
-         *
-         * If constructors ({@code <init>} methods) are called in LFs, problems might arise if the LFs
-         * are turned into bytecode, because the call to the allocator is routed through an MH, and the
-         * verifier cannot find a {@code NEW} instruction preceding the {@code INVOKESPECIAL} to
-         * {@code <init>}. To avoid this, we add an indirection by invoking {@code <init>} through
-         * {@link MethodHandle#linkToSpecial}.
-         *
-         * The last {@link LambdaForm.Name Name} in the argument's form is expected to be the {@code void}
-         * result of the {@code <init>} invocation. This entry is replaced.
-         */
-        private static MethodHandle linkConstructor(MethodHandle cmh) {
-            final LambdaForm lf = cmh.form;
-            final int initNameIndex = lf.names.length - 1;
-            final Name initName = lf.names[initNameIndex];
-            final MemberName ctorMN = initName.function.member;
-            final MethodType ctorMT = ctorMN.getInvocationType();
-
-            // obtain function member (call target)
-            // linker method type replaces initial parameter (BMH species) with BMH to avoid naming a species (anonymous class!)
-            final MethodType linkerMT = ctorMT.changeParameterType(0, BoundMethodHandle.class).appendParameterTypes(MemberName.class);
-            MemberName linkerMN = new MemberName(MethodHandle.class, "linkToSpecial", linkerMT, REF_invokeStatic);
-            try {
-                linkerMN = MemberName.getFactory().resolveOrFail(REF_invokeStatic, linkerMN, null, NoSuchMethodException.class);
-                assert(linkerMN.isStatic());
-            } catch (ReflectiveOperationException ex) {
-                throw newInternalError(ex);
-            }
-            // extend arguments array
-            Object[] newArgs = Arrays.copyOf(initName.arguments, initName.arguments.length + 1);
-            newArgs[newArgs.length - 1] = ctorMN;
-            // replace function
-            final NamedFunction nf = new NamedFunction(linkerMN);
-            final Name linkedCtor = new Name(nf, newArgs);
-            linkedCtor.initIndex(initNameIndex);
-            lf.names[initNameIndex] = linkedCtor;
-            return cmh;
-        }
-
     }
 
     private static final Lookup LOOKUP = Lookup.IMPL_LOOKUP;
--- a/jdk/src/share/classes/java/lang/invoke/DirectMethodHandle.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/java/lang/invoke/DirectMethodHandle.java	Mon Jun 02 13:53:52 2014 -0700
@@ -31,6 +31,7 @@
 import sun.invoke.util.VerifyAccess;
 import static java.lang.invoke.MethodHandleNatives.Constants.*;
 import static java.lang.invoke.LambdaForm.*;
+import static java.lang.invoke.LambdaForm.BasicType.*;
 import static java.lang.invoke.MethodTypeForm.*;
 import static java.lang.invoke.MethodHandleStatics.*;
 import java.lang.ref.WeakReference;
@@ -125,11 +126,6 @@
     }
 
     @Override
-    MethodHandle copyWith(MethodType mt, LambdaForm lf) {
-        return new DirectMethodHandle(mt, lf, member);
-    }
-
-    @Override
     String internalProperties() {
         return "/DMH="+member.toString();
     }
@@ -146,9 +142,9 @@
     }
 
     @Override
-    MethodHandle bindArgument(int pos, char basicType, Object value) {
+    MethodHandle bindArgument(int pos, BasicType basicType, Object value) {
         // If the member needs dispatching, do so.
-        if (pos == 0 && basicType == 'L') {
+        if (pos == 0 && basicType == L_TYPE) {
             DirectMethodHandle concrete = maybeRebind(value);
             if (concrete != null)
                 return concrete.bindReceiver(value);
@@ -274,7 +270,7 @@
             result = NEW_OBJ;
         }
         names[LINKER_CALL] = new Name(linker, outArgs);
-        lambdaName += "_" + LambdaForm.basicTypeSignature(mtype);
+        lambdaName += "_" + shortenSignature(basicTypeSignature(mtype));
         LambdaForm lform = new LambdaForm(lambdaName, ARG_LIMIT, names, result);
         // This is a tricky bit of code.  Don't send it through the LF interpreter.
         lform.compileToBytecode();
--- a/jdk/src/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java	Mon Jun 02 13:53:52 2014 -0700
@@ -26,7 +26,7 @@
 package java.lang.invoke;
 
 import sun.invoke.util.VerifyAccess;
-import java.lang.invoke.LambdaForm.Name;
+import static java.lang.invoke.LambdaForm.*;
 
 import sun.invoke.util.Wrapper;
 
@@ -38,6 +38,7 @@
 import java.lang.reflect.*;
 import static java.lang.invoke.MethodHandleStatics.*;
 import static java.lang.invoke.MethodHandleNatives.Constants.*;
+import static java.lang.invoke.LambdaForm.BasicType.*;
 import sun.invoke.util.VerifyType;
 
 /**
@@ -115,7 +116,7 @@
         Name[] names = form.names;
         for (int i = 0, index = 0; i < localsMap.length; i++) {
             localsMap[i] = index;
-            index += Wrapper.forBasicType(names[i].type).stackSlots();
+            index += names[i].type.basicTypeSlots();
         }
     }
 
@@ -358,47 +359,52 @@
     /*
      * NOTE: These load/store methods use the localsMap to find the correct index!
      */
-    private void emitLoadInsn(char type, int index) {
-        int opcode;
+    private void emitLoadInsn(BasicType type, int index) {
+        int opcode = loadInsnOpcode(type);
+        mv.visitVarInsn(opcode, localsMap[index]);
+    }
+
+    private int loadInsnOpcode(BasicType type) throws InternalError {
         switch (type) {
-        case 'I':  opcode = Opcodes.ILOAD;  break;
-        case 'J':  opcode = Opcodes.LLOAD;  break;
-        case 'F':  opcode = Opcodes.FLOAD;  break;
-        case 'D':  opcode = Opcodes.DLOAD;  break;
-        case 'L':  opcode = Opcodes.ALOAD;  break;
-        default:
-            throw new InternalError("unknown type: " + type);
+            case I_TYPE: return Opcodes.ILOAD;
+            case J_TYPE: return Opcodes.LLOAD;
+            case F_TYPE: return Opcodes.FLOAD;
+            case D_TYPE: return Opcodes.DLOAD;
+            case L_TYPE: return Opcodes.ALOAD;
+            default:
+                throw new InternalError("unknown type: " + type);
         }
-        mv.visitVarInsn(opcode, localsMap[index]);
     }
     private void emitAloadInsn(int index) {
-        emitLoadInsn('L', index);
+        emitLoadInsn(L_TYPE, index);
+    }
+
+    private void emitStoreInsn(BasicType type, int index) {
+        int opcode = storeInsnOpcode(type);
+        mv.visitVarInsn(opcode, localsMap[index]);
     }
 
-    private void emitStoreInsn(char type, int index) {
-        int opcode;
+    private int storeInsnOpcode(BasicType type) throws InternalError {
         switch (type) {
-        case 'I':  opcode = Opcodes.ISTORE;  break;
-        case 'J':  opcode = Opcodes.LSTORE;  break;
-        case 'F':  opcode = Opcodes.FSTORE;  break;
-        case 'D':  opcode = Opcodes.DSTORE;  break;
-        case 'L':  opcode = Opcodes.ASTORE;  break;
-        default:
-            throw new InternalError("unknown type: " + type);
+            case I_TYPE: return Opcodes.ISTORE;
+            case J_TYPE: return Opcodes.LSTORE;
+            case F_TYPE: return Opcodes.FSTORE;
+            case D_TYPE: return Opcodes.DSTORE;
+            case L_TYPE: return Opcodes.ASTORE;
+            default:
+                throw new InternalError("unknown type: " + type);
         }
-        mv.visitVarInsn(opcode, localsMap[index]);
     }
     private void emitAstoreInsn(int index) {
-        emitStoreInsn('L', index);
+        emitStoreInsn(L_TYPE, index);
     }
 
     /**
      * Emit a boxing call.
      *
-     * @param type primitive type class to box.
+     * @param wrapper primitive type class to box.
      */
-    private void emitBoxing(Class<?> type) {
-        Wrapper wrapper = Wrapper.forPrimitiveType(type);
+    private void emitBoxing(Wrapper wrapper) {
         String owner = "java/lang/" + wrapper.wrapperType().getSimpleName();
         String name  = "valueOf";
         String desc  = "(" + wrapper.basicTypeChar() + ")L" + owner + ";";
@@ -408,10 +414,9 @@
     /**
      * Emit an unboxing call (plus preceding checkcast).
      *
-     * @param type wrapper type class to unbox.
+     * @param wrapper wrapper type class to unbox.
      */
-    private void emitUnboxing(Class<?> type) {
-        Wrapper wrapper = Wrapper.forWrapperType(type);
+    private void emitUnboxing(Wrapper wrapper) {
         String owner = "java/lang/" + wrapper.wrapperType().getSimpleName();
         String name  = wrapper.primitiveSimpleName() + "Value";
         String desc  = "()" + wrapper.basicTypeChar();
@@ -425,9 +430,12 @@
      * @param ptype type of value present on stack
      * @param pclass type of value required on stack
      */
-    private void emitImplicitConversion(char ptype, Class<?> pclass) {
+    private void emitImplicitConversion(BasicType ptype, Class<?> pclass) {
+        assert(basicType(pclass) == ptype);  // boxing/unboxing handled by caller
+        if (pclass == ptype.basicTypeClass() && ptype != L_TYPE)
+            return;   // nothing to do
         switch (ptype) {
-        case 'L':
+        case L_TYPE:
             if (VerifyType.isNullConversion(Object.class, pclass))
                 return;
             if (isStaticallyNameable(pclass)) {
@@ -441,18 +449,9 @@
                     mv.visitTypeInsn(Opcodes.CHECKCAST, OBJARY);
             }
             return;
-        case 'I':
+        case I_TYPE:
             if (!VerifyType.isNullConversion(int.class, pclass))
-                emitPrimCast(ptype, Wrapper.basicTypeChar(pclass));
-            return;
-        case 'J':
-            assert(pclass == long.class);
-            return;
-        case 'F':
-            assert(pclass == float.class);
-            return;
-        case 'D':
-            assert(pclass == double.class);
+                emitPrimCast(ptype.basicTypeWrapper(), Wrapper.forPrimitiveType(pclass));
             return;
         }
         throw new InternalError("bad implicit conversion: tc="+ptype+": "+pclass);
@@ -461,15 +460,15 @@
     /**
      * Emits an actual return instruction conforming to the given return type.
      */
-    private void emitReturnInsn(Class<?> type) {
+    private void emitReturnInsn(BasicType type) {
         int opcode;
-        switch (Wrapper.basicTypeChar(type)) {
-        case 'I':  opcode = Opcodes.IRETURN;  break;
-        case 'J':  opcode = Opcodes.LRETURN;  break;
-        case 'F':  opcode = Opcodes.FRETURN;  break;
-        case 'D':  opcode = Opcodes.DRETURN;  break;
-        case 'L':  opcode = Opcodes.ARETURN;  break;
-        case 'V':  opcode = Opcodes.RETURN;   break;
+        switch (type) {
+        case I_TYPE:  opcode = Opcodes.IRETURN;  break;
+        case J_TYPE:  opcode = Opcodes.LRETURN;  break;
+        case F_TYPE:  opcode = Opcodes.FRETURN;  break;
+        case D_TYPE:  opcode = Opcodes.DRETURN;  break;
+        case L_TYPE:  opcode = Opcodes.ARETURN;  break;
+        case V_TYPE:  opcode = Opcodes.RETURN;   break;
         default:
             throw new InternalError("unknown return type: " + type);
         }
@@ -531,7 +530,7 @@
             // avoid store/load/return and just return)
             if (i == lambdaForm.names.length - 1 && i == lambdaForm.result) {
                 // return value - do nothing
-            } else if (name.type != 'V') {
+            } else if (name.type != V_TYPE) {
                 // non-void: actually assign
                 emitStoreInsn(name.type, name.index());
             }
@@ -865,20 +864,24 @@
 
     private void emitPushArgument(Name name, int paramIndex) {
         Object arg = name.arguments[paramIndex];
-        char ptype = name.function.parameterType(paramIndex);
-        MethodType mtype = name.function.methodType();
+        Class<?> ptype = name.function.methodType().parameterType(paramIndex);
+        emitPushArgument(ptype, arg);
+    }
+
+    private void emitPushArgument(Class<?> ptype, Object arg) {
+        BasicType bptype = basicType(ptype);
         if (arg instanceof Name) {
             Name n = (Name) arg;
             emitLoadInsn(n.type, n.index());
-            emitImplicitConversion(n.type, mtype.parameterType(paramIndex));
-        } else if ((arg == null || arg instanceof String) && ptype == 'L') {
+            emitImplicitConversion(n.type, ptype);
+        } else if ((arg == null || arg instanceof String) && bptype == L_TYPE) {
             emitConst(arg);
         } else {
-            if (Wrapper.isWrapperType(arg.getClass()) && ptype != 'L') {
+            if (Wrapper.isWrapperType(arg.getClass()) && bptype != L_TYPE) {
                 emitConst(arg);
             } else {
                 mv.visitLdcInsn(constantPlaceholder(arg));
-                emitImplicitConversion('L', mtype.parameterType(paramIndex));
+                emitImplicitConversion(L_TYPE, ptype);
             }
         }
     }
@@ -888,52 +891,33 @@
      */
     private void emitReturn() {
         // return statement
-        if (lambdaForm.result == -1) {
+        Class<?> rclass = invokerType.returnType();
+        BasicType rtype = lambdaForm.returnType();
+        assert(rtype == basicType(rclass));  // must agree
+        if (rtype == V_TYPE) {
             // void
             mv.visitInsn(Opcodes.RETURN);
+            // it doesn't matter what rclass is; the JVM will discard any value
         } else {
             LambdaForm.Name rn = lambdaForm.names[lambdaForm.result];
-            char rtype = Wrapper.basicTypeChar(invokerType.returnType());
 
             // put return value on the stack if it is not already there
-            if (lambdaForm.result != lambdaForm.names.length - 1) {
+            if (lambdaForm.result != lambdaForm.names.length - 1 ||
+                    lambdaForm.result < lambdaForm.arity) {
                 emitLoadInsn(rn.type, lambdaForm.result);
             }
 
-            // potentially generate cast
-            // rtype is the return type of the invoker - generated code must conform to this
-            // rn.type is the type of the result Name in the LF
-            if (rtype != rn.type) {
-                // need cast
-                if (rtype == 'L') {
-                    // possibly cast the primitive to the correct type for boxing
-                    char boxedType = Wrapper.forWrapperType(invokerType.returnType()).basicTypeChar();
-                    if (boxedType != rn.type) {
-                        emitPrimCast(rn.type, boxedType);
-                    }
-                    // cast primitive to reference ("boxing")
-                    emitBoxing(invokerType.returnType());
-                } else {
-                    // to-primitive cast
-                    if (rn.type != 'L') {
-                        // prim-to-prim cast
-                        emitPrimCast(rn.type, rtype);
-                    } else {
-                        // ref-to-prim cast ("unboxing")
-                        throw new InternalError("no ref-to-prim (unboxing) casts supported right now");
-                    }
-                }
-            }
+            emitImplicitConversion(rtype, rclass);
 
             // generate actual return statement
-            emitReturnInsn(invokerType.returnType());
+            emitReturnInsn(rtype);
         }
     }
 
     /**
      * Emit a type conversion bytecode casting from "from" to "to".
      */
-    private void emitPrimCast(char from, char to) {
+    private void emitPrimCast(Wrapper from, Wrapper to) {
         // Here's how.
         // -   indicates forbidden
         // <-> indicates implicit
@@ -950,17 +934,15 @@
             // no cast required, should be dead code anyway
             return;
         }
-        Wrapper wfrom = Wrapper.forBasicType(from);
-        Wrapper wto   = Wrapper.forBasicType(to);
-        if (wfrom.isSubwordOrInt()) {
+        if (from.isSubwordOrInt()) {
             // cast from {byte,short,char,int} to anything
             emitI2X(to);
         } else {
             // cast from {long,float,double} to anything
-            if (wto.isSubwordOrInt()) {
+            if (to.isSubwordOrInt()) {
                 // cast to {byte,short,char,int}
                 emitX2I(from);
-                if (wto.bitWidth() < 32) {
+                if (to.bitWidth() < 32) {
                     // targets other than int require another conversion
                     emitI2X(to);
                 }
@@ -968,20 +950,26 @@
                 // cast to {long,float,double} - this is verbose
                 boolean error = false;
                 switch (from) {
-                case 'J':
-                         if (to == 'F') { mv.visitInsn(Opcodes.L2F); }
-                    else if (to == 'D') { mv.visitInsn(Opcodes.L2D); }
-                    else error = true;
+                case LONG:
+                    switch (to) {
+                    case FLOAT:   mv.visitInsn(Opcodes.L2F);  break;
+                    case DOUBLE:  mv.visitInsn(Opcodes.L2D);  break;
+                    default:      error = true;               break;
+                    }
                     break;
-                case 'F':
-                         if (to == 'J') { mv.visitInsn(Opcodes.F2L); }
-                    else if (to == 'D') { mv.visitInsn(Opcodes.F2D); }
-                    else error = true;
+                case FLOAT:
+                    switch (to) {
+                    case LONG :   mv.visitInsn(Opcodes.F2L);  break;
+                    case DOUBLE:  mv.visitInsn(Opcodes.F2D);  break;
+                    default:      error = true;               break;
+                    }
                     break;
-                case 'D':
-                         if (to == 'J') { mv.visitInsn(Opcodes.D2L); }
-                    else if (to == 'F') { mv.visitInsn(Opcodes.D2F); }
-                    else error = true;
+                case DOUBLE:
+                    switch (to) {
+                    case LONG :   mv.visitInsn(Opcodes.D2L);  break;
+                    case FLOAT:   mv.visitInsn(Opcodes.D2F);  break;
+                    default:      error = true;               break;
+                    }
                     break;
                 default:
                     error = true;
@@ -994,16 +982,16 @@
         }
     }
 
-    private void emitI2X(char type) {
+    private void emitI2X(Wrapper type) {
         switch (type) {
-        case 'B':  mv.visitInsn(Opcodes.I2B);  break;
-        case 'S':  mv.visitInsn(Opcodes.I2S);  break;
-        case 'C':  mv.visitInsn(Opcodes.I2C);  break;
-        case 'I':  /* naught */                break;
-        case 'J':  mv.visitInsn(Opcodes.I2L);  break;
-        case 'F':  mv.visitInsn(Opcodes.I2F);  break;
-        case 'D':  mv.visitInsn(Opcodes.I2D);  break;
-        case 'Z':
+        case BYTE:    mv.visitInsn(Opcodes.I2B);  break;
+        case SHORT:   mv.visitInsn(Opcodes.I2S);  break;
+        case CHAR:    mv.visitInsn(Opcodes.I2C);  break;
+        case INT:     /* naught */                break;
+        case LONG:    mv.visitInsn(Opcodes.I2L);  break;
+        case FLOAT:   mv.visitInsn(Opcodes.I2F);  break;
+        case DOUBLE:  mv.visitInsn(Opcodes.I2D);  break;
+        case BOOLEAN:
             // For compatibility with ValueConversions and explicitCastArguments:
             mv.visitInsn(Opcodes.ICONST_1);
             mv.visitInsn(Opcodes.IAND);
@@ -1012,39 +1000,24 @@
         }
     }
 
-    private void emitX2I(char type) {
+    private void emitX2I(Wrapper type) {
         switch (type) {
-        case 'J':  mv.visitInsn(Opcodes.L2I);  break;
-        case 'F':  mv.visitInsn(Opcodes.F2I);  break;
-        case 'D':  mv.visitInsn(Opcodes.D2I);  break;
-        default:   throw new InternalError("unknown type: " + type);
+        case LONG:    mv.visitInsn(Opcodes.L2I);  break;
+        case FLOAT:   mv.visitInsn(Opcodes.F2I);  break;
+        case DOUBLE:  mv.visitInsn(Opcodes.D2I);  break;
+        default:      throw new InternalError("unknown type: " + type);
         }
     }
 
-    private static String basicTypeCharSignature(String prefix, MethodType type) {
-        StringBuilder buf = new StringBuilder(prefix);
-        for (Class<?> ptype : type.parameterList())
-            buf.append(Wrapper.forBasicType(ptype).basicTypeChar());
-        buf.append('_').append(Wrapper.forBasicType(type.returnType()).basicTypeChar());
-        return buf.toString();
-    }
-
     /**
      * Generate bytecode for a LambdaForm.vmentry which calls interpretWithArguments.
      */
     static MemberName generateLambdaFormInterpreterEntryPoint(String sig) {
-        assert(LambdaForm.isValidSignature(sig));
-        //System.out.println("generateExactInvoker "+sig);
-        // compute method type
-        // first parameter and return type
-        char tret = LambdaForm.signatureReturn(sig);
-        MethodType type = MethodType.methodType(LambdaForm.typeClass(tret), MethodHandle.class);
-        // other parameter types
-        int arity = LambdaForm.signatureArity(sig);
-        for (int i = 1; i < arity; i++) {
-            type = type.appendParameterTypes(LambdaForm.typeClass(sig.charAt(i)));
-        }
-        InvokerBytecodeGenerator g = new InvokerBytecodeGenerator("LFI", "interpret_"+tret, type);
+        assert(isValidSignature(sig));
+        String name = "interpret_"+signatureReturn(sig).basicTypeChar();
+        MethodType type = signatureType(sig);  // sig includes leading argument
+        type = type.changeParameterType(0, MethodHandle.class);
+        InvokerBytecodeGenerator g = new InvokerBytecodeGenerator("LFI", name, type);
         return g.loadMethod(g.generateLambdaFormInterpreterEntryPointBytes());
     }
 
@@ -1066,10 +1039,10 @@
             Class<?> ptype = invokerType.parameterType(i);
             mv.visitInsn(Opcodes.DUP);
             emitIconstInsn(i);
-            emitLoadInsn(Wrapper.basicTypeChar(ptype), i);
+            emitLoadInsn(basicType(ptype), i);
             // box if primitive type
             if (ptype.isPrimitive()) {
-                emitBoxing(ptype);
+                emitBoxing(Wrapper.forPrimitiveType(ptype));
             }
             mv.visitInsn(Opcodes.AASTORE);
         }
@@ -1082,11 +1055,11 @@
         // maybe unbox
         Class<?> rtype = invokerType.returnType();
         if (rtype.isPrimitive() && rtype != void.class) {
-            emitUnboxing(Wrapper.asWrapperType(rtype));
+            emitUnboxing(Wrapper.forPrimitiveType(rtype));
         }
 
         // return statement
-        emitReturnInsn(rtype);
+        emitReturnInsn(basicType(rtype));
 
         classFileEpilogue();
         bogusMethod(invokerType);
@@ -1100,14 +1073,12 @@
      * Generate bytecode for a NamedFunction invoker.
      */
     static MemberName generateNamedFunctionInvoker(MethodTypeForm typeForm) {
-        MethodType invokerType = LambdaForm.NamedFunction.INVOKER_METHOD_TYPE;
-        String invokerName = basicTypeCharSignature("invoke_", typeForm.erasedType());
+        MethodType invokerType = NamedFunction.INVOKER_METHOD_TYPE;
+        String invokerName = "invoke_" + shortenSignature(basicTypeSignature(typeForm.erasedType()));
         InvokerBytecodeGenerator g = new InvokerBytecodeGenerator("NFI", invokerName, invokerType);
         return g.loadMethod(g.generateNamedFunctionInvokerImpl(typeForm));
     }
 
-    static int nfi = 0;
-
     private byte[] generateNamedFunctionInvokerImpl(MethodTypeForm typeForm) {
         MethodType dstType = typeForm.erasedType();
         classFilePrologue();
@@ -1133,8 +1104,8 @@
                 Class<?> sptype = dstType.basicType().wrap().parameterType(i);
                 Wrapper dstWrapper = Wrapper.forBasicType(dptype);
                 Wrapper srcWrapper = dstWrapper.isSubwordOrInt() ? Wrapper.INT : dstWrapper;  // narrow subword from int
-                emitUnboxing(srcWrapper.wrapperType());
-                emitPrimCast(srcWrapper.basicTypeChar(), dstWrapper.basicTypeChar());
+                emitUnboxing(srcWrapper);
+                emitPrimCast(srcWrapper, dstWrapper);
             }
         }
 
@@ -1148,15 +1119,15 @@
             Wrapper srcWrapper = Wrapper.forBasicType(rtype);
             Wrapper dstWrapper = srcWrapper.isSubwordOrInt() ? Wrapper.INT : srcWrapper;  // widen subword to int
             // boolean casts not allowed
-            emitPrimCast(srcWrapper.basicTypeChar(), dstWrapper.basicTypeChar());
-            emitBoxing(dstWrapper.primitiveType());
+            emitPrimCast(srcWrapper, dstWrapper);
+            emitBoxing(dstWrapper);
         }
 
         // If the return type is void we return a null reference.
         if (rtype == void.class) {
             mv.visitInsn(Opcodes.ACONST_NULL);
         }
-        emitReturnInsn(Object.class);  // NOTE: NamedFunction invokers always return a reference value.
+        emitReturnInsn(L_TYPE);  // NOTE: NamedFunction invokers always return a reference value.
 
         classFileEpilogue();
         bogusMethod(dstType);
--- a/jdk/src/share/classes/java/lang/invoke/LambdaForm.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/java/lang/invoke/LambdaForm.java	Mon Jun 02 13:53:52 2014 -0700
@@ -30,14 +30,14 @@
 import java.util.Map;
 import java.util.List;
 import java.util.Arrays;
-import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.concurrent.ConcurrentHashMap;
 import sun.invoke.util.Wrapper;
+import java.lang.reflect.Field;
+
+import static java.lang.invoke.LambdaForm.BasicType.*;
 import static java.lang.invoke.MethodHandleStatics.*;
 import static java.lang.invoke.MethodHandleNatives.Constants.*;
-import java.lang.reflect.Field;
-import java.util.Objects;
 
 /**
  * The symbolic, non-executable form of a method handle's invocation semantics.
@@ -130,13 +130,119 @@
 
     public static final int VOID_RESULT = -1, LAST_RESULT = -2;
 
+    enum BasicType {
+        L_TYPE('L', Object.class, Wrapper.OBJECT),  // all reference types
+        I_TYPE('I', int.class,    Wrapper.INT),
+        J_TYPE('J', long.class,   Wrapper.LONG),
+        F_TYPE('F', float.class,  Wrapper.FLOAT),
+        D_TYPE('D', double.class, Wrapper.DOUBLE),  // all primitive types
+        V_TYPE('V', void.class,   Wrapper.VOID);    // not valid in all contexts
+
+        static final BasicType[] ALL_TYPES = BasicType.values();
+        static final BasicType[] ARG_TYPES = Arrays.copyOf(ALL_TYPES, ALL_TYPES.length-1);
+
+        static final int ARG_TYPE_LIMIT = ARG_TYPES.length;
+        static final int TYPE_LIMIT = ALL_TYPES.length;
+
+        private final char btChar;
+        private final Class<?> btClass;
+        private final Wrapper btWrapper;
+
+        private BasicType(char btChar, Class<?> btClass, Wrapper wrapper) {
+            this.btChar = btChar;
+            this.btClass = btClass;
+            this.btWrapper = wrapper;
+        }
+
+        char basicTypeChar() {
+            return btChar;
+        }
+        Class<?> basicTypeClass() {
+            return btClass;
+        }
+        Wrapper basicTypeWrapper() {
+            return btWrapper;
+        }
+        int basicTypeSlots() {
+            return btWrapper.stackSlots();
+        }
+
+        static BasicType basicType(byte type) {
+            return ALL_TYPES[type];
+        }
+        static BasicType basicType(char type) {
+            switch (type) {
+                case 'L': return L_TYPE;
+                case 'I': return I_TYPE;
+                case 'J': return J_TYPE;
+                case 'F': return F_TYPE;
+                case 'D': return D_TYPE;
+                case 'V': return V_TYPE;
+                // all subword types are represented as ints
+                case 'Z':
+                case 'B':
+                case 'S':
+                case 'C':
+                    return I_TYPE;
+                default:
+                    throw newInternalError("Unknown type char: '"+type+"'");
+            }
+        }
+        static BasicType basicType(Wrapper type) {
+            char c = type.basicTypeChar();
+            return basicType(c);
+        }
+        static BasicType basicType(Class<?> type) {
+            if (!type.isPrimitive())  return L_TYPE;
+            return basicType(Wrapper.forPrimitiveType(type));
+        }
+
+        static char basicTypeChar(Class<?> type) {
+            return basicType(type).btChar;
+        }
+        static BasicType[] basicTypes(List<Class<?>> types) {
+            BasicType[] btypes = new BasicType[types.size()];
+            for (int i = 0; i < btypes.length; i++) {
+                btypes[i] = basicType(types.get(i));
+            }
+            return btypes;
+        }
+        static BasicType[] basicTypes(String types) {
+            BasicType[] btypes = new BasicType[types.length()];
+            for (int i = 0; i < btypes.length; i++) {
+                btypes[i] = basicType(types.charAt(i));
+            }
+            return btypes;
+        }
+        static boolean isBasicTypeChar(char c) {
+            return "LIJFDV".indexOf(c) >= 0;
+        }
+        static boolean isArgBasicTypeChar(char c) {
+            return "LIJFD".indexOf(c) >= 0;
+        }
+
+        static { assert(checkBasicType()); }
+        private static boolean checkBasicType() {
+            for (int i = 0; i < ARG_TYPE_LIMIT; i++) {
+                assert ARG_TYPES[i].ordinal() == i;
+                assert ARG_TYPES[i] == ALL_TYPES[i];
+            }
+            for (int i = 0; i < TYPE_LIMIT; i++) {
+                assert ALL_TYPES[i].ordinal() == i;
+            }
+            assert ALL_TYPES[TYPE_LIMIT - 1] == V_TYPE;
+            assert !Arrays.asList(ARG_TYPES).contains(V_TYPE);
+            return true;
+        }
+    }
+
     LambdaForm(String debugName,
                int arity, Name[] names, int result) {
         assert(namesOK(arity, names));
         this.arity = arity;
         this.result = fixResult(result, names);
         this.names = names.clone();
-        this.debugName = debugName;
+        this.debugName = fixDebugName(debugName);
         normalize();
     }
 
@@ -168,12 +274,12 @@
         // Called only from getPreparedForm.
         assert(isValidSignature(sig));
         this.arity = signatureArity(sig);
-        this.result = (signatureReturn(sig) == 'V' ? -1 : arity);
+        this.result = (signatureReturn(sig) == V_TYPE ? -1 : arity);
         this.names = buildEmptyNames(arity, sig);
         this.debugName = "LF.zero";
         assert(nameRefsAreLegal());
         assert(isEmpty());
-        assert(sig.equals(basicTypeSignature()));
+        assert(sig.equals(basicTypeSignature())) : sig + " != " + basicTypeSignature();
     }
 
     private static Name[] buildEmptyNames(int arity, String basicTypeSignature) {
@@ -181,22 +287,53 @@
         int resultPos = arity + 1;  // skip '_'
         if (arity < 0 || basicTypeSignature.length() != resultPos+1)
             throw new IllegalArgumentException("bad arity for "+basicTypeSignature);
-        int numRes = (basicTypeSignature.charAt(resultPos) == 'V' ? 0 : 1);
+        int numRes = (basicType(basicTypeSignature.charAt(resultPos)) == V_TYPE ? 0 : 1);
         Name[] names = arguments(numRes, basicTypeSignature.substring(0, arity));
         for (int i = 0; i < numRes; i++) {
-            names[arity + i] = constantZero(arity + i, basicTypeSignature.charAt(resultPos + i));
+            Name zero = new Name(constantZero(basicType(basicTypeSignature.charAt(resultPos + i))));
+            names[arity + i] = zero.newIndex(arity + i);
         }
         return names;
     }
 
     private static int fixResult(int result, Name[] names) {
-        if (result >= 0) {
-            if (names[result].type == 'V')
-                return -1;
-        } else if (result == LAST_RESULT) {
-            return names.length - 1;
+        if (result == LAST_RESULT)
+            result = names.length - 1;  // might still be void
+        if (result >= 0 && names[result].type == V_TYPE)
+            result = VOID_RESULT;
+        return result;
+    }
+
+    private static String fixDebugName(String debugName) {
+        if (DEBUG_NAME_COUNTERS != null) {
+            int under = debugName.indexOf('_');
+            int length = debugName.length();
+            if (under < 0)  under = length;
+            String debugNameStem = debugName.substring(0, under);
+            Integer ctr;
+            synchronized (DEBUG_NAME_COUNTERS) {
+                ctr = DEBUG_NAME_COUNTERS.get(debugNameStem);
+                if (ctr == null)  ctr = 0;
+                DEBUG_NAME_COUNTERS.put(debugNameStem, ctr+1);
+            }
+            StringBuilder buf = new StringBuilder(debugNameStem);
+            buf.append('_');
+            int leadingZero = buf.length();
+            buf.append((int) ctr);
+            for (int i = buf.length() - leadingZero; i < 3; i++)
+                buf.insert(leadingZero, '0');
+            if (under < length) {
+                ++under;    // skip "_"
+                while (under < length && Character.isDigit(debugName.charAt(under))) {
+                    ++under;
+                }
+                if (under < length && debugName.charAt(under) == '_')  ++under;
+                if (under < length)
+                    buf.append('_').append(debugName, under, length);
+            }
+            return buf.toString();
         }
-        return result;
+        return debugName;
     }
 
     private static boolean namesOK(int arity, Name[] names) {
@@ -294,14 +431,14 @@
     // }
 
     /** Report the return type. */
-    char returnType() {
-        if (result < 0)  return 'V';
+    BasicType returnType() {
+        if (result < 0)  return V_TYPE;
         Name n = names[result];
         return n.type;
     }
 
     /** Report the N-th argument type. */
-    char parameterType(int n) {
+    BasicType parameterType(int n) {
         assert(n < arity);
         return names[n].type;
     }
@@ -319,15 +456,15 @@
     final String basicTypeSignature() {
         StringBuilder buf = new StringBuilder(arity() + 3);
         for (int i = 0, a = arity(); i < a; i++)
-            buf.append(parameterType(i));
-        return buf.append('_').append(returnType()).toString();
+            buf.append(parameterType(i).basicTypeChar());
+        return buf.append('_').append(returnType().basicTypeChar()).toString();
     }
     static int signatureArity(String sig) {
         assert(isValidSignature(sig));
         return sig.indexOf('_');
     }
-    static char signatureReturn(String sig) {
-        return sig.charAt(signatureArity(sig)+1);
+    static BasicType signatureReturn(String sig) {
+        return basicType(sig.charAt(signatureArity(sig)+1));
     }
     static boolean isValidSignature(String sig) {
         int arity = sig.indexOf('_');
@@ -339,27 +476,15 @@
             char c = sig.charAt(i);
             if (c == 'V')
                 return (i == siglen - 1 && arity == siglen - 2);
-            if (ALL_TYPES.indexOf(c) < 0)  return false; // must be [LIJFD]
+            if (!isArgBasicTypeChar(c))  return false; // must be [LIJFD]
         }
         return true;  // [LIJFD]*_[LIJFDV]
     }
-    static Class<?> typeClass(char t) {
-        switch (t) {
-        case 'I': return int.class;
-        case 'J': return long.class;
-        case 'F': return float.class;
-        case 'D': return double.class;
-        case 'L': return Object.class;
-        case 'V': return void.class;
-        default: assert false;
-        }
-        return null;
-    }
     static MethodType signatureType(String sig) {
         Class<?>[] ptypes = new Class<?>[signatureArity(sig)];
         for (int i = 0; i < ptypes.length; i++)
-            ptypes[i] = typeClass(sig.charAt(i));
-        Class<?> rtype = typeClass(signatureReturn(sig));
+            ptypes[i] = basicType(sig.charAt(i)).btClass;
+        Class<?> rtype = signatureReturn(sig).btClass;
         return MethodType.methodType(rtype, ptypes);
     }
 
@@ -543,21 +668,21 @@
         assert(mt.parameterCount() == arity-1);
         for (int i = 0; i < av.length; i++) {
             Class<?> pt = (i == 0 ? MethodHandle.class : mt.parameterType(i-1));
-            assert(valueMatches(sig.charAt(i), pt, av[i]));
+            assert(valueMatches(basicType(sig.charAt(i)), pt, av[i]));
         }
         return true;
     }
-    private static boolean valueMatches(char tc, Class<?> type, Object x) {
+    private static boolean valueMatches(BasicType tc, Class<?> type, Object x) {
         // The following line is needed because (...)void method handles can use non-void invokers
-        if (type == void.class)  tc = 'V';   // can drop any kind of value
+        if (type == void.class)  tc = V_TYPE;   // can drop any kind of value
         assert tc == basicType(type) : tc + " == basicType(" + type + ")=" + basicType(type);
         switch (tc) {
-        case 'I': assert checkInt(type, x)   : "checkInt(" + type + "," + x +")";   break;
-        case 'J': assert x instanceof Long   : "instanceof Long: " + x;             break;
-        case 'F': assert x instanceof Float  : "instanceof Float: " + x;            break;
-        case 'D': assert x instanceof Double : "instanceof Double: " + x;           break;
-        case 'L': assert checkRef(type, x)   : "checkRef(" + type + "," + x + ")";  break;
-        case 'V': break;  // allow anything here; will be dropped
+        case I_TYPE: assert checkInt(type, x)   : "checkInt(" + type + "," + x +")";   break;
+        case J_TYPE: assert x instanceof Long   : "instanceof Long: " + x;             break;
+        case F_TYPE: assert x instanceof Float  : "instanceof Float: " + x;            break;
+        case D_TYPE: assert x instanceof Double : "instanceof Double: " + x;           break;
+        case L_TYPE: assert checkRef(type, x)   : "checkRef(" + type + "," + x + ")";  break;
+        case V_TYPE: break;  // allow anything here; will be dropped
         default:  assert(false);
         }
         return true;
@@ -736,7 +861,7 @@
      * The first parameter to a LambdaForm, a0:L, always represents the form's method handle, so 0 is not
      * accepted as valid.
      */
-    LambdaForm bindImmediate(int pos, char basicType, Object value) {
+    LambdaForm bindImmediate(int pos, BasicType basicType, Object value) {
         // must be an argument, and the types must match
         assert pos > 0 && pos < arity && names[pos].type == basicType && Name.typesMatch(basicType, value);
 
@@ -782,8 +907,8 @@
 
     LambdaForm bind(int namePos, BoundMethodHandle.SpeciesData oldData) {
         Name name = names[namePos];
-        BoundMethodHandle.SpeciesData newData = oldData.extendWithType(name.type);
-        return bind(name, newData.getterName(names[0], oldData.fieldCount()), oldData, newData);
+        BoundMethodHandle.SpeciesData newData = oldData.extendWith(name.type);
+        return bind(name, new Name(newData.getterFunction(oldData.fieldCount()), names[0]), oldData, newData);
     }
     LambdaForm bind(Name name, Name binding,
                     BoundMethodHandle.SpeciesData oldData,
@@ -874,7 +999,7 @@
         return false;
     }
 
-    LambdaForm addArguments(int pos, char... types) {
+    LambdaForm addArguments(int pos, BasicType... types) {
         assert(pos <= arity);
         int length = names.length;
         int inTypes = types.length;
@@ -895,13 +1020,10 @@
     }
 
     LambdaForm addArguments(int pos, List<Class<?>> types) {
-        char[] basicTypes = new char[types.size()];
-        for (int i = 0; i < basicTypes.length; i++)
-            basicTypes[i] = basicType(types.get(i));
-        return addArguments(pos, basicTypes);
+        return addArguments(pos, basicTypes(types));
     }
 
-    LambdaForm permuteArguments(int skip, int[] reorder, char[] types) {
+    LambdaForm permuteArguments(int skip, int[] reorder, BasicType[] types) {
         // Note:  When inArg = reorder[outArg], outArg is fed by a copy of inArg.
         // The types are the types of the new (incoming) arguments.
         int length = names.length;
@@ -960,7 +1082,7 @@
         return new LambdaForm(debugName, arity2, names2, result2);
     }
 
-    static boolean permutedTypesMatch(int[] reorder, char[] types, Name[] names, int skip) {
+    static boolean permutedTypesMatch(int[] reorder, BasicType[] types, Name[] names, int skip) {
         int inTypes = types.length;
         int outArgs = reorder.length;
         for (int i = 0; i < outArgs; i++) {
@@ -1044,7 +1166,7 @@
                     String sig = m.getName().substring("invoke_".length());
                     int arity = LambdaForm.signatureArity(sig);
                     MethodType srcType = MethodType.genericMethodType(arity);
-                    if (LambdaForm.signatureReturn(sig) == 'V')
+                    if (LambdaForm.signatureReturn(sig) == V_TYPE)
                         srcType = srcType.changeReturnType(void.class);
                     MethodTypeForm typeForm = srcType.form();
                     typeForm.namedFunctionInvoker = DirectMethodHandle.make(m);
@@ -1134,7 +1256,7 @@
             MethodHandle mh2 = typeForm.namedFunctionInvoker;
             if (mh2 != null)  return mh2;  // benign race
             if (!mh.type().equals(INVOKER_METHOD_TYPE))
-                throw new InternalError(mh.debugString());
+                throw newInternalError(mh.debugString());
             return typeForm.namedFunctionInvoker = mh;
         }
 
@@ -1193,11 +1315,6 @@
             return true;
         }
 
-        String basicTypeSignature() {
-            //return LambdaForm.basicTypeSignature(resolvedHandle.type());
-            return LambdaForm.basicTypeSignature(methodType());
-        }
-
         MethodType methodType() {
             if (resolvedHandle != null)
                 return resolvedHandle.type();
@@ -1224,18 +1341,15 @@
             return (member == null) ? null : member.getDeclaringClass();
         }
 
-        char returnType() {
+        BasicType returnType() {
             return basicType(methodType().returnType());
         }
 
-        char parameterType(int n) {
+        BasicType parameterType(int n) {
             return basicType(methodType().parameterType(n));
         }
 
         int arity() {
-            //int siglen = member.getMethodType().parameterCount();
-            //if (!member.isStatic())  siglen += 1;
-            //return siglen;
             return methodType().parameterCount();
         }
 
@@ -1243,44 +1357,63 @@
             if (member == null)  return String.valueOf(resolvedHandle);
             return member.getDeclaringClass().getSimpleName()+"."+member.getName();
         }
-    }
 
-    void resolve() {
-        for (Name n : names) n.resolve();
+        public boolean isIdentity() {
+            return this.equals(identity(returnType()));
+        }
+
+        public boolean isConstantZero() {
+            return this.equals(constantZero(returnType()));
+        }
     }
 
-    public static char basicType(Class<?> type) {
-        char c = Wrapper.basicTypeChar(type);
-        if ("ZBSC".indexOf(c) >= 0)  c = 'I';
-        assert("LIJFDV".indexOf(c) >= 0);
-        return c;
-    }
-    public static char[] basicTypes(List<Class<?>> types) {
-        char[] btypes = new char[types.size()];
-        for (int i = 0; i < btypes.length; i++) {
-            btypes[i] = basicType(types.get(i));
-        }
-        return btypes;
-    }
     public static String basicTypeSignature(MethodType type) {
         char[] sig = new char[type.parameterCount() + 2];
         int sigp = 0;
         for (Class<?> pt : type.parameterList()) {
-            sig[sigp++] = basicType(pt);
+            sig[sigp++] = basicTypeChar(pt);
         }
         sig[sigp++] = '_';
-        sig[sigp++] = basicType(type.returnType());
+        sig[sigp++] = basicTypeChar(type.returnType());
         assert(sigp == sig.length);
         return String.valueOf(sig);
     }
+    public static String shortenSignature(String signature) {
+        // Hack to make signatures more readable when they show up in method names.
+        final int NO_CHAR = -1, MIN_RUN = 3;
+        int c0, c1 = NO_CHAR, c1reps = 0;
+        StringBuilder buf = null;
+        int len = signature.length();
+        if (len < MIN_RUN)  return signature;
+        for (int i = 0; i <= len; i++) {
+            // shift in the next char:
+            c0 = c1; c1 = (i == len ? NO_CHAR : signature.charAt(i));
+            if (c1 == c0) { ++c1reps; continue; }
+            // shift in the next count:
+            int c0reps = c1reps; c1reps = 1;
+            // end of a  character run
+            if (c0reps < MIN_RUN) {
+                if (buf != null) {
+                    while (--c0reps >= 0)
+                        buf.append((char)c0);
+                }
+                continue;
+            }
+            // found three or more in a row
+            if (buf == null)
+                buf = new StringBuilder().append(signature, 0, i - c0reps);
+            buf.append((char)c0).append(c0reps);
+        }
+        return (buf == null) ? signature : buf.toString();
+    }
 
     static final class Name {
-        final char type;
+        final BasicType type;
         private short index;
         final NamedFunction function;
         @Stable final Object[] arguments;
 
-        private Name(int index, char type, NamedFunction function, Object[] arguments) {
+        private Name(int index, BasicType type, NamedFunction function, Object[] arguments) {
             this.index = (short)index;
             this.type = type;
             this.function = function;
@@ -1292,7 +1425,7 @@
         }
         Name(MethodType functionType, Object... arguments) {
             this(new NamedFunction(functionType), arguments);
-            assert(arguments[0] instanceof Name && ((Name)arguments[0]).type == 'L');
+            assert(arguments[0] instanceof Name && ((Name)arguments[0]).type == L_TYPE);
         }
         Name(MemberName function, Object... arguments) {
             this(new NamedFunction(function), arguments);
@@ -1303,14 +1436,14 @@
             for (int i = 0; i < arguments.length; i++)
                 assert(typesMatch(function.parameterType(i), arguments[i])) : "types don't match: function.parameterType(" + i + ")=" + function.parameterType(i) + ", arguments[" + i + "]=" + arguments[i] + " in " + debugString();
         }
-        Name(int index, char type) {
+        /** Create a raw parameter of the given type, with an expected index. */
+        Name(int index, BasicType type) {
             this(index, type, null, null);
         }
-        Name(char type) {
-            this(-1, type);
-        }
+        /** Create a raw parameter of the given type. */
+        Name(BasicType type) { this(-1, type); }
 
-        char type() { return type; }
+        BasicType type() { return type; }
         int index() { return index; }
         boolean initIndex(int i) {
             if (index != i) {
@@ -1319,7 +1452,9 @@
             }
             return true;
         }
-
+        char typeChar() {
+            return type.btChar;
+        }
 
         void resolve() {
             if (function != null)
@@ -1397,18 +1532,18 @@
             return function == null;
         }
         boolean isConstantZero() {
-            return !isParam() && arguments.length == 0 && function.equals(constantZero(0, type).function);
+            return !isParam() && arguments.length == 0 && function.isConstantZero();
         }
 
         public String toString() {
-            return (isParam()?"a":"t")+(index >= 0 ? index : System.identityHashCode(this))+":"+type;
+            return (isParam()?"a":"t")+(index >= 0 ? index : System.identityHashCode(this))+":"+typeChar();
         }
         public String debugString() {
             String s = toString();
             return (function == null) ? s : s + "=" + exprString();
         }
         public String exprString() {
-            if (function == null)  return "null";
+            if (function == null)  return toString();
             StringBuilder buf = new StringBuilder(function.toString());
             buf.append("(");
             String cma = "";
@@ -1423,17 +1558,17 @@
             return buf.toString();
         }
 
-        private static boolean typesMatch(char parameterType, Object object) {
+        static boolean typesMatch(BasicType parameterType, Object object) {
             if (object instanceof Name) {
                 return ((Name)object).type == parameterType;
             }
             switch (parameterType) {
-                case 'I':  return object instanceof Integer;
-                case 'J':  return object instanceof Long;
-                case 'F':  return object instanceof Float;
-                case 'D':  return object instanceof Double;
+                case I_TYPE:  return object instanceof Integer;
+                case J_TYPE:  return object instanceof Long;
+                case F_TYPE:  return object instanceof Float;
+                case D_TYPE:  return object instanceof Double;
             }
-            assert(parameterType == 'L');
+            assert(parameterType == L_TYPE);
             return true;
         }
 
@@ -1510,7 +1645,7 @@
         @Override
         public int hashCode() {
             if (isParam())
-                return index | (type << 8);
+                return index | (type.ordinal() << 8);
             return function.hashCode() ^ Arrays.hashCode(arguments);
         }
     }
@@ -1545,10 +1680,12 @@
     }
 
     static Name argument(int which, char type) {
-        int tn = ALL_TYPES.indexOf(type);
-        if (tn < 0 || which >= INTERNED_ARGUMENT_LIMIT)
+        return argument(which, basicType(type));
+    }
+    static Name argument(int which, BasicType type) {
+        if (which >= INTERNED_ARGUMENT_LIMIT)
             return new Name(which, type);
-        return INTERNED_ARGUMENTS[tn][which];
+        return INTERNED_ARGUMENTS[type.ordinal()][which];
     }
     static Name internArgument(Name n) {
         assert(n.isParam()) : "not param: " + n;
@@ -1590,56 +1727,118 @@
             names[i] = argument(i, basicType(types.parameterType(i)));
         return names;
     }
-    static final String ALL_TYPES = "LIJFD";  // omit V, not an argument type
     static final int INTERNED_ARGUMENT_LIMIT = 10;
     private static final Name[][] INTERNED_ARGUMENTS
-            = new Name[ALL_TYPES.length()][INTERNED_ARGUMENT_LIMIT];
+            = new Name[ARG_TYPE_LIMIT][INTERNED_ARGUMENT_LIMIT];
     static {
-        for (int tn = 0; tn < ALL_TYPES.length(); tn++) {
-            for (int i = 0; i < INTERNED_ARGUMENTS[tn].length; i++) {
-                char type = ALL_TYPES.charAt(tn);
-                INTERNED_ARGUMENTS[tn][i] = new Name(i, type);
+        for (BasicType type : BasicType.ARG_TYPES) {
+            int ord = type.ordinal();
+            for (int i = 0; i < INTERNED_ARGUMENTS[ord].length; i++) {
+                INTERNED_ARGUMENTS[ord][i] = new Name(i, type);
             }
         }
     }
 
     private static final MemberName.Factory IMPL_NAMES = MemberName.getFactory();
 
-    static Name constantZero(int which, char type) {
-        return CONSTANT_ZERO[ALL_TYPES.indexOf(type)].newIndex(which);
+    static LambdaForm identityForm(BasicType type) {
+        return LF_identityForm[type.ordinal()];
+    }
+    static LambdaForm zeroForm(BasicType type) {
+        return LF_zeroForm[type.ordinal()];
+    }
+    static NamedFunction identity(BasicType type) {
+        return NF_identity[type.ordinal()];
+    }
+    static NamedFunction constantZero(BasicType type) {
+        return NF_zero[type.ordinal()];
     }
-    private static final Name[] CONSTANT_ZERO
-            = new Name[ALL_TYPES.length()];
-    static {
-        for (int tn = 0; tn < ALL_TYPES.length(); tn++) {
-            char bt = ALL_TYPES.charAt(tn);
-            Wrapper wrap = Wrapper.forBasicType(bt);
-            MemberName zmem = new MemberName(LambdaForm.class, "zero"+bt, MethodType.methodType(wrap.primitiveType()), REF_invokeStatic);
+    private static final LambdaForm[] LF_identityForm = new LambdaForm[TYPE_LIMIT];
+    private static final LambdaForm[] LF_zeroForm = new LambdaForm[TYPE_LIMIT];
+    private static final NamedFunction[] NF_identity = new NamedFunction[TYPE_LIMIT];
+    private static final NamedFunction[] NF_zero = new NamedFunction[TYPE_LIMIT];
+    private static void createIdentityForms() {
+        for (BasicType type : BasicType.ALL_TYPES) {
+            int ord = type.ordinal();
+            char btChar = type.basicTypeChar();
+            boolean isVoid = (type == V_TYPE);
+            Class<?> btClass = type.btClass;
+            MethodType zeType = MethodType.methodType(btClass);
+            MethodType idType = isVoid ? zeType : zeType.appendParameterTypes(btClass);
+
+            // Look up some symbolic names.  It might not be necessary to have these,
+            // but if we need to emit direct references to bytecodes, it helps.
+            // Zero is built from a call to an identity function with a constant zero input.
+            MemberName idMem = new MemberName(LambdaForm.class, "identity_"+btChar, idType, REF_invokeStatic);
+            MemberName zeMem = new MemberName(LambdaForm.class, "zero_"+btChar, zeType, REF_invokeStatic);
             try {
-                zmem = IMPL_NAMES.resolveOrFail(REF_invokeStatic, zmem, null, NoSuchMethodException.class);
+                zeMem = IMPL_NAMES.resolveOrFail(REF_invokeStatic, zeMem, null, NoSuchMethodException.class);
+                idMem = IMPL_NAMES.resolveOrFail(REF_invokeStatic, idMem, null, NoSuchMethodException.class);
             } catch (IllegalAccessException|NoSuchMethodException ex) {
                 throw newInternalError(ex);
             }
-            NamedFunction zcon = new NamedFunction(zmem);
-            Name n = new Name(zcon).newIndex(0);
-            assert(n.type == ALL_TYPES.charAt(tn));
-            CONSTANT_ZERO[tn] = n;
-            assert(n.isConstantZero());
+
+            NamedFunction idFun = new NamedFunction(idMem);
+            LambdaForm idForm;
+            if (isVoid) {
+                Name[] idNames = new Name[] { argument(0, L_TYPE) };
+                idForm = new LambdaForm(idMem.getName(), 1, idNames, VOID_RESULT);
+            } else {
+                Name[] idNames = new Name[] { argument(0, L_TYPE), argument(1, type) };
+                idForm = new LambdaForm(idMem.getName(), 2, idNames, 1);
+            }
+            LF_identityForm[ord] = idForm;
+            NF_identity[ord] = idFun;
+
+            NamedFunction zeFun = new NamedFunction(zeMem);
+            LambdaForm zeForm;
+            if (isVoid) {
+                zeForm = idForm;
+            } else {
+                Object zeValue = Wrapper.forBasicType(btChar).zero();
+                Name[] zeNames = new Name[] { argument(0, L_TYPE), new Name(idFun, zeValue) };
+                zeForm = new LambdaForm(zeMem.getName(), 1, zeNames, 1);
+            }
+            LF_zeroForm[ord] = zeForm;
+            NF_zero[ord] = zeFun;
+
+            assert(idFun.isIdentity());
+            assert(zeFun.isConstantZero());
+            assert(new Name(zeFun).isConstantZero());
+        }
+
+        // Do this in a separate pass, so that SimpleMethodHandle.make can see the tables.
+        for (BasicType type : BasicType.ALL_TYPES) {
+            int ord = type.ordinal();
+            NamedFunction idFun = NF_identity[ord];
+            LambdaForm idForm = LF_identityForm[ord];
+            MemberName idMem = idFun.member;
+            idFun.resolvedHandle = SimpleMethodHandle.make(idMem.getInvocationType(), idForm);
+
+            NamedFunction zeFun = NF_zero[ord];
+            LambdaForm zeForm = LF_zeroForm[ord];
+            MemberName zeMem = zeFun.member;
+            zeFun.resolvedHandle = SimpleMethodHandle.make(zeMem.getInvocationType(), zeForm);
+
+            assert(idFun.isIdentity());
+            assert(zeFun.isConstantZero());
+            assert(new Name(zeFun).isConstantZero());
         }
     }
 
     // Avoid appealing to ValueConversions at bootstrap time:
-    private static int zeroI() { return 0; }
-    private static long zeroJ() { return 0; }
-    private static float zeroF() { return 0; }
-    private static double zeroD() { return 0; }
-    private static Object zeroL() { return null; }
-
-    // Put this last, so that previous static inits can run before.
-    static {
-        if (USE_PREDEFINED_INTERPRET_METHODS)
-            PREPARED_FORMS.putAll(computeInitialPreparedForms());
-    }
+    private static int identity_I(int x) { return x; }
+    private static long identity_J(long x) { return x; }
+    private static float identity_F(float x) { return x; }
+    private static double identity_D(double x) { return x; }
+    private static Object identity_L(Object x) { return x; }
+    private static void identity_V() { return; }  // same as zeroV, but that's OK
+    private static int zero_I() { return 0; }
+    private static long zero_J() { return 0; }
+    private static float zero_F() { return 0; }
+    private static double zero_D() { return 0; }
+    private static Object zero_L() { return null; }
+    private static void zero_V() { return; }
 
     /**
      * Internal marker for byte-compiled LambdaForms.
@@ -1690,7 +1889,21 @@
     static final native Object linkToInterface(Object x1, MemberName mn) throws Throwable;
  */
 
-    static { NamedFunction.initializeInvokers(); }
+    private static final HashMap<String,Integer> DEBUG_NAME_COUNTERS;
+    static {
+        if (debugEnabled())
+            DEBUG_NAME_COUNTERS = new HashMap<>();
+        else
+            DEBUG_NAME_COUNTERS = null;
+    }
+
+    // Put this last, so that previous static inits can run before.
+    static {
+        createIdentityForms();
+        if (USE_PREDEFINED_INTERPRET_METHODS)
+            PREPARED_FORMS.putAll(computeInitialPreparedForms());
+        NamedFunction.initializeInvokers();
+    }
 
     // The following hack is necessary in order to suppress TRACE_INTERPRETER
     // during execution of the static initializes of this class.
--- a/jdk/src/share/classes/java/lang/invoke/MethodHandle.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/java/lang/invoke/MethodHandle.java	Mon Jun 02 13:53:52 2014 -0700
@@ -27,10 +27,12 @@
 
 
 import java.util.*;
+import java.lang.invoke.LambdaForm.BasicType;
 import sun.invoke.util.*;
 import sun.misc.Unsafe;
 
 import static java.lang.invoke.MethodHandleStatics.*;
+import static java.lang.invoke.LambdaForm.BasicType.*;
 
 /**
  * A method handle is a typed, directly executable reference to an underlying method,
@@ -729,7 +731,7 @@
      * <li>If the return type <em>T0</em> is void and <em>T1</em> a primitive,
      *     a zero value is introduced.
      * </ul>
-    * (<em>Note:</em> Both <em>T0</em> and <em>T1</em> may be regarded as static types,
+     * (<em>Note:</em> Both <em>T0</em> and <em>T1</em> may be regarded as static types,
      * because neither corresponds specifically to the <em>dynamic type</em> of any
      * actual argument or return value.)
      * <p>
@@ -1374,7 +1376,7 @@
     }
 
     /*non-public*/
-    MethodHandle bindArgument(int pos, char basicType, Object value) {
+    MethodHandle bindArgument(int pos, BasicType basicType, Object value) {
         // Override this if it can be improved.
         return rebind().bindArgument(pos, basicType, value);
     }
@@ -1382,26 +1384,7 @@
     /*non-public*/
     MethodHandle bindReceiver(Object receiver) {
         // Override this if it can be improved.
-        return bindArgument(0, 'L', receiver);
-    }
-
-    /*non-public*/
-    MethodHandle bindImmediate(int pos, char basicType, Object value) {
-        // Bind an immediate value to a position in the arguments.
-        // This means, elide the respective argument,
-        // and replace all references to it in NamedFunction args with the specified value.
-
-        // CURRENT RESTRICTIONS
-        // * only for pos 0 and UNSAFE (position is adjusted in MHImpl to make API usable for others)
-        assert pos == 0 && basicType == 'L' && value instanceof Unsafe;
-        MethodType type2 = type.dropParameterTypes(pos, pos + 1); // adjustment: ignore receiver!
-        LambdaForm form2 = form.bindImmediate(pos + 1, basicType, value); // adjust pos to form-relative pos
-        return copyWith(type2, form2);
-    }
-
-    /*non-public*/
-    MethodHandle copyWith(MethodType mt, LambdaForm lf) {
-        throw new InternalError("copyWith: " + this.getClass());
+        return bindArgument(0, L_TYPE, receiver);
     }
 
     /*non-public*/
--- a/jdk/src/share/classes/java/lang/invoke/MethodHandleImpl.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/java/lang/invoke/MethodHandleImpl.java	Mon Jun 02 13:53:52 2014 -0700
@@ -412,7 +412,7 @@
 
 
         @Override
-        MethodHandle bindArgument(int pos, char basicType, Object value) {
+        MethodHandle bindArgument(int pos, BasicType basicType, Object value) {
             return asFixedArity().bindArgument(pos, basicType, value);
         }
 
--- a/jdk/src/share/classes/java/lang/invoke/MethodHandleNatives.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/java/lang/invoke/MethodHandleNatives.java	Mon Jun 02 13:53:52 2014 -0700
@@ -78,7 +78,7 @@
 
         // The JVM calls MethodHandleNatives.<clinit>.  Cascade the <clinit> calls as needed:
         MethodHandleImpl.initStatics();
-}
+    }
 
     // All compile-time constants go here.
     // There is an opportunity to check them against the JVM's idea of them.
@@ -293,6 +293,17 @@
         Class<?> caller = (Class<?>)callerObj;
         String name = nameObj.toString().intern();
         MethodType type = (MethodType)typeObj;
+        if (!TRACE_METHOD_LINKAGE)
+            return linkCallSiteImpl(caller, bootstrapMethod, name, type,
+                                    staticArguments, appendixResult);
+        return linkCallSiteTracing(caller, bootstrapMethod, name, type,
+                                   staticArguments, appendixResult);
+    }
+    static MemberName linkCallSiteImpl(Class<?> caller,
+                                       MethodHandle bootstrapMethod,
+                                       String name, MethodType type,
+                                       Object staticArguments,
+                                       Object[] appendixResult) {
         CallSite callSite = CallSite.makeSite(bootstrapMethod,
                                               name,
                                               type,
@@ -306,6 +317,30 @@
             return Invokers.linkToCallSiteMethod(type);
         }
     }
+    // Tracing logic:
+    static MemberName linkCallSiteTracing(Class<?> caller,
+                                          MethodHandle bootstrapMethod,
+                                          String name, MethodType type,
+                                          Object staticArguments,
+                                          Object[] appendixResult) {
+        Object bsmReference = bootstrapMethod.internalMemberName();
+        if (bsmReference == null)  bsmReference = bootstrapMethod;
+        Object staticArglist = (staticArguments instanceof Object[] ?
+                                java.util.Arrays.asList((Object[]) staticArguments) :
+                                staticArguments);
+        System.out.println("linkCallSite "+caller.getName()+" "+
+                           bsmReference+" "+
+                           name+type+"/"+staticArglist);
+        try {
+            MemberName res = linkCallSiteImpl(caller, bootstrapMethod, name, type,
+                                              staticArguments, appendixResult);
+            System.out.println("linkCallSite => "+res+" + "+appendixResult[0]);
+            return res;
+        } catch (Throwable ex) {
+            System.out.println("linkCallSite => throw "+ex);
+            throw ex;
+        }
+    }
 
     /**
      * The JVM wants a pointer to a MethodType.  Oblige it by finding or creating one.
--- a/jdk/src/share/classes/java/lang/invoke/MethodHandleStatics.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/java/lang/invoke/MethodHandleStatics.java	Mon Jun 02 13:53:52 2014 -0700
@@ -65,6 +65,16 @@
         COMPILE_THRESHOLD         = (Integer) values[4];
     }
 
+    /** Tell if any of the debugging switches are turned on.
+     *  If this is the case, it is reasonable to perform extra checks or save extra information.
+     */
+    /*non-public*/ static boolean debugEnabled() {
+        return (DEBUG_METHOD_HANDLE_NAMES |
+                DUMP_CLASS_FILES |
+                TRACE_INTERPRETER |
+                TRACE_METHOD_LINKAGE);
+    }
+
     /*non-public*/ static String getNameString(MethodHandle target, MethodType type) {
         if (type == null)
             type = target.type();
@@ -93,6 +103,9 @@
     }
 
     // handy shared exception makers (they simplify the common case code)
+    /*non-public*/ static InternalError newInternalError(String message) {
+        return new InternalError(message);
+    }
     /*non-public*/ static InternalError newInternalError(String message, Throwable cause) {
         return new InternalError(message, cause);
     }
--- a/jdk/src/share/classes/java/lang/invoke/MethodHandles.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/java/lang/invoke/MethodHandles.java	Mon Jun 02 13:53:52 2014 -0700
@@ -37,10 +37,11 @@
 import sun.reflect.Reflection;
 import sun.reflect.misc.ReflectUtil;
 import sun.security.util.SecurityConstants;
+import java.lang.invoke.LambdaForm.BasicType;
+import static java.lang.invoke.LambdaForm.BasicType.*;
 import static java.lang.invoke.MethodHandleStatics.*;
 import static java.lang.invoke.MethodHandleNatives.Constants.*;
 import java.util.concurrent.ConcurrentHashMap;
-import sun.security.util.SecurityConstants;
 
 /**
  * This class consists exclusively of static methods that operate on or return
@@ -2189,12 +2190,12 @@
             Object value = values[i];
             Class<?> ptype = oldType.parameterType(pos+i);
             if (ptype.isPrimitive()) {
-                char btype = 'I';
+                BasicType btype = I_TYPE;
                 Wrapper w = Wrapper.forPrimitiveType(ptype);
                 switch (w) {
-                case LONG:    btype = 'J'; break;
-                case FLOAT:   btype = 'F'; break;
-                case DOUBLE:  btype = 'D'; break;
+                case LONG:    btype = J_TYPE; break;
+                case FLOAT:   btype = F_TYPE; break;
+                case DOUBLE:  btype = D_TYPE; break;
                 }
                 // perform unboxing and/or primitive conversion
                 value = w.convert(value, ptype);
@@ -2205,7 +2206,7 @@
             if (pos == 0) {
                 result = result.bindReceiver(value);
             } else {
-                result = result.bindArgument(pos, 'L', value);
+                result = result.bindArgument(pos, L_TYPE, value);
             }
         }
         return result;
--- a/jdk/src/share/classes/java/lang/invoke/SimpleMethodHandle.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/java/lang/invoke/SimpleMethodHandle.java	Mon Jun 02 13:53:52 2014 -0700
@@ -26,7 +26,7 @@
 package java.lang.invoke;
 
 import static java.lang.invoke.LambdaForm.*;
-import static java.lang.invoke.MethodHandleNatives.Constants.*;
+import static java.lang.invoke.LambdaForm.BasicType.*;
 
 /**
  * A method handle whose behavior is determined only by its LambdaForm.
@@ -42,7 +42,7 @@
     }
 
     @Override
-    MethodHandle bindArgument(int pos, char basicType, Object value) {
+    MethodHandle bindArgument(int pos, BasicType basicType, Object value) {
         MethodType type2 = type().dropParameterTypes(pos, pos+1);
         LambdaForm form2 = internalForm().bind(1+pos, BoundMethodHandle.SpeciesData.EMPTY);
         return BoundMethodHandle.bindSingle(type2, form2, basicType, value);
@@ -59,10 +59,4 @@
         LambdaForm form2 = internalForm().permuteArguments(1, reorder, basicTypes(newType.parameterList()));
         return new SimpleMethodHandle(newType, form2);
     }
-
-    @Override
-    MethodHandle copyWith(MethodType mt, LambdaForm lf) {
-        return new SimpleMethodHandle(mt, lf);
-    }
-
 }
--- a/jdk/src/share/classes/java/util/DoubleSummaryStatistics.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/java/util/DoubleSummaryStatistics.java	Mon Jun 02 13:53:52 2014 -0700
@@ -54,7 +54,7 @@
  *
  * @implNote This implementation is not thread safe. However, it is safe to use
  * {@link java.util.stream.Collectors#summarizingDouble(java.util.function.ToDoubleFunction)
- * Collectors.toDoubleStatistics()} on a parallel stream, because the parallel
+ * Collectors.summarizingDouble()} on a parallel stream, because the parallel
  * implementation of {@link java.util.stream.Stream#collect Stream.collect()}
  * provides the necessary partitioning, isolation, and merging of results for
  * safe and efficient parallel execution.
--- a/jdk/src/share/classes/java/util/IntSummaryStatistics.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/java/util/IntSummaryStatistics.java	Mon Jun 02 13:53:52 2014 -0700
@@ -54,7 +54,7 @@
  *
  * @implNote This implementation is not thread safe. However, it is safe to use
  * {@link java.util.stream.Collectors#summarizingInt(java.util.function.ToIntFunction)
- * Collectors.toIntStatistics()} on a parallel stream, because the parallel
+ * Collectors.summarizingInt()} on a parallel stream, because the parallel
  * implementation of {@link java.util.stream.Stream#collect Stream.collect()}
  * provides the necessary partitioning, isolation, and merging of results for
  * safe and efficient parallel execution.
--- a/jdk/src/share/classes/java/util/LongSummaryStatistics.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/java/util/LongSummaryStatistics.java	Mon Jun 02 13:53:52 2014 -0700
@@ -42,7 +42,7 @@
  * }</pre>
  *
  * <p>{@code LongSummaryStatistics} can be used as a
- * {@linkplain java.util.stream.Stream#collect(Collector)} reduction}
+ * {@linkplain java.util.stream.Stream#collect(Collector) reduction}
  * target for a {@linkplain java.util.stream.Stream stream}. For example:
  *
  * <pre> {@code
@@ -55,7 +55,7 @@
  *
  * @implNote This implementation is not thread safe. However, it is safe to use
  * {@link java.util.stream.Collectors#summarizingLong(java.util.function.ToLongFunction)
- * Collectors.toLongStatistics()} on a parallel stream, because the parallel
+ * Collectors.summarizingLong()} on a parallel stream, because the parallel
  * implementation of {@link java.util.stream.Stream#collect Stream.collect()}
  * provides the necessary partitioning, isolation, and merging of results for
  * safe and efficient parallel execution.
--- a/jdk/src/share/classes/java/util/TimeZone.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/java/util/TimeZone.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -591,8 +591,7 @@
     /**
      * Gets the platform defined TimeZone ID.
      **/
-    private static native String getSystemTimeZoneID(String javaHome,
-                                                     String country);
+    private static native String getSystemTimeZoneID(String javaHome);
 
     /**
      * Gets the custom time zone ID based on the GMT offset of the
@@ -650,12 +649,10 @@
         // if the time zone ID is not set (yet), perform the
         // platform to Java time zone ID mapping.
         if (zoneID == null || zoneID.isEmpty()) {
-            String country = AccessController.doPrivileged(
-                    new GetPropertyAction("user.country"));
             String javaHome = AccessController.doPrivileged(
                     new GetPropertyAction("java.home"));
             try {
-                zoneID = getSystemTimeZoneID(javaHome, country);
+                zoneID = getSystemTimeZoneID(javaHome);
                 if (zoneID == null) {
                     zoneID = GMT_ID;
                 }
--- a/jdk/src/share/classes/javax/accessibility/AccessibleContext.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/javax/accessibility/AccessibleContext.java	Mon Jun 02 13:53:52 2014 -0700
@@ -25,6 +25,9 @@
 
 package javax.accessibility;
 
+import sun.awt.AWTAccessor;
+import sun.awt.AppContext;
+
 import java.util.Locale;
 import java.beans.PropertyChangeListener;
 import java.beans.PropertyChangeSupport;
@@ -79,6 +82,26 @@
  */
 public abstract class AccessibleContext {
 
+    /**
+     * The AppContext that should be used to dispatch events for this
+     * AccessibleContext
+     */
+    private volatile AppContext targetAppContext;
+
+    static {
+        AWTAccessor.setAccessibleContextAccessor(new AWTAccessor.AccessibleContextAccessor() {
+            @Override
+            public void setAppContext(AccessibleContext accessibleContext, AppContext appContext) {
+                accessibleContext.targetAppContext = appContext;
+            }
+
+            @Override
+            public AppContext getAppContext(AccessibleContext accessibleContext) {
+                return accessibleContext.targetAppContext;
+            }
+        });
+    }
+
    /**
     * Constant used to determine when the accessibleName property has
     * changed.  The old value in the PropertyChangeEvent will be the old
--- a/jdk/src/share/classes/javax/crypto/JceSecurity.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/javax/crypto/JceSecurity.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -216,26 +216,28 @@
             new WeakHashMap<>();
 
     /*
-     * Retuns the CodeBase for the given class.
+     * Returns the CodeBase for the given class.
      */
     static URL getCodeBase(final Class<?> clazz) {
-        URL url = codeBaseCacheRef.get(clazz);
-        if (url == null) {
-            url = AccessController.doPrivileged(new PrivilegedAction<URL>() {
-                public URL run() {
-                    ProtectionDomain pd = clazz.getProtectionDomain();
-                    if (pd != null) {
-                        CodeSource cs = pd.getCodeSource();
-                        if (cs != null) {
-                            return cs.getLocation();
+        synchronized (codeBaseCacheRef) {
+            URL url = codeBaseCacheRef.get(clazz);
+            if (url == null) {
+                url = AccessController.doPrivileged(new PrivilegedAction<URL>() {
+                    public URL run() {
+                        ProtectionDomain pd = clazz.getProtectionDomain();
+                        if (pd != null) {
+                            CodeSource cs = pd.getCodeSource();
+                            if (cs != null) {
+                                return cs.getLocation();
+                            }
                         }
+                        return NULL_URL;
                     }
-                    return NULL_URL;
-                }
-            });
-            codeBaseCacheRef.put(clazz, url);
+                });
+                codeBaseCacheRef.put(clazz, url);
+            }
+            return (url == NULL_URL) ? null : url;
         }
-        return (url == NULL_URL) ? null : url;
     }
 
     private static void setupJurisdictionPolicies() throws Exception {
--- a/jdk/src/share/classes/javax/sound/sampled/spi/AudioFileReader.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/javax/sound/sampled/spi/AudioFileReader.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,7 +35,7 @@
 import javax.sound.sampled.UnsupportedAudioFileException;
 
 /**
- * Provider for audio file reading services.  Classes providing concrete
+ * Provider for audio file reading services. Classes providing concrete
  * implementations can parse the format information from one or more types of
  * audio file, and can produce audio input streams from files of these types.
  *
@@ -45,93 +45,106 @@
 public abstract class AudioFileReader {
 
     /**
-     * Obtains the audio file format of the input stream provided.  The stream must
-     * point to valid audio file data.  In general, audio file readers may
+     * Obtains the audio file format of the input stream provided. The stream
+     * must point to valid audio file data. In general, audio file readers may
      * need to read some data from the stream before determining whether they
-     * support it.  These parsers must
-     * be able to mark the stream, read enough data to determine whether they
-     * support the stream, and, if not, reset the stream's read pointer to its original
-     * position.  If the input stream does not support this, this method may fail
-     * with an <code>IOException</code>.
-     * @param stream the input stream from which file format information should be
-     * extracted
-     * @return an <code>AudioFileFormat</code> object describing the audio file format
-     * @throws UnsupportedAudioFileException if the stream does not point to valid audio
-     * file data recognized by the system
+     * support it. These parsers must be able to mark the stream, read enough
+     * data to determine whether they support the stream, and, if not, reset the
+     * stream's read pointer to its original position. If the input stream does
+     * not support this, this method may fail with an {@code IOException}.
+     *
+     * @param  stream the input stream from which file format information should
+     *         be extracted
+     * @return an {@code AudioFileFormat} object describing the audio file
+     *         format
+     * @throws UnsupportedAudioFileException if the stream does not point to
+     *         valid audio file data recognized by the system
      * @throws IOException if an I/O exception occurs
      * @see InputStream#markSupported
      * @see InputStream#mark
      */
-    public abstract AudioFileFormat getAudioFileFormat(InputStream stream) throws UnsupportedAudioFileException, IOException;
+    public abstract AudioFileFormat getAudioFileFormat(InputStream stream)
+            throws UnsupportedAudioFileException, IOException;
 
     /**
-     * Obtains the audio file format of the URL provided.  The URL must
-     * point to valid audio file data.
-     * @param url the URL from which file format information should be
-     * extracted
-     * @return an <code>AudioFileFormat</code> object describing the audio file format
-     * @throws UnsupportedAudioFileException if the URL does not point to valid audio
-     * file data recognized by the system
+     * Obtains the audio file format of the URL provided. The URL must point to
+     * valid audio file data.
+     *
+     * @param  url the URL from which file format information should be
+     *         extracted
+     * @return an {@code AudioFileFormat} object describing the audio file
+     *         format
+     * @throws UnsupportedAudioFileException if the URL does not point to valid
+     *         audio file data recognized by the system
      * @throws IOException if an I/O exception occurs
      */
-    public abstract AudioFileFormat getAudioFileFormat(URL url) throws UnsupportedAudioFileException, IOException;
+    public abstract AudioFileFormat getAudioFileFormat(URL url)
+            throws UnsupportedAudioFileException, IOException;
 
     /**
-     * Obtains the audio file format of the <code>File</code> provided.  The <code>File</code> must
-     * point to valid audio file data.
-     * @param file the <code>File</code> from which file format information should be
-     * extracted
-     * @return an <code>AudioFileFormat</code> object describing the audio file format
-     * @throws UnsupportedAudioFileException if the <code>File</code> does not point to valid audio
-     * file data recognized by the system
+     * Obtains the audio file format of the {@code File} provided.
+     * The {@code File} must point to valid audio file data.
+     *
+     * @param  file the {@code File} from which file format information
+     *         should be extracted
+     * @return an {@code AudioFileFormat} object describing the audio file
+     *         format
+     * @throws UnsupportedAudioFileException if the {@code File} does not point
+     *         to valid audio file data recognized by the system
      * @throws IOException if an I/O exception occurs
      */
-    public abstract AudioFileFormat getAudioFileFormat(File file) throws UnsupportedAudioFileException, IOException;
+    public abstract AudioFileFormat getAudioFileFormat(File file)
+            throws UnsupportedAudioFileException, IOException;
 
     /**
-     * Obtains an audio input stream from the input stream provided.  The stream must
-     * point to valid audio file data.  In general, audio file readers may
+     * Obtains an audio input stream from the input stream provided. The stream
+     * must point to valid audio file data. In general, audio file readers may
      * need to read some data from the stream before determining whether they
-     * support it.  These parsers must
-     * be able to mark the stream, read enough data to determine whether they
-     * support the stream, and, if not, reset the stream's read pointer to its original
-     * position.  If the input stream does not support this, this method may fail
-     * with an <code>IOException</code>.
-     * @param stream the input stream from which the <code>AudioInputStream</code> should be
-     * constructed
-     * @return an <code>AudioInputStream</code> object based on the audio file data contained
-     * in the input stream.
-     * @throws UnsupportedAudioFileException if the stream does not point to valid audio
-     * file data recognized by the system
+     * support it. These parsers must be able to mark the stream, read enough
+     * data to determine whether they support the stream, and, if not, reset the
+     * stream's read pointer to its original position. If the input stream does
+     * not support this, this method may fail with an {@code IOException}.
+     *
+     * @param  stream the input stream from which the {@code AudioInputStream}
+     *         should be constructed
+     * @return an {@code AudioInputStream} object based on the audio file data
+     *         contained in the input stream.
+     * @throws UnsupportedAudioFileException if the stream does not point to
+     *         valid audio file data recognized by the system
      * @throws IOException if an I/O exception occurs
      * @see InputStream#markSupported
      * @see InputStream#mark
      */
-    public abstract AudioInputStream getAudioInputStream(InputStream stream) throws UnsupportedAudioFileException, IOException;
+    public abstract AudioInputStream getAudioInputStream(InputStream stream)
+            throws UnsupportedAudioFileException, IOException;
 
     /**
-     * Obtains an audio input stream from the URL provided.  The URL must
-     * point to valid audio file data.
-     * @param url the URL for which the <code>AudioInputStream</code> should be
-     * constructed
-     * @return an <code>AudioInputStream</code> object based on the audio file data pointed
-     * to by the URL
-     * @throws UnsupportedAudioFileException if the URL does not point to valid audio
-     * file data recognized by the system
+     * Obtains an audio input stream from the URL provided. The URL must point
+     * to valid audio file data.
+     *
+     * @param  url the URL for which the {@code AudioInputStream} should be
+     *         constructed
+     * @return an {@code AudioInputStream} object based on the audio file data
+     *         pointed to by the URL
+     * @throws UnsupportedAudioFileException if the URL does not point to valid
+     *         audio file data recognized by the system
      * @throws IOException if an I/O exception occurs
      */
-    public abstract AudioInputStream getAudioInputStream(URL url) throws UnsupportedAudioFileException, IOException;
+    public abstract AudioInputStream getAudioInputStream(URL url)
+            throws UnsupportedAudioFileException, IOException;
 
     /**
-     * Obtains an audio input stream from the <code>File</code> provided.  The <code>File</code> must
-     * point to valid audio file data.
-     * @param file the <code>File</code> for which the <code>AudioInputStream</code> should be
-     * constructed
-     * @return an <code>AudioInputStream</code> object based on the audio file data pointed
-     * to by the File
-     * @throws UnsupportedAudioFileException if the <code>File</code> does not point to valid audio
-     * file data recognized by the system
+     * Obtains an audio input stream from the {@code File} provided.
+     * The {@code File} must point to valid audio file data.
+     *
+     * @param  file the {@code File} for which the {@code AudioInputStream}
+     *         should be constructed
+     * @return an {@code AudioInputStream} object based on the audio file data
+     *         pointed to by the File
+     * @throws UnsupportedAudioFileException if the {@code File} does not point
+     *         to valid audio file data recognized by the system
      * @throws IOException if an I/O exception occurs
      */
-    public abstract AudioInputStream getAudioInputStream(File file) throws UnsupportedAudioFileException, IOException;
+    public abstract AudioInputStream getAudioInputStream(File file)
+            throws UnsupportedAudioFileException, IOException;
 }
--- a/jdk/src/share/classes/javax/sound/sampled/spi/AudioFileWriter.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/javax/sound/sampled/spi/AudioFileWriter.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,16 +26,15 @@
 package javax.sound.sampled.spi;
 
 import java.io.File;
-import java.io.InputStream;
 import java.io.IOException;
 import java.io.OutputStream;
 
-import javax.sound.sampled.AudioFileFormat;
 import javax.sound.sampled.AudioInputStream;
 
+import static javax.sound.sampled.AudioFileFormat.Type;
 
 /**
- * Provider for audio file writing services.  Classes providing concrete
+ * Provider for audio file writing services. Classes providing concrete
  * implementations can write one or more types of audio file from an audio
  * stream.
  *
@@ -47,22 +46,23 @@
     /**
      * Obtains the file types for which file writing support is provided by this
      * audio file writer.
-     * @return array of file types.  If no file types are supported,
-     * an array of length 0 is returned.
+     *
+     * @return array of file types. If no file types are supported, an array of
+     *         length 0 is returned.
      */
-    public abstract AudioFileFormat.Type[] getAudioFileTypes();
-
+    public abstract Type[] getAudioFileTypes();
 
     /**
-     * Indicates whether file writing support for the specified file type is provided
-     * by this audio file writer.
-     * @param fileType the file type for which write capabilities are queried
-     * @return <code>true</code> if the file type is supported,
-     * otherwise <code>false</code>
+     * Indicates whether file writing support for the specified file type is
+     * provided by this audio file writer.
+     *
+     * @param  fileType the file type for which write capabilities are queried
+     * @return {@code true} if the file type is supported, otherwise
+     *         {@code false}
      */
-    public boolean isFileTypeSupported(AudioFileFormat.Type fileType) {
+    public boolean isFileTypeSupported(Type fileType) {
 
-        AudioFileFormat.Type types[] = getAudioFileTypes();
+        Type types[] = getAudioFileTypes();
 
         for(int i=0; i<types.length; i++) {
             if( fileType.equals( types[i] ) ) {
@@ -72,29 +72,29 @@
         return false;
     }
 
-
     /**
      * Obtains the file types that this audio file writer can write from the
      * audio input stream specified.
-     * @param stream the audio input stream for which audio file type support
-     * is queried
-     * @return array of file types.  If no file types are supported,
-     * an array of length 0 is returned.
+     *
+     * @param  stream the audio input stream for which audio file type support
+     *         is queried
+     * @return array of file types. If no file types are supported, an array of
+     *         length 0 is returned.
      */
-    public abstract AudioFileFormat.Type[] getAudioFileTypes(AudioInputStream stream);
-
+    public abstract Type[] getAudioFileTypes(AudioInputStream stream);
 
     /**
-     * Indicates whether an audio file of the type specified can be written
-     * from the audio input stream indicated.
-     * @param fileType file type for which write capabilities are queried
-     * @param stream for which file writing support is queried
-     * @return <code>true</code> if the file type is supported for this audio input stream,
-     * otherwise <code>false</code>
+     * Indicates whether an audio file of the type specified can be written from
+     * the audio input stream indicated.
+     *
+     * @param  fileType file type for which write capabilities are queried
+     * @param  stream for which file writing support is queried
+     * @return {@code true} if the file type is supported for this audio input
+     *         stream, otherwise {@code false}
      */
-    public boolean isFileTypeSupported(AudioFileFormat.Type fileType, AudioInputStream stream) {
+    public boolean isFileTypeSupported(Type fileType, AudioInputStream stream) {
 
-        AudioFileFormat.Type types[] = getAudioFileTypes( stream );
+        Type types[] = getAudioFileTypes( stream );
 
         for(int i=0; i<types.length; i++) {
             if( fileType.equals( types[i] ) ) {
@@ -104,44 +104,44 @@
         return false;
     }
 
-
     /**
      * Writes a stream of bytes representing an audio file of the file type
-     * indicated to the output stream provided.  Some file types require that
+     * indicated to the output stream provided. Some file types require that
      * the length be written into the file header, and cannot be written from
-     * start to finish unless the length is known in advance.  An attempt
-     * to write such a file type will fail with an IOException if the length in
-     * the audio file format is
-     * {@link javax.sound.sampled.AudioSystem#NOT_SPECIFIED AudioSystem.NOT_SPECIFIED}.
-     * @param stream the audio input stream containing audio data to be
-     * written to the output stream
-     * @param fileType file type to be written to the output stream
-     * @param out stream to which the file data should be written
+     * start to finish unless the length is known in advance. An attempt to
+     * write such a file type will fail with an IOException if the length in the
+     * audio file format is {@link javax.sound.sampled.AudioSystem#NOT_SPECIFIED
+     * AudioSystem.NOT_SPECIFIED}.
+     *
+     * @param  stream the audio input stream containing audio data to be written
+     *         to the output stream
+     * @param  fileType file type to be written to the output stream
+     * @param  out stream to which the file data should be written
      * @return the number of bytes written to the output stream
      * @throws IOException if an I/O exception occurs
-     * @throws IllegalArgumentException if the file type is not supported by
-     * the system
-     * @see #isFileTypeSupported(AudioFileFormat.Type, AudioInputStream)
+     * @throws IllegalArgumentException if the file type is not supported by the
+     *         system
+     * @see #isFileTypeSupported(Type, AudioInputStream)
      * @see #getAudioFileTypes
      */
-    public abstract int write(AudioInputStream stream, AudioFileFormat.Type fileType, OutputStream out) throws IOException;
-
+    public abstract int write(AudioInputStream stream, Type fileType,
+                              OutputStream out) throws IOException;
 
     /**
      * Writes a stream of bytes representing an audio file of the file format
      * indicated to the external file provided.
-     * @param stream the audio input stream containing audio data to be
-     * written to the file
-     * @param fileType file type to be written to the file
-     * @param out external file to which the file data should be written
+     *
+     * @param  stream the audio input stream containing audio data to be written
+     *         to the file
+     * @param  fileType file type to be written to the file
+     * @param  out external file to which the file data should be written
      * @return the number of bytes written to the file
      * @throws IOException if an I/O exception occurs
      * @throws IllegalArgumentException if the file format is not supported by
-     * the system
+     *         the system
      * @see #isFileTypeSupported
      * @see #getAudioFileTypes
      */
-    public abstract int write(AudioInputStream stream, AudioFileFormat.Type fileType, File out) throws IOException;
-
-
+    public abstract int write(AudioInputStream stream, Type fileType, File out)
+            throws IOException;
 }
--- a/jdk/src/share/classes/javax/sound/sampled/spi/FormatConversionProvider.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/javax/sound/sampled/spi/FormatConversionProvider.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,63 +25,62 @@
 
 package javax.sound.sampled.spi;
 
-import java.io.InputStream;
-
 import javax.sound.sampled.AudioFormat;
 import javax.sound.sampled.AudioInputStream;
 
+import static javax.sound.sampled.AudioFormat.Encoding;
+
 /**
- * A format conversion provider provides format conversion services
- * from one or more input formats to one or more output formats.
- * Converters include codecs, which encode and/or decode audio data,
- * as well as transcoders, etc.  Format converters provide methods for
- * determining what conversions are supported and for obtaining an audio
- * stream from which converted data can be read.
+ * A format conversion provider provides format conversion services from one or
+ * more input formats to one or more output formats. Converters include codecs,
+ * which encode and/or decode audio data, as well as transcoders, etc. Format
+ * converters provide methods for determining what conversions are supported and
+ * for obtaining an audio stream from which converted data can be read.
  * <p>
- * The source format represents the format of the incoming
- * audio data, which will be converted.
+ * The source format represents the format of the incoming audio data, which
+ * will be converted.
  * <p>
- * The target format represents the format of the processed, converted
- * audio data.  This is the format of the data that can be read from
- * the stream returned by one of the <code>getAudioInputStream</code> methods.
+ * The target format represents the format of the processed, converted audio
+ * data. This is the format of the data that can be read from the stream
+ * returned by one of the {@code getAudioInputStream} methods.
  *
  * @author Kara Kytle
  * @since 1.3
  */
 public abstract class FormatConversionProvider {
 
-
-    // NEW METHODS
+    /**
+     * Obtains the set of source format encodings from which format conversion
+     * services are provided by this provider.
+     *
+     * @return array of source format encodings. If for some reason provider
+     *         does not provide any conversion services, an array of length 0 is
+     *         returned.
+     */
+    public abstract Encoding[] getSourceEncodings();
 
     /**
-     * Obtains the set of source format encodings from which format
-     * conversion services are provided by this provider.
-     * @return array of source format encodings. If for some reason provider
-     * does not provide any conversion services, an array of length 0 is
-     * returned.
+     * Obtains the set of target format encodings to which format conversion
+     * services are provided by this provider.
+     *
+     * @return array of target format encodings. If for some reason provider
+     *         does not provide any conversion services, an array of length 0 is
+     *         returned.
      */
-    public abstract AudioFormat.Encoding[] getSourceEncodings();
-
-
-    /**
-     * Obtains the set of target format encodings to which format
-     * conversion services are provided by this provider.
-     * @return array of target format encodings. If for some reason provider
-     * does not provide any conversion services, an array of length 0 is
-     * returned.
-     */
-    public abstract AudioFormat.Encoding[] getTargetEncodings();
-
+    public abstract Encoding[] getTargetEncodings();
 
     /**
      * Indicates whether the format converter supports conversion from the
      * specified source format encoding.
-     * @param sourceEncoding the source format encoding for which support is queried
-     * @return <code>true</code> if the encoding is supported, otherwise <code>false</code>
+     *
+     * @param  sourceEncoding the source format encoding for which support is
+     *         queried
+     * @return {@code true} if the encoding is supported, otherwise
+     *         {@code false}
      */
-    public boolean isSourceEncodingSupported(AudioFormat.Encoding sourceEncoding){
+    public boolean isSourceEncodingSupported(Encoding sourceEncoding) {
 
-        AudioFormat.Encoding sourceEncodings[] = getSourceEncodings();
+        Encoding sourceEncodings[] = getSourceEncodings();
 
         for(int i=0; i<sourceEncodings.length; i++) {
             if( sourceEncoding.equals( sourceEncodings[i]) ) {
@@ -91,16 +90,18 @@
         return false;
     }
 
-
     /**
      * Indicates whether the format converter supports conversion to the
      * specified target format encoding.
-     * @param targetEncoding the target format encoding for which support is queried
-     * @return <code>true</code> if the encoding is supported, otherwise <code>false</code>
+     *
+     * @param  targetEncoding the target format encoding for which support is
+     *         queried
+     * @return {@code true} if the encoding is supported, otherwise
+     *         {@code false}
      */
-    public boolean isTargetEncodingSupported(AudioFormat.Encoding targetEncoding){
+    public boolean isTargetEncodingSupported(Encoding targetEncoding) {
 
-        AudioFormat.Encoding targetEncodings[] = getTargetEncodings();
+        Encoding targetEncodings[] = getTargetEncodings();
 
         for(int i=0; i<targetEncodings.length; i++) {
             if( targetEncoding.equals( targetEncodings[i]) ) {
@@ -110,28 +111,29 @@
         return false;
     }
 
-
     /**
-     * Obtains the set of target format encodings supported by the format converter
-     * given a particular source format.
-     * If no target format encodings are supported for this source format,
-     * an array of length 0 is returned.
-     * @param sourceFormat format of the incoming data
+     * Obtains the set of target format encodings supported by the format
+     * converter given a particular source format. If no target format encodings
+     * are supported for this source format, an array of length 0 is returned.
+     *
+     * @param  sourceFormat format of the incoming data
      * @return array of supported target format encodings.
      */
-    public abstract AudioFormat.Encoding[] getTargetEncodings(AudioFormat sourceFormat);
-
+    public abstract Encoding[] getTargetEncodings(AudioFormat sourceFormat);
 
     /**
-     * Indicates whether the format converter supports conversion to a particular encoding
-     * from a particular format.
-     * @param targetEncoding desired encoding of the outgoing data
-     * @param sourceFormat format of the incoming data
-     * @return <code>true</code> if the conversion is supported, otherwise <code>false</code>
+     * Indicates whether the format converter supports conversion to a
+     * particular encoding from a particular format.
+     *
+     * @param  targetEncoding desired encoding of the outgoing data
+     * @param  sourceFormat format of the incoming data
+     * @return {@code true} if the conversion is supported, otherwise
+     *         {@code false}
      */
-    public boolean isConversionSupported(AudioFormat.Encoding targetEncoding, AudioFormat sourceFormat){
+    public boolean isConversionSupported(Encoding targetEncoding,
+                                         AudioFormat sourceFormat) {
 
-        AudioFormat.Encoding targetEncodings[] = getTargetEncodings(sourceFormat);
+        Encoding targetEncodings[] = getTargetEncodings(sourceFormat);
 
         for(int i=0; i<targetEncodings.length; i++) {
             if( targetEncoding.equals( targetEncodings[i]) ) {
@@ -141,27 +143,29 @@
         return false;
     }
 
-
     /**
-     * Obtains the set of target formats with the encoding specified
-     * supported by the format converter
-     * If no target formats with the specified encoding are supported
-     * for this source format, an array of length 0 is returned.
-     * @param targetEncoding desired encoding of the stream after processing
-     * @param sourceFormat format of the incoming data
+     * Obtains the set of target formats with the encoding specified supported
+     * by the format converter If no target formats with the specified encoding
+     * are supported for this source format, an array of length 0 is returned.
+     *
+     * @param  targetEncoding desired encoding of the stream after processing
+     * @param  sourceFormat format of the incoming data
      * @return array of supported target formats.
      */
-    public abstract AudioFormat[] getTargetFormats(AudioFormat.Encoding targetEncoding, AudioFormat sourceFormat);
-
+    public abstract AudioFormat[] getTargetFormats(Encoding targetEncoding,
+                                                   AudioFormat sourceFormat);
 
     /**
      * Indicates whether the format converter supports conversion to one
      * particular format from another.
-     * @param targetFormat desired format of outgoing data
-     * @param sourceFormat format of the incoming data
-     * @return <code>true</code> if the conversion is supported, otherwise <code>false</code>
+     *
+     * @param  targetFormat desired format of outgoing data
+     * @param  sourceFormat format of the incoming data
+     * @return {@code true} if the conversion is supported, otherwise
+     *         {@code false}
      */
-    public boolean isConversionSupported(AudioFormat targetFormat, AudioFormat sourceFormat){
+    public boolean isConversionSupported(AudioFormat targetFormat,
+                                         AudioFormat sourceFormat) {
 
         AudioFormat targetFormats[] = getTargetFormats( targetFormat.getEncoding(), sourceFormat );
 
@@ -173,28 +177,33 @@
         return false;
     }
 
+    /**
+     * Obtains an audio input stream with the specified encoding from the given
+     * audio input stream.
+     *
+     * @param  targetEncoding desired encoding of the stream after processing
+     * @param  sourceStream stream from which data to be processed should be
+     *         read
+     * @return stream from which processed data with the specified target
+     *         encoding may be read
+     * @throws IllegalArgumentException if the format combination supplied is
+     *         not supported.
+     */
+    public abstract AudioInputStream getAudioInputStream(
+            Encoding targetEncoding, AudioInputStream sourceStream);
 
     /**
-     * Obtains an audio input stream with the specified encoding from the given audio
-     * input stream.
-     * @param targetEncoding desired encoding of the stream after processing
-     * @param sourceStream stream from which data to be processed should be read
-     * @return stream from which processed data with the specified target encoding may be read
+     * Obtains an audio input stream with the specified format from the given
+     * audio input stream.
+     *
+     * @param  targetFormat desired data format of the stream after processing
+     * @param  sourceStream stream from which data to be processed should be
+     *         read
+     * @return stream from which processed data with the specified format may be
+     *         read
      * @throws IllegalArgumentException if the format combination supplied is
-     * not supported.
+     *         not supported.
      */
-    public abstract AudioInputStream getAudioInputStream(AudioFormat.Encoding targetEncoding, AudioInputStream sourceStream);
-
-
-    /**
-     * Obtains an audio input stream with the specified format from the given audio
-     * input stream.
-     * @param targetFormat desired data format of the stream after processing
-     * @param sourceStream stream from which data to be processed should be read
-     * @return stream from which processed data with the specified format may be read
-     * @throws IllegalArgumentException if the format combination supplied is
-     * not supported.
-     */
-    public abstract AudioInputStream getAudioInputStream(AudioFormat targetFormat, AudioInputStream sourceStream);
-
+    public abstract AudioInputStream getAudioInputStream(
+            AudioFormat targetFormat, AudioInputStream sourceStream);
 }
--- a/jdk/src/share/classes/javax/sound/sampled/spi/MixerProvider.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/javax/sound/sampled/spi/MixerProvider.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,28 +28,27 @@
 import javax.sound.sampled.Mixer;
 
 /**
- * A provider or factory for a particular mixer type.
- * This mechanism allows the implementation to determine
- * how resources are managed in creation / management of
- * a mixer.
+ * A provider or factory for a particular mixer type. This mechanism allows the
+ * implementation to determine how resources are managed in creation /
+ * management of a mixer.
  *
  * @author Kara Kytle
  * @since 1.3
  */
 public abstract class MixerProvider {
 
-
     /**
      * Indicates whether the mixer provider supports the mixer represented by
      * the specified mixer info object.
      * <p>
-     * The full set of mixer info objects that represent the mixers supported
-     * by this {@code MixerProvider} may be obtained
-     * through the {@code getMixerInfo} method.
+     * The full set of mixer info objects that represent the mixers supported by
+     * this {@code MixerProvider} may be obtained through the
+     * {@code getMixerInfo} method.
      *
-     * @param info an info object that describes the mixer for which support is queried
-     * @return {@code true} if the specified mixer is supported,
-     *     otherwise {@code false}
+     * @param  info an info object that describes the mixer for which support is
+     *         queried
+     * @return {@code true} if the specified mixer is supported, otherwise
+     *         {@code false}
      * @see #getMixerInfo()
      */
     public boolean isMixerSupported(Mixer.Info info) {
@@ -64,38 +63,34 @@
         return false;
     }
 
-
     /**
-     * Obtains the set of info objects representing the mixer
-     * or mixers provided by this MixerProvider.
+     * Obtains the set of info objects representing the mixer or mixers provided
+     * by this MixerProvider.
      * <p>
-     * The {@code isMixerSupported} method returns {@code true}
-     * for all the info objects returned by this method.
-     * The corresponding mixer instances for the info objects
-     * are returned by the {@code getMixer} method.
+     * The {@code isMixerSupported} method returns {@code true} for all the info
+     * objects returned by this method. The corresponding mixer instances for
+     * the info objects are returned by the {@code getMixer} method.
      *
      * @return a set of mixer info objects
-     * @see #getMixer(javax.sound.sampled.Mixer.Info) getMixer(Mixer.Info)
-     * @see #isMixerSupported(javax.sound.sampled.Mixer.Info) isMixerSupported(Mixer.Info)
+     * @see #getMixer(Mixer.Info)
+     * @see #isMixerSupported(Mixer.Info)
      */
     public abstract Mixer.Info[] getMixerInfo();
 
-
     /**
      * Obtains an instance of the mixer represented by the info object.
      * <p>
      * The full set of the mixer info objects that represent the mixers
-     * supported by this {@code MixerProvider} may be obtained
-     * through the {@code getMixerInfo} method.
-     * Use the {@code isMixerSupported} method to test whether
-     * this {@code MixerProvider} supports a particular mixer.
+     * supported by this {@code MixerProvider} may be obtained through the
+     * {@code getMixerInfo} method. Use the {@code isMixerSupported} method to
+     * test whether this {@code MixerProvider} supports a particular mixer.
      *
-     * @param info an info object that describes the desired mixer
+     * @param  info an info object that describes the desired mixer
      * @return mixer instance
      * @throws IllegalArgumentException if the info object specified does not
-     *     match the info object for a mixer supported by this MixerProvider.
+     *         match the info object for a mixer supported by this MixerProvider
      * @see #getMixerInfo()
-     * @see #isMixerSupported(javax.sound.sampled.Mixer.Info) isMixerSupported(Mixer.Info)
+     * @see #isMixerSupported(Mixer.Info)
      */
     public abstract Mixer getMixer(Mixer.Info info);
 }
--- a/jdk/src/share/classes/javax/swing/JComponent.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/javax/swing/JComponent.java	Mon Jun 02 13:53:52 2014 -0700
@@ -3986,7 +3986,18 @@
          * @see AccessibleKeyBinding
          * @since 1.4
          */
-        public AccessibleKeyBinding getAccessibleKeyBinding() {
+        public AccessibleKeyBinding getAccessibleKeyBinding(){
+            // Try to get the linked label's mnemonic if it exists
+            Object o = getClientProperty(JLabel.LABELED_BY_PROPERTY);
+            if (o instanceof Accessible){
+                AccessibleContext ac = ((Accessible) o).getAccessibleContext();
+                if (ac != null){
+                    AccessibleComponent comp = ac.getAccessibleComponent();
+                    if (! (comp instanceof AccessibleExtendedComponent))
+                        return null;
+                    return ((AccessibleExtendedComponent)comp).getAccessibleKeyBinding();
+                }
+            }
             return null;
         }
     } // inner class AccessibleJComponent
--- a/jdk/src/share/classes/javax/swing/border/BevelBorder.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/javax/swing/border/BevelBorder.java	Mon Jun 02 13:53:52 2014 -0700
@@ -134,7 +134,9 @@
      * when rendered on the specified component.  If no highlight
      * color was specified at instantiation, the highlight color
      * is derived from the specified component's background color.
+     *
      * @param c the component for which the highlight may be derived
+     * @return the outer highlight {@code Color}
      * @since 1.3
      */
     public Color getHighlightOuterColor(Component c)   {
@@ -148,7 +150,9 @@
      * when rendered on the specified component.  If no highlight
      * color was specified at instantiation, the highlight color
      * is derived from the specified component's background color.
+     *
      * @param c the component for which the highlight may be derived
+     * @return the inner highlight {@code Color}
      * @since 1.3
      */
     public Color getHighlightInnerColor(Component c)   {
@@ -162,7 +166,9 @@
      * when rendered on the specified component.  If no shadow
      * color was specified at instantiation, the shadow color
      * is derived from the specified component's background color.
+     *
      * @param c the component for which the shadow may be derived
+     * @return the inner shadow {@code Color}
      * @since 1.3
      */
     public Color getShadowInnerColor(Component c)      {
@@ -176,7 +182,9 @@
      * when rendered on the specified component.  If no shadow
      * color was specified at instantiation, the shadow color
      * is derived from the specified component's background color.
+     *
      * @param c the component for which the shadow may be derived
+     * @return the outer shadow {@code Color}
      * @since 1.3
      */
     public Color getShadowOuterColor(Component c)      {
@@ -189,6 +197,9 @@
      * Returns the outer highlight color of the bevel border.
      * Will return null if no highlight color was specified
      * at instantiation.
+     *
+     * @return the outer highlight {@code Color} or {@code null} if no highlight
+     *         color was specified
      * @since 1.3
      */
     public Color getHighlightOuterColor()   {
@@ -199,6 +210,9 @@
      * Returns the inner highlight color of the bevel border.
      * Will return null if no highlight color was specified
      * at instantiation.
+     *
+     * @return the inner highlight {@code Color} or {@code null} if no highlight
+     *         color was specified
      * @since 1.3
      */
     public Color getHighlightInnerColor()   {
@@ -209,6 +223,9 @@
      * Returns the inner shadow color of the bevel border.
      * Will return null if no shadow color was specified
      * at instantiation.
+     *
+     * @return the inner shadow {@code Color} or {@code null} if no shadow color
+     *         was specified
      * @since 1.3
      */
     public Color getShadowInnerColor()      {
@@ -219,6 +236,9 @@
      * Returns the outer shadow color of the bevel border.
      * Will return null if no shadow color was specified
      * at instantiation.
+     *
+     * @return the outer shadow {@code Color} or {@code null} if no shadow color
+     *         was specified
      * @since 1.3
      */
     public Color getShadowOuterColor()      {
@@ -227,13 +247,18 @@
 
     /**
      * Returns the type of the bevel border.
+     *
+     * @return the bevel border type, either {@code RAISED} or {@code LOWERED}
      */
     public int getBevelType()       {
         return bevelType;
     }
 
     /**
-     * Returns whether or not the border is opaque.
+     * Returns whether or not the border is opaque. This implementation
+     * returns {@code true}.
+     *
+     * @return true
      */
     public boolean isBorderOpaque() { return true; }
 
--- a/jdk/src/share/classes/javax/swing/border/Border.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/javax/swing/border/Border.java	Mon Jun 02 13:53:52 2014 -0700
@@ -66,6 +66,7 @@
     /**
      * Paints the border for the specified component with the specified
      * position and size.
+     *
      * @param c the component for which this border is being painted
      * @param g the paint graphics
      * @param x the x position of the painted border
@@ -77,7 +78,10 @@
 
     /**
      * Returns the insets of the border.
+     *
      * @param c the component for which this border insets value applies
+     * @return an {@code Insets} object containing the insets from top, left,
+     *         bottom and right of this {@code Border}
      */
     Insets getBorderInsets(Component c);
 
@@ -85,6 +89,8 @@
      * Returns whether or not the border is opaque.  If the border
      * is opaque, it is responsible for filling in it's own
      * background when painting.
+     *
+     * @return true if this {@code Border} is opaque
      */
     boolean isBorderOpaque();
 }
--- a/jdk/src/share/classes/javax/swing/border/CompoundBorder.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/javax/swing/border/CompoundBorder.java	Mon Jun 02 13:53:52 2014 -0700
@@ -155,6 +155,8 @@
 
     /**
      * Returns the outside border object.
+     *
+     * @return the outside {@code Border} object
      */
     public Border getOutsideBorder() {
         return outsideBorder;
@@ -162,6 +164,8 @@
 
     /**
      * Returns the inside border object.
+     *
+     * @return the inside {@code Border} object
      */
     public Border getInsideBorder() {
         return insideBorder;
--- a/jdk/src/share/classes/javax/swing/border/EmptyBorder.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/javax/swing/border/EmptyBorder.java	Mon Jun 02 13:53:52 2014 -0700
@@ -98,6 +98,9 @@
 
     /**
      * Returns the insets of the border.
+     *
+     * @return an {@code Insets} object containing the insets from top, left,
+     *         bottom and right
      * @since 1.3
      */
     public Insets getBorderInsets() {
--- a/jdk/src/share/classes/javax/swing/border/EtchedBorder.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/javax/swing/border/EtchedBorder.java	Mon Jun 02 13:53:52 2014 -0700
@@ -77,6 +77,7 @@
      * whose colors will be derived
      * from the background color of the component passed into
      * the paintBorder method.
+     *
      * @param etchType the type of etch to be drawn by the border
      */
     public EtchedBorder(int etchType)    {
@@ -86,6 +87,7 @@
     /**
      * Creates a lowered etched border with the specified highlight and
      * shadow colors.
+     *
      * @param highlight the color to use for the etched highlight
      * @param shadow the color to use for the etched shadow
      */
@@ -96,6 +98,7 @@
     /**
      * Creates an etched border with the specified etch-type,
      * highlight and shadow colors.
+     *
      * @param etchType the type of etch to be drawn by the border
      * @param highlight the color to use for the etched highlight
      * @param shadow the color to use for the etched shadow
@@ -110,6 +113,7 @@
     /**
      * Paints the border for the specified component with the
      * specified position and size.
+     *
      * @param c the component for which this border is being painted
      * @param g the paint graphics
      * @param x the x position of the painted border
@@ -138,6 +142,7 @@
 
     /**
      * Reinitialize the insets parameter with this Border's current Insets.
+     *
      * @param c the component for which this border insets value applies
      * @param insets the object to be reinitialized
      */
@@ -148,11 +153,16 @@
 
     /**
      * Returns whether or not the border is opaque.
+     * This implementation returns true.
+     *
+     * @return true
      */
     public boolean isBorderOpaque() { return true; }
 
     /**
      * Returns which etch-type is set on the etched border.
+     *
+     * @return the etched border type, either {@code RAISED} or {@code LOWERED}
      */
     public int getEtchType() {
         return etchType;
@@ -163,7 +173,9 @@
      * when rendered on the specified component.  If no highlight
      * color was specified at instantiation, the highlight color
      * is derived from the specified component's background color.
+     *
      * @param c the component for which the highlight may be derived
+     * @return the highlight {@code Color} of this {@code EtchedBorder}
      * @since 1.3
      */
     public Color getHighlightColor(Component c)   {
@@ -175,6 +187,9 @@
      * Returns the highlight color of the etched border.
      * Will return null if no highlight color was specified
      * at instantiation.
+     *
+     * @return the highlight {@code Color} of this {@code EtchedBorder} or null
+     *         if none was specified
      * @since 1.3
      */
     public Color getHighlightColor()   {
@@ -186,7 +201,9 @@
      * when rendered on the specified component.  If no shadow
      * color was specified at instantiation, the shadow color
      * is derived from the specified component's background color.
+     *
      * @param c the component for which the shadow may be derived
+     * @return the shadow {@code Color} of this {@code EtchedBorder}
      * @since 1.3
      */
     public Color getShadowColor(Component c)   {
@@ -197,6 +214,9 @@
      * Returns the shadow color of the etched border.
      * Will return null if no shadow color was specified
      * at instantiation.
+     *
+     * @return the shadow {@code Color} of this {@code EtchedBorder} or null
+     *         if none was specified
      * @since 1.3
      */
     public Color getShadowColor()   {
--- a/jdk/src/share/classes/javax/swing/border/LineBorder.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/javax/swing/border/LineBorder.java	Mon Jun 02 13:53:52 2014 -0700
@@ -60,8 +60,11 @@
     protected Color lineColor;
     protected boolean roundedCorners;
 
-    /** Convenience method for getting the Color.black LineBorder of thickness 1.
-      */
+    /**
+     * Convenience method for getting the Color.black LineBorder of thickness 1.
+     *
+     * @return a {@code LineBorder} with {@code Color.black} and thickness of 1
+     */
     public static Border createBlackLineBorder() {
         if (blackLine == null) {
             blackLine = new LineBorder(Color.black, 1);
@@ -69,8 +72,11 @@
         return blackLine;
     }
 
-    /** Convenience method for getting the Color.gray LineBorder of thickness 1.
-      */
+    /**
+     * Convenience method for getting the Color.gray LineBorder of thickness 1.
+     *
+     * @return a {@code LineBorder} with {@code Color.gray} and thickness of 1
+     */
     public static Border createGrayLineBorder() {
         if (grayLine == null) {
             grayLine = new LineBorder(Color.gray, 1);
@@ -81,6 +87,7 @@
     /**
      * Creates a line border with the specified color and a
      * thickness = 1.
+     *
      * @param color the color for the border
      */
     public LineBorder(Color color) {
@@ -89,6 +96,7 @@
 
     /**
      * Creates a line border with the specified color and thickness.
+     *
      * @param color the color of the border
      * @param thickness the thickness of the border
      */
@@ -99,6 +107,7 @@
     /**
      * Creates a line border with the specified color, thickness,
      * and corner shape.
+     *
      * @param color the color of the border
      * @param thickness the thickness of the border
      * @param roundedCorners whether or not border corners should be round
@@ -114,6 +123,7 @@
     /**
      * Paints the border for the specified component with the
      * specified position and size.
+     *
      * @param c the component for which this border is being painted
      * @param g the paint graphics
      * @param x the x position of the painted border
@@ -134,8 +144,8 @@
             int offs = this.thickness;
             int size = offs + offs;
             if (this.roundedCorners) {
-                int arc = offs + size;
-                outer = new RoundRectangle2D.Float(x, y, width, height, arc, arc);
+                float arc = .2f * offs;
+                outer = new RoundRectangle2D.Float(x, y, width, height, offs, offs);
                 inner = new RoundRectangle2D.Float(x + offs, y + offs, width - size, height - size, arc, arc);
             }
             else {
@@ -152,6 +162,7 @@
 
     /**
      * Reinitialize the insets parameter with this Border's current Insets.
+     *
      * @param c the component for which this border insets value applies
      * @param insets the object to be reinitialized
      */
@@ -162,6 +173,8 @@
 
     /**
      * Returns the color of the border.
+     *
+     * @return a {@code Color} object representing the color of this object
      */
     public Color getLineColor()     {
         return lineColor;
@@ -169,6 +182,8 @@
 
     /**
      * Returns the thickness of the border.
+     *
+     * @return the thickness of this border
      */
     public int getThickness()       {
         return thickness;
@@ -176,6 +191,8 @@
 
     /**
      * Returns whether this border will be drawn with rounded corners.
+     *
+     * @return {@code true} if this border should have rounded corners
      * @since 1.3
      */
     public boolean getRoundedCorners() {
@@ -184,6 +201,8 @@
 
     /**
      * Returns whether or not the border is opaque.
+     *
+     * @return {@code true} if the border is opaque, {@code false} otherwise
      */
     public boolean isBorderOpaque() {
         return !roundedCorners;
--- a/jdk/src/share/classes/javax/swing/border/MatteBorder.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/javax/swing/border/MatteBorder.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -196,6 +196,9 @@
     /**
      * Returns the color used for tiling the border or null
      * if a tile icon is being used.
+     *
+     * @return the {@code Color} object used to render the border or {@code null}
+     *         if a tile icon is used
      * @since 1.3
      */
     public Color getMatteColor() {
@@ -205,6 +208,9 @@
    /**
      * Returns the icon used for tiling the border or null
      * if a solid color is being used.
+     *
+     * @return the {@code Icon} used to tile the border or {@code null} if a
+     *         solid color is used to fill the border
      * @since 1.3
      */
     public Icon getTileIcon() {
@@ -213,6 +219,8 @@
 
     /**
      * Returns whether or not the border is opaque.
+     *
+     * @return {@code true} if the border is opaque, {@code false} otherwise
      */
     public boolean isBorderOpaque() {
         // If a tileIcon is set, then it may contain transparent bits
--- a/jdk/src/share/classes/javax/swing/colorchooser/AbstractColorChooserPanel.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/javax/swing/colorchooser/AbstractColorChooserPanel.java	Mon Jun 02 13:53:52 2014 -0700
@@ -145,7 +145,8 @@
     /**
      * Invoked when the panel is added to the chooser.
      * If you override this, be sure to call <code>super</code>.
-     * @param enclosingChooser  the panel to be added
+     *
+     * @param enclosingChooser the chooser to which the panel is to be added
      * @exception RuntimeException  if the chooser panel has already been
      *                          installed
      */
@@ -163,6 +164,8 @@
     /**
      * Invoked when the panel is removed from the chooser.
      * If override this, be sure to call <code>super</code>.
+     *
+     * @param enclosingChooser the chooser from which the panel is to be removed
      */
   public void uninstallChooserPanel(JColorChooser enclosingChooser) {
         chooser.removePropertyChangeListener("enabled", enabledListener);
--- a/jdk/src/share/classes/javax/swing/filechooser/FileFilter.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/javax/swing/filechooser/FileFilter.java	Mon Jun 02 13:53:52 2014 -0700
@@ -51,11 +51,16 @@
 public abstract class FileFilter {
     /**
      * Whether the given file is accepted by this filter.
+     *
+     * @param f the File to test
+     * @return true if the file is to be accepted
      */
     public abstract boolean accept(File f);
 
     /**
      * The description of this filter. For example: "JPG and GIF Images"
+     *
+     * @return the description of this filter
      * @see FileView#getName
      */
     public abstract String getDescription();
--- a/jdk/src/share/classes/javax/swing/filechooser/FileSystemView.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/javax/swing/filechooser/FileSystemView.java	Mon Jun 02 13:53:52 2014 -0700
@@ -324,11 +324,18 @@
 
     /**
      * Creates a new folder with a default folder name.
+     *
+     * @param containingDir a {@code File} object denoting directory to contain the new folder
+     * @return a {@code File} object denoting the newly created folder
+     * @throws IOException if new folder could not be created
      */
     public abstract File createNewFolder(File containingDir) throws IOException;
 
     /**
      * Returns whether a file is hidden or not.
+     *
+     * @param f a {@code File} object
+     * @return true if the given {@code File} denotes a hidden file
      */
     public boolean isHiddenFile(File f) {
         return f.isHidden();
@@ -395,6 +402,9 @@
      * Returns all root partitions on this system. For example, on
      * Windows, this would be the "Desktop" folder, while on DOS this
      * would be the A: through Z: drives.
+     *
+     * @return an array of {@code File} objects representing all root partitions
+     *         on this system
      */
     public File[] getRoots() {
         // Don't cache this array, because filesystem might change
@@ -435,6 +445,10 @@
 
     /**
      * Returns a File object constructed in dir from the given filename.
+     *
+     * @param dir an abstract pathname denoting a directory
+     * @param filename a {@code String} representation of a pathname
+     * @return a {@code File} object created from {@code dir} and {@code filename}
      */
     public File createFileObject(File dir, String filename) {
         if(dir == null) {
@@ -446,6 +460,9 @@
 
     /**
      * Returns a File object constructed from the given path string.
+     *
+     * @param path {@code String} representation of path
+     * @return a {@code File} object created from the given {@code path}
      */
     public File createFileObject(String path) {
         File f = new File(path);
@@ -458,6 +475,12 @@
 
     /**
      * Gets the list of shown (i.e. not hidden) files.
+     *
+     * @param dir the root directory of files to be returned
+     * @param useFileHiding determine if hidden files are returned
+     * @return an array of {@code File} objects representing files and
+     *         directories in the given {@code dir}. It includes hidden
+     *         files if {@code useFileHiding} is false.
      */
     public File[] getFiles(File dir, boolean useFileHiding) {
         List<File> files = new ArrayList<File>();
--- a/jdk/src/share/classes/javax/swing/filechooser/FileView.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/javax/swing/filechooser/FileView.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -69,6 +69,9 @@
     /**
      * The name of the file. Normally this would be simply
      * <code>f.getName()</code>.
+     *
+     * @param f a {@code File} object
+     * @return a {@code String} representing the name of the file
      */
     public String getName(File f) {
         return null;
@@ -78,6 +81,11 @@
      * A human readable description of the file. For example,
      * a file named <i>jag.jpg</i> might have a description that read:
      * "A JPEG image file of James Gosling's face".
+     *
+     * @param f a {@code File} object
+     * @return a {@code String} containing a description of the file or
+     *         {@code null} if it is not available.
+     *
      */
     public String getDescription(File f) {
         return null;
@@ -87,6 +95,10 @@
      * A human readable description of the type of the file. For
      * example, a <code>jpg</code> file might have a type description of:
      * "A JPEG Compressed Image File"
+     *
+     * @param f a {@code File} object
+     * @return a {@code String} containing a description of the type of the file
+     *         or {@code null} if it is not available   .
      */
     public String getTypeDescription(File f) {
         return null;
@@ -94,6 +106,10 @@
 
     /**
      * The icon that represents this file in the <code>JFileChooser</code>.
+     *
+     * @param f a {@code File} object
+     * @return an {@code Icon} which represents the specified {@code File} or
+     *         {@code null} if it is not available.
      */
     public Icon getIcon(File f) {
         return null;
@@ -103,6 +119,12 @@
      * Whether the directory is traversable or not. This might be
      * useful, for example, if you want a directory to represent
      * a compound document and don't want the user to descend into it.
+     *
+     * @param f a {@code File} object representing a directory
+     * @return {@code true} if the directory is traversable,
+     *         {@code false} if it is not, and {@code null} if the
+     *         file system should be checked.
+     * @see FileSystemView#isTraversable
      */
     public Boolean isTraversable(File f) {
         return null;
--- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java	Mon Jun 02 13:53:52 2014 -0700
@@ -2271,6 +2271,7 @@
 
     // From the JLF Design Guidelines:
     // http://www.oracle.com/technetwork/java/jlf-135985.html
+    @SuppressWarnings("fallthrough")
     private static class MetalLayoutStyle extends DefaultLayoutStyle {
         private static MetalLayoutStyle INSTANCE = new MetalLayoutStyle();
 
@@ -2407,4 +2408,4 @@
             return 0;
         }
     }
-}
\ No newline at end of file
+}
--- a/jdk/src/share/classes/javax/swing/plaf/nimbus/skin.laf	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/skin.laf	Mon Jun 02 13:53:52 2014 -0700
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
 <!--
- Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 
  This code is free software; you can redistribute it and/or modify it
@@ -13424,10 +13424,10 @@
             <state stateKeys="Selected">
                 <style>
                    <textForeground>
-                      <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0" uiResource="false"/>
+                      <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
                    </textForeground>
                    <textBackground>
-                      <matte red="57" green="105" blue="138" alpha="255" uiDefaultParentName="nimbusSelectionBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0" uiResource="false"/>
+                      <matte red="57" green="105" blue="138" alpha="255" uiDefaultParentName="nimbusSelectionBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
                    </textBackground>
                    <background/>
                    <inherit-textForeground>false</inherit-textForeground>
@@ -13453,7 +13453,7 @@
                 <style>
                    <textForeground/>
                    <textBackground>
-                       <matte red="57" green="105" blue="138" alpha="255" uiDefaultParentName="nimbusSelectionBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0" uiResource="false"/>
+                       <matte red="57" green="105" blue="138" alpha="255" uiDefaultParentName="nimbusSelectionBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
                    </textBackground>
                    <background/>
                    <inherit-textBackground>false</inherit-textBackground>
@@ -13477,7 +13477,7 @@
             <state stateKeys="Disabled">
                 <style>
                    <textForeground>
-                      <matte red="142" green="143" blue="145" alpha="255" uiDefaultParentName="nimbusDisabledText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0" uiResource="false"/>
+                      <matte red="142" green="143" blue="145" alpha="255" uiDefaultParentName="nimbusDisabledText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
                    </textForeground>
                    <textBackground/>
                    <background/>
@@ -13520,7 +13520,7 @@
                         </textForeground>
                         <textBackground/>
                         <background>
-                           <matte red="57" green="105" blue="138" alpha="255" uiDefaultParentName="nimbusSelectionBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0" uiResource="false"/>
+                           <matte red="57" green="105" blue="138" alpha="255" uiDefaultParentName="nimbusSelectionBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
                         </background>
                         <inherit-textForeground>false</inherit-textForeground>
                         <inherit-background>false</inherit-background>
--- a/jdk/src/share/classes/javax/swing/text/JTextComponent.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/javax/swing/text/JTextComponent.java	Mon Jun 02 13:53:52 2014 -0700
@@ -4473,6 +4473,7 @@
     // composed(uncommitted) text is done here after all input
     // method listeners get called for stealing the events.
     //
+    @SuppressWarnings("fallthrough")
     protected void processInputMethodEvent(InputMethodEvent e) {
         // let listeners handle the events
         super.processInputMethodEvent(e);
--- a/jdk/src/share/classes/javax/swing/text/html/StyleSheet.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/javax/swing/text/html/StyleSheet.java	Mon Jun 02 13:53:52 2014 -0700
@@ -2324,6 +2324,7 @@
          * @param itemNum number to format
          * @param type    type of ordered list
          */
+        @SuppressWarnings("fallthrough")
         String formatItemNum(int itemNum, char type) {
             String numStyle = "1";
 
--- a/jdk/src/share/classes/javax/swing/text/html/parser/AttributeList.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/javax/swing/text/html/parser/AttributeList.java	Mon Jun 02 13:53:52 2014 -0700
@@ -59,6 +59,8 @@
 
     /**
      * Create an attribute list element.
+     *
+     * @param name  the attribute name
      */
     public AttributeList(String name) {
         this.name = name;
@@ -66,6 +68,13 @@
 
     /**
      * Create an attribute list element.
+     *
+     * @param name      the attribute name
+     * @param type      the attribute type
+     * @param modifier  the attribute modifier
+     * @param value     the default attribute value
+     * @param values    the possible attribute values
+     * @param next      the next attribute in the list
      */
     public AttributeList(String name, int type, int modifier, String value, Vector<?> values, AttributeList next) {
         this.name = name;
--- a/jdk/src/share/classes/javax/swing/text/html/parser/ContentModel.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/javax/swing/text/html/parser/ContentModel.java	Mon Jun 02 13:53:52 2014 -0700
@@ -62,6 +62,8 @@
 
     /**
      * Create a content model for an element.
+     *
+     * @param content  the element
      */
     public ContentModel(Element content) {
         this(0, content, null);
@@ -69,6 +71,9 @@
 
     /**
      * Create a content model of a particular type.
+     *
+     * @param type     the type
+     * @param content  the content
      */
     public ContentModel(int type, ContentModel content) {
         this(type, content, null);
@@ -76,6 +81,10 @@
 
     /**
      * Create a content model of a particular type.
+     *
+     * @param type     the type
+     * @param content  the content
+     * @param next     the next content model
      */
     public ContentModel(int type, Object content, ContentModel next) {
         this.type = type;
@@ -86,6 +95,9 @@
     /**
      * Return true if the content model could
      * match an empty input stream.
+     *
+     * @return {@code true} if the content model could
+     *         match an empty input stream
      */
     public boolean empty() {
         switch (type) {
@@ -119,6 +131,8 @@
     /**
      * Update elemVec with the list of elements that are
      * part of the this contentModel.
+     *
+     * @param elemVec  the list of elements
      */
      public void getElements(Vector<Element> elemVec) {
          switch (type) {
@@ -148,6 +162,11 @@
     /**
      * Return true if the token could potentially be the
      * first token in the input stream.
+     *
+     * @param token  the token
+     *
+     * @return {@code true} if the token could potentially be the first token
+     *         in the input stream
      */
     public boolean first(Object token) {
         switch (type) {
@@ -206,6 +225,8 @@
 
     /**
      * Return the element that must be next.
+     *
+     * @return the element that must be next
      */
     public Element first() {
         switch (type) {
@@ -226,6 +247,8 @@
 
     /**
      * Convert to a string.
+     *
+     * @return the string representation of this {@code ContentModel}
      */
     public String toString() {
         switch (type) {
--- a/jdk/src/share/classes/javax/swing/text/html/parser/ContentModelState.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/javax/swing/text/html/parser/ContentModelState.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -92,12 +92,14 @@
      * tokens required in the input stream.
      * @return true if the model can terminate without further input
      */
+    @SuppressWarnings("fallthrough")
     public boolean terminate() {
         switch (model.type) {
           case '+':
             if ((value == 0) && !(model).empty()) {
                 return false;
             }
+            // Fall through
           case '*':
           case '?':
             return (next == null) || next.terminate();
--- a/jdk/src/share/classes/javax/swing/text/html/parser/DTD.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/javax/swing/text/html/parser/DTD.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -102,6 +102,7 @@
 
     /**
      * Gets an entity by name.
+     * @param name  the entity name
      * @return the <code>Entity</code> corresponding to the
      *   <code>name</code> <code>String</code>
      */
@@ -111,6 +112,7 @@
 
     /**
      * Gets a character entity.
+     * @param ch  the character
      * @return the <code>Entity</code> corresponding to the
      *    <code>ch</code> character
      */
@@ -193,13 +195,15 @@
      * specified parameters.  If one doesn't exist, a new
      * one is created and returned.
      *
-     * @param name the name of the <code>Element</code>
-     * @param type the type of the <code>Element</code>
-     * @param omitStart <code>true</code> if start should be omitted
-     * @param omitEnd  <code>true</code> if end should be omitted
-     * @param content  the <code>ContentModel</code>
-     * @param atts the <code>AttributeList</code> specifying the
-     *    <code>Element</code>
+     * @param name        the name of the <code>Element</code>
+     * @param type        the type of the <code>Element</code>
+     * @param omitStart   <code>true</code> if start should be omitted
+     * @param omitEnd     <code>true</code> if end should be omitted
+     * @param content     the <code>ContentModel</code>
+     * @param exclusions  the set of elements that must not occur inside the element
+     * @param inclusions  the set of elements that can occur inside the element
+     * @param atts        the <code>AttributeList</code> specifying the
+     *                    <code>Element</code>
      * @return the <code>Element</code> specified
      */
     public Element defineElement(String name, int type,
@@ -231,6 +235,8 @@
     /**
      * Creates and returns a character <code>Entity</code>.
      * @param name the entity's name
+     * @param type the entity's type
+     * @param ch   the entity's value (character)
      * @return the new character <code>Entity</code>
      */
     public Entity defEntity(String name, int type, int ch) {
@@ -241,6 +247,8 @@
     /**
      * Creates and returns an <code>Entity</code>.
      * @param name the entity's name
+     * @param type the entity's type
+     * @param str  the entity's data section
      * @return the new <code>Entity</code>
      */
     protected Entity defEntity(String name, int type, String str) {
@@ -252,7 +260,14 @@
 
     /**
      * Creates and returns an <code>Element</code>.
-     * @param name the element's name
+     * @param name        the element's name
+     * @param type        the element's type
+     * @param omitStart   {@code true} if the element needs no starting tag
+     * @param omitEnd     {@code true} if the element needs no closing tag
+     * @param content     the element's content
+     * @param exclusions  the elements that must be excluded from the content of the element
+     * @param inclusions  the elements that can be included as the content of the element
+     * @param atts        the attributes of the element
      * @return the new <code>Element</code>
      */
     protected Element defElement(String name, int type,
@@ -280,11 +295,18 @@
     }
 
     /**
-     * Creates and returns an <code>AttributeList</code>.
-     * @param name the attribute list's name
+     * Creates and returns an <code>AttributeList</code> responding to a new attribute.
+     * @param name      the attribute's name
+     * @param type      the attribute's type
+     * @param modifier  the attribute's modifier
+     * @param value     the default value of the attribute
+     * @param values    the allowed values for the attribute (multiple values could be separated by '|')
+     * @param atts      the previous attribute of the element; to be placed to {@code AttributeList.next},
+     *                  creating a linked list
      * @return the new <code>AttributeList</code>
      */
-    protected AttributeList defAttributeList(String name, int type, int modifier, String value, String values, AttributeList atts) {
+    protected AttributeList defAttributeList(String name, int type, int modifier,
+                                             String value, String values, AttributeList atts) {
         Vector<String> vals = null;
         if (values != null) {
             vals = new Vector<String>();
@@ -301,6 +323,8 @@
     /**
      * Creates and returns a new content model.
      * @param type the type of the new content model
+     * @param obj  the content of the content model
+     * @param next pointer to the next content model
      * @return the new <code>ContentModel</code>
      */
     protected ContentModel defContentModel(int type, Object obj, ContentModel next) {
@@ -332,6 +356,7 @@
      *
      * @param name the name of the DTD
      * @return the DTD which corresponds to <code>name</code>
+     * @throws IOException if an I/O error occurs
      */
     public static DTD getDTD(String name) throws IOException {
         name = name.toLowerCase();
@@ -359,6 +384,7 @@
     /**
      * Recreates a DTD from an archived format.
      * @param in  the <code>DataInputStream</code> to read from
+     * @throws IOException if an I/O error occurs
      */
     public void read(DataInputStream in) throws IOException {
         if (in.readInt() != FILE_VERSION) {
--- a/jdk/src/share/classes/javax/swing/text/html/parser/Element.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/javax/swing/text/html/parser/Element.java	Mon Jun 02 13:53:52 2014 -0700
@@ -64,6 +64,9 @@
 
     /**
      * Create a new element.
+     *
+     * @param name   the name of the element
+     * @param index  the index
      */
     Element(String name, int index) {
         this.name = name;
@@ -84,6 +87,8 @@
 
     /**
      * Get the name of the element.
+     *
+     * @return  the name of the element
      */
     public String getName() {
         return name;
@@ -91,6 +96,8 @@
 
     /**
      * Return true if the start tag can be omitted.
+     *
+     * @return  {@code true} if the start tag can be omitted
      */
     public boolean omitStart() {
         return oStart;
@@ -98,6 +105,8 @@
 
     /**
      * Return true if the end tag can be omitted.
+     *
+     * @return  {@code true} if the end tag can be omitted
      */
     public boolean omitEnd() {
         return oEnd;
@@ -105,6 +114,8 @@
 
     /**
      * Get type.
+     *
+     * @return  the type of the element
      */
     public int getType() {
         return type;
@@ -112,6 +123,8 @@
 
     /**
      * Get content model
+     *
+     * @return  the content model
      */
     public ContentModel getContent() {
         return content;
@@ -119,6 +132,8 @@
 
     /**
      * Get the attributes.
+     *
+     * @return  the {@code AttributeList} specifying the element
      */
     public AttributeList getAttributes() {
         return atts;
@@ -126,6 +141,8 @@
 
     /**
      * Get index.
+     *
+     * @return the element index
      */
     public int getIndex() {
         return index;
@@ -133,6 +150,8 @@
 
     /**
      * Check if empty
+     *
+     * @return  true if the current element is empty
      */
     public boolean isEmpty() {
         return type == EMPTY;
@@ -140,6 +159,8 @@
 
     /**
      * Convert to a string.
+     *
+     * @return  a string representation for the given {@code Element} instance
      */
     public String toString() {
         return name;
@@ -147,6 +168,10 @@
 
     /**
      * Get an attribute by name.
+     *
+     * @param name  the attribute name
+     *
+     * @return the {@code AttributeList} for the given {@code name}
      */
     public AttributeList getAttribute(String name) {
         for (AttributeList a = atts ; a != null ; a = a.next) {
@@ -159,10 +184,14 @@
 
     /**
      * Get an attribute by value.
+     *
+     * @param value  the string representation of value
+     *
+     * @return  the {@code AttributeList} for the given {@code value}
      */
-    public AttributeList getAttributeByValue(String name) {
+    public AttributeList getAttributeByValue(String value) {
         for (AttributeList a = atts ; a != null ; a = a.next) {
-            if ((a.values != null) && a.values.contains(name)) {
+            if ((a.values != null) && a.values.contains(value)) {
                 return a;
             }
         }
--- a/jdk/src/share/classes/javax/swing/text/html/parser/Parser.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/javax/swing/text/html/parser/Parser.java	Mon Jun 02 13:53:52 2014 -0700
@@ -216,6 +216,8 @@
      * the current comment tag, text, block.... This is provided for
      * subclassers that wish to know the start of the current block when
      * called with one of the handleXXX methods.
+     *
+     * @return the start position of the current block
      */
     int getBlockStartPosition() {
         return Math.max(0, lastBlockStartPos - 1);
@@ -223,31 +225,55 @@
 
     /**
      * Makes a TagElement.
+     *
+     * @param elem       the element storing the tag definition
+     * @param fictional  the value of the flag "{@code fictional}" to be set for the tag
+     *
+     * @return the created {@code TagElement}
      */
     protected TagElement makeTag(Element elem, boolean fictional) {
         return new TagElement(elem, fictional);
     }
 
+    /**
+     * Makes a TagElement.
+     *
+     * @param elem  the element storing the tag definition
+     *
+     * @return the created {@code TagElement}
+     */
     protected TagElement makeTag(Element elem) {
         return makeTag(elem, false);
     }
 
+    /**
+     * Returns attributes for the current tag.
+     *
+     * @return {@code SimpleAttributeSet} containing the attributes
+     */
     protected SimpleAttributeSet getAttributes() {
         return attributes;
     }
 
+    /**
+     * Removes the current attributes.
+     */
     protected void flushAttributes() {
         attributes.removeAttributes(attributes);
     }
 
     /**
      * Called when PCDATA is encountered.
+     *
+     * @param text  the section text
      */
     protected void handleText(char text[]) {
     }
 
     /**
      * Called when an HTML title tag is encountered.
+     *
+     * @param text  the title text
      */
     protected void handleTitle(char text[]) {
         // default behavior is to call handleText. Subclasses
@@ -257,10 +283,15 @@
 
     /**
      * Called when an HTML comment is encountered.
+     *
+     * @param text  the comment being handled
      */
     protected void handleComment(char text[]) {
     }
 
+    /**
+     * Called when the content terminates without closing the HTML comment.
+     */
     protected void handleEOFInComment() {
         // We've reached EOF.  Our recovery strategy is to
         // see if we have more than one line in the comment;
@@ -288,24 +319,34 @@
 
     /**
      * Called when an empty tag is encountered.
+     *
+     * @param tag  the tag being handled
+     * @throws ChangedCharSetException if the document charset was changed
      */
     protected void handleEmptyTag(TagElement tag) throws ChangedCharSetException {
     }
 
     /**
      * Called when a start tag is encountered.
+     *
+     * @param tag  the tag being handled
      */
     protected void handleStartTag(TagElement tag) {
     }
 
     /**
      * Called when an end tag is encountered.
+     *
+     * @param tag  the tag being handled
      */
     protected void handleEndTag(TagElement tag) {
     }
 
     /**
      * An error has occurred.
+     *
+     * @param ln   the number of line containing the error
+     * @param msg  the error message
      */
     protected void handleError(int ln, String msg) {
         /*
@@ -368,7 +409,12 @@
     }
 
     /**
-     * Invoke the error handler.
+     * Invokes the error handler.
+     *
+     * @param err   the error type
+     * @param arg1  the 1st error message argument
+     * @param arg2  the 2nd error message argument
+     * @param arg3  the 3rd error message argument
      */
     protected void error(String err, String arg1, String arg2,
         String arg3) {
@@ -390,6 +436,9 @@
      * Handle a start tag. The new tag is pushed
      * onto the tag stack. The attribute list is
      * checked for required attributes.
+     *
+     * @param tag  the tag
+     * @throws ChangedCharSetException if the document charset was changed
      */
     protected void startTag(TagElement tag) throws ChangedCharSetException {
         Element elem = tag.getElement();
@@ -441,6 +490,9 @@
     /**
      * Handle an end tag. The end tag is popped
      * from the tag stack.
+     *
+     * @param omitted  {@code true} if the tag is no actually present in the
+     *                 document, but is supposed by the parser
      */
     protected void endTag(boolean omitted) {
         handleText(stack.tag);
@@ -498,6 +550,8 @@
 
     /**
      * Marks the first time a tag has been seen in a document
+     *
+     * @param elem  the element represented by the tag
      */
 
     protected void markFirstTime(Element elem) {
@@ -852,6 +906,7 @@
             if (lower) {
                 ch = 'a' + (ch - 'A');
             }
+            break;
 
           case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
           case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
@@ -876,6 +931,7 @@
                 if (lower) {
                     ch = 'a' + (ch - 'A');
                 }
+                break;
 
               case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
               case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
@@ -1214,6 +1270,7 @@
     /**
      * Parse attribute value. [33] 331:1
      */
+    @SuppressWarnings("fallthrough")
     String parseAttributeValue(boolean lower) throws IOException {
         int delim = -1;
 
@@ -1258,6 +1315,7 @@
               case '\t':
                   if (delim < 0)
                       c = ' ';
+                  // Fall through
               case ' ':
                 ch = readCh();
                 if (delim < 0) {
@@ -1478,8 +1536,11 @@
     }
 
     /**
-     * Parses th Document Declaration Type markup declaration.
+     * Parses the Document Type Declaration markup declaration.
      * Currently ignores it.
+     *
+     * @return the string representation of the markup declaration
+     * @throws IOException if an I/O error occurs
      */
     public String parseDTDMarkup() throws IOException {
 
@@ -1523,6 +1584,11 @@
      * Parse markup declarations.
      * Currently only handles the Document Type Declaration markup.
      * Returns true if it is a markup declaration false otherwise.
+     *
+     * @param strBuff  the markup declaration
+     * @return {@code true} if this is a valid markup declaration;
+     *         otherwise {@code false}
+     * @throws IOException if an I/O error occurs
      */
     protected boolean parseMarkupDeclarations(StringBuffer strBuff) throws IOException {
 
@@ -1559,6 +1625,7 @@
     /**
      * Parse a start or end tag.
      */
+    @SuppressWarnings("fallthrough")
     void parseTag() throws IOException {
         Element elem;
         boolean net = false;
@@ -1602,6 +1669,7 @@
                         continue;
                       case '>':
                         ch = readCh();
+                        return;
                       case -1:
                         return;
                       default:
@@ -1626,6 +1694,7 @@
                     switch(ch) {
                       case '>':
                         ch = readCh();
+                        // Fall through
                       case -1:
                         error("invalid.markup");
                         return;
@@ -1657,6 +1726,7 @@
             switch (ch = readCh()) {
               case '>':
                 ch = readCh();
+                // Fall through
               case '<':
                 // empty end tag. either </> or </<
                 if (recent == null) {
@@ -1675,6 +1745,7 @@
                 switch (ch) {
                   case '>':
                     ch = readCh();
+                    break;
                   case '<':
                     break;
 
@@ -1875,6 +1946,7 @@
         switch (ch) {
           case '/':
             net = true;
+            // Fall through
           case '>':
             ch = readCh();
             if (ch == '>' && net) {
@@ -2236,6 +2308,9 @@
 
     /**
      * Parse an HTML stream, given a DTD.
+     *
+     * @param in  the reader to read the source from
+     * @throws IOException if an I/O error occurs
      */
     public synchronized void parse(Reader in) throws IOException {
         this.in = in;
--- a/jdk/src/share/classes/javax/swing/text/rtf/RTFGenerator.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/javax/swing/text/rtf/RTFGenerator.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -868,6 +868,7 @@
     afterKeyword = false;
 }
 
+@SuppressWarnings("fallthrough")
 public void writeCharacter(char ch)
     throws IOException
 {
--- a/jdk/src/share/classes/javax/swing/text/rtf/RTFParser.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/javax/swing/text/rtf/RTFParser.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -148,6 +148,7 @@
       handleText(s);
   }
 
+  @SuppressWarnings("fallthrough")
   public void write(char ch)
     throws IOException
   {
--- a/jdk/src/share/classes/javax/swing/tree/AbstractLayoutCache.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/javax/swing/tree/AbstractLayoutCache.java	Mon Jun 02 13:53:52 2014 -0700
@@ -149,6 +149,8 @@
      * Returns the height of each row.  If the returned value is less than
      * or equal to 0 the height for each row is determined by the
      * renderer.
+     *
+     * @return the height of each row
      */
     public int getRowHeight() {
         return rowHeight;
@@ -263,6 +265,9 @@
 
     /**
       * Returns true if the value identified by row is currently expanded.
+      *
+      * @param path TreePath to check
+      * @return whether TreePath is expanded
       */
     public abstract boolean isExpanded(TreePath path);
 
@@ -496,6 +501,8 @@
 
     /**
       * Returns true if the height of each row is a fixed size.
+      *
+      * @return whether the height of each row is a fixed size
       */
     protected boolean isFixedRowHeight() {
         return (rowHeight > 0);
--- a/jdk/src/share/classes/javax/swing/tree/DefaultMutableTreeNode.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/javax/swing/tree/DefaultMutableTreeNode.java	Mon Jun 02 13:53:52 2014 -0700
@@ -534,6 +534,7 @@
      * Returns true if and only if <code>aNode</code> is in the same tree
      * as this node.  Returns false if <code>aNode</code> is null.
      *
+     * @param   aNode node to find common ancestor with
      * @see     #getSharedAncestor
      * @see     #getRoot
      * @return  true if <code>aNode</code> is in the same tree as this node;
@@ -638,6 +639,8 @@
       * Returns the user object path, from the root, to get to this node.
       * If some of the TreeNodes in the path have null user objects, the
       * returned path will contain nulls.
+      *
+      * @return the user object path, from the root, to get to this node
       */
     public Object[] getUserObjectPath() {
         TreeNode[]          realPath = getPath();
@@ -828,6 +831,7 @@
      * Modifying the tree by inserting, removing, or moving a node invalidates
      * any enumerations created before the modification.
      *
+     * @param           ancestor the node to start enumeration from
      * @see             #isNodeAncestor
      * @see             #isNodeDescendant
      * @exception       IllegalArgumentException if <code>ancestor</code> is
@@ -848,6 +852,7 @@
      * Returns true if <code>aNode</code> is a child of this node.  If
      * <code>aNode</code> is null, this method returns false.
      *
+     * @param   aNode the node to determinate whether it is a child
      * @return  true if <code>aNode</code> is a child of this node; false if
      *                  <code>aNode</code> is null
      */
@@ -906,6 +911,7 @@
      * <code>aChild</code> and is O(n) where n is the number of children; to
      * traverse the entire array of children, use an enumeration instead.
      *
+     * @param           aChild the child node to look for next child after it
      * @see             #children
      * @exception       IllegalArgumentException if <code>aChild</code> is
      *                                  null or is not a child of this node
@@ -938,6 +944,7 @@
      * performs a linear search of this node's children for <code>aChild</code>
      * and is O(n) where n is the number of children.
      *
+     * @param           aChild the child node to look for previous child before it
      * @exception       IllegalArgumentException if <code>aChild</code> is null
      *                                          or is not a child of this node
      * @return  the child of this node that immediately precedes
--- a/jdk/src/share/classes/javax/swing/tree/DefaultTreeCellEditor.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/javax/swing/tree/DefaultTreeCellEditor.java	Mon Jun 02 13:53:52 2014 -0700
@@ -405,7 +405,9 @@
     /**
      * Returns true if <code>event</code> is a <code>MouseEvent</code>
      * and the click count is 1.
-     * @param event  the event being studied
+     *
+     * @param event the event being studied
+     * @return whether {@code event} should starts the editing timer
      */
     protected boolean shouldStartEditingTimer(EventObject event) {
         if((event instanceof MouseEvent) &&
@@ -433,7 +435,9 @@
      * Returns true if <code>event</code> is <code>null</code>,
      * or it is a <code>MouseEvent</code> with a click count &gt; 2
      * and <code>inHitRegion</code> returns true.
+     *
      * @param event the event being studied
+     * @return whether editing can be started for the given {@code event}
      */
     protected boolean canEditImmediately(EventObject event) {
         if((event instanceof MouseEvent) &&
@@ -513,6 +517,8 @@
     /**
      * Creates the container to manage placement of
      * <code>editingComponent</code>.
+     *
+     * @return new Container object
      */
     protected Container createContainer() {
         return new EditorContainer();
--- a/jdk/src/share/classes/javax/swing/tree/DefaultTreeCellRenderer.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/javax/swing/tree/DefaultTreeCellRenderer.java	Mon Jun 02 13:53:52 2014 -0700
@@ -234,6 +234,9 @@
     /**
       * Returns the default icon, for the current laf, that is used to
       * represent non-leaf nodes that are expanded.
+      *
+      * @return the default icon, for the current laf, that is used to
+      *         represent non-leaf nodes that are expanded.
       */
     public Icon getDefaultOpenIcon() {
         return DefaultLookup.getIcon(this, ui, "Tree.openIcon");
@@ -242,6 +245,9 @@
     /**
       * Returns the default icon, for the current laf, that is used to
       * represent non-leaf nodes that are not expanded.
+      *
+      * @return the default icon, for the current laf, that is used to
+      *         represent non-leaf nodes that are not expanded.
       */
     public Icon getDefaultClosedIcon() {
         return DefaultLookup.getIcon(this, ui, "Tree.closedIcon");
@@ -250,6 +256,9 @@
     /**
       * Returns the default icon, for the current laf, that is used to
       * represent leaf nodes.
+      *
+      * @return the default icon, for the current laf, that is used to
+      *         represent leaf nodes.
       */
     public Icon getDefaultLeafIcon() {
         return DefaultLookup.getIcon(this, ui, "Tree.leafIcon");
@@ -257,6 +266,8 @@
 
     /**
       * Sets the icon used to represent non-leaf nodes that are expanded.
+      *
+      * @param newIcon the icon to be used for expanded non-leaf nodes
       */
     public void setOpenIcon(Icon newIcon) {
         openIcon = newIcon;
@@ -264,6 +275,8 @@
 
     /**
       * Returns the icon used to represent non-leaf nodes that are expanded.
+      *
+      * @return the icon used to represent non-leaf nodes that are expanded
       */
     public Icon getOpenIcon() {
         return openIcon;
@@ -271,6 +284,8 @@
 
     /**
       * Sets the icon used to represent non-leaf nodes that are not expanded.
+      *
+      * @param newIcon the icon to be used for not expanded non-leaf nodes
       */
     public void setClosedIcon(Icon newIcon) {
         closedIcon = newIcon;
@@ -279,6 +294,9 @@
     /**
       * Returns the icon used to represent non-leaf nodes that are not
       * expanded.
+      *
+      * @return the icon used to represent non-leaf nodes that are not
+      *         expanded
       */
     public Icon getClosedIcon() {
         return closedIcon;
@@ -286,6 +304,8 @@
 
     /**
       * Sets the icon used to represent leaf nodes.
+      *
+      * @param newIcon icon to be used for leaf nodes
       */
     public void setLeafIcon(Icon newIcon) {
         leafIcon = newIcon;
@@ -293,6 +313,8 @@
 
     /**
       * Returns the icon used to represent leaf nodes.
+      *
+      * @return the icon used to represent leaf nodes
       */
     public Icon getLeafIcon() {
         return leafIcon;
@@ -300,6 +322,8 @@
 
     /**
       * Sets the color the text is drawn with when the node is selected.
+      *
+      * @param newColor color to be used for text when the node is selected
       */
     public void setTextSelectionColor(Color newColor) {
         textSelectionColor = newColor;
@@ -307,6 +331,8 @@
 
     /**
       * Returns the color the text is drawn with when the node is selected.
+      *
+      * @return the color the text is drawn with when the node is selected
       */
     public Color getTextSelectionColor() {
         return textSelectionColor;
@@ -314,6 +340,8 @@
 
     /**
       * Sets the color the text is drawn with when the node isn't selected.
+      *
+      * @param newColor color to be used for text when the node isn't selected
       */
     public void setTextNonSelectionColor(Color newColor) {
         textNonSelectionColor = newColor;
@@ -321,6 +349,8 @@
 
     /**
       * Returns the color the text is drawn with when the node isn't selected.
+      *
+      * @return the color the text is drawn with when the node isn't selected.
       */
     public Color getTextNonSelectionColor() {
         return textNonSelectionColor;
@@ -328,6 +358,8 @@
 
     /**
       * Sets the color to use for the background if node is selected.
+      *
+      * @param newColor to be used for the background if the node is selected
       */
     public void setBackgroundSelectionColor(Color newColor) {
         backgroundSelectionColor = newColor;
@@ -336,6 +368,8 @@
 
     /**
       * Returns the color to use for the background if node is selected.
+      *
+      * @return the color to use for the background if node is selected
       */
     public Color getBackgroundSelectionColor() {
         return backgroundSelectionColor;
@@ -343,6 +377,8 @@
 
     /**
       * Sets the background color to be used for non selected nodes.
+      *
+      * @param newColor color to be used for the background for non selected nodes
       */
     public void setBackgroundNonSelectionColor(Color newColor) {
         backgroundNonSelectionColor = newColor;
@@ -350,6 +386,8 @@
 
     /**
       * Returns the background color to be used for non selected nodes.
+      *
+      * @return the background color to be used for non selected nodes.
       */
     public Color getBackgroundNonSelectionColor() {
         return backgroundNonSelectionColor;
@@ -357,6 +395,8 @@
 
     /**
       * Sets the color to use for the border.
+      *
+      * @param newColor color to be used for the border
       */
     public void setBorderSelectionColor(Color newColor) {
         borderSelectionColor = newColor;
@@ -364,6 +404,8 @@
 
     /**
       * Returns the color the border is drawn.
+      *
+      * @return the color the border is drawn
       */
     public Color getBorderSelectionColor() {
         return borderSelectionColor;
--- a/jdk/src/share/classes/javax/swing/tree/DefaultTreeModel.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/javax/swing/tree/DefaultTreeModel.java	Mon Jun 02 13:53:52 2014 -0700
@@ -105,6 +105,9 @@
       * Sets whether or not to test leafness by asking getAllowsChildren()
       * or isLeaf() to the TreeNodes.  If newvalue is true, getAllowsChildren()
       * is messaged, otherwise isLeaf() is messaged.
+      *
+      * @param newValue if true, getAllowsChildren() is messaged, otherwise
+      *                 isLeaf() is messaged
       */
     public void setAsksAllowsChildren(boolean newValue) {
         asksAllowsChildren = newValue;
@@ -125,6 +128,8 @@
     /**
      * Sets the root to <code>root</code>. A null <code>root</code> implies
      * the tree is to display nothing, and is legal.
+     *
+     * @param root new value of tree root
      */
     public void setRoot(TreeNode root) {
         Object oldRoot = this.root;
@@ -231,6 +236,10 @@
      * This will then message nodesWereInserted to create the appropriate
      * event. This is the preferred way to add children as it will create
      * the appropriate event.
+     *
+     * @param newChild  child node to be inserted
+     * @param parent    node to which children new node will be added
+     * @param index     index of parent's children
      */
     public void insertNodeInto(MutableTreeNode newChild,
                                MutableTreeNode parent, int index){
@@ -247,6 +256,8 @@
      * nodesWereRemoved to create the appropriate event. This is the
      * preferred way to remove a node as it handles the event creation
      * for you.
+     *
+     * @param node the node to be removed from it's parrent
      */
     public void removeNodeFromParent(MutableTreeNode node) {
         MutableTreeNode         parent = (MutableTreeNode)node.getParent();
@@ -266,6 +277,8 @@
     /**
       * Invoke this method after you've changed how node is to be
       * represented in the tree.
+      *
+      * @param node the changed node
       */
     public void nodeChanged(TreeNode node) {
         if(listenerList != null && node != null) {
@@ -303,6 +316,9 @@
       * Invoke this method after you've inserted some TreeNodes into
       * node.  childIndices should be the index of the new elements and
       * must be sorted in ascending order.
+      *
+      * @param node         parent node which children count been incremented
+      * @param childIndices indexes of inserted children
       */
     public void nodesWereInserted(TreeNode node, int[] childIndices) {
         if(listenerList != null && node != null && childIndices != null
@@ -322,6 +338,10 @@
       * node.  childIndices should be the index of the removed elements and
       * must be sorted in ascending order. And removedChildren should be
       * the array of the children objects that were removed.
+      *
+      * @param node             parent node which childred were removed
+      * @param childIndices     indexes of removed childs
+      * @param removedChildren  array of the children objects that were removed
       */
     public void nodesWereRemoved(TreeNode node, int[] childIndices,
                                  Object[] removedChildren) {
@@ -334,6 +354,9 @@
     /**
       * Invoke this method after you've changed how the children identified by
       * childIndicies are to be represented in the tree.
+      *
+      * @param node         changed node
+      * @param childIndices indexes of changed children
       */
     public void nodesChanged(TreeNode node, int[] childIndices) {
         if(node != null) {
@@ -360,6 +383,8 @@
       * Invoke this method if you've totally changed the children of
       * node and its children's children...  This will post a
       * treeStructureChanged event.
+      *
+      * @param node changed node
       */
     public void nodeStructureChanged(TreeNode node) {
         if(node != null) {
@@ -374,6 +399,7 @@
      * tree.
      *
      * @param aNode the TreeNode to get the path for
+     * @return an array of TreeNodes giving the path from the root
      */
     public TreeNode[] getPathToRoot(TreeNode aNode) {
         return getPathToRoot(aNode, 0);
--- a/jdk/src/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java	Mon Jun 02 13:53:52 2014 -0700
@@ -618,6 +618,9 @@
     /**
      * Notifies all listeners that are registered for
      * tree selection events on this object.
+     *
+     * @param e the event that characterizes the change
+     *
      * @see #addTreeSelectionListener
      * @see EventListenerList
      */
@@ -920,6 +923,9 @@
     /**
      * Returns true if the paths are contiguous,
      * or this object has no RowMapper.
+     *
+     * @param paths array of paths to check
+     * @return      whether the paths are contiguous, or this object has no RowMapper
      */
     protected boolean arePathsContiguous(TreePath[] paths) {
         if(rowMapper == null || paths.length < 2)
@@ -968,6 +974,9 @@
      * or the selection mode is <code>DISCONTIGUOUS_TREE_SELECTION</code>, or
      * adding the paths to the current selection still results in a
      * contiguous set of <code>TreePath</code>s.
+     *
+     * @param paths array of {@code TreePaths} to check
+     * @return      whether the particular set of {@code TreePaths} can be added
      */
     protected boolean canPathsBeAdded(TreePath[] paths) {
         if(paths == null || paths.length == 0 || rowMapper == null ||
@@ -1019,6 +1028,10 @@
      * Returns true if the paths can be removed without breaking the
      * continuity of the model.
      * This is rather expensive.
+     *
+     * @param paths array of {@code TreePath} to check
+     * @return      whether the paths can be removed without breaking the
+     *              continuity of the model
      */
     protected boolean canPathsBeRemoved(TreePath[] paths) {
         if(rowMapper == null || selection == null ||
@@ -1072,6 +1085,9 @@
      * instances of PathPlaceHolder.
      *
      * @deprecated As of JDK version 1.7
+     *
+     * @param changedPaths      the vector of the changed paths
+     * @param oldLeadSelection  the old selection path
      */
     @Deprecated
     protected void notifyPathChange(Vector<?> changedPaths,
--- a/jdk/src/share/classes/javax/swing/tree/MutableTreeNode.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/javax/swing/tree/MutableTreeNode.java	Mon Jun 02 13:53:52 2014 -0700
@@ -42,22 +42,31 @@
     /**
      * Adds <code>child</code> to the receiver at <code>index</code>.
      * <code>child</code> will be messaged with <code>setParent</code>.
+     *
+     * @param child node to be added
+     * @param index index of the receiver
      */
     void insert(MutableTreeNode child, int index);
 
     /**
      * Removes the child at <code>index</code> from the receiver.
+     *
+     * @param index index of child to be removed
      */
     void remove(int index);
 
     /**
      * Removes <code>node</code> from the receiver. <code>setParent</code>
      * will be messaged on <code>node</code>.
+     *
+     * @param node node to be removed from the receiver
      */
     void remove(MutableTreeNode node);
 
     /**
      * Resets the user object of the receiver to <code>object</code>.
+     *
+     * @param object object to be set as a receiver
      */
     void setUserObject(Object object);
 
@@ -68,6 +77,8 @@
 
     /**
      * Sets the parent of the receiver to <code>newParent</code>.
+     *
+     * @param newParent node to be set as parent of the receiver
      */
     void setParent(MutableTreeNode newParent);
 }
--- a/jdk/src/share/classes/javax/swing/tree/RowMapper.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/javax/swing/tree/RowMapper.java	Mon Jun 02 13:53:52 2014 -0700
@@ -41,6 +41,10 @@
      * the same length as that passed in, and if one of the TreePaths
      * in <code>path</code> is not valid its entry in the array should
      * be set to -1.
+     *
+     * @param path  array of TreePath to parse
+     * @return      the rows that the TreePath instances in {@code path} are
+     *              being displayed at
      */
     int[] getRowsForPaths(TreePath[] path);
 }
--- a/jdk/src/share/classes/javax/swing/tree/TreeCellRenderer.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/javax/swing/tree/TreeCellRenderer.java	Mon Jun 02 13:53:52 2014 -0700
@@ -67,7 +67,14 @@
      *     }
      * </pre>
      *
-     * @return  the <code>Component</code> that the renderer uses to draw the value
+     * @param tree      the receiver is being configured for
+     * @param value     the value to render
+     * @param selected  whether node is selected
+     * @param expanded  whether node is expanded
+     * @param leaf      whether node is a lead node
+     * @param row       row index
+     * @param hasFocus  whether node has focus
+     * @return          the {@code Component} that the renderer uses to draw the value
      */
     Component getTreeCellRendererComponent(JTree tree, Object value,
                                    boolean selected, boolean expanded,
--- a/jdk/src/share/classes/javax/swing/tree/TreeModel.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/javax/swing/tree/TreeModel.java	Mon Jun 02 13:53:52 2014 -0700
@@ -79,8 +79,9 @@
      * is a valid index for <code>parent</code> (that is <code>index &gt;= 0 &amp;&amp;
      * index &lt; getChildCount(parent</code>)).
      *
-     * @param   parent  a node in the tree, obtained from this data source
-     * @return  the child of <code>parent</code> at index <code>index</code>
+     * @param parent    a node in the tree, obtained from this data source
+     * @param index     index of child to be returned
+     * @return          the child of {@code parent} at index {@code index}
      */
     public Object getChild(Object parent, int index);
 
--- a/jdk/src/share/classes/javax/swing/tree/TreeNode.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/javax/swing/tree/TreeNode.java	Mon Jun 02 13:53:52 2014 -0700
@@ -49,17 +49,24 @@
     /**
      * Returns the child <code>TreeNode</code> at index
      * <code>childIndex</code>.
+     *
+     * @param   childIndex  index of child
+     * @return              the child node at given index
      */
     TreeNode getChildAt(int childIndex);
 
     /**
      * Returns the number of children <code>TreeNode</code>s the receiver
      * contains.
+     *
+     * @return              the number of children the receiver contains
      */
     int getChildCount();
 
     /**
      * Returns the parent <code>TreeNode</code> of the receiver.
+     *
+     * @return              the parent of the receiver
      */
     TreeNode getParent();
 
@@ -67,21 +74,30 @@
      * Returns the index of <code>node</code> in the receivers children.
      * If the receiver does not contain <code>node</code>, -1 will be
      * returned.
+     *
+     * @param   node        node to be loked for
+     * @return              index of specified node
      */
     int getIndex(TreeNode node);
 
     /**
      * Returns true if the receiver allows children.
+     *
+     * @return              whether the receiver allows children
      */
     boolean getAllowsChildren();
 
     /**
      * Returns true if the receiver is a leaf.
+     *
+     * @return              whether the receiver is a leaf
      */
     boolean isLeaf();
 
     /**
      * Returns the children of the receiver as an <code>Enumeration</code>.
+     *
+     * @return              the children of the receiver as an {@code Enumeration}
      */
     Enumeration children();
 }
--- a/jdk/src/share/classes/javax/swing/tree/TreePath.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/javax/swing/tree/TreePath.java	Mon Jun 02 13:53:52 2014 -0700
@@ -320,8 +320,10 @@
      * plus <code>child</code>. <code>child</code> is the last element
      * of the newly created {@code TreePath}.
      *
-     * @param child the path element to add
-     * @throws NullPointerException if {@code child} is {@code null}
+     * @param   child   the path element to add
+     * @throws          NullPointerException if {@code child} is {@code null}
+     * @return          a new path containing all the elements of this path
+     *                  plus {@code child}
      */
     public TreePath pathByAddingChild(Object child) {
         if(child == null)
--- a/jdk/src/share/classes/javax/swing/tree/TreeSelectionModel.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/javax/swing/tree/TreeSelectionModel.java	Mon Jun 02 13:53:52 2014 -0700
@@ -109,6 +109,8 @@
      * selected when the mode is changed to <code>SINGLE_TREE_SELECTION</code>,
      * only one TreePath will remain selected. It is up to the particular
      * implementation to decide what TreePath remains selected.
+     *
+     * @param   mode    selection mode to be set
      */
     void setSelectionMode(int mode);
 
@@ -117,6 +119,8 @@
      * <code>SINGLE_TREE_SELECTION</code>,
      * <code>CONTIGUOUS_TREE_SELECTION</code> or
      * <code>DISCONTIGUOUS_TREE_SELECTION</code>.
+     *
+     * @return          the current selection mode
      */
     int getSelectionMode();
 
@@ -125,7 +129,7 @@
       * the TreeSelectionListeners are notified. If <code>path</code> is
       * null, this has the same effect as invoking <code>clearSelection</code>.
       *
-      * @param path new path to select
+      * @param  path    new path to select
       */
     void setSelectionPath(TreePath path);
 
@@ -134,7 +138,7 @@
       * the TreeSelectionListeners are notified. If <code>paths</code> is
       * null, this has the same effect as invoking <code>clearSelection</code>.
       *
-      * @param paths new selection
+      * @param  paths   new selection
       */
     void setSelectionPaths(TreePath[] paths);
 
@@ -143,7 +147,7 @@
       * in the selection the TreeSelectionListeners are notified. This has
       * no effect if <code>path</code> is null.
       *
-      * @param path the new path to add to the current selection
+      * @param  path    the new path to add to the current selection
       */
     void addSelectionPath(TreePath path);
 
@@ -153,7 +157,7 @@
       * are notified. This has
       * no effect if <code>paths</code> is null.
       *
-      * @param paths the new paths to add to the current selection
+      * @param  paths   the new paths to add to the current selection
       */
     void addSelectionPaths(TreePath[] paths);
 
@@ -162,7 +166,7 @@
       * The TreeSelectionListeners are notified. This has no effect if
       * <code>path</code> is null.
       *
-      * @param path the path to remove from the selection
+      * @param  path    the path to remove from the selection
       */
     void removeSelectionPath(TreePath path);
 
@@ -172,7 +176,7 @@
       * are in the selection, the TreeSelectionListeners are notified.
       * This method has no effect if <code>paths</code> is null.
       *
-      * @param paths the path to remove from the selection
+      * @param  paths   the path to remove from the selection
       */
     void removeSelectionPaths(TreePath[] paths);
 
@@ -181,28 +185,39 @@
       * up to implementors, and may not necessarily be the TreePath with
       * the smallest integer value as determined from the
       * <code>RowMapper</code>.
+      *
+      * @return         the first path in the selection
       */
     TreePath getSelectionPath();
 
     /**
       * Returns the paths in the selection. This will return null (or an
       * empty array) if nothing is currently selected.
+      *
+      * @return         the paths in the selection
       */
     TreePath[] getSelectionPaths();
 
     /**
      * Returns the number of paths that are selected.
+     *
+     * @return          the number of paths that are selected
      */
     int getSelectionCount();
 
     /**
       * Returns true if the path, <code>path</code>, is in the current
       * selection.
+      *
+      * @param  path    the path to be loked for
+      * @return         whether the {@code path} is in the current selection
       */
     boolean isPathSelected(TreePath path);
 
     /**
       * Returns true if the selection is currently empty.
+      *
+      * @return         whether the selection is currently empty
       */
     boolean isSelectionEmpty();
 
@@ -215,12 +230,17 @@
     /**
      * Sets the RowMapper instance. This instance is used to determine
      * the row for a particular TreePath.
+     *
+     * @param   newMapper   RowMapper to be set
      */
     void setRowMapper(RowMapper newMapper);
 
     /**
      * Returns the RowMapper instance that is able to map a TreePath to a
      * row.
+     *
+     * @return          the RowMapper instance that is able to map a TreePath
+     *                  to a row
      */
     RowMapper getRowMapper();
 
@@ -228,6 +248,8 @@
       * Returns all of the currently selected rows. This will return
       * null (or an empty array) if there are no selected TreePaths or
       * a RowMapper has not been set.
+      *
+      * @return         all of the currently selected rows
       */
     int[] getSelectionRows();
 
@@ -235,6 +257,9 @@
      * Returns the smallest value obtained from the RowMapper for the
      * current set of selected TreePaths. If nothing is selected,
      * or there is no RowMapper, this will return -1.
+     *
+     * @return          the smallest value obtained from the RowMapper
+     *                  for the current set of selected TreePaths
       */
     int getMinSelectionRow();
 
@@ -242,11 +267,17 @@
      * Returns the largest value obtained from the RowMapper for the
      * current set of selected TreePaths. If nothing is selected,
      * or there is no RowMapper, this will return -1.
+     *
+     * @return          the largest value obtained from the RowMapper
+     *                  for the current set of selected TreePaths
       */
     int getMaxSelectionRow();
 
     /**
       * Returns true if the row identified by <code>row</code> is selected.
+      *
+      * @param  row     row to check
+      * @return         whether the row is selected
       */
     boolean isRowSelected(int row);
 
@@ -264,12 +295,16 @@
     /**
      * Returns the lead selection index. That is the last index that was
      * added.
+     *
+     * @return          the lead selection index
      */
     int getLeadSelectionRow();
 
     /**
      * Returns the last path that was added. This may differ from the
      * leadSelectionPath property maintained by the JTree.
+     *
+     * @return          the last path that was added
      */
     TreePath getLeadSelectionPath();
 
@@ -280,7 +315,7 @@
      * A PropertyChangeEvent will get fired when the selection mode
      * changes.
      *
-     * @param listener  the PropertyChangeListener to be added
+     * @param   listener    the PropertyChangeListener to be added
      */
     void addPropertyChangeListener(PropertyChangeListener listener);
 
@@ -289,7 +324,7 @@
      * This removes a PropertyChangeListener that was registered
      * for all properties.
      *
-     * @param listener  the PropertyChangeListener to be removed
+     * @param   listener    the PropertyChangeListener to be removed
      */
     void removePropertyChangeListener(PropertyChangeListener listener);
 
@@ -297,7 +332,7 @@
       * Adds x to the list of listeners that are notified each time the
       * set of selected TreePaths changes.
       *
-      * @param x the new listener to be added
+      * @param  x       the new listener to be added
       */
     void addTreeSelectionListener(TreeSelectionListener x);
 
@@ -305,7 +340,7 @@
       * Removes x from the list of listeners that are notified each time
       * the set of selected TreePaths changes.
       *
-      * @param x the listener to remove
+      * @param  x       the listener to remove
       */
     void removeTreeSelectionListener(TreeSelectionListener x);
 }
--- a/jdk/src/share/classes/javax/swing/undo/CompoundEdit.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/javax/swing/undo/CompoundEdit.java	Mon Jun 02 13:53:52 2014 -0700
@@ -82,6 +82,9 @@
      * Returns the last <code>UndoableEdit</code> in
      * <code>edits</code>, or <code>null</code>
      * if <code>edits</code> is empty.
+     *
+     * @return the last {@code UndoableEdit} in {@code edits},
+     *         or {@code null} if {@code edits} is empty.
      */
     protected UndoableEdit lastEdit() {
         int count = edits.size();
@@ -182,6 +185,7 @@
      * received end. This generally means that edits are still being
      * added to it.
      *
+     * @return  whether this edit is in progress
      * @see     #end
      */
     public boolean isInProgress() {
--- a/jdk/src/share/classes/javax/swing/undo/StateEditable.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/javax/swing/undo/StateEditable.java	Mon Jun 02 13:53:52 2014 -0700
@@ -43,12 +43,16 @@
     /**
      * Upon receiving this message the receiver should place any relevant
      * state into <EM>state</EM>.
+     *
+     * @param state Hashtable object to store the state
      */
     public void storeState(Hashtable<Object,Object> state);
 
     /**
      * Upon receiving this message the receiver should extract any relevant
      * state out of <EM>state</EM>.
+     *
+     * @param state Hashtable object to restore the state from it
      */
     public void restoreState(Hashtable<?,?> state);
 } // End of interface StateEditable
--- a/jdk/src/share/classes/javax/swing/undo/UndoManager.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/javax/swing/undo/UndoManager.java	Mon Jun 02 13:53:52 2014 -0700
@@ -326,6 +326,7 @@
      * Undoes all changes from the index of the next edit to
      * <code>edit</code>, updating the index of the next edit appropriately.
      *
+     * @param edit the edit to be undo to
      * @throws CannotUndoException if one of the edits throws
      *         <code>CannotUndoException</code>
      */
@@ -342,6 +343,7 @@
      * Redoes all changes from the index of the next edit to
      * <code>edit</code>, updating the index of the next edit appropriately.
      *
+     * @param edit the edit to be redo to
      * @throws CannotRedoException if one of the edits throws
      *         <code>CannotRedoException</code>
      */
--- a/jdk/src/share/classes/javax/swing/undo/UndoableEditSupport.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/javax/swing/undo/UndoableEditSupport.java	Mon Jun 02 13:53:52 2014 -0700
@@ -96,6 +96,8 @@
      * Called only from <code>postEdit</code> and <code>endUpdate</code>. Calls
      * <code>undoableEditHappened</code> in all listeners. No synchronization
      * is performed here, since the two calling methods are synchronized.
+     *
+     * @param e edit to be verified
      */
     protected void _postEdit(UndoableEdit e) {
         UndoableEditEvent ev = new UndoableEditEvent(realSource, e);
@@ -110,6 +112,8 @@
      * DEADLOCK WARNING: Calling this method may call
      * <code>undoableEditHappened</code> in all listeners.
      * It is unwise to call this method from one of its listeners.
+     *
+     * @param e edit to be posted
      */
     public synchronized void postEdit(UndoableEdit e) {
         if (updateLevel == 0) {
@@ -142,6 +146,8 @@
     /**
      * Called only from <code>beginUpdate</code>.
      * Exposed here for subclasses' use.
+     *
+     * @return new created {@code CompoundEdit} object
      */
     protected CompoundEdit createCompoundEdit() {
         return new CompoundEdit();
--- a/jdk/src/share/classes/jdk/internal/util/xml/impl/Parser.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/jdk/internal/util/xml/impl/Parser.java	Mon Jun 02 13:53:52 2014 -0700
@@ -2860,14 +2860,25 @@
             } else {
                 //              Get encoding from BOM or the xml text decl.
                 reader = bom(is.getByteStream(), ' ');
+                /**
+                 * [#4.3.3] requires BOM for UTF-16, however, it's not uncommon
+                 * that it may be missing. A mature technique exists in Xerces
+                 * to further check for possible UTF-16 encoding
+                 */
+                if (reader == null) {
+                    reader = utf16(is.getByteStream());
+                }
+
                 if (reader == null) {
                     //          Encoding is defined by the xml text decl.
                     reader = enc("UTF-8", is.getByteStream());
                     expenc = xml(reader);
-                    if (expenc.startsWith("UTF-16")) {
-                        panic(FAULT);  // UTF-16 must have BOM [#4.3.3]
+                    if (!expenc.equals("UTF-8")) {
+                        if (expenc.startsWith("UTF-16")) {
+                            panic(FAULT);  // UTF-16 must have BOM [#4.3.3]
+                        }
+                        reader = enc(expenc, is.getByteStream());
                     }
-                    reader = enc(expenc, is.getByteStream());
                 } else {
                     //          Encoding is defined by the BOM.
                     xml(reader);
@@ -2956,6 +2967,49 @@
         }
     }
 
+
+    /**
+     * Using a mature technique from Xerces, this method checks further after
+     * the bom method above to see if the encoding is UTF-16
+     *
+     * @param is A byte stream of the entity.
+     * @return a reader, may be null
+     * @exception Exception is parser specific exception form panic method.
+     * @exception IOException
+     */
+    private Reader utf16(InputStream is)
+            throws Exception {
+        if (mChIdx != 0) {
+            //The bom method has read ONE byte into the buffer.
+            byte b0 = (byte)mChars[0];
+            if (b0 == 0x00 || b0 == 0x3C) {
+                int b1 = is.read();
+                int b2 = is.read();
+                int b3 = is.read();
+                if (b0 == 0x00 && b1 == 0x3C && b2 == 0x00 && b3 == 0x3F) {
+                    // UTF-16, big-endian, no BOM
+                    mChars[0] = (char)(b1);
+                    mChars[mChIdx++] = (char)(b3);
+                    return new ReaderUTF16(is, 'b');
+                } else if (b0 == 0x3C && b1 == 0x00 && b2 == 0x3F && b3 == 0x00) {
+                    // UTF-16, little-endian, no BOM
+                    mChars[0] = (char)(b0);
+                    mChars[mChIdx++] = (char)(b2);
+                    return new ReaderUTF16(is, 'l');
+                } else {
+                    /**not every InputStream supports reset, so we have to remember
+                     * the state for further parsing
+                    **/
+                    mChars[0] = (char)(b0);
+                    mChars[mChIdx++] = (char)(b1);
+                    mChars[mChIdx++] = (char)(b2);
+                    mChars[mChIdx++] = (char)(b3);
+                }
+
+            }
+        }
+        return null;
+    }
     /**
      * Parses the xml text declaration.
      *
@@ -2974,17 +3028,17 @@
         String enc = "UTF-8";
         char ch;
         int val;
-        short st;
-        //              Read the xml text declaration into the buffer
-        if (mChIdx != 0) {
-            //          The bom method have read ONE char into the buffer.
-            st = (short) ((mChars[0] == '<') ? 1 : -1);
-        } else {
-            st = 0;
-        }
+        short st = 0;
+        int byteRead =  mChIdx; //number of bytes read prior to entering this method
+
         while (st >= 0 && mChIdx < mChars.length) {
-            ch = ((val = reader.read()) >= 0) ? (char) val : EOS;
-            mChars[mChIdx++] = ch;
+            if (st < byteRead) {
+                ch = mChars[st];
+            } else {
+                ch = ((val = reader.read()) >= 0) ? (char) val : EOS;
+                mChars[mChIdx++] = ch;
+            }
+
             switch (st) {
                 case 0:     // read '<' of xml declaration
                     switch (ch) {
--- a/jdk/src/share/classes/sun/awt/AWTAccessor.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/awt/AWTAccessor.java	Mon Jun 02 13:53:52 2014 -0700
@@ -27,6 +27,7 @@
 
 import sun.misc.Unsafe;
 
+import javax.accessibility.AccessibleContext;
 import java.awt.*;
 import java.awt.KeyboardFocusManager;
 import java.awt.DefaultKeyboardFocusManager;
@@ -620,7 +621,7 @@
         /**
          * Returns menus
          */
-        Vector getMenus(MenuBar menuBar);
+        Vector<Menu> getMenus(MenuBar menuBar);
     }
 
     /**
@@ -662,7 +663,7 @@
         /**
          * Returns vector of the items that are part of the Menu
          */
-        Vector getItems(Menu menu);
+        Vector<MenuItem> getItems(Menu menu);
     }
 
     /**
@@ -762,6 +763,14 @@
     }
 
     /*
+     * An accessor object for the AccessibleContext class
+     */
+    public interface AccessibleContextAccessor {
+        void setAppContext(AccessibleContext accessibleContext, AppContext appContext);
+        AppContext getAppContext(AccessibleContext accessibleContext);
+    }
+
+    /*
      * Accessor instances are initialized in the static initializers of
      * corresponding AWT classes by using setters defined below.
      */
@@ -791,6 +800,7 @@
     private static ToolkitAccessor toolkitAccessor;
     private static InvocationEventAccessor invocationEventAccessor;
     private static SystemColorAccessor systemColorAccessor;
+    private static AccessibleContextAccessor accessibleContextAccessor;
 
     /*
      * Set an accessor object for the java.awt.Component class.
@@ -1234,4 +1244,21 @@
      public static void setSystemColorAccessor(SystemColorAccessor systemColorAccessor) {
          AWTAccessor.systemColorAccessor = systemColorAccessor;
      }
+
+    /*
+     * Get the accessor object for the javax.accessibility.AccessibleContext class.
+     */
+    public static AccessibleContextAccessor getAccessibleContextAccessor() {
+        if (accessibleContextAccessor == null) {
+            unsafe.ensureClassInitialized(AccessibleContext.class);
+        }
+        return accessibleContextAccessor;
+    }
+
+   /*
+    * Set the accessor object for the javax.accessibility.AccessibleContext class.
+    */
+    public static void setAccessibleContextAccessor(AccessibleContextAccessor accessor) {
+        AWTAccessor.accessibleContextAccessor = accessor;
+    }
 }
--- a/jdk/src/share/classes/sun/awt/AWTAutoShutdown.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/awt/AWTAutoShutdown.java	Mon Jun 02 13:53:52 2014 -0700
@@ -35,7 +35,7 @@
 import java.util.Set;
 
 import sun.util.logging.PlatformLogger;
-import sun.misc.ThreadGroupUtils;
+import sun.awt.util.ThreadGroupUtils;
 
 /**
  * This class is to let AWT shutdown automatically when a user is done
--- a/jdk/src/share/classes/sun/awt/AppContext.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/awt/AppContext.java	Mon Jun 02 13:53:52 2014 -0700
@@ -890,6 +890,7 @@
             Supplier<T> supplier) {
 
         final AppContext appContext = AppContext.getAppContext();
+        @SuppressWarnings("unchecked")
         SoftReference<T> ref = (SoftReference<T>) appContext.get(key);
         if (ref != null) {
             final T object = ref.get();
--- a/jdk/src/share/classes/sun/awt/FontConfiguration.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/awt/FontConfiguration.java	Mon Jun 02 13:53:52 2014 -0700
@@ -64,7 +64,7 @@
     protected static String osName;
     protected static String encoding; // canonical name of default nio charset
     protected static Locale startupLocale = null;
-    protected static Hashtable localeMap = null;
+    protected static Hashtable<String, String> localeMap = null;
     private static FontConfiguration fontConfig;
     private static PlatformLogger logger;
     protected static boolean isProperties = true;
@@ -159,15 +159,15 @@
         short fontNameID = compFontNameIDs[0][0][0];
         short fileNameID = getComponentFileID(fontNameID);
         final String fileName = mapFileName(getComponentFileName(fileNameID));
-        Boolean exists = (Boolean)java.security.AccessController.doPrivileged(
-            new java.security.PrivilegedAction() {
-                 public Object run() {
+        Boolean exists = java.security.AccessController.doPrivileged(
+            new java.security.PrivilegedAction<Boolean>() {
+                 public Boolean run() {
                      try {
                          File f = new File(fileName);
                          return Boolean.valueOf(f.exists());
                      }
                      catch (Exception e) {
-                         return false;
+                         return Boolean.FALSE;
                      }
                  }
                 });
@@ -534,11 +534,11 @@
    private short remapLocaleMap(int fontIndex, int styleIndex, short scriptID, short fontID) {
         String scriptName = getString(table_scriptIDs[scriptID]);
 
-        String value = (String)localeMap.get(scriptName);
+        String value = localeMap.get(scriptName);
         if (value == null) {
             String fontName = fontNames[fontIndex];
             String styleName = styleNames[styleIndex];
-            value = (String)localeMap.get(fontName + "." + styleName + "." + scriptName);
+            value = localeMap.get(fontName + "." + styleName + "." + scriptName);
         }
         if (value == null) {
             return fontID;
@@ -746,7 +746,7 @@
     /* Mappings from file encoding to font config name for font supporting
      * the corresponding language. This is filled in by initReorderMap()
      */
-    protected HashMap reorderMap = null;
+    protected HashMap<String, Object> reorderMap = null;
 
     /* Platform-specific mappings */
     protected abstract void initReorderMap();
@@ -777,7 +777,7 @@
         if (fontConfig.reorderMap == null) {
              fontConfig.initReorderMap();
         }
-        HashMap reorderMap = fontConfig.reorderMap;
+        HashMap<String, Object> reorderMap = fontConfig.reorderMap;
 
         /* Find the most specific mapping */
         String language = startupLocale.getLanguage();
@@ -817,9 +817,9 @@
         }
     }
 
-    private static Vector splitSequence(String sequence) {
+    private static Vector<String> splitSequence(String sequence) {
         //String.split would be more convenient, but incurs big performance penalty
-        Vector parts = new Vector();
+        Vector<String> parts = new Vector<>();
         int start = 0;
         int end;
         while ((end = sequence.indexOf(',', start)) >= 0) {
@@ -833,14 +833,14 @@
     }
 
     protected String[] split(String sequence) {
-        Vector v = splitSequence(sequence);
-        return (String[])v.toArray(new String[0]);
+        Vector<String> v = splitSequence(sequence);
+        return v.toArray(new String[0]);
     }
 
     ////////////////////////////////////////////////////////////////////////
     // Methods for extracting information from the fontconfig data for AWT//
     ////////////////////////////////////////////////////////////////////////
-    private Hashtable charsetRegistry = new Hashtable(5);
+    private Hashtable<String, Charset> charsetRegistry = new Hashtable<>(5);
 
     /**
      * Returns FontDescriptors describing the physical fonts used for the
@@ -932,9 +932,9 @@
 
         Charset fc = null;
         if (charsetName.equals("default")) {
-            fc = (Charset) charsetRegistry.get(fontName);
+            fc = charsetRegistry.get(fontName);
         } else {
-            fc = (Charset) charsetRegistry.get(charsetName);
+            fc = charsetRegistry.get(charsetName);
         }
         if (fc != null) {
             return fc.newEncoder();
@@ -943,8 +943,8 @@
         if (!charsetName.startsWith("sun.awt.") && !charsetName.equals("default")) {
             fc = Charset.forName(charsetName);
         } else {
-            Class fcc = (Class) AccessController.doPrivileged(new PrivilegedAction() {
-                    public Object run() {
+            Class<?> fcc = AccessController.doPrivileged(new PrivilegedAction<Class<?>>() {
+                    public Class<?> run() {
                         try {
                             return Class.forName(charsetName, true,
                                                  ClassLoader.getSystemClassLoader());
@@ -1377,9 +1377,9 @@
 
         //This method will only be called during build time, do we
         //need do PrivilegedAction?
-        String osName = (String)java.security.AccessController.doPrivileged(
-                            new java.security.PrivilegedAction() {
-            public Object run() {
+        String osName = java.security.AccessController.doPrivileged(
+                            new java.security.PrivilegedAction<String>() {
+            public String run() {
                 return System.getProperty("os.name");
             }
         });
@@ -2139,7 +2139,7 @@
                 boolean has1252 = false;
 
                 //get the scriptID list
-                String[] ss = (String[])splitSequence(value).toArray(EMPTY_STRING_ARRAY);
+                String[] ss = splitSequence(value).toArray(EMPTY_STRING_ARRAY);
                 short [] sa = new short[ss.length];
                 for (int i = 0; i < ss.length; i++) {
                     if ("alphabetic/default".equals(ss[i])) {
--- a/jdk/src/share/classes/sun/awt/HToolkit.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/awt/HToolkit.java	Mon Jun 02 13:53:52 2014 -0700
@@ -214,7 +214,8 @@
         throw new HeadlessException();
     }
 
-    public Map mapInputMethodHighlight(InputMethodHighlight highlight)
+    public Map<java.awt.font.TextAttribute, ?> mapInputMethodHighlight(
+            InputMethodHighlight highlight)
         throws HeadlessException {
         throw new HeadlessException();
     }
--- a/jdk/src/share/classes/sun/awt/HeadlessToolkit.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/awt/HeadlessToolkit.java	Mon Jun 02 13:53:52 2014 -0700
@@ -29,6 +29,7 @@
 import java.awt.dnd.*;
 import java.awt.dnd.peer.DragSourceContextPeer;
 import java.awt.event.*;
+import java.awt.font.TextAttribute;
 import java.awt.im.InputMethodHighlight;
 import java.awt.image.*;
 import java.awt.datatransfer.Clipboard;
@@ -224,7 +225,7 @@
         throw new HeadlessException();
     }
 
-    public Map mapInputMethodHighlight(InputMethodHighlight highlight)
+    public Map<TextAttribute, ?> mapInputMethodHighlight(InputMethodHighlight highlight)
         throws HeadlessException {
         throw new HeadlessException();
     }
--- a/jdk/src/share/classes/sun/awt/PlatformFont.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/awt/PlatformFont.java	Mon Jun 02 13:53:52 2014 -0700
@@ -143,7 +143,7 @@
         if (len < 1) {
             return new CharsetString[0];
         }
-        Vector mcs = null;
+        Vector<CharsetString> mcs = null;
         char[] tmpStr = new char[len];
         char tmpChar = defaultChar;
         boolean encoded = false;
@@ -198,7 +198,7 @@
             }
             if (currentFont != fd){
                 if (mcs == null) {
-                    mcs = new Vector(3);
+                    mcs = new Vector<>(3);
                 }
                 mcs.addElement(new CharsetString(tmpStr, lastIndex,
                                                  i-lastIndex, currentFont));
@@ -209,16 +209,13 @@
         }
         CharsetString[] result;
         CharsetString cs = new CharsetString(tmpStr, lastIndex,
-                                            len-lastIndex, currentFont);
+                                             len-lastIndex, currentFont);
         if (mcs == null) {
             result = new CharsetString[1];
             result[0] = cs;
         } else {
             mcs.addElement(cs);
-            result = new CharsetString[mcs.size()];
-            for (int i = 0; i < mcs.size(); i++){
-                result[i] = (CharsetString)mcs.elementAt(i);
-            }
+            result = mcs.toArray(new CharsetString[mcs.size()]);
         }
         return result;
     }
--- a/jdk/src/share/classes/sun/awt/SunToolkit.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/awt/SunToolkit.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1915,6 +1915,7 @@
 
     public synchronized void setWindowDeactivationTime(Window w, long time) {
         AppContext ctx = getAppContext(w);
+        @SuppressWarnings("unchecked")
         WeakHashMap<Window, Long> map = (WeakHashMap<Window, Long>)ctx.get(DEACTIVATION_TIMES_MAP_KEY);
         if (map == null) {
             map = new WeakHashMap<Window, Long>();
@@ -1925,6 +1926,7 @@
 
     public synchronized long getWindowDeactivationTime(Window w) {
         AppContext ctx = getAppContext(w);
+        @SuppressWarnings("unchecked")
         WeakHashMap<Window, Long> map = (WeakHashMap<Window, Long>)ctx.get(DEACTIVATION_TIMES_MAP_KEY);
         if (map == null) {
             return -1;
--- a/jdk/src/share/classes/sun/awt/datatransfer/DataTransferer.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/awt/datatransfer/DataTransferer.java	Mon Jun 02 13:53:52 2014 -0700
@@ -57,6 +57,7 @@
 import java.nio.charset.Charset;
 import java.nio.charset.CharsetEncoder;
 import java.nio.charset.IllegalCharsetNameException;
+import java.nio.charset.StandardCharsets;
 import java.nio.charset.UnsupportedCharsetException;
 
 import java.lang.reflect.Constructor;
@@ -70,22 +71,7 @@
 import java.security.PrivilegedExceptionAction;
 import java.security.ProtectionDomain;
 
-import java.util.AbstractMap;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.SortedMap;
-import java.util.SortedSet;
-import java.util.Set;
-import java.util.Stack;
-import java.util.TreeMap;
-import java.util.TreeSet;
+import java.util.*;
 
 import sun.util.logging.PlatformLogger;
 
@@ -164,7 +150,7 @@
             tempSet.add("UTF-16BE");
             tempSet.add("UTF-16LE");
             tempSet.add("UTF-16");
-            tempSet.add(getDefaultTextCharset());
+            tempSet.add(Charset.defaultCharset().name());
             return Collections.unmodifiableSortedSet(tempSet);
         }
     }
@@ -178,12 +164,6 @@
     private static final Map<String, Boolean> textMIMESubtypeCharsetSupport;
 
     /**
-     * Cache of the platform default encoding as specified in the
-     * "file.encoding" system property.
-     */
-    private static String defaultEncoding;
-
-    /**
      * A collection of all natives listed in flavormap.properties with
      * a primary MIME type of "text".
      */
@@ -281,17 +261,7 @@
 
         String encoding = flavor.getParameter("charset");
 
-        return (encoding != null) ? encoding : getDefaultTextCharset();
-    }
-
-    /**
-     * Returns the platform's default character encoding.
-     */
-    public static String getDefaultTextCharset() {
-        if (defaultEncoding != null) {
-            return defaultEncoding;
-        }
-        return defaultEncoding = Charset.defaultCharset().name();
+        return (encoding != null) ? encoding : Charset.defaultCharset().name();
     }
 
     /**
@@ -354,7 +324,7 @@
             return false;
         }
 
-        Class rep_class = flavor.getRepresentationClass();
+        Class<?> rep_class = flavor.getRepresentationClass();
 
         if (flavor.isRepresentationClassReader() ||
             String.class.equals(rep_class) ||
@@ -485,7 +455,7 @@
 
         textNatives.add(format);
         nativeCharsets.put(format, (charset != null && charset.length() != 0)
-                ? charset : getDefaultTextCharset());
+                ? charset : Charset.defaultCharset().name());
         if (eoln != null && eoln.length() != 0 && !eoln.equals("\n")) {
             nativeEOLNs.put(format, eoln);
         }
@@ -726,7 +696,7 @@
      *            DataFlavors and data formats
      * @throws NullPointerException if formats or map is <code>null</code>
      */
-    public Set getFlavorsForFormatsAsSet(long[] formats, FlavorTable map) {
+    public Set<DataFlavor> getFlavorsForFormatsAsSet(long[] formats, FlavorTable map) {
         Set<DataFlavor> flavorSet = new HashSet<>(formats.length);
 
         for (long format : formats) {
@@ -786,19 +756,17 @@
      * clipboard string encoding/decoding, basing on clipboard
      * format and localeTransferable(on decoding, if available)
      */
-    private String getBestCharsetForTextFormat(Long lFormat,
+    protected String getBestCharsetForTextFormat(Long lFormat,
         Transferable localeTransferable) throws IOException
     {
         String charset = null;
         if (localeTransferable != null &&
             isLocaleDependentTextFormat(lFormat) &&
-            localeTransferable.isDataFlavorSupported(javaTextEncodingFlavor))
-        {
+            localeTransferable.isDataFlavorSupported(javaTextEncodingFlavor)) {
             try {
-                charset = new String(
-                    (byte[])localeTransferable.getTransferData(javaTextEncodingFlavor),
-                    "UTF-8"
-                );
+                byte[] charsetNameBytes = (byte[])localeTransferable
+                        .getTransferData(javaTextEncodingFlavor);
+                charset = new String(charsetNameBytes, StandardCharsets.UTF_8);
             } catch (UnsupportedFlavorException cannotHappen) {
             }
         } else {
@@ -806,7 +774,7 @@
         }
         if (charset == null) {
             // Only happens when we have a custom text type.
-            charset = getDefaultTextCharset();
+            charset = Charset.defaultCharset().name();
         }
         return charset;
     }
@@ -1117,7 +1085,7 @@
                 throw new IOException("data translation failed");
             }
 
-            final List list = (List)obj;
+            final List<?> list = (List<?>)obj;
 
             final ProtectionDomain userProtectionDomain = getUserProtectionDomain(contents);
 
@@ -1145,7 +1113,7 @@
             if (targetCharset == null) {
                 targetCharset = "UTF-8";
             }
-            final List list = (List)obj;
+            final List<?> list = (List<?>)obj;
             final ProtectionDomain userProtectionDomain = getUserProtectionDomain(contents);
             final ArrayList<String> fileList = castToFiles(list, userProtectionDomain);
             final ArrayList<String> uriList = new ArrayList<>(fileList.size());
@@ -1290,7 +1258,7 @@
         return true;
     }
 
-    private ArrayList<String> castToFiles(final List files,
+    private ArrayList<String> castToFiles(final List<?> files,
                                           final ProtectionDomain userProtectionDomain) throws IOException {
         try {
             return AccessController.doPrivileged((PrivilegedExceptionAction<ArrayList<String>>) () -> {
@@ -1668,7 +1636,7 @@
      * instance of the Class as its sole parameter.
      */
     private Object constructFlavoredObject(Object arg, DataFlavor flavor,
-                                           Class clazz)
+                                           Class<?> clazz)
         throws IOException
     {
         final Class<?> dfrc = flavor.getRepresentationClass();
@@ -1676,19 +1644,19 @@
         if (clazz.equals(dfrc)) {
             return arg; // simple case
         } else {
-            Constructor[] constructors;
+            Constructor<?>[] constructors;
 
             try {
                 constructors = AccessController.doPrivileged(
-                        (PrivilegedAction<Constructor[]>) dfrc::getConstructors);
+                        (PrivilegedAction<Constructor<?>[]>) dfrc::getConstructors);
             } catch (SecurityException se) {
                 throw new IOException(se.getMessage());
             }
 
-            Constructor constructor = Stream.of(constructors)
+            Constructor<?> constructor = Stream.of(constructors)
                     .filter(c -> Modifier.isPublic(c.getModifiers()))
                     .filter(c -> {
-                        Class[] ptypes = c.getParameterTypes();
+                        Class<?>[] ptypes = c.getParameterTypes();
                         return ptypes != null
                                 && ptypes.length == 1
                                 && clazz.equals(ptypes[0]);
@@ -1731,28 +1699,8 @@
         {
             Long lFormat = format;
 
-            String sourceEncoding = null;
-            if (isLocaleDependentTextFormat(format) &&
-                localeTransferable != null &&
-                localeTransferable.
-                    isDataFlavorSupported(javaTextEncodingFlavor))
-            {
-                try {
-                    sourceEncoding = new String((byte[])localeTransferable.
-                                       getTransferData(javaTextEncodingFlavor),
-                                       "UTF-8");
-                } catch (UnsupportedFlavorException cannotHappen) {
-                }
-            } else {
-                sourceEncoding = getCharsetForTextFormat(lFormat);
-            }
-
-            if (sourceEncoding == null) {
-                // Only happens when we have a custom text type.
-                sourceEncoding = getDefaultTextCharset();
-            }
-            wrapped = new BufferedReader
-                (new InputStreamReader(bytestream, sourceEncoding));
+            String sourceEncoding = getBestCharsetForTextFormat(format, localeTransferable);
+            wrapped = new BufferedReader(new InputStreamReader(bytestream, sourceEncoding));
 
             if (targetEncoding == null) {
                 // Throw NullPointerException for compatibility with the former
@@ -1917,7 +1865,8 @@
         byte[] bytes, String mimeType) throws IOException
     {
 
-        Iterator readerIterator = ImageIO.getImageReadersByMIMEType(mimeType);
+        Iterator<ImageReader> readerIterator =
+            ImageIO.getImageReadersByMIMEType(mimeType);
 
         if (!readerIterator.hasNext()) {
             throw new IOException("No registered service provider can decode " +
@@ -1927,7 +1876,7 @@
         IOException ioe = null;
 
         while (readerIterator.hasNext()) {
-            ImageReader imageReader = (ImageReader)readerIterator.next();
+            ImageReader imageReader = readerIterator.next();
             try (ByteArrayInputStream bais = new ByteArrayInputStream(bytes)) {
                 try (ImageInputStream imageInputStream = ImageIO.createImageInputStream(bais)) {
                     ImageReadParam param = imageReader.getDefaultReadParam();
@@ -1970,7 +1919,8 @@
       throws IOException {
         IOException originalIOE = null;
 
-        Iterator writerIterator = ImageIO.getImageWritersByMIMEType(mimeType);
+        Iterator<ImageWriter> writerIterator =
+            ImageIO.getImageWritersByMIMEType(mimeType);
 
         if (!writerIterator.hasNext()) {
             throw new IOException("No registered service provider can encode " +
@@ -2029,7 +1979,8 @@
                                               String mimeType)
         throws IOException {
 
-        Iterator writerIterator = ImageIO.getImageWritersByMIMEType(mimeType);
+        Iterator<ImageWriter> writerIterator =
+            ImageIO.getImageWritersByMIMEType(mimeType);
 
         ImageTypeSpecifier typeSpecifier =
             new ImageTypeSpecifier(renderedImage);
@@ -2038,7 +1989,7 @@
         IOException ioe = null;
 
         while (writerIterator.hasNext()) {
-            ImageWriter imageWriter = (ImageWriter)writerIterator.next();
+            ImageWriter imageWriter = writerIterator.next();
             ImageWriterSpi writerSpi = imageWriter.getOriginatingProvider();
 
             if (!writerSpi.canEncodeImage(typeSpecifier)) {
@@ -2122,7 +2073,7 @@
     public byte[] convertData(final Object source,
                               final Transferable contents,
                               final long format,
-                              final Map formatMap,
+                              final Map<Long, DataFlavor> formatMap,
                               final boolean isToolkitThread)
         throws IOException
     {
@@ -2145,7 +2096,7 @@
                     }
                     byte[] data = null;
                     try {
-                        DataFlavor flavor = (DataFlavor)formatMap.get(format);
+                        DataFlavor flavor = formatMap.get(format);
                         if (flavor != null) {
                             data = translateTransferable(contents, flavor, format);
                         }
@@ -2186,7 +2137,7 @@
         } finally {
             getToolkitThreadBlockedHandler().unlock();
         } else {
-            DataFlavor flavor = (DataFlavor)formatMap.get(format);
+            DataFlavor flavor = formatMap.get(format);
             if (flavor != null) {
                 ret = translateTransferable(contents, flavor, format);
             }
@@ -2235,7 +2186,7 @@
      * Helper function to convert a Set of DataFlavors to a sorted array.
      * The array will be sorted according to <code>DataFlavorComparator</code>.
      */
-    public static DataFlavor[] setToSortedDataFlavorArray(Set flavorsSet) {
+    public static DataFlavor[] setToSortedDataFlavorArray(Set<DataFlavor> flavorsSet) {
         DataFlavor[] flavors = new DataFlavor[flavorsSet.size()];
         flavorsSet.toArray(flavors);
         final Comparator<DataFlavor> comparator =
@@ -2267,8 +2218,8 @@
      * If there are no platform-specific mappings for this native, the method
      * returns an empty <code>List</code>.
      */
-    public List<DataFlavor> getPlatformMappingsForNative(String nat) {
-        return new ArrayList<>();
+    public LinkedHashSet<DataFlavor> getPlatformMappingsForNative(String nat) {
+        return new LinkedHashSet<>();
     }
 
     /**
@@ -2276,8 +2227,8 @@
      * If there are no platform-specific mappings for this flavor, the method
      * returns an empty <code>List</code>.
      */
-    public List<String> getPlatformMappingsForFlavor(DataFlavor df) {
-        return new ArrayList<>();
+    public LinkedHashSet<String> getPlatformMappingsForFlavor(DataFlavor df) {
+        return new LinkedHashSet<>();
     }
 
     /**
@@ -2333,7 +2284,6 @@
      */
     public static class CharsetComparator extends IndexedComparator<String> {
         private static final Map<String, Integer> charsets;
-        private static final String defaultEncoding;
 
         private static final Integer DEFAULT_CHARSET_INDEX = 2;
         private static final Integer OTHER_CHARSET_INDEX = 1;
@@ -2354,8 +2304,7 @@
             // US-ASCII is the worst charset supported
             charsetsMap.put(canonicalName("US-ASCII"), WORST_CHARSET_INDEX);
 
-            defaultEncoding = DataTransferer.canonicalName(DataTransferer.getDefaultTextCharset());
-            charsetsMap.putIfAbsent(defaultEncoding, DEFAULT_CHARSET_INDEX);
+            charsetsMap.putIfAbsent(Charset.defaultCharset().name(), DEFAULT_CHARSET_INDEX);
 
             charsetsMap.put(UNSUPPORTED_CHARSET, UNSUPPORTED_CHARSET_INDEX);
 
@@ -2598,12 +2547,12 @@
             String primaryType1 = flavor1.getPrimaryType();
             String subType1 = flavor1.getSubType();
             String mimeType1 = primaryType1 + "/" + subType1;
-            Class class1 = flavor1.getRepresentationClass();
+            Class<?> class1 = flavor1.getRepresentationClass();
 
             String primaryType2 = flavor2.getPrimaryType();
             String subType2 = flavor2.getSubType();
             String mimeType2 = primaryType2 + "/" + subType2;
-            Class class2 = flavor2.getRepresentationClass();
+            Class<?> class2 = flavor2.getRepresentationClass();
 
             if (flavor1.isFlavorTextType() && flavor2.isFlavorTextType()) {
                 // First, compare MIME types
--- a/jdk/src/share/classes/sun/awt/datatransfer/SunClipboard.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/awt/datatransfer/SunClipboard.java	Mon Jun 02 13:53:52 2014 -0700
@@ -78,7 +78,7 @@
      * this clipboard. It is used for tracking changes
      * of <code>DataFlavor</code>s available on this clipboard.
      */
-    private volatile Set currentDataFlavors;
+    private volatile Set<DataFlavor> currentDataFlavors;
 
 
     public SunClipboard(String name) {
@@ -338,7 +338,7 @@
     protected abstract byte[] getClipboardData(long format) throws IOException;
 
 
-    private static Set formatArrayAsDataFlavorSet(long[] formats) {
+    private static Set<DataFlavor> formatArrayAsDataFlavorSet(long[] formats) {
         return (formats == null) ? null :
                 DataTransferer.getInstance().
                 getFlavorsForFormatsAsSet(formats, getDefaultFlavorTable());
@@ -417,7 +417,7 @@
      *        this clipboard
      */
     public void checkChange(long[] formats) {
-        Set prevDataFlavors = currentDataFlavors;
+        Set<DataFlavor> prevDataFlavors = currentDataFlavors;
         currentDataFlavors = formatArrayAsDataFlavorSet(formats);
 
         if (Objects.equals(prevDataFlavors, currentDataFlavors)) {
--- a/jdk/src/share/classes/sun/awt/datatransfer/TransferableProxy.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/awt/datatransfer/TransferableProxy.java	Mon Jun 02 13:53:52 2014 -0700
@@ -111,9 +111,9 @@
     }
 
     protected void annotateClass(final Class<?> cl) throws IOException {
-        ClassLoader classLoader =
-            (ClassLoader)AccessController.doPrivileged(new PrivilegedAction() {
-                public Object run() {
+        ClassLoader classLoader = AccessController.doPrivileged(
+            new PrivilegedAction<ClassLoader>() {
+                public ClassLoader run() {
                     return cl.getClassLoader();
                 }
             });
@@ -124,14 +124,14 @@
         map.put(s, classLoader);
     }
     protected void annotateProxyClass(final Class<?> cl) throws IOException {
-        ClassLoader classLoader =
-            (ClassLoader)AccessController.doPrivileged(new PrivilegedAction() {
-                public Object run() {
+        ClassLoader classLoader = AccessController.doPrivileged(
+            new PrivilegedAction<ClassLoader>() {
+                public ClassLoader run() {
                     return cl.getClassLoader();
                 }
             });
 
-        Class[] interfaces = cl.getInterfaces();
+        Class<?>[] interfaces = cl.getInterfaces();
         Set<String> s = new HashSet<String>(interfaces.length);
         for (int i = 0; i < interfaces.length; i++) {
             s.add(interfaces[i].getName());
@@ -141,7 +141,7 @@
     }
 
     Map<Set<String>, ClassLoader> getClassLoaderMap() {
-        return new HashMap(map);
+        return new HashMap<>(map);
     }
 }
 
@@ -191,9 +191,9 @@
         boolean hasNonPublicInterface = false;
 
         // define proxy in class loader of non-public interface(s), if any
-        Class[] classObjs = new Class[interfaces.length];
+        Class<?>[] classObjs = new Class<?>[interfaces.length];
         for (int i = 0; i < interfaces.length; i++) {
-            Class cl = Class.forName(interfaces[i], false, classLoader);
+            Class<?> cl = Class.forName(interfaces[i], false, classLoader);
             if ((cl.getModifiers() & Modifier.PUBLIC) == 0) {
                 if (hasNonPublicInterface) {
                     if (nonPublicLoader != cl.getClassLoader()) {
--- a/jdk/src/share/classes/sun/awt/dnd/SunDragSourceContextPeer.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/awt/dnd/SunDragSourceContextPeer.java	Mon Jun 02 13:53:52 2014 -0700
@@ -146,7 +146,7 @@
     }
 
     protected abstract void startDrag(Transferable trans,
-                                      long[] formats, Map formatMap);
+                                      long[] formats, Map<Long, DataFlavor> formatMap);
 
     /**
      * set cursor
--- a/jdk/src/share/classes/sun/awt/dnd/SunDropTargetContextPeer.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/awt/dnd/SunDropTargetContextPeer.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -239,17 +239,24 @@
 
         if (localTransferable != null) {
             return localTransferable.getTransferData(df);
+        } else if (df.isMimeTypeEqual(DataFlavor.javaJVMLocalObjectMimeType)) {
+            // Workaround to JDK-8024061: Exception thrown when drag and drop
+            //      between two components is executed quickly.
+            // It is expected localTransferable is not null if javaJVMLocalObjectMimeType
+            // is used. Executing further results in ClassCastException, so null is
+            // returned here as no transfer data is available in this case.
+            return null;
         }
 
         if (dropStatus != STATUS_ACCEPT || dropComplete) {
             throw new InvalidDnDOperationException("No drop current");
         }
 
-        Map flavorMap = DataTransferer.getInstance().getFlavorsForFormats
-            (currentT, DataTransferer.adaptFlavorMap
+        Map<DataFlavor, Long> flavorMap = DataTransferer.getInstance()
+            .getFlavorsForFormats(currentT, DataTransferer.adaptFlavorMap
                 (currentDT.getFlavorMap()));
 
-        lFormat = (Long)flavorMap.get(df);
+        lFormat = flavorMap.get(df);
         if (lFormat == null) {
             throw new UnsupportedFlavorException(df);
         }
@@ -738,7 +745,7 @@
         // dispatcher state fields
         private int returnValue = 0;
         // set of events to be dispatched by this dispatcher
-        private final HashSet eventSet = new HashSet(3);
+        private final HashSet<SunDropTargetEvent> eventSet = new HashSet<>(3);
 
         static final ToolkitThreadBlockedHandler handler =
             DataTransferer.getInstance().getToolkitThreadBlockedHandler();
--- a/jdk/src/share/classes/sun/awt/geom/AreaOp.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/awt/geom/AreaOp.java	Mon Jun 02 13:53:52 2014 -0700
@@ -152,36 +152,36 @@
 
     public abstract int getState();
 
-    public Vector calculate(Vector left, Vector right) {
-        Vector edges = new Vector();
+    public Vector<Curve> calculate(Vector<Curve> left, Vector<Curve> right) {
+        Vector<Edge> edges = new Vector<>();
         addEdges(edges, left, AreaOp.CTAG_LEFT);
         addEdges(edges, right, AreaOp.CTAG_RIGHT);
-        edges = pruneEdges(edges);
+        Vector<Curve> curves = pruneEdges(edges);
         if (false) {
             System.out.println("result: ");
-            int numcurves = edges.size();
-            Curve[] curvelist = (Curve[]) edges.toArray(new Curve[numcurves]);
+            int numcurves = curves.size();
+            Curve[] curvelist = curves.toArray(new Curve[numcurves]);
             for (int i = 0; i < numcurves; i++) {
                 System.out.println("curvelist["+i+"] = "+curvelist[i]);
             }
         }
-        return edges;
+        return curves;
     }
 
-    private static void addEdges(Vector edges, Vector curves, int curvetag) {
-        Enumeration enum_ = curves.elements();
+    private static void addEdges(Vector<Edge> edges, Vector<Curve> curves, int curvetag) {
+        Enumeration<Curve> enum_ = curves.elements();
         while (enum_.hasMoreElements()) {
-            Curve c = (Curve) enum_.nextElement();
+            Curve c = enum_.nextElement();
             if (c.getOrder() > 0) {
                 edges.add(new Edge(c, curvetag));
             }
         }
     }
 
-    private static Comparator YXTopComparator = new Comparator() {
-        public int compare(Object o1, Object o2) {
-            Curve c1 = ((Edge) o1).getCurve();
-            Curve c2 = ((Edge) o2).getCurve();
+    private static Comparator<Edge> YXTopComparator = new Comparator<Edge>() {
+        public int compare(Edge o1, Edge o2) {
+            Curve c1 = o1.getCurve();
+            Curve c2 = o2.getCurve();
             double v1, v2;
             if ((v1 = c1.getYTop()) == (v2 = c2.getYTop())) {
                 if ((v1 = c1.getXTop()) == (v2 = c2.getXTop())) {
@@ -195,12 +195,13 @@
         }
     };
 
-    private Vector pruneEdges(Vector edges) {
+    private Vector<Curve> pruneEdges(Vector<Edge> edges) {
         int numedges = edges.size();
         if (numedges < 2) {
-            return edges;
+            // empty vector is expected with less than 2 edges
+            return new Vector<>();
         }
-        Edge[] edgelist = (Edge[]) edges.toArray(new Edge[numedges]);
+        Edge[] edgelist = edges.toArray(new Edge[numedges]);
         Arrays.sort(edgelist, YXTopComparator);
         if (false) {
             System.out.println("pruning: ");
@@ -214,9 +215,9 @@
         int cur = 0;
         int next = 0;
         double yrange[] = new double[2];
-        Vector subcurves = new Vector();
-        Vector chains = new Vector();
-        Vector links = new Vector();
+        Vector<CurveLink> subcurves = new Vector<>();
+        Vector<ChainEnd> chains = new Vector<>();
+        Vector<CurveLink> links = new Vector<>();
         // Active edges are between left (inclusive) and right (exclusive)
         while (left < numedges) {
             double y = yrange[0];
@@ -385,7 +386,7 @@
             if (false) {
                 System.out.println("new links:");
                 for (int i = 0; i < links.size(); i++) {
-                    CurveLink link = (CurveLink) links.elementAt(i);
+                    CurveLink link = links.elementAt(i);
                     System.out.println("  "+link.getSubCurve());
                 }
             }
@@ -396,10 +397,10 @@
             yrange[0] = yend;
         }
         finalizeSubCurves(subcurves, chains);
-        Vector ret = new Vector();
-        Enumeration enum_ = subcurves.elements();
+        Vector<Curve> ret = new Vector<>();
+        Enumeration<CurveLink> enum_ = subcurves.elements();
         while (enum_.hasMoreElements()) {
-            CurveLink link = (CurveLink) enum_.nextElement();
+            CurveLink link = enum_.nextElement();
             ret.add(link.getMoveto());
             CurveLink nextlink = link;
             while ((nextlink = nextlink.getNext()) != null) {
@@ -413,7 +414,8 @@
         return ret;
     }
 
-    public static void finalizeSubCurves(Vector subcurves, Vector chains) {
+    public static void finalizeSubCurves(Vector<CurveLink> subcurves,
+                                         Vector<ChainEnd> chains) {
         int numchains = chains.size();
         if (numchains == 0) {
             return;
@@ -437,9 +439,9 @@
     private static CurveLink[] EmptyLinkList = new CurveLink[2];
     private static ChainEnd[] EmptyChainList = new ChainEnd[2];
 
-    public static void resolveLinks(Vector subcurves,
-                                    Vector chains,
-                                    Vector links)
+    public static void resolveLinks(Vector<CurveLink> subcurves,
+                                    Vector<ChainEnd> chains,
+                                    Vector<CurveLink> links)
     {
         int numlinks = links.size();
         CurveLink[] linklist;
--- a/jdk/src/share/classes/sun/awt/geom/Crossings.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/awt/geom/Crossings.java	Mon Jun 02 13:53:52 2014 -0700
@@ -77,14 +77,14 @@
 
     public abstract boolean covers(double ystart, double yend);
 
-    public static Crossings findCrossings(Vector curves,
+    public static Crossings findCrossings(Vector<? extends Curve> curves,
                                           double xlo, double ylo,
                                           double xhi, double yhi)
     {
         Crossings cross = new EvenOdd(xlo, ylo, xhi, yhi);
-        Enumeration enum_ = curves.elements();
+        Enumeration<? extends Curve> enum_ = curves.elements();
         while (enum_.hasMoreElements()) {
-            Curve c = (Curve) enum_.nextElement();
+            Curve c = enum_.nextElement();
             if (c.accumulateCrossings(cross)) {
                 return null;
             }
@@ -237,7 +237,7 @@
         return false;
     }
 
-    private Vector tmp = new Vector();
+    private Vector<Curve> tmp = new Vector<>();
 
     public boolean accumulateQuad(double x0, double y0, double coords[]) {
         if (y0 < ylo && coords[1] < ylo && coords[3] < ylo) {
@@ -258,9 +258,9 @@
             return false;
         }
         Curve.insertQuad(tmp, x0, y0, coords);
-        Enumeration enum_ = tmp.elements();
+        Enumeration<Curve> enum_ = tmp.elements();
         while (enum_.hasMoreElements()) {
-            Curve c = (Curve) enum_.nextElement();
+            Curve c = enum_.nextElement();
             if (c.accumulateCrossings(this)) {
                 return true;
             }
@@ -296,9 +296,9 @@
             return false;
         }
         Curve.insertCubic(tmp, x0, y0, coords);
-        Enumeration enum_ = tmp.elements();
+        Enumeration<Curve> enum_ = tmp.elements();
         while (enum_.hasMoreElements()) {
-            Curve c = (Curve) enum_.nextElement();
+            Curve c = enum_.nextElement();
             if (c.accumulateCrossings(this)) {
                 return true;
             }
--- a/jdk/src/share/classes/sun/awt/geom/Curve.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/awt/geom/Curve.java	Mon Jun 02 13:53:52 2014 -0700
@@ -38,11 +38,11 @@
 
     protected int direction;
 
-    public static void insertMove(Vector curves, double x, double y) {
+    public static void insertMove(Vector<Curve> curves, double x, double y) {
         curves.add(new Order0(x, y));
     }
 
-    public static void insertLine(Vector curves,
+    public static void insertLine(Vector<Curve> curves,
                                   double x0, double y0,
                                   double x1, double y1)
     {
@@ -59,7 +59,7 @@
         }
     }
 
-    public static void insertQuad(Vector curves,
+    public static void insertQuad(Vector<Curve> curves,
                                   double x0, double y0,
                                   double coords[])
     {
@@ -82,7 +82,7 @@
         }
     }
 
-    public static void insertCubic(Vector curves,
+    public static void insertCubic(Vector<Curve> curves,
                                    double x0, double y0,
                                    double coords[])
     {
--- a/jdk/src/share/classes/sun/awt/geom/Order2.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/awt/geom/Order2.java	Mon Jun 02 13:53:52 2014 -0700
@@ -47,7 +47,7 @@
     private double ycoeff1;
     private double ycoeff2;
 
-    public static void insert(Vector curves, double tmp[],
+    public static void insert(Vector<Curve> curves, double tmp[],
                               double x0, double y0,
                               double cx0, double cy0,
                               double x1, double y1,
@@ -74,7 +74,7 @@
                     tmp[i1 + 4], tmp[i1 + 5], direction);
     }
 
-    public static void addInstance(Vector curves,
+    public static void addInstance(Vector<Curve> curves,
                                    double x0, double y0,
                                    double cx0, double cy0,
                                    double x1, double y1,
--- a/jdk/src/share/classes/sun/awt/geom/Order3.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/awt/geom/Order3.java	Mon Jun 02 13:53:52 2014 -0700
@@ -53,7 +53,7 @@
     private double ycoeff2;
     private double ycoeff3;
 
-    public static void insert(Vector curves, double tmp[],
+    public static void insert(Vector<Curve> curves, double tmp[],
                               double x0, double y0,
                               double cx0, double cy0,
                               double cx1, double cy1,
@@ -105,7 +105,7 @@
         }
     }
 
-    public static void addInstance(Vector curves,
+    public static void addInstance(Vector<Curve> curves,
                                    double x0, double y0,
                                    double cx0, double cy0,
                                    double cx1, double cy1,
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/sun/awt/image/AbstractMultiResolutionImage.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package sun.awt.image;
+
+import java.awt.Graphics;
+import java.awt.Image;
+import java.awt.image.*;
+
+/**
+ * This class provides default implementations for the
+ * <code>MultiResolutionImage</code> interface. The developer needs only
+ * to subclass this abstract class and define the <code>getResolutionVariant</code>,
+ * <code>getResolutionVariants</code>, and <code>getBaseImage</code> methods.
+ *
+ *
+ * For example,
+ * {@code
+ * public class CustomMultiResolutionImage extends AbstractMultiResolutionImage {
+ *
+ *     int baseImageIndex;
+ *     Image[] resolutionVariants;
+ *
+ *     public CustomMultiResolutionImage(int baseImageIndex,
+ *             Image... resolutionVariants) {
+ *          this.baseImageIndex = baseImageIndex;
+ *          this.resolutionVariants = resolutionVariants;
+ *     }
+ *
+ *     @Override
+ *     public Image getResolutionVariant(float logicalDPIX, float logicalDPIY,
+ *             float baseImageWidth, float baseImageHeight,
+ *             float destImageWidth, float destImageHeight) {
+ *         // return a resolution variant based on the given logical DPI,
+ *         // base image size, or destination image size
+ *     }
+ *
+ *     @Override
+ *     public List<Image> getResolutionVariants() {
+ *         return Arrays.asList(resolutionVariants);
+ *     }
+ *
+ *     protected Image getBaseImage() {
+ *         return resolutionVariants[baseImageIndex];
+ *     }
+ * }
+ * }
+ *
+ * @see java.awt.Image
+ * @see java.awt.image.MultiResolutionImage
+ *
+ * @since 1.9
+ */
+public abstract class AbstractMultiResolutionImage extends java.awt.Image
+        implements MultiResolutionImage {
+
+    /**
+     * @inheritDoc
+     */
+    @Override
+    public int getWidth(ImageObserver observer) {
+        return getBaseImage().getWidth(null);
+    }
+
+    /**
+     * @inheritDoc
+     */
+    @Override
+    public int getHeight(ImageObserver observer) {
+        return getBaseImage().getHeight(null);
+    }
+
+    /**
+     * @inheritDoc
+     */
+    @Override
+    public ImageProducer getSource() {
+        return getBaseImage().getSource();
+    }
+
+    /**
+     * @inheritDoc
+     */
+    @Override
+    public Graphics getGraphics() {
+        return getBaseImage().getGraphics();
+
+    }
+
+    /**
+     * @inheritDoc
+     */
+    @Override
+    public Object getProperty(String name, ImageObserver observer) {
+        return getBaseImage().getProperty(name, observer);
+    }
+
+    /**
+     * @return base image
+     */
+    protected abstract Image getBaseImage();
+}
--- a/jdk/src/share/classes/sun/awt/image/BufImgSurfaceData.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/awt/image/BufImgSurfaceData.java	Mon Jun 02 13:53:52 2014 -0700
@@ -51,7 +51,7 @@
     private BufferedImageGraphicsConfig graphicsConfig;
     RenderLoops solidloops;
 
-    private static native void initIDs(Class ICM, Class ICMColorData);
+    private static native void initIDs(Class<?> ICM, Class<?> ICMColorData);
 
     private static final int DCM_RGBX_RED_MASK   = 0xff000000;
     private static final int DCM_RGBX_GREEN_MASK = 0x00ff0000;
--- a/jdk/src/share/classes/sun/awt/image/GifImageDecoder.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/awt/image/GifImageDecoder.java	Mon Jun 02 13:53:52 2014 -0700
@@ -61,7 +61,7 @@
     int trans_pixel = -1;
     IndexColorModel global_model;
 
-    Hashtable props = new Hashtable();
+    Hashtable<String, Object> props = new Hashtable<>();
 
     byte[] saved_image;
     IndexColorModel saved_model;
--- a/jdk/src/share/classes/sun/awt/image/ImageDecoder.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/awt/image/ImageDecoder.java	Mon Jun 02 13:53:52 2014 -0700
@@ -83,7 +83,7 @@
         return count;
     }
 
-    protected int setProperties(Hashtable props) {
+    protected int setProperties(Hashtable<?,?> props) {
         ImageConsumerQueue cq = null;
         int count = 0;
         while ((cq = nextConsumer(cq)) != null) {
@@ -164,7 +164,7 @@
         source.doneDecoding(this);
         close();
         java.security.AccessController.doPrivileged(
-            new java.security.PrivilegedAction() {
+            new java.security.PrivilegedAction<Object>() {
             public Object run() {
                 feeder.interrupt();
                 return null;
--- a/jdk/src/share/classes/sun/awt/image/ImageFetcher.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/awt/image/ImageFetcher.java	Mon Jun 02 13:53:52 2014 -0700
@@ -152,7 +152,7 @@
                         info.numWaiting--;
                     }
                 }
-                src = (ImageFetchable) info.waitList.elementAt(0);
+                src = info.waitList.elementAt(0);
                 info.waitList.removeElement(src);
             }
             return src;
@@ -303,26 +303,25 @@
        final ThreadGroup fetcherGroup = fetcherThreadGroup;
 
        java.security.AccessController.doPrivileged(
-         new java.security.PrivilegedAction() {
-         public Object run() {
-             for (int i = 0; i < info.fetchers.length; i++) {
-               if (info.fetchers[i] == null) {
-                   ImageFetcher f = new ImageFetcher(
-                           fetcherGroup, i);
-                   try {
-                       f.start();
-                       info.fetchers[i] = f;
-                       info.numFetchers++;
-                       break;
-                   } catch (Error e) {
+           new java.security.PrivilegedAction<Object>() {
+               public Object run() {
+                   for (int i = 0; i < info.fetchers.length; i++) {
+                       if (info.fetchers[i] == null) {
+                           ImageFetcher f = new ImageFetcher(fetcherGroup, i);
+                       try {
+                           f.start();
+                           info.fetchers[i] = f;
+                           info.numFetchers++;
+                           break;
+                       } catch (Error e) {
+                       }
                    }
+                 }
+                 return null;
                }
-             }
-          return null;
-        }
-       });
-      return;
-    }
+           });
+       return;
+   }
 
 }
 
@@ -337,13 +336,13 @@
     Thread[] fetchers;
     int numFetchers;
     int numWaiting;
-    Vector waitList;
+    Vector<ImageFetchable> waitList;
 
     private FetcherInfo() {
         fetchers = new Thread[MAX_NUM_FETCHERS_PER_APPCONTEXT];
         numFetchers = 0;
         numWaiting = 0;
-        waitList = new Vector();
+        waitList = new Vector<>();
     }
 
     /* The key to put()/get() the FetcherInfo into/from the AppContext. */
--- a/jdk/src/share/classes/sun/awt/image/ImageRepresentation.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/awt/image/ImageRepresentation.java	Mon Jun 02 13:53:52 2014 -0700
@@ -185,7 +185,7 @@
     protected BufferedImage createImage(ColorModel cm,
                                         WritableRaster raster,
                                         boolean isRasterPremultiplied,
-                                        Hashtable properties)
+                                        Hashtable<?,?> properties)
     {
         BufferedImage bi =
             new BufferedImage(cm, raster, isRasterPremultiplied, null);
--- a/jdk/src/share/classes/sun/awt/image/ImagingLib.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/awt/image/ImagingLib.java	Mon Jun 02 13:53:52 2014 -0700
@@ -61,7 +61,7 @@
     private static final int AFFINE_OP   = 1;
     private static final int CONVOLVE_OP = 2;
 
-    private static Class[] nativeOpClass = new Class[NUM_NATIVE_OPS];
+    private static Class<?>[] nativeOpClass = new Class<?>[NUM_NATIVE_OPS];
 
     /**
      * Returned value indicates whether the library initailization was
@@ -134,7 +134,7 @@
 
     }
 
-    private static int getNativeOpIndex(Class opClass) {
+    private static int getNativeOpIndex(Class<?> opClass) {
         //
         // Search for this class in cached list of
         // classes supplying native acceleration
--- a/jdk/src/share/classes/sun/awt/image/JPEGImageDecoder.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/awt/image/JPEGImageDecoder.java	Mon Jun 02 13:53:52 2014 -0700
@@ -47,8 +47,8 @@
     private static ColorModel ARGBcolormodel;
     private static ColorModel Graycolormodel;
 
-    private static final Class InputStreamClass = InputStream.class;
-    private static native void initIDs(Class InputStreamClass);
+    private static final Class<?> InputStreamClass = InputStream.class;
+    private static native void initIDs(Class<?> InputStreamClass);
 
     private ColorModel colormodel;
 
@@ -73,7 +73,7 @@
     private native void readImage(InputStream is, byte buf[])
         throws ImageFormatException, IOException;
 
-    Hashtable props = new Hashtable();
+    Hashtable<String, Object> props = new Hashtable<>();
 
     public JPEGImageDecoder(InputStreamImageSource src, InputStream is) {
         super(src, is);
--- a/jdk/src/share/classes/sun/awt/image/MultiResolutionBufferedImage.java	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,185 +0,0 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.awt.image;
-
-import java.awt.Dimension;
-import java.awt.Image;
-import java.awt.Graphics;
-import java.awt.geom.Dimension2D;
-import java.awt.image.BufferedImage;
-import java.awt.image.ImageObserver;
-import java.util.Arrays;
-import java.util.List;
-import java.util.function.Function;
-import java.util.function.BiFunction;
-import java.util.stream.Collectors;
-
-public class MultiResolutionBufferedImage extends BufferedImage
-        implements MultiResolutionImage {
-
-    private final BiFunction<Integer, Integer, Image> mapper;
-    private final Dimension2D[] sizes;
-    private int availableInfo;
-
-    public MultiResolutionBufferedImage(Image baseImage,
-            BiFunction<Integer, Integer, Image> mapper) {
-        this(baseImage, new Dimension[]{new Dimension(
-            baseImage.getWidth(null), baseImage.getHeight(null))
-        }, mapper);
-    }
-
-    public MultiResolutionBufferedImage(Image baseImage,
-            Dimension2D[] sizes, BiFunction<Integer, Integer, Image> mapper) {
-        super(baseImage.getWidth(null), baseImage.getHeight(null),
-                BufferedImage.TYPE_INT_ARGB_PRE);
-        this.sizes = sizes;
-        this.mapper = mapper;
-        this.availableInfo = getInfo(baseImage);
-        Graphics g = getGraphics();
-        g.drawImage(baseImage, 0, 0, null);
-        g.dispose();
-    }
-
-    @Override
-    public Image getResolutionVariant(int width, int height) {
-        int baseWidth = getWidth();
-        int baseHeight = getHeight();
-
-        if (baseWidth == width && baseHeight == height) {
-            return this;
-        }
-
-        ImageCache cache = ImageCache.getInstance();
-        ImageCacheKey key = new ImageCacheKey(this, width, height);
-        Image resolutionVariant = cache.getImage(key);
-        if (resolutionVariant == null) {
-            resolutionVariant = mapper.apply(width, height);
-            cache.setImage(key, resolutionVariant);
-            preload(resolutionVariant, availableInfo);
-        }
-
-        return resolutionVariant;
-    }
-
-    @Override
-    public List<Image> getResolutionVariants() {
-        return Arrays.stream(sizes).map((Function<Dimension2D, Image>) size
-                -> getResolutionVariant((int) size.getWidth(),
-                        (int) size.getHeight())).collect(Collectors.toList());
-    }
-
-    public MultiResolutionBufferedImage map(Function<Image, Image> mapper) {
-        return new MultiResolutionBufferedImage(mapper.apply(this), sizes,
-                (width, height) ->
-                        mapper.apply(getResolutionVariant(width, height)));
-    }
-
-    @Override
-    public int getWidth(ImageObserver observer) {
-        availableInfo |= ImageObserver.WIDTH;
-        return super.getWidth(observer);
-    }
-
-    @Override
-    public int getHeight(ImageObserver observer) {
-        availableInfo |= ImageObserver.HEIGHT;
-        return super.getHeight(observer);
-    }
-
-    @Override
-    public Object getProperty(String name, ImageObserver observer) {
-        availableInfo |= ImageObserver.PROPERTIES;
-        return super.getProperty(name, observer);
-    }
-
-    private static int getInfo(Image image) {
-        if (image instanceof ToolkitImage) {
-            return ((ToolkitImage) image).getImageRep().check(
-                    (img, infoflags, x, y, w, h) -> false);
-        }
-        return 0;
-    }
-
-    private static void preload(Image image, int availableInfo) {
-        if (availableInfo != 0 && image instanceof ToolkitImage) {
-            ((ToolkitImage) image).preload(new ImageObserver() {
-                int flags = availableInfo;
-
-                @Override
-                public boolean imageUpdate(Image img, int infoflags,
-                        int x, int y, int width, int height) {
-                    flags &= ~infoflags;
-                    return (flags != 0) && ((infoflags
-                            & (ImageObserver.ERROR | ImageObserver.ABORT)) == 0);
-                }
-            });
-        }
-    }
-
-    private static class ImageCacheKey implements ImageCache.PixelsKey {
-
-        private final int pixelCount;
-        private final int hash;
-
-        private final int w;
-        private final int h;
-        private final Image baseImage;
-
-        ImageCacheKey(final Image baseImage,
-                final int w, final int h) {
-            this.baseImage = baseImage;
-            this.w = w;
-            this.h = h;
-            this.pixelCount = w * h;
-            hash = hash();
-        }
-
-        @Override
-        public int getPixelCount() {
-            return pixelCount;
-        }
-
-        private int hash() {
-            int hash = baseImage.hashCode();
-            hash = 31 * hash + w;
-            hash = 31 * hash + h;
-            return hash;
-        }
-
-        @Override
-        public int hashCode() {
-            return hash;
-        }
-
-        @Override
-        public boolean equals(Object obj) {
-            if (obj instanceof ImageCacheKey) {
-                ImageCacheKey key = (ImageCacheKey) obj;
-                return baseImage == key.baseImage && w == key.w && h == key.h;
-            }
-            return false;
-        }
-    }
-}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/sun/awt/image/MultiResolutionCachedImage.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,181 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package sun.awt.image;
+
+import java.awt.Dimension;
+import java.awt.Image;
+import java.awt.geom.Dimension2D;
+import java.awt.image.ImageObserver;
+import java.util.Arrays;
+import java.util.List;
+import java.util.function.Function;
+import java.util.function.BiFunction;
+import java.util.stream.Collectors;
+
+public class MultiResolutionCachedImage extends AbstractMultiResolutionImage {
+
+    private final int baseImageWidth;
+    private final int baseImageHeight;
+    private final Dimension2D[] sizes;
+    private final BiFunction<Integer, Integer, Image> mapper;
+    private int availableInfo;
+
+    public MultiResolutionCachedImage(int baseImageWidth, int baseImageHeight,
+            BiFunction<Integer, Integer, Image> mapper) {
+        this(baseImageWidth, baseImageHeight, new Dimension[]{new Dimension(
+            baseImageWidth, baseImageHeight)
+        }, mapper);
+    }
+
+    public MultiResolutionCachedImage(int baseImageWidth, int baseImageHeight,
+            Dimension2D[] sizes, BiFunction<Integer, Integer, Image> mapper) {
+        this.baseImageWidth = baseImageWidth;
+        this.baseImageHeight = baseImageHeight;
+        this.sizes = sizes;
+        this.mapper = mapper;
+    }
+
+    @Override
+    public Image getResolutionVariant(int width, int height) {
+        ImageCache cache = ImageCache.getInstance();
+        ImageCacheKey key = new ImageCacheKey(this, width, height);
+        Image resolutionVariant = cache.getImage(key);
+        if (resolutionVariant == null) {
+            resolutionVariant = mapper.apply(width, height);
+            cache.setImage(key, resolutionVariant);
+        }
+        preload(resolutionVariant, availableInfo);
+        return resolutionVariant;
+    }
+
+    @Override
+    public List<Image> getResolutionVariants() {
+        return Arrays.stream(sizes).map((Function<Dimension2D, Image>) size
+                -> getResolutionVariant((int) size.getWidth(),
+                        (int) size.getHeight())).collect(Collectors.toList());
+    }
+
+    public MultiResolutionCachedImage map(Function<Image, Image> mapper) {
+        return new MultiResolutionCachedImage(baseImageWidth, baseImageHeight,
+                sizes, (width, height) ->
+                        mapper.apply(getResolutionVariant(width, height)));
+    }
+
+    @Override
+    public int getWidth(ImageObserver observer) {
+        updateInfo(observer, ImageObserver.WIDTH);
+        return super.getWidth(observer);
+    }
+
+    @Override
+    public int getHeight(ImageObserver observer) {
+        updateInfo(observer, ImageObserver.HEIGHT);
+        return super.getHeight(observer);
+    }
+
+    @Override
+    public Object getProperty(String name, ImageObserver observer) {
+        updateInfo(observer, ImageObserver.PROPERTIES);
+        return super.getProperty(name, observer);
+    }
+
+    @Override
+    protected Image getBaseImage() {
+        return getResolutionVariant(baseImageWidth, baseImageHeight);
+    }
+
+    private void updateInfo(ImageObserver observer, int info) {
+        availableInfo |= (observer == null) ? ImageObserver.ALLBITS : info;
+    }
+
+    private static int getInfo(Image image) {
+        if (image instanceof ToolkitImage) {
+            return ((ToolkitImage) image).getImageRep().check(
+                    (img, infoflags, x, y, w, h) -> false);
+        }
+        return 0;
+    }
+
+    private static void preload(Image image, int availableInfo) {
+        if (availableInfo != 0 && image instanceof ToolkitImage) {
+            ((ToolkitImage) image).preload(new ImageObserver() {
+                int flags = availableInfo;
+
+                @Override
+                public boolean imageUpdate(Image img, int infoflags,
+                        int x, int y, int width, int height) {
+                    flags &= ~infoflags;
+                    return (flags != 0) && ((infoflags
+                            & (ImageObserver.ERROR | ImageObserver.ABORT)) == 0);
+                }
+            });
+        }
+    }
+
+    private static class ImageCacheKey implements ImageCache.PixelsKey {
+
+        private final int pixelCount;
+        private final int hash;
+
+        private final int w;
+        private final int h;
+        private final Image baseImage;
+
+        ImageCacheKey(final Image baseImage,
+                final int w, final int h) {
+            this.baseImage = baseImage;
+            this.w = w;
+            this.h = h;
+            this.pixelCount = w * h;
+            hash = hash();
+        }
+
+        @Override
+        public int getPixelCount() {
+            return pixelCount;
+        }
+
+        private int hash() {
+            int hash = baseImage.hashCode();
+            hash = 31 * hash + w;
+            hash = 31 * hash + h;
+            return hash;
+        }
+
+        @Override
+        public int hashCode() {
+            return hash;
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (obj instanceof ImageCacheKey) {
+                ImageCacheKey key = (ImageCacheKey) obj;
+                return baseImage == key.baseImage && w == key.w && h == key.h;
+            }
+            return false;
+        }
+    }
+}
\ No newline at end of file
--- a/jdk/src/share/classes/sun/awt/image/OffScreenImageSource.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/awt/image/OffScreenImageSource.java	Mon Jun 02 13:53:52 2014 -0700
@@ -40,15 +40,15 @@
     BufferedImage image;
     int width;
     int height;
-    Hashtable properties;
+    Hashtable<?, ?> properties;
 
     public OffScreenImageSource(BufferedImage image,
-                                Hashtable properties) {
+                                Hashtable<?, ?> properties) {
         this.image = image;
         if (properties != null) {
             this.properties = properties;
         } else {
-            this.properties = new Hashtable();
+            this.properties = new Hashtable<String, Object>();
         }
         width  = image.getWidth();
         height = image.getHeight();
--- a/jdk/src/share/classes/sun/awt/image/PNGImageDecoder.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/awt/image/PNGImageDecoder.java	Mon Jun 02 13:53:52 2014 -0700
@@ -68,7 +68,7 @@
     private int filterMethod;
     private int interlaceMethod;
     private int gamma = 100000;
-    private java.util.Hashtable properties;
+    private java.util.Hashtable<String, Object> properties;
   /* this is not needed
     ImageConsumer target;
     */
@@ -83,7 +83,7 @@
 
     private void property(String key,Object value) {
         if(value==null) return;
-        if(properties==null) properties=new java.util.Hashtable();
+        if(properties==null) properties=new java.util.Hashtable<>();
         properties.put(key,value);
     }
     private void property(String key,float value) {
--- a/jdk/src/share/classes/sun/awt/image/ToolkitImage.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/awt/image/ToolkitImage.java	Mon Jun 02 13:53:52 2014 -0700
@@ -79,7 +79,7 @@
 
     private int width = -1;
     private int height = -1;
-    private Hashtable properties;
+    private Hashtable<?, ?> properties;
 
     private int availinfo;
 
@@ -254,9 +254,9 @@
         addInfo(ImageObserver.WIDTH | ImageObserver.HEIGHT);
     }
 
-    void setProperties(Hashtable props) {
+    void setProperties(Hashtable<?, ?> props) {
         if (props == null) {
-            props = new Hashtable();
+            props = new Hashtable<String, Object>();
         }
         properties = props;
         addInfo(ImageObserver.PROPERTIES);
--- a/jdk/src/share/classes/sun/awt/shell/ShellFolder.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/awt/shell/ShellFolder.java	Mon Jun 02 13:53:52 2014 -0700
@@ -127,14 +127,14 @@
         File[] files = super.listFiles();
 
         if (!includeHiddenFiles) {
-            Vector v = new Vector();
+            Vector<File> v = new Vector<>();
             int nameCount = (files == null) ? 0 : files.length;
             for (int i = 0; i < nameCount; i++) {
                 if (!files[i].isHidden()) {
                     v.addElement(files[i]);
                 }
             }
-            files = (File[])v.toArray(new File[v.size()]);
+            files = v.toArray(new File[v.size()]);
         }
 
         return files;
@@ -208,7 +208,7 @@
     static {
         String managerClassName = (String)Toolkit.getDefaultToolkit().
                                       getDesktopProperty("Shell.shellFolderManager");
-        Class managerClass = null;
+        Class<?> managerClass = null;
         try {
             managerClass = ReflectUtil.forName(managerClassName);
         // swallow the exceptions below and use default shell folder
@@ -554,7 +554,7 @@
     /**
      * Provides a default comparator for the default column set
      */
-    private static final Comparator DEFAULT_COMPARATOR = new Comparator() {
+    private static final Comparator<Object> DEFAULT_COMPARATOR = new Comparator<Object>() {
         public int compare(Object o1, Object o2) {
             int gt;
 
@@ -565,7 +565,9 @@
             } else if (o1 == null && o2 != null) {
                 gt = -1;
             } else if (o1 instanceof Comparable) {
-                gt = ((Comparable) o1).compareTo(o2);
+                @SuppressWarnings("unchecked")
+                Comparable<Object> o = (Comparable<Object>) o1;
+                gt = o.compareTo(o2);
             } else {
                 gt = 0;
             }
--- a/jdk/src/share/classes/sun/awt/shell/ShellFolderColumnInfo.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/awt/shell/ShellFolderColumnInfo.java	Mon Jun 02 13:53:52 2014 -0700
@@ -38,7 +38,7 @@
      */
     private Integer alignment;
     private SortOrder sortOrder;
-    private Comparator comparator;
+    private Comparator<?> comparator;
     /**
      * <code>false</code> (default) if the {@link comparator} expects folders as arguments,
      * and <code>true</code> if folder's column values. The first option is used default for comparison
@@ -49,7 +49,7 @@
 
     public ShellFolderColumnInfo(String title, Integer width,
                                  Integer alignment, boolean visible,
-                                 SortOrder sortOrder, Comparator comparator,
+                                 SortOrder sortOrder, Comparator<?> comparator,
                                  boolean compareByColumn) {
         this.title = title;
         this.width = width;
@@ -62,7 +62,7 @@
 
     public ShellFolderColumnInfo(String title, Integer width,
                                  Integer alignment, boolean visible,
-                                 SortOrder sortOrder, Comparator comparator) {
+                                 SortOrder sortOrder, Comparator<?> comparator) {
         this(title, width, alignment, visible, sortOrder, comparator, false);
     }
 
@@ -115,11 +115,11 @@
         this.sortOrder = sortOrder;
     }
 
-    public Comparator getComparator() {
+    public Comparator<?> getComparator() {
         return comparator;
     }
 
-    public void setComparator(Comparator comparator) {
+    public void setComparator(Comparator<?> comparator) {
         this.comparator = comparator;
     }
 
--- a/jdk/src/share/classes/sun/awt/util/IdentityArrayList.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/awt/util/IdentityArrayList.java	Mon Jun 02 13:53:52 2014 -0700
@@ -285,6 +285,7 @@
      *         this list
      * @throws NullPointerException if the specified array is null
      */
+    @SuppressWarnings("unchecked")
     public <T> T[] toArray(T[] a) {
         if (a.length < size)
             // Make a new array of a's runtime type, but my contents:
@@ -307,7 +308,9 @@
     public E get(int index) {
         rangeCheck(index);
 
-        return (E) elementData[index];
+        @SuppressWarnings("unchecked")
+        E rv = (E) elementData[index];
+        return rv;
     }
 
     /**
@@ -322,6 +325,7 @@
     public E set(int index, E element) {
         rangeCheck(index);
 
+        @SuppressWarnings("unchecked")
         E oldValue = (E) elementData[index];
         elementData[index] = element;
         return oldValue;
@@ -371,6 +375,7 @@
         rangeCheck(index);
 
         modCount++;
+        @SuppressWarnings("unchecked")
         E oldValue = (E) elementData[index];
 
         int numMoved = size - index - 1;
--- a/jdk/src/share/classes/sun/awt/util/IdentityLinkedList.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/awt/util/IdentityLinkedList.java	Mon Jun 02 13:53:52 2014 -0700
@@ -280,7 +280,9 @@
         Entry<E> successor = (index==size ? header : entry(index));
         Entry<E> predecessor = successor.previous;
         for (int i=0; i<numNew; i++) {
-            Entry<E> e = new Entry<E>((E)a[i], successor, predecessor);
+            @SuppressWarnings("unchecked")
+            E tmp = (E) a[i];
+            Entry<E> e = new Entry<E>(tmp, successor, predecessor);
             predecessor.next = e;
             predecessor = e;
         }
@@ -396,7 +398,7 @@
      */
     public int indexOf(Object o) {
         int index = 0;
-        for (Entry e = header.next; e != header; e = e.next) {
+        for (Entry<E> e = header.next; e != header; e = e.next) {
             if (o == e.element) {
                 return index;
             }
@@ -418,7 +420,7 @@
      */
     public int lastIndexOf(Object o) {
         int index = size;
-        for (Entry e = header.previous; e != header; e = e.previous) {
+        for (Entry<E> e = header.previous; e != header; e = e.previous) {
             index--;
             if (o == e.element) {
                 return index;
@@ -787,7 +789,7 @@
     }
 
     /** Adapter to provide descending iterators via ListItr.previous */
-    private class DescendingIterator implements Iterator {
+    private class DescendingIterator implements Iterator<E> {
         final ListItr itr = new ListItr(size());
         public boolean hasNext() {
             return itr.hasPrevious();
@@ -860,6 +862,7 @@
      *         this list
      * @throws NullPointerException if the specified array is null
      */
+    @SuppressWarnings("unchecked")
     public <T> T[] toArray(T[] a) {
         if (a.length < size)
             a = (T[])java.lang.reflect.Array.newInstance(
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/sun/awt/util/ThreadGroupUtils.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.awt.util;
+
+/**
+ * A utility class needed to access the root {@code ThreadGroup}
+ *
+ * The class should not depend on any others, because it' called from JNI_OnLoad of the AWT
+ * native library. Triggering class loading could lead to a deadlock.
+ */
+public final class ThreadGroupUtils {
+
+    private ThreadGroupUtils() {
+        // Avoid instantiation
+    }
+
+    /**
+     * Returns a root thread group.
+     * Should be called with {@link sun.security.util.SecurityConstants#MODIFY_THREADGROUP_PERMISSION}
+     *
+     * @return a root {@code ThreadGroup}
+     */
+    public static ThreadGroup getRootThreadGroup() {
+        ThreadGroup currentTG = Thread.currentThread().getThreadGroup();
+        ThreadGroup parentTG = currentTG.getParent();
+        while (parentTG != null) {
+            currentTG = parentTG;
+            parentTG = currentTG.getParent();
+        }
+        return currentTG;
+    }
+}
--- a/jdk/src/share/classes/sun/dc/META-INF/services/sun.java2d.pipe.RenderingEngine	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-#  Ductus Rendering Engine module
-sun.dc.DuctusRenderingEngine
--- a/jdk/src/share/classes/sun/font/CreatedFontTracker.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/font/CreatedFontTracker.java	Mon Jun 02 13:53:52 2014 -0700
@@ -35,7 +35,7 @@
 import java.util.concurrent.TimeUnit;
 
 import sun.awt.AppContext;
-import sun.misc.ThreadGroupUtils;
+import sun.awt.util.ThreadGroupUtils;
 
 public class CreatedFontTracker {
 
--- a/jdk/src/share/classes/sun/font/SunFontManager.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/font/SunFontManager.java	Mon Jun 02 13:53:52 2014 -0700
@@ -52,7 +52,7 @@
 import sun.awt.AppContext;
 import sun.awt.FontConfiguration;
 import sun.awt.SunToolkit;
-import sun.misc.ThreadGroupUtils;
+import sun.awt.util.ThreadGroupUtils;
 import sun.java2d.FontSupport;
 import sun.util.logging.PlatformLogger;
 
@@ -1161,6 +1161,7 @@
             case FONTFORMAT_NATIVE:
                 NativeFont nf = new NativeFont(fileName, false);
                 physicalFont = addToFontList(nf, fontRank);
+                break;
             default:
 
             }
--- a/jdk/src/share/classes/sun/font/TrueTypeGlyphMapper.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/font/TrueTypeGlyphMapper.java	Mon Jun 02 13:53:52 2014 -0700
@@ -109,6 +109,7 @@
         cmap = CMap.theNullCmap;
     }
 
+    @SuppressWarnings("fallthrough")
     private final char remapJAChar(char unicode) {
         switch (unicode) {
         case REVERSE_SOLIDUS:
@@ -123,6 +124,7 @@
         default: return unicode;
         }
     }
+    @SuppressWarnings("fallthrough")
     private final int remapJAIntChar(int unicode) {
         switch (unicode) {
         case REVERSE_SOLIDUS:
--- a/jdk/src/share/classes/sun/java2d/Disposer.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/java2d/Disposer.java	Mon Jun 02 13:53:52 2014 -0700
@@ -25,7 +25,7 @@
 
 package sun.java2d;
 
-import sun.misc.ThreadGroupUtils;
+import sun.awt.util.ThreadGroupUtils;
 
 import java.lang.ref.Reference;
 import java.lang.ref.ReferenceQueue;
--- a/jdk/src/share/classes/sun/java2d/Spans.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/java2d/Spans.java	Mon Jun 02 13:53:52 2014 -0700
@@ -49,7 +49,7 @@
      * Holds a list of individual
      * Span instances.
      */
-    private List mSpans = new Vector(kMaxAddsSinceSort);
+    private List<Span> mSpans = new Vector<>(kMaxAddsSinceSort);
 
     /**
      * The number of <code>Span</code>
@@ -144,7 +144,7 @@
         Collections.sort(mSpans);
         mAddsSinceSort = 0;
 
-        Iterator iter = mSpans.iterator();
+        Iterator<Span> iter = mSpans.iterator();
 
         /* Have 'span' start at the first span in
          * the collection. The collection may be empty
@@ -152,7 +152,7 @@
          */
         Span span = null;
         if (iter.hasNext()) {
-            span = (Span) iter.next();
+            span = iter.next();
         }
 
         /* Loop over the spans collapsing those that intersect
@@ -160,7 +160,7 @@
          */
         while (iter.hasNext()) {
 
-            Span nextSpan = (Span) iter.next();
+            Span nextSpan = iter.next();
 
             /* The spans are in ascending start position
              * order and so the next span's starting point
@@ -202,9 +202,9 @@
     private void printSpans() {
         System.out.println("----------");
         if (mSpans != null) {
-            Iterator iter = mSpans.iterator();
+            Iterator<Span> iter = mSpans.iterator();
             while (iter.hasNext()) {
-                Span span = (Span) iter.next();
+                Span span = iter.next();
                 System.out.println(span);
             }
         }
@@ -216,7 +216,7 @@
     /**
      * Holds a single half-open interval.
      */
-    static class Span implements Comparable {
+    static class Span implements Comparable<Span> {
 
         /**
          * The span includes the starting point.
@@ -315,8 +315,7 @@
          * position. The end position is ignored
          * in this ranking.
          */
-        public int compareTo(Object o) {
-            Span otherSpan = (Span) o;
+        public int compareTo(Span otherSpan) {
             float otherStart = otherSpan.getStart();
             int result;
 
@@ -345,7 +344,7 @@
      * <code>SpanIntersection.instance</code> to
      * get the single instance of this class.
      */
-    static class SpanIntersection implements Comparator {
+    static class SpanIntersection implements Comparator<Span> {
 
         /**
          * This class is a Singleton and the following
@@ -361,10 +360,8 @@
 
         }
 
-        public int compare(Object o1, Object o2) {
+        public int compare(Span span1, Span span2) {
             int result;
-            Span span1 = (Span) o1;
-            Span span2 = (Span) o2;
 
             /* Span 1 is entirely to the left of span2.
              * span1:   <-----<
--- a/jdk/src/share/classes/sun/java2d/SunGraphics2D.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/java2d/SunGraphics2D.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1430,8 +1430,11 @@
         }
     }
 
-    RenderingHints makeHints(Map hints) {
-        RenderingHints model = new RenderingHints(hints);
+    RenderingHints makeHints(Map<?,?> hints) {
+        RenderingHints model = new RenderingHints(null);
+        if (hints != null) {
+            model.putAll(hints);
+        }
         model.put(SunHints.KEY_RENDERING,
                   SunHints.Value.get(SunHints.INTKEY_RENDERING,
                                      renderHint));
--- a/jdk/src/share/classes/sun/java2d/SunGraphicsEnvironment.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/java2d/SunGraphicsEnvironment.java	Mon Jun 02 13:53:52 2014 -0700
@@ -82,7 +82,7 @@
 
     public SunGraphicsEnvironment() {
         java.security.AccessController.doPrivileged(
-                                    new java.security.PrivilegedAction() {
+                                    new java.security.PrivilegedAction<Object>() {
             public Object run() {
                     String version = System.getProperty("os.version", "0.0");
                     try {
--- a/jdk/src/share/classes/sun/java2d/cmm/CMSManager.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/java2d/cmm/CMSManager.java	Mon Jun 02 13:53:52 2014 -0700
@@ -34,7 +34,6 @@
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import sun.security.action.GetPropertyAction;
-import java.util.ServiceLoader;
 
 public class CMSManager {
     public static ColorSpace GRAYspace;       // These two fields allow access
@@ -52,35 +51,28 @@
             return cmmImpl;
         }
 
-        CMMServiceProvider spi = AccessController.doPrivileged(
-                new PrivilegedAction<CMMServiceProvider>() {
-                    public CMMServiceProvider run() {
-                        String cmmClass = System.getProperty(
-                            "sun.java2d.cmm", "sun.java2d.cmm.lcms.LcmsServiceProvider");
-
-                    ServiceLoader<CMMServiceProvider> cmmLoader
-                    = ServiceLoader.loadInstalled(CMMServiceProvider.class);
-
-                CMMServiceProvider spi = null;
+        GetPropertyAction gpa = new GetPropertyAction("sun.java2d.cmm");
+        String cmmProviderClass = AccessController.doPrivileged(gpa);
+        CMMServiceProvider provider = null;
+        if (cmmProviderClass != null) {
+            try {
+                Class<?> cls = Class.forName(cmmProviderClass);
+                provider = (CMMServiceProvider)cls.newInstance();
+            } catch (ReflectiveOperationException e) {
+            }
+        }
+        if (provider == null) {
+            provider = new sun.java2d.cmm.lcms.LcmsServiceProvider();
+        }
 
-                for (CMMServiceProvider cmm : cmmLoader) {
-                    spi = cmm;
-                    if (cmm.getClass().getName().equals(cmmClass)) {
-                        break;
-                    }
-                }
-                return spi;
-            }
-        });
-
-        cmmImpl = spi.getColorManagementModule();
+        cmmImpl = provider.getColorManagementModule();
 
         if (cmmImpl == null) {
             throw new CMMException("Cannot initialize Color Management System."+
                                    "No CM module found");
         }
 
-        GetPropertyAction gpa = new GetPropertyAction("sun.java2d.cmm.trace");
+        gpa = new GetPropertyAction("sun.java2d.cmm.trace");
         String cmmTrace = AccessController.doPrivileged(gpa);
         if (cmmTrace != null) {
             cmmImpl = new CMMTracer(cmmImpl);
--- a/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMS.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMS.java	Mon Jun 02 13:53:52 2014 -0700
@@ -189,7 +189,7 @@
                                            LCMSImageLayout dest);
     public static native void freeTransform(long ID);
 
-    public static native void initLCMS(Class Trans, Class IL, Class Pf);
+    public static native void initLCMS(Class<?> Trans, Class<?> IL, Class<?> Pf);
 
     private LCMS() {};
 
@@ -201,7 +201,7 @@
         }
 
         java.security.AccessController.doPrivileged(
-                new java.security.PrivilegedAction() {
+                new java.security.PrivilegedAction<Object>() {
                     public Object run() {
                         /* We need to load awt here because of usage trace and
                          * disposer frameworks
--- a/jdk/src/share/classes/sun/java2d/cmm/lcms/META-INF/services/sun.java2d.cmm.CMMServiceProvider	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-#  Little CMS color management module
-sun.java2d.cmm.lcms.LcmsServiceProvider
--- a/jdk/src/share/classes/sun/java2d/loops/Blit.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/java2d/loops/Blit.java	Mon Jun 02 13:53:52 2014 -0700
@@ -217,8 +217,8 @@
         Blit performop;
         Blit convertresult;
 
-        WeakReference srcTmp;
-        WeakReference dstTmp;
+        WeakReference<SurfaceData> srcTmp;
+        WeakReference<SurfaceData> dstTmp;
 
         public GeneralXorBlit(SurfaceType srctype,
                               CompositeType comptype,
@@ -257,14 +257,14 @@
             } else {
                 SurfaceData cachedSrc = null;
                 if (srcTmp != null) {
-                    cachedSrc = (SurfaceData) srcTmp.get();
+                    cachedSrc = srcTmp.get();
                 }
                 src = convertFrom(convertsrc, srcData, srcx, srcy,
                                   width, height, cachedSrc);
                 sx = 0;
                 sy = 0;
                 if (src != cachedSrc) {
-                    srcTmp = new WeakReference(src);
+                    srcTmp = new WeakReference<>(src);
                 }
             }
 
@@ -277,7 +277,7 @@
                 // assert: convertresult != null
                 SurfaceData cachedDst = null;
                 if (dstTmp != null) {
-                    cachedDst = (SurfaceData) dstTmp.get();
+                    cachedDst = dstTmp.get();
                 }
                 dst = convertFrom(convertdst, dstData, dstx, dsty,
                                   width, height, cachedDst);
@@ -285,7 +285,7 @@
                 dy = 0;
                 opclip = null;
                 if (dst != cachedDst) {
-                    dstTmp = new WeakReference(dst);
+                    dstTmp = new WeakReference<>(dst);
                 }
             }
 
--- a/jdk/src/share/classes/sun/java2d/loops/CustomComponent.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/java2d/loops/CustomComponent.java	Mon Jun 02 13:53:52 2014 -0700
@@ -50,7 +50,7 @@
     public static void register() {
         // REMIND: This does not work for all destinations yet since
         // the screen SurfaceData objects do not implement getRaster
-        Class owner = CustomComponent.class;
+        Class<?> owner = CustomComponent.class;
         GraphicsPrimitive[] primitives = {
             new GraphicsPrimitiveProxy(owner, "OpaqueCopyAnyToArgb",
                                        Blit.methodSignature,
--- a/jdk/src/share/classes/sun/java2d/loops/GeneralRenderer.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/java2d/loops/GeneralRenderer.java	Mon Jun 02 13:53:52 2014 -0700
@@ -50,7 +50,7 @@
 
 public final class GeneralRenderer {
     public static void register() {
-        Class owner = GeneralRenderer.class;
+        Class<?> owner = GeneralRenderer.class;
         GraphicsPrimitive[] primitives = {
             new  GraphicsPrimitiveProxy(owner, "SetFillRectANY",
                                         FillRect.methodSignature,
--- a/jdk/src/share/classes/sun/java2d/loops/GraphicsPrimitive.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/java2d/loops/GraphicsPrimitive.java	Mon Jun 02 13:53:52 2014 -0700
@@ -316,7 +316,7 @@
 
     public abstract GraphicsPrimitive traceWrap();
 
-    static HashMap traceMap;
+    static HashMap<Object, int[]> traceMap;
 
     public static int traceflags;
     public static String tracefile;
@@ -427,13 +427,14 @@
 
         public void run() {
             PrintStream ps = getTraceOutputFile();
-            Iterator iterator = traceMap.entrySet().iterator();
+            Iterator<Map.Entry<Object, int[]>> iterator =
+                traceMap.entrySet().iterator();
             long total = 0;
             int numprims = 0;
             while (iterator.hasNext()) {
-                Map.Entry me = (Map.Entry) iterator.next();
+                Map.Entry<Object, int[]> me = iterator.next();
                 Object prim = me.getKey();
-                int[] count = (int[]) me.getValue();
+                int[] count = me.getValue();
                 if (count[0] == 1) {
                     ps.print("1 call to ");
                 } else {
@@ -455,15 +456,15 @@
     public synchronized static void tracePrimitive(Object prim) {
         if ((traceflags & TRACECOUNTS) != 0) {
             if (traceMap == null) {
-                traceMap = new HashMap();
+                traceMap = new HashMap<>();
                 TraceReporter.setShutdownHook();
             }
-            Object o = traceMap.get(prim);
+            int[] o = traceMap.get(prim);
             if (o == null) {
                 o = new int[1];
                 traceMap.put(prim, o);
             }
-            ((int[]) o)[0]++;
+            o[0]++;
         }
         if ((traceflags & TRACELOG) != 0) {
             PrintStream ps = getTraceOutputFile();
--- a/jdk/src/share/classes/sun/java2d/loops/GraphicsPrimitiveMgr.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/java2d/loops/GraphicsPrimitiveMgr.java	Mon Jun 02 13:53:52 2014 -0700
@@ -45,11 +45,11 @@
     private static GraphicsPrimitive generalPrimitives[];
     private static boolean needssort = true;
 
-    private static native void initIDs(Class GP, Class ST, Class CT,
-                                       Class SG2D, Class Color, Class AT,
-                                       Class XORComp, Class AlphaComp,
-                                       Class Path2D, Class Path2DFloat,
-                                       Class SHints);
+    private static native void initIDs(Class<?> GP, Class<?> ST, Class<?> CT,
+                                       Class<?> SG2D, Class<?> Color, Class<?> AT,
+                                       Class<?> XORComp, Class<?> AlphaComp,
+                                       Class<?> Path2D, Class<?> Path2DFloat,
+                                       Class<?> SHints);
     private static native void registerNativeLoops();
 
     static {
@@ -73,16 +73,17 @@
         public int uniqueID;
     }
 
-    private static Comparator primSorter = new Comparator() {
-        public int compare(Object o1, Object o2) {
-            int id1 = ((GraphicsPrimitive) o1).getUniqueID();
-            int id2 = ((GraphicsPrimitive) o2).getUniqueID();
+    private static Comparator<GraphicsPrimitive> primSorter =
+            new Comparator<GraphicsPrimitive>() {
+        public int compare(GraphicsPrimitive o1, GraphicsPrimitive o2) {
+            int id1 = o1.getUniqueID();
+            int id2 = o2.getUniqueID();
 
             return (id1 == id2 ? 0 : (id1 < id2 ? -1 : 1));
         }
     };
 
-    private static Comparator primFinder = new Comparator() {
+    private static Comparator<Object> primFinder = new Comparator<Object>() {
         public int compare(Object o1, Object o2) {
             int id1 = ((GraphicsPrimitive) o1).getUniqueID();
             int id2 = ((PrimitiveSpec) o2).uniqueID;
--- a/jdk/src/share/classes/sun/java2d/loops/GraphicsPrimitiveProxy.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/java2d/loops/GraphicsPrimitiveProxy.java	Mon Jun 02 13:53:52 2014 -0700
@@ -41,7 +41,7 @@
  */
 public class GraphicsPrimitiveProxy extends GraphicsPrimitive {
 
-    private Class owner;
+    private Class<?> owner;
     private String relativeClassName;
 
     /**
@@ -53,7 +53,7 @@
      * @param relativeClassName  The name of the class this is a proxy for.
      *          This should not include the package.
      */
-    public GraphicsPrimitiveProxy(Class owner, String relativeClassName,
+    public GraphicsPrimitiveProxy(Class<?> owner, String relativeClassName,
                                   String methodSignature,
                                   int primID,
                                   SurfaceType srctype,
@@ -80,7 +80,7 @@
         String name = getPackageName(owner.getName()) + "."
                         + relativeClassName;
         try {
-            Class clazz = Class.forName(name);
+            Class<?> clazz = Class.forName(name);
             GraphicsPrimitive p = (GraphicsPrimitive) clazz.newInstance();
             if (!satisfiesSameAs(p)) {
                 throw new RuntimeException("Primitive " + p
--- a/jdk/src/share/classes/sun/java2d/loops/MaskBlit.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/java2d/loops/MaskBlit.java	Mon Jun 02 13:53:52 2014 -0700
@@ -143,8 +143,8 @@
         MaskBlit performop;
         Blit convertresult;
 
-        WeakReference srcTmp;
-        WeakReference dstTmp;
+        WeakReference<SurfaceData> srcTmp;
+        WeakReference<SurfaceData> dstTmp;
 
         public General(SurfaceType srctype,
                        CompositeType comptype,
@@ -184,14 +184,14 @@
             } else {
                 SurfaceData cachedSrc = null;
                 if (srcTmp != null) {
-                    cachedSrc = (SurfaceData) srcTmp.get();
+                    cachedSrc = srcTmp.get();
                 }
                 src = convertFrom(convertsrc, srcData, srcx, srcy,
                                   width, height, cachedSrc);
                 sx = 0;
                 sy = 0;
                 if (src != cachedSrc) {
-                    srcTmp = new WeakReference(src);
+                    srcTmp = new WeakReference<>(src);
                 }
             }
 
@@ -204,7 +204,7 @@
                 // assert: convertresult != null
                 SurfaceData cachedDst = null;
                 if (dstTmp != null) {
-                    cachedDst = (SurfaceData) dstTmp.get();
+                    cachedDst = dstTmp.get();
                 }
                 dst = convertFrom(convertdst, dstData, dstx, dsty,
                                   width, height, cachedDst);
@@ -212,7 +212,7 @@
                 dy = 0;
                 opclip = null;
                 if (dst != cachedDst) {
-                    dstTmp = new WeakReference(dst);
+                    dstTmp = new WeakReference<>(dst);
                 }
             }
 
--- a/jdk/src/share/classes/sun/java2d/opengl/OGLBlitLoops.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/java2d/opengl/OGLBlitLoops.java	Mon Jun 02 13:53:52 2014 -0700
@@ -728,7 +728,7 @@
 class OGLGeneralBlit extends Blit {
 
     private Blit performop;
-    private WeakReference srcTmp;
+    private WeakReference<SurfaceData> srcTmp;
 
     OGLGeneralBlit(SurfaceType dstType,
                    CompositeType compType,
@@ -750,7 +750,7 @@
         SurfaceData cachedSrc = null;
         if (srcTmp != null) {
             // use cached intermediate surface, if available
-            cachedSrc = (SurfaceData)srcTmp.get();
+            cachedSrc = srcTmp.get();
         }
 
         // convert source to IntArgbPre
@@ -763,7 +763,7 @@
 
         if (src != cachedSrc) {
             // cache the intermediate surface
-            srcTmp = new WeakReference(src);
+            srcTmp = new WeakReference<>(src);
         }
     }
 }
@@ -802,7 +802,7 @@
 
         if (dstBuffer != cachedDst) {
             // cache the intermediate surface
-            dstTmp = new WeakReference(dstBuffer);
+            dstTmp = new WeakReference<>(dstBuffer);
         }
 
         // now blit the buffer back to the destination
--- a/jdk/src/share/classes/sun/java2d/opengl/OGLRenderQueue.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/java2d/opengl/OGLRenderQueue.java	Mon Jun 02 13:53:52 2014 -0700
@@ -25,7 +25,7 @@
 
 package sun.java2d.opengl;
 
-import sun.misc.ThreadGroupUtils;
+import sun.awt.util.ThreadGroupUtils;
 import sun.java2d.pipe.RenderBuffer;
 import sun.java2d.pipe.RenderQueue;
 import static sun.java2d.pipe.BufferedOpCodes.*;
--- a/jdk/src/share/classes/sun/java2d/pipe/AlphaPaintPipe.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/java2d/pipe/AlphaPaintPipe.java	Mon Jun 02 13:53:52 2014 -0700
@@ -48,16 +48,16 @@
  * SunGraphics2D.
  */
 public class AlphaPaintPipe implements CompositePipe {
-    static WeakReference cachedLastRaster;
-    static WeakReference cachedLastColorModel;
-    static WeakReference cachedLastData;
+    static WeakReference<Raster> cachedLastRaster;
+    static WeakReference<ColorModel> cachedLastColorModel;
+    static WeakReference<SurfaceData> cachedLastData;
 
     static class TileContext {
         SunGraphics2D sunG2D;
         PaintContext paintCtxt;
         ColorModel paintModel;
-        WeakReference lastRaster;
-        WeakReference lastData;
+        WeakReference<Raster> lastRaster;
+        WeakReference<SurfaceData> lastData;
         MaskBlit lastMask;
         Blit     lastBlit;
         SurfaceData dstData;
@@ -105,8 +105,8 @@
         SurfaceData srcData = null;
         Raster lastRas = null;
         if (context.lastData != null && context.lastRaster != null) {
-            srcData = (SurfaceData) context.lastData.get();
-            lastRas = (Raster) context.lastRaster.get();
+            srcData = context.lastData.get();
+            lastRas = context.lastRaster.get();
             if (srcData == null || lastRas == null) {
                 srcData = null;
                 lastRas = null;
@@ -127,7 +127,7 @@
                 }
                 if (lastRas != srcRaster) {
                     lastRas = srcRaster;
-                    context.lastRaster = new WeakReference(lastRas);
+                    context.lastRaster = new WeakReference<>(lastRas);
                     // REMIND: This will fail for a non-Writable raster!
                     BufferedImage bImg =
                         new BufferedImage(paintModel,
@@ -135,7 +135,7 @@
                                           paintModel.isAlphaPremultiplied(),
                                           null);
                     srcData = BufImgSurfaceData.createData(bImg);
-                    context.lastData = new WeakReference(srcData);
+                    context.lastData = new WeakReference<>(srcData);
                     context.lastMask = null;
                     context.lastBlit = null;
                 }
@@ -197,7 +197,7 @@
                 {
                     // Avoid creating new WeakReference if possible
                     cachedLastColorModel =
-                        new WeakReference(context.paintModel);
+                        new WeakReference<>(context.paintModel);
                 }
                 cachedLastData = context.lastData;
             }
--- a/jdk/src/share/classes/sun/java2d/pipe/RenderQueue.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/java2d/pipe/RenderQueue.java	Mon Jun 02 13:53:52 2014 -0700
@@ -81,10 +81,10 @@
      * A Set containing hard references to Objects that must stay alive until
      * the queue has been completely flushed.
      */
-    protected Set refSet;
+    protected Set<Object> refSet;
 
     protected RenderQueue() {
-        refSet = new HashSet();
+        refSet = new HashSet<>();
         buf = RenderBuffer.allocate(BUFFER_SIZE);
     }
 
--- a/jdk/src/share/classes/sun/java2d/pipe/RenderingEngine.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/java2d/pipe/RenderingEngine.java	Mon Jun 02 13:53:52 2014 -0700
@@ -32,7 +32,6 @@
 
 import java.security.PrivilegedAction;
 import java.security.AccessController;
-import java.util.ServiceLoader;
 import sun.security.action.GetPropertyAction;
 
 import sun.awt.geom.PathConsumer2D;
@@ -97,12 +96,9 @@
      * </pre>
      *
      * If no specific {@code RenderingEngine} is specified on the command
-     * or Ductus renderer is specified, it will attempt loading the
-     * sun.dc.DuctusRenderingEngine class using Class.forName as a fastpath;
-     * if not found, use the ServiceLoader.
-     * If no specific {@code RenderingEngine} is specified on the command
-     * line then the last one returned by enumerating all subclasses of
-     * {@code RenderingEngine} known to the ServiceLoader is used.
+     * or Ductus renderer is specified, it will first attempt loading the
+     * sun.dc.DuctusRenderingEngine class using Class.forName, if that
+     * is not found, then it will look for Pisces.
      * <p>
      * Runtime tracing of the actions of the {@code RenderingEngine}
      * can be enabled by specifying the runtime flag:
@@ -117,42 +113,30 @@
             return reImpl;
         }
 
-        reImpl =
-            AccessController.doPrivileged(new PrivilegedAction<RenderingEngine>() {
-                public RenderingEngine run() {
-                    final String ductusREClass = "sun.dc.DuctusRenderingEngine";
-                    String reClass =
-                        System.getProperty("sun.java2d.renderer", ductusREClass);
-                    if (reClass.equals(ductusREClass)) {
-                        try {
-                            Class<?> cls = Class.forName(ductusREClass);
-                            return (RenderingEngine) cls.newInstance();
-                        } catch (ReflectiveOperationException ignored) {
-                            // not found
-                        }
-                    }
-
-                    ServiceLoader<RenderingEngine> reLoader =
-                        ServiceLoader.loadInstalled(RenderingEngine.class);
-
-                    RenderingEngine service = null;
-
-                    for (RenderingEngine re : reLoader) {
-                        service = re;
-                        if (re.getClass().getName().equals(reClass)) {
-                            break;
-                        }
-                    }
-                    return service;
-                }
-            });
+        /* Look first for ductus or an app-override renderer,
+         * if not specified or present, then look for pisces.
+         */
+        final String ductusREClass = "sun.dc.DuctusRenderingEngine";
+        final String piscesREClass = "sun.java2d.pisces.PiscesRenderingEngine";
+        GetPropertyAction gpa =
+            new GetPropertyAction("sun.java2d.renderer", ductusREClass);
+        String reClass = AccessController.doPrivileged(gpa);
+        try {
+            Class<?> cls = Class.forName(reClass);
+            reImpl = (RenderingEngine) cls.newInstance();
+        } catch (ReflectiveOperationException ignored0) {
+            try {
+                Class<?> cls = Class.forName(piscesREClass);
+                reImpl = (RenderingEngine) cls.newInstance();
+            } catch (ReflectiveOperationException ignored1) {
+            }
+        }
 
         if (reImpl == null) {
             throw new InternalError("No RenderingEngine module found");
         }
 
-        GetPropertyAction gpa =
-            new GetPropertyAction("sun.java2d.renderer.trace");
+        gpa = new GetPropertyAction("sun.java2d.renderer.trace");
         String reTrace = AccessController.doPrivileged(gpa);
         if (reTrace != null) {
             reImpl = new Tracer(reImpl);
--- a/jdk/src/share/classes/sun/java2d/pipe/SpanClipRenderer.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/java2d/pipe/SpanClipRenderer.java	Mon Jun 02 13:53:52 2014 -0700
@@ -39,14 +39,14 @@
 {
     CompositePipe outpipe;
 
-    static Class RegionClass = Region.class;
-    static Class RegionIteratorClass = RegionIterator.class;
+    static Class<?> RegionClass = Region.class;
+    static Class<?> RegionIteratorClass = RegionIterator.class;
 
     static {
         initIDs(RegionClass, RegionIteratorClass);
     }
 
-    static native void initIDs(Class rc, Class ric);
+    static native void initIDs(Class<?> rc, Class<?> ric);
 
     public SpanClipRenderer(CompositePipe pipe) {
         outpipe = pipe;
--- a/jdk/src/share/classes/sun/java2d/pisces/META-INF/services/sun.java2d.pipe.RenderingEngine	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-#  Pisces Rendering Engine module
-sun.java2d.pisces.PiscesRenderingEngine
--- a/jdk/src/share/classes/sun/misc/ThreadGroupUtils.java	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.misc;
-
-/**
- * A utility class needed to access the root {@code ThreadGroup}
- *
- * The class should not depend on any others, because it' called from JNI_OnLoad of the AWT
- * native library. Triggering class loading could could lead to a deadlock.
- */
-public final class ThreadGroupUtils {
-
-    private ThreadGroupUtils() {
-        // Avoid instantiation
-    }
-
-    /**
-     * Returns a root thread group.
-     * Should be called with {@link sun.security.util.SecurityConstants#MODIFY_THREADGROUP_PERMISSION}
-     *
-     * @return a root {@code ThreadGroup}
-     */
-    public static ThreadGroup getRootThreadGroup() {
-        ThreadGroup currentTG = Thread.currentThread().getThreadGroup();
-        ThreadGroup parentTG = currentTG.getParent();
-        while (parentTG != null) {
-            currentTG = parentTG;
-            parentTG = currentTG.getParent();
-        }
-        return currentTG;
-    }
-}
--- a/jdk/src/share/classes/sun/misc/VM.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/misc/VM.java	Mon Jun 02 13:53:52 2014 -0700
@@ -370,7 +370,37 @@
     /**
      * Returns {@code true} if we are in a set UID program.
      */
-    public static native boolean isSetUID();
+    public static boolean isSetUID() {
+        long uid = getuid();
+        long euid = geteuid();
+        long gid = getgid();
+        long egid = getegid();
+        return uid != euid  || gid != egid;
+    }
+
+    /**
+     * Returns the real user ID of the calling process,
+     * or -1 if the value is not available.
+     */
+    public static native long getuid();
+
+    /**
+     * Returns the effective user ID of the calling process,
+     * or -1 if the value is not available.
+     */
+    public static native long geteuid();
+
+    /**
+     * Returns the real group ID of the calling process,
+     * or -1 if the value is not available.
+     */
+    public static native long getgid();
+
+    /**
+     * Returns the effective group ID of the calling process,
+     * or -1 if the value is not available.
+     */
+    public static native long getegid();
 
     static {
         initialize();
--- a/jdk/src/share/classes/sun/nio/ch/ServerSocketAdaptor.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/nio/ch/ServerSocketAdaptor.java	Mon Jun 02 13:53:52 2014 -0700
@@ -93,9 +93,9 @@
 
     public Socket accept() throws IOException {
         synchronized (ssc.blockingLock()) {
-            if (!ssc.isBound())
-                throw new IllegalBlockingModeException();
             try {
+                if (!ssc.isBound())
+                    throw new NotYetBoundException();
                 if (timeout == 0) {
                     SocketChannel sc = ssc.accept();
                     if (sc == null && !ssc.isBlocking())
--- a/jdk/src/share/classes/sun/reflect/annotation/TypeAnnotationParser.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/reflect/annotation/TypeAnnotationParser.java	Mon Jun 02 13:53:52 2014 -0700
@@ -75,7 +75,7 @@
             if (ti.getTarget() == filter)
                 l.add(t);
         }
-        TypeAnnotation[] typeAnnotations = l.toArray(new TypeAnnotation[0]);
+        TypeAnnotation[] typeAnnotations = l.toArray(EMPTY_TYPE_ANNOTATION_ARRAY);
         return AnnotatedTypeFactory.buildAnnotatedType(type,
                                                        LocationInfo.BASE_LOCATION,
                                                        typeAnnotations,
@@ -245,7 +245,6 @@
         if (bounds != null) {
             int startIndex = 0;
             AnnotatedType[] res = new AnnotatedType[bounds.length];
-            Arrays.fill(res, AnnotatedTypeFactory.EMPTY_ANNOTATED_TYPE);
 
             // Adjust bounds index
             //
@@ -276,12 +275,12 @@
                             tInfo.getCount() == typeVarIndex) {
                         l.add(t);
                     }
-                    res[i] = AnnotatedTypeFactory.buildAnnotatedType(bounds[i],
-                                                                     loc,
-                                                                     l.toArray(new TypeAnnotation[0]),
-                                                                     candidates.toArray(new TypeAnnotation[0]),
-                                                                     (AnnotatedElement)decl);
                 }
+                res[i] = AnnotatedTypeFactory.buildAnnotatedType(bounds[i],
+                        loc,
+                        l.toArray(EMPTY_TYPE_ANNOTATION_ARRAY),
+                        candidates.toArray(EMPTY_TYPE_ANNOTATION_ARRAY),
+                        (AnnotatedElement)decl);
             }
             return res;
         }
--- a/jdk/src/share/classes/sun/security/krb5/KdcComm.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/security/krb5/KdcComm.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -144,7 +144,8 @@
         try {
             Config cfg = Config.getInstance();
             String temp = cfg.get("libdefaults", "kdc_timeout");
-            timeout = parsePositiveIntString(temp);
+            timeout = parseTimeString(temp);
+
             temp = cfg.get("libdefaults", "max_retries");
             max_retries = parsePositiveIntString(temp);
             temp = cfg.get("libdefaults", "udp_preference_limit");
@@ -426,6 +427,25 @@
     }
 
     /**
+     * Parses a time value string. If it ends with "s", parses as seconds.
+     * Otherwise, parses as milliseconds.
+     * @param s the time string
+     * @return the integer value in milliseconds, or -1 if input is null or
+     * has an invalid format
+     */
+    private static int parseTimeString(String s) {
+        if (s == null) {
+            return -1;
+        }
+        if (s.endsWith("s")) {
+            int seconds = parsePositiveIntString(s.substring(0, s.length()-1));
+            return (seconds < 0) ? -1 : (seconds*1000);
+        } else {
+            return parsePositiveIntString(s);
+        }
+    }
+
+    /**
      * Returns krb5.conf setting of {@code key} for a specific realm,
      * which can be:
      * 1. defined in the sub-stanza for the given realm inside [realms], or
@@ -446,7 +466,11 @@
         try {
             String value =
                Config.getInstance().get("realms", realm, key);
-            temp = parsePositiveIntString(value);
+            if (key.equals("kdc_timeout")) {
+                temp = parseTimeString(value);
+            } else {
+                temp = parsePositiveIntString(value);
+            }
         } catch (Exception exc) {
             // Ignored, defValue will be picked up
         }
--- a/jdk/src/share/classes/sun/security/krb5/internal/rcache/DflCache.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/security/krb5/internal/rcache/DflCache.java	Mon Jun 02 13:53:52 2014 -0700
@@ -39,7 +39,6 @@
 import java.security.AccessController;
 import java.util.*;
 
-import com.sun.security.auth.module.UnixSystem;
 import sun.security.action.GetPropertyAction;
 import sun.security.krb5.internal.KerberosTime;
 import sun.security.krb5.internal.Krb5;
@@ -61,8 +60,7 @@
  *
  *    service_euid
  *
- * Java does not have a method to get euid, so uid is used instead. This
- * should normally to be since a Java program is seldom used as a setuid app.
+ * in which euid is available as sun.misc.VM.geteuid().
  *
  * The file has a header:
  *
@@ -108,14 +106,8 @@
 
     private static long uid;
     static {
-        try {
-            // Available on Solaris, Linux and Mac. Otherwise, no _euid suffix
-            UnixSystem us = new com.sun.security.auth.module.UnixSystem();
-            uid = us.getUid();
-        } catch (Throwable e) {
-            // Cannot be only Exception, might be UnsatisfiedLinkError
-            uid = -1;
-        }
+        // Available on Solaris, Linux and Mac. Otherwise, -1 and no _euid suffix
+        uid = sun.misc.VM.geteuid();
     }
 
     public DflCache (String source) {
--- a/jdk/src/share/classes/sun/security/pkcs11/P11Util.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/security/pkcs11/P11Util.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -166,7 +166,7 @@
         if (b == null) {
             return "(null)";
         }
-        StringBuffer sb = new StringBuffer(b.length * 3);
+        StringBuilder sb = new StringBuilder(b.length * 3);
         for (int i = 0; i < b.length; i++) {
             int k = b[i] & 0xff;
             if (i != 0) {
--- a/jdk/src/share/classes/sun/security/provider/DigestBase.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/security/provider/DigestBase.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -122,10 +122,10 @@
             }
         }
         // compress complete blocks
-        while (len >= blockSize) {
-            implCompress(b, ofs);
-            len -= blockSize;
-            ofs += blockSize;
+        if (len >= blockSize) {
+            int limit = ofs + len;
+            ofs = implCompressMultiBlock(b, ofs, limit - blockSize);
+            len = limit - ofs;
         }
         // copy remainder to buffer
         if (len > 0) {
@@ -134,6 +134,14 @@
         }
     }
 
+    // compress complete blocks
+    private int implCompressMultiBlock(byte[] b, int ofs, int limit) {
+        for (; ofs <= limit; ofs += blockSize) {
+            implCompress(b, ofs);
+        }
+        return ofs;
+    }
+
     // reset this object. See JCA doc.
     protected final void engineReset() {
         if (bytesProcessed == 0) {
--- a/jdk/src/share/classes/sun/security/smartcardio/CardImpl.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/security/smartcardio/CardImpl.java	Mon Jun 02 13:53:52 2014 -0700
@@ -246,7 +246,7 @@
         }
         checkExclusive();
         try {
-            SCardDisconnect(cardId, (reset ? SCARD_LEAVE_CARD : SCARD_RESET_CARD));
+            SCardDisconnect(cardId, (reset ? SCARD_RESET_CARD : SCARD_LEAVE_CARD));
         } catch (PCSCException e) {
             throw new CardException("disconnect() failed", e);
         } finally {
--- a/jdk/src/share/classes/sun/security/tools/jarsigner/Main.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/security/tools/jarsigner/Main.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1560,8 +1560,7 @@
             first = false;
         }
         try {
-            CertPath cp = certificateFactory.generateCertPath(certs);
-            validator.validate(cp, pkixParameters);
+            validateCertChain(certs);
         } catch (Exception e) {
             if (debug) {
                 e.printStackTrace();
@@ -1871,8 +1870,7 @@
             printCert("", certChain[0], true, null, true);
 
             try {
-                CertPath cp = certificateFactory.generateCertPath(Arrays.asList(certChain));
-                validator.validate(cp, pkixParameters);
+                validateCertChain(Arrays.asList(certChain));
             } catch (Exception e) {
                 if (debug) {
                     e.printStackTrace();
@@ -1937,6 +1935,22 @@
         System.exit(1);
     }
 
+    void validateCertChain(List<? extends Certificate> certs) throws Exception {
+        int cpLen = 0;
+        out: for (; cpLen<certs.size(); cpLen++) {
+            for (TrustAnchor ta: pkixParameters.getTrustAnchors()) {
+                if (ta.getTrustedCert().equals(certs.get(cpLen))) {
+                    break out;
+                }
+            }
+        }
+        if (cpLen > 0) {
+            CertPath cp = certificateFactory.generateCertPath(
+                    (cpLen == certs.size())? certs: certs.subList(0, cpLen));
+            validator.validate(cp, pkixParameters);
+        }
+    }
+
     char[] getPass(String prompt)
     {
         System.err.print(prompt);
--- a/jdk/src/share/classes/sun/text/resources/es/FormatData_es_DO.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/text/resources/es/FormatData_es_DO.java	Mon Jun 02 13:53:52 2014 -0700
@@ -75,8 +75,8 @@
                 new String[] {
                     "EEEE d' de 'MMMM' de 'yyyy", // full date pattern
                     "d' de 'MMMM' de 'yyyy", // long date pattern
-                    "MM/dd/yyyy", // medium date pattern
-                    "MM/dd/yy", // short date pattern
+                    "dd/MM/yyyy", // medium date pattern
+                    "dd/MM/yy", // short date pattern
                 }
             },
             { "DateTimePatterns",
--- a/jdk/src/share/classes/sun/tools/jinfo/JInfo.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/tools/jinfo/JInfo.java	Mon Jun 02 13:53:52 2014 -0700
@@ -158,6 +158,8 @@
                         sysprops(pid);
                         System.out.println();
                         flags(pid);
+                        System.out.println();
+                        commandLine(pid);
                     } else {
                         usage(1);
                     }
@@ -248,6 +250,12 @@
         drain(vm, in);
     }
 
+    private static void commandLine(String pid) throws IOException {
+        HotSpotVirtualMachine vm = (HotSpotVirtualMachine) attach(pid);
+        InputStream in = vm.executeJCmd("VM.command_line");
+        drain(vm, in);
+    }
+
     private static void sysprops(String pid) throws IOException {
         HotSpotVirtualMachine vm = (HotSpotVirtualMachine) attach(pid);
         InputStream in = vm.executeJCmd("VM.system_properties");
--- a/jdk/src/share/classes/sun/tools/serialver/SerialVer.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/tools/serialver/SerialVer.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,8 +26,6 @@
 package sun.tools.serialver;
 
 import java.io.*;
-import java.awt.*;
-import java.applet.*;
 import java.io.ObjectStreamClass;
 import java.util.Properties;
 import java.text.MessageFormat;
@@ -39,106 +37,7 @@
 import java.util.StringTokenizer;
 import sun.net.www.ParseUtil;
 
-public class SerialVer extends Applet {
-    GridBagLayout gb;
-    TextField classname_t;
-    Button show_b;
-    TextField serialversion_t;
-    Label footer_l;
-
-    private static final long serialVersionUID = 7666909783837760853L;
-
-    public synchronized void init() {
-        gb = new GridBagLayout();
-        setLayout(gb);
-
-        GridBagConstraints c = new GridBagConstraints();
-        c.fill = GridBagConstraints.BOTH;
-
-        Label l1 = new Label(Res.getText("FullClassName"));
-        l1.setAlignment(Label.RIGHT);
-        gb.setConstraints(l1, c);
-        add(l1);
-
-        classname_t = new TextField(20);
-        c.gridwidth = GridBagConstraints.RELATIVE;
-        c.weightx = 1.0;
-        gb.setConstraints(classname_t, c);
-        add(classname_t);
-
-        show_b = new Button(Res.getText("Show"));
-        c.gridwidth = GridBagConstraints.REMAINDER;
-        c.weightx = 0.0;        /* Don't grow the button */
-        gb.setConstraints(show_b, c);
-        add(show_b);
-
-        Label l2 = new Label(Res.getText("SerialVersion"));
-        l2.setAlignment(Label.RIGHT);
-        c.gridwidth = 1;
-        gb.setConstraints(l2, c);
-        add(l2);
-
-        serialversion_t = new TextField(50);
-        serialversion_t.setEditable(false);
-        c.gridwidth = GridBagConstraints.REMAINDER;
-        gb.setConstraints(serialversion_t, c);
-        add(serialversion_t);
-
-        footer_l = new Label();
-        c.gridwidth = GridBagConstraints.REMAINDER;
-        gb.setConstraints(footer_l, c);
-        add(footer_l);
-
-        /* Give the focus to the type-in area */
-        classname_t.requestFocus();
-    }
-
-    public void start() {
-        /* Give the focus to the type-in area */
-        classname_t.requestFocus();
-    }
-
-    @SuppressWarnings("deprecation")
-    public boolean action(Event ev, Object obj) {
-        if (ev.target == classname_t) {
-            show((String)ev.arg);
-            return true;
-        } else if (ev.target == show_b) {
-            show(classname_t.getText());
-            return true;
-        }
-        return false;
-    }
-
-
-    @SuppressWarnings("deprecation")
-    public boolean handleEvent(Event ev) {
-        boolean rc = super.handleEvent(ev);
-        return rc;
-    }
-
-    /**
-     * Lookup the specified classname and display it.
-     */
-    void show(String classname) {
-        try {
-            footer_l.setText(""); // Clear the message
-            serialversion_t.setText(""); // clear the last value
-
-            if (classname.equals("")) {
-                return;
-            }
-
-            String s = serialSyntax(classname);
-            if (s != null) {
-                serialversion_t.setText(s);
-            } else {
-                footer_l.setText(Res.getText("NotSerializable", classname));
-            }
-        } catch (ClassNotFoundException cnf) {
-            footer_l.setText(Res.getText("ClassNotFound", classname));
-        }
-    }
+public class SerialVer {
 
     /*
      * A class loader that will load from the CLASSPATH environment
@@ -218,13 +117,7 @@
         }
     }
 
-    @SuppressWarnings("deprecation")
-    private static void showWindow(Window w) {
-        w.show();
-    }
-
     public static void main(String[] args) {
-        boolean show = false;
         String envcp = null;
         int i = 0;
 
@@ -234,9 +127,7 @@
         }
 
         for (i = 0; i < args.length; i++) {
-            if (args[i].equals("-show")) {
-                show = true;
-            } else if (args[i].equals("-classpath")) {
+            if (args[i].equals("-classpath")) {
                 if ((i+1 == args.length) || args[i+1].startsWith("-")) {
                     System.err.println(Res.getText("error.missing.classpath"));
                     usage();
@@ -278,51 +169,35 @@
             System.exit(3);
         }
 
-        if (!show) {
-            /*
-             * Check if there are any class names specified, if it is not a
-             * invocation with the -show option.
-             */
-            if (i == args.length) {
-                usage();
-                System.exit(1);
-            }
+        /*
+         * Check if there are any class names specified
+         */
+        if (i == args.length) {
+            usage();
+            System.exit(1);
+        }
 
-            /*
-             * The rest of the parameters are classnames.
-             */
-            boolean exitFlag = false;
-            for (i = i; i < args.length; i++ ) {
-                try {
-                    String syntax = serialSyntax(args[i]);
-                    if (syntax != null)
-                        System.out.println(args[i] + ":" + syntax);
-                    else {
-                        System.err.println(Res.getText("NotSerializable",
-                            args[i]));
-                        exitFlag = true;
-                    }
-                } catch (ClassNotFoundException cnf) {
-                    System.err.println(Res.getText("ClassNotFound", args[i]));
+        /*
+         * The rest of the parameters are classnames.
+         */
+        boolean exitFlag = false;
+        for (i = i; i < args.length; i++ ) {
+            try {
+                String syntax = serialSyntax(args[i]);
+                if (syntax != null)
+                    System.out.println(args[i] + ":" + syntax);
+                else {
+                    System.err.println(Res.getText("NotSerializable",
+                        args[i]));
                     exitFlag = true;
                 }
-            }
-            if (exitFlag) {
-                System.exit(1);
-            }
-        } else {
-            if (i < args.length) {
-                System.err.println(Res.getText("ignoring.classes"));
-                System.exit(1);
+            } catch (ClassNotFoundException cnf) {
+                System.err.println(Res.getText("ClassNotFound", args[i]));
+                exitFlag = true;
             }
-            Frame f =  new SerialVerFrame();
-            //  f.setLayout(new FlowLayout());
-            SerialVer sv = new SerialVer();
-            sv.init();
-
-            f.add("Center", sv);
-            f.pack();
-            showWindow(f);
+        }
+        if (exitFlag) {
+            System.exit(1);
         }
     }
 
@@ -337,65 +212,6 @@
 }
 
 /**
- * Top level frame so serialVer can be run as an main program
- * and have an exit menu item.
- */
-class SerialVerFrame extends Frame {
-    MenuBar menu_mb;
-    Menu file_m;
-    MenuItem exit_i;
-
-    private static final long serialVersionUID = -7248105987187532533L;
-
-    /*
-     * Construct a new Frame with title and menu.
-     */
-    SerialVerFrame() {
-        super(Res.getText("SerialVersionInspector"));
-
-        /* Create the file menu */
-        file_m = new Menu(Res.getText("File"));
-        file_m.add(exit_i = new MenuItem(Res.getText("Exit")));
-
-        /* Now add the file menu to the menu bar  */
-        menu_mb = new MenuBar();
-        menu_mb.add(file_m);
-
-        /* Add the menubar to the frame */
-        // Bug in JDK1.1        setMenuBar(menu_mb);
-    }
-
-    /*
-     * Handle a window destroy event by exiting.
-     */
-    @SuppressWarnings("deprecation")
-    public boolean handleEvent(Event e) {
-        if (e.id == Event.WINDOW_DESTROY) {
-            exit(0);
-        }
-        return super.handleEvent(e);
-    }
-    /*
-     * Handle an Exit event by exiting.
-     */
-    @SuppressWarnings("deprecation")
-    public boolean action(Event ev, Object obj) {
-        if (ev.target == exit_i) {
-            exit(0);
-        }
-        return false;
-    }
-
-    /*
-     * Cleanup and exit.
-     */
-    void exit(int ret) {
-        System.exit(ret);
-    }
-
-}
-
-/**
  * Utility for integrating with serialver and for localization.
  * Handle Resources. Access to error and warning counts.
  * Message formatting.
--- a/jdk/src/share/classes/sun/tools/serialver/resources/serialver.properties	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/classes/sun/tools/serialver/resources/serialver.properties	Mon Jun 02 13:53:52 2014 -0700
@@ -1,9 +1,3 @@
-SerialVersionInspector=Serial Version Inspector
-File=File
-Exit=Exit
-Show=Show
-FullClassName=Full Class Name:
-SerialVersion=Serial Version:
 NotSerializable=\
 	Class {0} is not Serializable.
 ClassNotFound=\
@@ -14,7 +8,5 @@
 	Missing argument for -classpath option
 invalid.flag=\
 	Invalid flag {0}.
-ignoring.classes=\
-	Cannot specify class arguments with the -show option
 usage=\
-	use: serialver [-classpath classpath] [-show] [classname...]
+	use: serialver [-classpath classpath] [classname...]
--- a/jdk/src/share/lib/security/sunpkcs11-solaris.cfg	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/lib/security/sunpkcs11-solaris.cfg	Mon Jun 02 13:53:52 2014 -0700
@@ -18,16 +18,6 @@
 
 disabledMechanisms = {
   CKM_DSA_KEY_PAIR_GEN
-# the following mechanisms are disabled due to CKR_SAVED_STATE_INVALID bug
-# (Solaris bug 7058108)
-  CKM_MD2
-  CKM_MD5
-  CKM_SHA_1
-# the following mechanisms are disabled due to no cloning support
-# (Solaris bug 7050617)
-  CKM_SHA256
-  CKM_SHA384
-  CKM_SHA512
 # the following mechanisms are disabled due to performance issues
 # (Solaris bug 6337157)
   CKM_DSA_SHA1
--- a/jdk/src/share/native/java/util/TimeZone.c	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/native/java/util/TimeZone.c	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,42 +38,28 @@
  */
 JNIEXPORT jstring JNICALL
 Java_java_util_TimeZone_getSystemTimeZoneID(JNIEnv *env, jclass ign,
-                                            jstring java_home, jstring country)
+                                            jstring java_home)
 {
-    const char *cname;
     const char *java_home_dir;
     char *javaTZ;
+    jstring jstrJavaTZ = NULL;
 
-    if (java_home == NULL)
-        return NULL;
+    CHECK_NULL_RETURN(java_home, NULL);
 
     java_home_dir = JNU_GetStringPlatformChars(env, java_home, 0);
-    if (java_home_dir == NULL)
-        return NULL;
-
-    if (country != NULL) {
-        cname = JNU_GetStringPlatformChars(env, country, 0);
-        /* ignore error cases for cname */
-    } else {
-        cname = NULL;
-    }
+    CHECK_NULL_RETURN(java_home_dir, NULL);
 
     /*
      * Invoke platform dependent mapping function
      */
-    javaTZ = findJavaTZ_md(java_home_dir, cname);
-
-    free((void *)java_home_dir);
-    if (cname != NULL) {
-        free((void *)cname);
+    javaTZ = findJavaTZ_md(java_home_dir);
+    if (javaTZ != NULL) {
+        jstrJavaTZ = JNU_NewStringPlatform(env, javaTZ);
+        free((void *)javaTZ);
     }
 
-    if (javaTZ != NULL) {
-        jstring jstrJavaTZ = JNU_NewStringPlatform(env, javaTZ);
-        free((void *)javaTZ);
-        return jstrJavaTZ;
-    }
-    return NULL;
+    JNU_ReleaseStringPlatformChars(env, java_home, java_home_dir);
+    return jstrJavaTZ;
 }
 
 /*
--- a/jdk/src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c	Mon Jun 02 13:53:52 2014 -0700
@@ -25,7 +25,6 @@
 
 #include "splashscreen_impl.h"
 
-#include "jinclude.h"
 #include "jpeglib.h"
 #include "jerror.h"
 
@@ -107,11 +106,11 @@
     if (cinfo->src == NULL) {   /* first time for this JPEG object? */
         cinfo->src = (struct jpeg_source_mgr *)
             (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo,
-            JPOOL_PERMANENT, SIZEOF(stream_source_mgr));
+            JPOOL_PERMANENT, sizeof(stream_source_mgr));
         src = (stream_src_ptr) cinfo->src;
         src->buffer = (JOCTET *)
             (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo,
-            JPOOL_PERMANENT, INPUT_BUF_SIZE * SIZEOF(JOCTET));
+            JPOOL_PERMANENT, INPUT_BUF_SIZE * sizeof(JOCTET));
     }
 
     src = (stream_src_ptr) cinfo->src;
--- a/jdk/src/share/native/sun/java2d/cmm/lcms/LCMS.c	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/native/sun/java2d/cmm/lcms/LCMS.c	Mon Jun 02 13:53:52 2014 -0700
@@ -30,7 +30,7 @@
 #include "jni_util.h"
 #include "Trace.h"
 #include "Disposer.h"
-#include "lcms2.h"
+#include <lcms2.h>
 #include "jlong.h"
 
 
--- a/jdk/src/share/native/sun/java2d/loops/ProcessPath.c	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/native/sun/java2d/loops/ProcessPath.c	Mon Jun 02 13:53:52 2014 -0700
@@ -189,34 +189,34 @@
 
 #define PROCESS_POINT(hnd, fX, fY, checkBounds, pixelInfo)                  \
     do {                                                                    \
-        jint _X = (fX)>> MDP_PREC;                                          \
-        jint _Y = (fY)>> MDP_PREC;                                          \
+        jint X_ = (fX)>> MDP_PREC;                                          \
+        jint Y_ = (fY)>> MDP_PREC;                                          \
         if (checkBounds &&                                                  \
-            (hnd->dhnd->yMin > _Y  ||                                       \
-             hnd->dhnd->yMax <= _Y ||                                       \
-             hnd->dhnd->xMin > _X  ||                                       \
-             hnd->dhnd->xMax <= _X)) break;                                 \
+            (hnd->dhnd->yMin > Y_  ||                                       \
+             hnd->dhnd->yMax <= Y_ ||                                       \
+             hnd->dhnd->xMin > X_  ||                                       \
+             hnd->dhnd->xMax <= X_)) break;                                 \
 /*                                                                          \
- *       (_X,_Y) should be inside boundaries                                \
+ *       (X_,Y_) should be inside boundaries                                \
  *                                                                          \
- *       assert(hnd->dhnd->yMin <= _Y &&                                    \
- *              hnd->dhnd->yMax >  _Y &&                                    \
- *              hnd->dhnd->xMin <= _X &&                                    \
- *              hnd->dhnd->xMax >  _X);                                     \
+ *       assert(hnd->dhnd->yMin <= Y_ &&                                    \
+ *              hnd->dhnd->yMax >  Y_ &&                                    \
+ *              hnd->dhnd->xMin <= X_ &&                                    \
+ *              hnd->dhnd->xMax >  X_);                                     \
  *                                                                          \
  */                                                                         \
         if (pixelInfo[0] == 0) {                                            \
             pixelInfo[0] = 1;                                               \
-            pixelInfo[1] = _X;                                              \
-            pixelInfo[2] = _Y;                                              \
-            pixelInfo[3] = _X;                                              \
-            pixelInfo[4] = _Y;                                              \
-            hnd->dhnd->pDrawPixel(hnd->dhnd, _X, _Y);                       \
-        } else if ((_X != pixelInfo[3] || _Y != pixelInfo[4]) &&            \
-                   (_X != pixelInfo[1] || _Y != pixelInfo[2])) {            \
-            hnd->dhnd->pDrawPixel(hnd->dhnd, _X, _Y);                       \
-            pixelInfo[3] = _X;                                              \
-            pixelInfo[4] = _Y;                                              \
+            pixelInfo[1] = X_;                                              \
+            pixelInfo[2] = Y_;                                              \
+            pixelInfo[3] = X_;                                              \
+            pixelInfo[4] = Y_;                                              \
+            hnd->dhnd->pDrawPixel(hnd->dhnd, X_, Y_);                       \
+        } else if ((X_ != pixelInfo[3] || Y_ != pixelInfo[4]) &&            \
+                   (X_ != pixelInfo[1] || Y_ != pixelInfo[2])) {            \
+            hnd->dhnd->pDrawPixel(hnd->dhnd, X_, Y_);                       \
+            pixelInfo[3] = X_;                                              \
+            pixelInfo[4] = Y_;                                              \
         }                                                                   \
     } while(0)
 
--- a/jdk/src/share/native/sun/security/smartcardio/pcsc.c	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/native/sun/security/smartcardio/pcsc.c	Mon Jun 02 13:53:52 2014 -0700
@@ -108,7 +108,7 @@
 JNIEXPORT jlong JNICALL Java_sun_security_smartcardio_PCSC_SCardEstablishContext
     (JNIEnv *env, jclass thisClass, jint dwScope)
 {
-    SCARDCONTEXT context;
+    SCARDCONTEXT context = 0;
     LONG rv;
     dprintf("-establishContext\n");
     rv = CALL_SCardEstablishContext(dwScope, NULL, NULL, &context);
@@ -125,7 +125,7 @@
 jobjectArray pcsc_multi2jstring(JNIEnv *env, char *spec) {
     jobjectArray result;
     jclass stringClass;
-    char *cp, **tab;
+    char *cp, **tab = NULL;
     jstring js;
     int cnt = 0;
 
@@ -179,8 +179,8 @@
 {
     SCARDCONTEXT context = (SCARDCONTEXT)jContext;
     LONG rv;
-    LPTSTR mszReaders;
-    DWORD size;
+    LPTSTR mszReaders = NULL;
+    DWORD size = 0;
     jobjectArray result;
 
     dprintf1("-context: %x\n", context);
@@ -190,18 +190,20 @@
     }
     dprintf1("-size: %d\n", size);
 
-    mszReaders = malloc(size);
-    if (mszReaders == NULL) {
-        throwOutOfMemoryError(env, NULL);
-        return NULL;
-    }
+    if (size) {
+        mszReaders = malloc(size);
+        if (mszReaders == NULL) {
+            throwOutOfMemoryError(env, NULL);
+            return NULL;
+        }
 
-    rv = CALL_SCardListReaders(context, NULL, mszReaders, &size);
-    if (handleRV(env, rv)) {
-        free(mszReaders);
-        return NULL;
+        rv = CALL_SCardListReaders(context, NULL, mszReaders, &size);
+        if (handleRV(env, rv)) {
+            free(mszReaders);
+            return NULL;
+        }
+        dprintf1("-String: %s\n", mszReaders);
     }
-    dprintf1("-String: %s\n", mszReaders);
 
     result = pcsc_multi2jstring(env, mszReaders);
     free(mszReaders);
@@ -215,8 +217,8 @@
     SCARDCONTEXT context = (SCARDCONTEXT)jContext;
     LONG rv;
     LPCTSTR readerName;
-    SCARDHANDLE card;
-    DWORD proto;
+    SCARDHANDLE card = 0;
+    DWORD proto = 0;
 
     readerName = (*env)->GetStringUTFChars(env, jReaderName, NULL);
     if (readerName == NULL) {
@@ -280,8 +282,8 @@
     DWORD readerLen = READERNAME_BUFFER_SIZE;
     unsigned char atr[ATR_BUFFER_SIZE];
     DWORD atrLen = ATR_BUFFER_SIZE;
-    DWORD state;
-    DWORD protocol;
+    DWORD state = 0;
+    DWORD protocol = 0;
     jbyteArray jArray;
     jbyte status[2];
 
@@ -336,7 +338,7 @@
     const char *readerName;
 
     readerState = calloc(readers, sizeof(SCARD_READERSTATE));
-    if (readerState == NULL) {
+    if (readerState == NULL && readers > 0) {
         throwOutOfMemoryError(env, NULL);
         return NULL;
     }
@@ -348,6 +350,10 @@
     }
 
     for (i = 0; i < readers; i++) {
+        readerState[i].szReader = NULL;
+    }
+
+    for (i = 0; i < readers; i++) {
         jobject jReaderName = (*env)->GetObjectArrayElement(env, jReaderNames, i);
         if ((*env)->ExceptionCheck(env)) {
             goto cleanup;
@@ -369,9 +375,11 @@
         (*env)->DeleteLocalRef(env, jReaderName);
     }
 
-    rv = CALL_SCardGetStatusChange(context, (DWORD)jTimeout, readerState, readers);
-    if (handleRV(env, rv)) {
-        goto cleanup;
+    if (readers > 0) {
+        rv = CALL_SCardGetStatusChange(context, (DWORD)jTimeout, readerState, readers);
+        if (handleRV(env, rv)) {
+            goto cleanup;
+        }
     }
 
     jEventState = (*env)->NewIntArray(env, readers);
--- a/jdk/src/share/transport/socket/socketTransport.c	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/share/transport/socket/socketTransport.c	Mon Jun 02 13:53:52 2014 -0700
@@ -31,6 +31,11 @@
 #include "jdwpTransport.h"
 #include "sysSocket.h"
 
+#ifdef _WIN32
+ #include <winsock2.h>
+ #include <ws2tcpip.h>
+#endif
+
 /*
  * The Socket Transport Library.
  *
@@ -189,23 +194,83 @@
     return JDWPTRANSPORT_ERROR_NONE;
 }
 
+static uint32_t
+getLocalHostAddress() {
+    // Simple routine to guess localhost address.
+    // it looks up "localhost" and returns 127.0.0.1 if lookup
+    // fails.
+    struct addrinfo hints, *res = NULL;
+    int err;
+
+    // Use portable way to initialize the structure
+    memset((void *)&hints, 0, sizeof(hints));
+    hints.ai_family = AF_INET;
+
+    err = getaddrinfo("localhost", NULL, &hints, &res);
+    if (err < 0 || res == NULL) {
+        return dbgsysHostToNetworkLong(INADDR_LOOPBACK);
+    }
+
+    // getaddrinfo might return more than one address
+    // but we are using first one only
+    return ((struct sockaddr_in *)(res->ai_addr))->sin_addr.s_addr;
+}
+
+static int
+getPortNumber(const char *s_port) {
+    u_long n;
+    char *eptr;
+
+    if (*s_port == 0) {
+        // bad address - colon with no port number in parameters
+        return -1;
+    }
+
+    n = strtoul(s_port, &eptr, 10);
+    if (eptr != s_port + strlen(s_port)) {
+        // incomplete conversion - port number contains non-digit
+        return -1;
+    }
+
+    if (n > (u_short) -1) {
+        // check that value supplied by user is less than
+        // maximum possible u_short value (65535) and
+        // will not be truncated later.
+        return -1;
+    }
+
+    return n;
+}
+
 static jdwpTransportError
-parseAddress(const char *address, struct sockaddr_in *sa, uint32_t defaultHost) {
+parseAddress(const char *address, struct sockaddr_in *sa) {
     char *colon;
+    int port;
 
     memset((void *)sa,0,sizeof(struct sockaddr_in));
     sa->sin_family = AF_INET;
 
     /* check for host:port or port */
     colon = strchr(address, ':');
+    port = getPortNumber((colon == NULL) ? address : colon +1);
+    if (port < 0) {
+        RETURN_ERROR(JDWPTRANSPORT_ERROR_ILLEGAL_ARGUMENT, "invalid port number specified");
+    }
+    sa->sin_port = dbgsysHostToNetworkShort((u_short)port);
+
     if (colon == NULL) {
-        u_short port = (u_short)atoi(address);
-        sa->sin_port = dbgsysHostToNetworkShort(port);
-        sa->sin_addr.s_addr = dbgsysHostToNetworkLong(defaultHost);
-    } else {
+        // bind to localhost only if no address specified
+        sa->sin_addr.s_addr = getLocalHostAddress();
+    } else if (strncmp(address,"localhost:",10) == 0) {
+        // optimize for common case
+        sa->sin_addr.s_addr = getLocalHostAddress();
+    } else if (*address == '*' && *(address+1) == ':') {
+        // we are explicitly asked to bind server to all available IP addresses
+        // has no meaning for client.
+        sa->sin_addr.s_addr = dbgsysHostToNetworkLong(INADDR_ANY);
+     } else {
         char *buf;
         char *hostname;
-        u_short port;
         uint32_t addr;
 
         buf = (*callback->alloc)((int)strlen(address)+1);
@@ -215,8 +280,6 @@
         strcpy(buf, address);
         buf[colon - address] = '\0';
         hostname = buf;
-        port = atoi(colon + 1);
-        sa->sin_port = dbgsysHostToNetworkShort(port);
 
         /*
          * First see if the host is a literal IP address.
@@ -277,7 +340,7 @@
         address = "0";
     }
 
-    err = parseAddress(address, &sa, INADDR_ANY);
+    err = parseAddress(address, &sa);
     if (err != JDWPTRANSPORT_ERROR_NONE) {
         return err;
     }
@@ -437,7 +500,7 @@
         RETURN_ERROR(JDWPTRANSPORT_ERROR_ILLEGAL_ARGUMENT, "address is missing");
     }
 
-    err = parseAddress(addressString, &sa, 0x7f000001);
+    err = parseAddress(addressString, &sa);
     if (err != JDWPTRANSPORT_ERROR_NONE) {
         return err;
     }
--- a/jdk/src/solaris/classes/java/lang/UNIXProcess.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/classes/java/lang/UNIXProcess.java	Mon Jun 02 13:53:52 2014 -0700
@@ -97,6 +97,7 @@
                 EnumSet.copyOf(Arrays.asList(launchMechanisms));
         }
 
+        @SuppressWarnings("fallthrough")
         private String helperPath(String javahome, String osArch) {
             switch (this) {
                 case SOLARIS:
@@ -483,6 +484,11 @@
     }
 
     @Override
+    public long getPid() {
+        return pid;
+    }
+
+    @Override
     public synchronized boolean isAlive() {
         return !hasExited;
     }
--- a/jdk/src/solaris/classes/sun/awt/X11/InfoWindow.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/InfoWindow.java	Mon Jun 02 13:53:52 2014 -0700
@@ -207,8 +207,9 @@
                             textLabel.setText(tooltipString);
                         }
 
-                        Point pointer = (Point)AccessController.doPrivileged(new PrivilegedAction() {
-                                public Object run() {
+                        Point pointer = AccessController.doPrivileged(
+                            new PrivilegedAction<Point>() {
+                                public Point run() {
                                     if (!isPointerOverTrayIcon(liveArguments.getBounds())) {
                                         return null;
                                     }
--- a/jdk/src/solaris/classes/sun/awt/X11/ListHelper.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/ListHelper.java	Mon Jun 02 13:53:52 2014 -0700
@@ -55,10 +55,10 @@
 
     private final int SCROLLBAR_WIDTH;  // Width of a scrollbar
 
-    private java.util.List items;        // List of items
+    private java.util.List<String> items;        // List of items
 
     // TODO: maybe this would be better as a simple int[]
-    private java.util.List selected;     // List of selected items
+    private java.util.List<Integer> selected;     // List of selected items
     private boolean multiSelect;         // Can multiple items be selected
                                          // at once?
     private int focusedIndex;
@@ -100,8 +100,8 @@
         this.peer = peer;
         this.colors = colors;
         this.multiSelect = multiSelect;
-        items = new ArrayList(initialSize);
-        selected = new ArrayList(1);
+        items = new ArrayList<>(initialSize);
+        selected = new ArrayList<>(1);
         selected.add(Integer.valueOf(-1));
 
         this.maxVisItems = maxVisItems;
@@ -190,7 +190,7 @@
     /* if called for multiselect, return -1 */
     public int getSelectedIndex() {
         if (!multiSelect) {
-            Integer val = (Integer)selected.get(0);
+            Integer val = selected.get(0);
             return val.intValue();
         }
         return -1;
@@ -217,7 +217,7 @@
     }
 
     public String getItem(int index) {
-        return (String) items.get(index);
+        return items.get(index);
     }
 
     /**********************************************************************/
@@ -576,9 +576,9 @@
     }
 
     boolean isItemSelected(int index) {
-        Iterator itr = selected.iterator();
+        Iterator<Integer> itr = selected.iterator();
         while (itr.hasNext()) {
-            Integer val = (Integer)itr.next();
+            Integer val = itr.next();
             if (val.intValue() == index) {
                 return true;
             }
--- a/jdk/src/solaris/classes/sun/awt/X11/MotifDnDDragSourceProtocol.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/MotifDnDDragSourceProtocol.java	Mon Jun 02 13:53:52 2014 -0700
@@ -26,6 +26,7 @@
 package sun.awt.X11;
 
 import java.awt.datatransfer.Transferable;
+import java.awt.datatransfer.DataFlavor;
 
 import java.awt.dnd.DnDConstants;
 import java.awt.dnd.InvalidDnDOperationException;
@@ -65,7 +66,7 @@
     }
 
     protected void initializeDragImpl(int actions, Transferable contents,
-                                      Map formatMap, long[] formats)
+                                      Map<Long, DataFlavor> formatMap, long[] formats)
       throws InvalidDnDOperationException,
         IllegalArgumentException, XException {
 
--- a/jdk/src/solaris/classes/sun/awt/X11/Native.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/Native.java	Mon Jun 02 13:53:52 2014 -0700
@@ -43,13 +43,12 @@
 
     static int dataModel;
     static {
-        String dataModelProp = (String)AccessController.
-            doPrivileged(
-                         new PrivilegedAction() {
-                                 public Object run() {
-                                     return System.getProperty("sun.arch.data.model");
-                                 }
-                             });
+        String dataModelProp = AccessController.doPrivileged(
+            new PrivilegedAction<String>() {
+                public String run() {
+                    return System.getProperty("sun.arch.data.model");
+                }
+            });
         try {
             dataModel = Integer.parseInt(dataModelProp);
         } catch (Exception e) {
@@ -333,9 +332,9 @@
      * Stores Java Vector of Longs into memory. Memory location is treated as array
      * of native <code>long</code>s
      */
-    static void putLong(long ptr, Vector arr) {
+    static void putLong(long ptr, Vector<Long> arr) {
         for (int i = 0; i < arr.size(); i ++, ptr += getLongSize()) {
-            putLong(ptr, ((Long)arr.elementAt(i)).longValue());
+            putLong(ptr, arr.elementAt(i).longValue());
         }
     }
 
@@ -343,9 +342,9 @@
      * Stores Java Vector of Longs into memory. Memory location is treated as array
      * of native <code>long</code>s. Array is stored in reverse order
      */
-    static void putLongReverse(long ptr, Vector arr) {
+    static void putLongReverse(long ptr, Vector<Long> arr) {
         for (int i = arr.size()-1; i >= 0; i--, ptr += getLongSize()) {
-            putLong(ptr, ((Long)arr.elementAt(i)).longValue());
+            putLong(ptr, arr.elementAt(i).longValue());
         }
     }
     /**
--- a/jdk/src/solaris/classes/sun/awt/X11/XAWTXSettings.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XAWTXSettings.java	Mon Jun 02 13:53:52 2014 -0700
@@ -98,7 +98,7 @@
          * should be "good enough" for most cases.
          */
 
-        Map updatedSettings = null;
+        Map<String, Object> updatedSettings = null;
         XToolkit.awtLock();
         try {
             long display = XToolkit.getDisplay();
@@ -112,7 +112,7 @@
     }
 
     private void updateXSettings(int screen, long owner) {
-        final Map updatedSettings = getUpdatedSettings(owner);
+        final Map<String, Object> updatedSettings = getUpdatedSettings(owner);
         // this method is called under awt lock and usually on toolkit thread
         // but parseXSettings() causes public code execution, so we need to transfer
         // this to EDT
@@ -123,7 +123,7 @@
         });
     }
 
-    private Map getUpdatedSettings(final long owner) {
+    private Map<String, Object> getUpdatedSettings(final long owner) {
         if (log.isLoggable(PlatformLogger.Level.FINE)) {
             log.fine("owner =" + owner);
         }
@@ -131,7 +131,7 @@
             return null;
         }
 
-        Map settings = null;
+        Map<String, Object> settings = null;
         try {
             WindowPropertyGetter getter =
                 new WindowPropertyGetter(owner, xSettingsPropertyAtom, 0, MAX_LENGTH,
--- a/jdk/src/solaris/classes/sun/awt/X11/XAtomList.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XAtomList.java	Mon Jun 02 13:53:52 2014 -0700
@@ -157,7 +157,7 @@
     public String toString() {
         StringBuffer buf = new StringBuffer();
         buf.append("[");
-        Iterator iter = atoms.iterator();
+        Iterator<XAtom> iter = atoms.iterator();
         while (iter.hasNext()) {
             buf.append(iter.next().toString());
             if (iter.hasNext()) {
--- a/jdk/src/solaris/classes/sun/awt/X11/XAwtState.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XAwtState.java	Mon Jun 02 13:53:52 2014 -0700
@@ -40,7 +40,7 @@
      * The mouse is over this component.
      * If the component is not disabled, it received MOUSE_ENTERED but no MOUSE_EXITED.
      */
-    private static WeakReference componentMouseEnteredRef = null;
+    private static WeakReference<Component> componentMouseEnteredRef = null;
 
     static void setComponentMouseEntered(Component component) {
         XToolkit.awtLock();
@@ -50,7 +50,7 @@
                 return;
             }
             if (component != getComponentMouseEntered()) {
-                componentMouseEnteredRef = new WeakReference(component);
+                componentMouseEnteredRef = new WeakReference<>(component);
             }
         } finally {
             XToolkit.awtUnlock();
@@ -63,7 +63,7 @@
             if (componentMouseEnteredRef == null) {
                 return null;
             }
-            return (Component)componentMouseEnteredRef.get();
+            return componentMouseEnteredRef.get();
         } finally {
             XToolkit.awtUnlock();
         }
@@ -83,7 +83,7 @@
         return inManualGrab;
     }
 
-    private static WeakReference grabWindowRef = null;
+    private static WeakReference<XBaseWindow> grabWindowRef = null;
 
     /**
      * The X Active Grab overrides any other active grab by the same
@@ -112,7 +112,7 @@
                 return;
             }
             if (grabWindow != getGrabWindow()) {
-                grabWindowRef = new WeakReference(grabWindow);
+                grabWindowRef = new WeakReference<>(grabWindow);
             }
         } finally {
             XToolkit.awtUnlock();
@@ -125,7 +125,7 @@
             if (grabWindowRef == null) {
                 return null;
             }
-            XBaseWindow xbw = (XBaseWindow)grabWindowRef.get();
+            XBaseWindow xbw = grabWindowRef.get();
             if( xbw != null && xbw.isDisposed() ) {
                 xbw = null;
                 grabWindowRef = null;
--- a/jdk/src/solaris/classes/sun/awt/X11/XBaseMenuWindow.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XBaseMenuWindow.java	Mon Jun 02 13:53:52 2014 -0700
@@ -231,7 +231,7 @@
      */
     void instantPreInit(XCreateWindowParams params) {
         super.instantPreInit(params);
-        items = new ArrayList();
+        items = new ArrayList<>();
     }
 
     /************************************************
@@ -367,10 +367,10 @@
      * Clears items vector and loads specified vector
      * @param items vector to be loaded
      */
-    public void reloadItems(Vector items) {
+    public void reloadItems(Vector<? extends MenuItem> items) {
         synchronized(getMenuTreeLock()) {
             this.items.clear();
-            MenuItem[] itemArray = (MenuItem[])items.toArray(new MenuItem[] {});
+            MenuItem[] itemArray = items.toArray(new MenuItem[] {});
             int itemCnt = itemArray.length;
             for(int i = 0; i < itemCnt; i++) {
                 addItem(itemArray[i]);
--- a/jdk/src/solaris/classes/sun/awt/X11/XComponentPeer.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XComponentPeer.java	Mon Jun 02 13:53:52 2014 -0700
@@ -236,8 +236,8 @@
         return false;
     }
 
-    private static Class seClass;
-    private static Constructor seCtor;
+    private static Class<?> seClass;
+    private static Constructor<?> seCtor;
 
     final static AWTEvent wrapInSequenced(AWTEvent event) {
         try {
@@ -246,9 +246,11 @@
             }
 
             if (seCtor == null) {
-                seCtor = (Constructor) AccessController.doPrivileged(new PrivilegedExceptionAction() {
-                        public Object run() throws Exception {
-                            Constructor ctor = seClass.getConstructor(new Class[] { AWTEvent.class });
+                seCtor = AccessController.doPrivileged(new
+                    PrivilegedExceptionAction<Constructor<?>>() {
+                        public Constructor<?> run() throws Exception {
+                            Constructor<?> ctor = seClass.getConstructor(
+                                new Class<?>[] { AWTEvent.class });
                             ctor.setAccessible(true);
                             return ctor;
                         }
@@ -1322,7 +1324,7 @@
         }
     }
 
-    private void addTree(Collection order, Set set, Container cont) {
+    private void addTree(Collection<Long> order, Set<Long> set, Container cont) {
         for (int i = 0; i < cont.getComponentCount(); i++) {
             Component comp = cont.getComponent(i);
             ComponentPeer peer = comp.getPeer();
--- a/jdk/src/solaris/classes/sun/awt/X11/XCreateWindowParams.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XCreateWindowParams.java	Mon Jun 02 13:53:52 2014 -0700
@@ -30,7 +30,7 @@
 import java.util.Map;
 
 @SuppressWarnings("serial") // JDK-implementation class
-public class XCreateWindowParams extends HashMap {
+public class XCreateWindowParams extends HashMap<Object, Object> {
     public XCreateWindowParams() {
     }
     public XCreateWindowParams(Object[] map) {
@@ -82,9 +82,9 @@
     }
     public String toString() {
         StringBuffer buf = new StringBuffer();
-        Iterator eIter = entrySet().iterator();
+        Iterator<Map.Entry<Object, Object>> eIter = entrySet().iterator();
         while (eIter.hasNext()) {
-            Map.Entry entry = (Map.Entry)eIter.next();
+            Map.Entry<Object, Object> entry = eIter.next();
             buf.append(entry.getKey() + ": " + entry.getValue() + "\n");
         }
         return buf.toString();
--- a/jdk/src/solaris/classes/sun/awt/X11/XDataTransferer.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XDataTransferer.java	Mon Jun 02 13:53:52 2014 -0700
@@ -45,9 +45,11 @@
 
 import java.util.ArrayList;
 import java.util.Iterator;
+import java.util.LinkedHashSet;
 import java.util.List;
 
 import javax.imageio.ImageIO;
+import javax.imageio.ImageReader;
 import javax.imageio.ImageTypeSpecifier;
 import javax.imageio.ImageWriter;
 import javax.imageio.spi.ImageWriterSpi;
@@ -258,28 +260,9 @@
                                   Transferable localeTransferable)
       throws IOException {
 
-        String charset = null;
-        if (localeTransferable != null &&
-            isLocaleDependentTextFormat(format) &&
-            localeTransferable.isDataFlavorSupported(javaTextEncodingFlavor)) {
-            try {
-                charset = new String(
-                    (byte[])localeTransferable.getTransferData(javaTextEncodingFlavor),
-                    "UTF-8"
-                );
-            } catch (UnsupportedFlavorException cannotHappen) {
-            }
-        } else {
-            charset = getCharsetForTextFormat(format);
-        }
-        if (charset == null) {
-            // Only happens when we have a custom text type.
-            charset = getDefaultTextCharset();
-        }
-
-        BufferedReader reader = null;
-        try {
-            reader = new BufferedReader(new InputStreamReader(stream, charset));
+        String charset = getBestCharsetForTextFormat(format, localeTransferable);
+        try (InputStreamReader isr = new InputStreamReader(stream, charset);
+             BufferedReader reader = new BufferedReader(isr)) {
             String line;
             ArrayList<URI> uriList = new ArrayList<>();
             URI uri;
@@ -292,9 +275,6 @@
                 uriList.add(uri);
             }
             return uriList.toArray(new URI[uriList.size()]);
-        } finally {
-            if (reader != null)
-                reader.close();
         }
     }
 
@@ -330,8 +310,8 @@
      * type can be translated by the Data Transfer subsystem.
      */
     @Override
-    public List<DataFlavor> getPlatformMappingsForNative(String nat) {
-        List<DataFlavor> flavors = new ArrayList<>();
+    public LinkedHashSet<DataFlavor> getPlatformMappingsForNative(String nat) {
+        LinkedHashSet<DataFlavor> flavors = new LinkedHashSet<>();
 
         if (nat == null) {
             return flavors;
@@ -354,7 +334,7 @@
         // flavors to enable dynamic text native-to-flavor mapping generation.
         // See SystemFlavorMap.getFlavorsForNative() for details.
         if ("image".equals(primaryType)) {
-            Iterator readers = ImageIO.getImageReadersByMIMEType(baseType);
+            Iterator<ImageReader> readers = ImageIO.getImageReadersByMIMEType(baseType);
             if (readers.hasNext()) {
                 flavors.add(DataFlavor.imageFlavor);
             }
@@ -392,8 +372,8 @@
      * Transfer subsystem.
      */
     @Override
-    public List<String> getPlatformMappingsForFlavor(DataFlavor df) {
-        List<String> natives = new ArrayList<>(1);
+    public LinkedHashSet<String> getPlatformMappingsForFlavor(DataFlavor df) {
+        LinkedHashSet<String> natives = new LinkedHashSet<>(1);
 
         if (df == null) {
             return natives;
--- a/jdk/src/solaris/classes/sun/awt/X11/XDnDDragSourceProtocol.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XDnDDragSourceProtocol.java	Mon Jun 02 13:53:52 2014 -0700
@@ -26,6 +26,7 @@
 package sun.awt.X11;
 
 import java.awt.datatransfer.Transferable;
+import java.awt.datatransfer.DataFlavor;
 
 import java.awt.dnd.DnDConstants;
 import java.awt.dnd.InvalidDnDOperationException;
@@ -70,7 +71,7 @@
      * @returns true if the initialized successfully.
      */
     protected void initializeDragImpl(int actions, Transferable contents,
-                                         Map formatMap, long[] formats)
+                                      Map<Long, DataFlavor> formatMap, long[] formats)
       throws InvalidDnDOperationException,
         IllegalArgumentException, XException {
         assert XToolkit.isAWTLockHeldByCurrentThread();
--- a/jdk/src/solaris/classes/sun/awt/X11/XDragAndDropProtocols.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XDragAndDropProtocols.java	Mon Jun 02 13:53:52 2014 -0700
@@ -36,8 +36,8 @@
  * @since 1.5
  */
 final class XDragAndDropProtocols {
-    private final static List dragProtocols;
-    private final static List dropProtocols;
+    private final static List<XDragSourceProtocol> dragProtocols;
+    private final static List<XDropTargetProtocol> dropProtocols;
 
     public static final String XDnD = "XDnD";
     public static final String MotifDnD = "MotifDnD";
@@ -50,7 +50,7 @@
         XDropTargetProtocolListener dropTargetProtocolListener =
             XDropTargetContextPeer.getXDropTargetProtocolListener();
 
-        List tDragSourceProtocols = new ArrayList();
+        List<XDragSourceProtocol> tDragSourceProtocols = new ArrayList<>();
         XDragSourceProtocol xdndDragSourceProtocol =
             XDnDDragSourceProtocol.createInstance(dragSourceProtocolListener);
         tDragSourceProtocols.add(xdndDragSourceProtocol);
@@ -58,7 +58,7 @@
             MotifDnDDragSourceProtocol.createInstance(dragSourceProtocolListener);
         tDragSourceProtocols.add(motifdndDragSourceProtocol);
 
-        List tDropTargetProtocols = new ArrayList();
+        List<XDropTargetProtocol> tDropTargetProtocols = new ArrayList<>();
         XDropTargetProtocol xdndDropTargetProtocol =
             XDnDDropTargetProtocol.createInstance(dropTargetProtocolListener);
         tDropTargetProtocols.add(xdndDropTargetProtocol);
@@ -70,11 +70,11 @@
         dropProtocols = Collections.unmodifiableList(tDropTargetProtocols);
     }
 
-    static Iterator getDragSourceProtocols() {
+    static Iterator<XDragSourceProtocol> getDragSourceProtocols() {
         return dragProtocols.iterator();
     }
 
-    static Iterator getDropTargetProtocols() {
+    static Iterator<XDropTargetProtocol> getDropTargetProtocols() {
         return dropProtocols.iterator();
     }
 
@@ -88,10 +88,10 @@
             return null;
         }
 
-        Iterator dragProtocols = XDragAndDropProtocols.getDragSourceProtocols();
+        Iterator<XDragSourceProtocol> dragProtocols =
+            XDragAndDropProtocols.getDragSourceProtocols();
         while (dragProtocols.hasNext()) {
-            XDragSourceProtocol dragProtocol =
-                (XDragSourceProtocol)dragProtocols.next();
+            XDragSourceProtocol dragProtocol = dragProtocols.next();
             if (dragProtocol.getProtocolName().equals(name)) {
                 return dragProtocol;
             }
@@ -110,10 +110,10 @@
             return null;
         }
 
-        Iterator dropProtocols = XDragAndDropProtocols.getDropTargetProtocols();
+        Iterator<XDropTargetProtocol> dropProtocols =
+            XDragAndDropProtocols.getDropTargetProtocols();
         while (dropProtocols.hasNext()) {
-            XDropTargetProtocol dropProtocol =
-                (XDropTargetProtocol)dropProtocols.next();
+            XDropTargetProtocol dropProtocol = dropProtocols.next();
             if (dropProtocol.getProtocolName().equals(name)) {
                 return dropProtocol;
             }
--- a/jdk/src/solaris/classes/sun/awt/X11/XDragSourceContextPeer.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XDragSourceContextPeer.java	Mon Jun 02 13:53:52 2014 -0700
@@ -29,6 +29,7 @@
 import java.awt.Cursor;
 import java.awt.Window;
 
+import java.awt.datatransfer.DataFlavor;
 import java.awt.datatransfer.Transferable;
 
 import java.awt.dnd.DnDConstants;
@@ -110,7 +111,7 @@
     }
 
     protected void startDrag(Transferable transferable,
-                             long[] formats, Map formatMap) {
+                             long[] formats, Map<Long, DataFlavor> formatMap) {
         Component component = getTrigger().getComponent();
         Component c = null;
         XWindowPeer wpeer = null;
@@ -161,9 +162,10 @@
 
             int dropActions = getDragSourceContext().getSourceActions();
 
-            Iterator dragProtocols = XDragAndDropProtocols.getDragSourceProtocols();
+            Iterator<XDragSourceProtocol> dragProtocols =
+                XDragAndDropProtocols.getDragSourceProtocols();
             while (dragProtocols.hasNext()) {
-                XDragSourceProtocol dragProtocol = (XDragSourceProtocol)dragProtocols.next();
+                XDragSourceProtocol dragProtocol = dragProtocols.next();
                 try {
                     dragProtocol.initializeDrag(dropActions, transferable,
                                                 formatMap, formats);
@@ -313,9 +315,10 @@
             dragDropFinished(false, DnDConstants.ACTION_NONE, xRoot, yRoot);
         }
 
-        Iterator dragProtocols = XDragAndDropProtocols.getDragSourceProtocols();
+        Iterator<XDragSourceProtocol> dragProtocols =
+            XDragAndDropProtocols.getDragSourceProtocols();
         while (dragProtocols.hasNext()) {
-            XDragSourceProtocol dragProtocol = (XDragSourceProtocol)dragProtocols.next();
+            XDragSourceProtocol dragProtocol = dragProtocols.next();
             try {
                 dragProtocol.cleanup();
             } catch (XException xe) {
@@ -418,9 +421,10 @@
         }
 
         if (clientWindow != 0) {
-            Iterator dragProtocols = XDragAndDropProtocols.getDragSourceProtocols();
+            Iterator<XDragSourceProtocol> dragProtocols =
+                XDragAndDropProtocols.getDragSourceProtocols();
             while (dragProtocols.hasNext()) {
-                XDragSourceProtocol dragProtocol = (XDragSourceProtocol)dragProtocols.next();
+                XDragSourceProtocol dragProtocol = dragProtocols.next();
                 if (dragProtocol.attachTargetWindow(clientWindow, time)) {
                     protocol = dragProtocol;
                     break;
@@ -550,10 +554,10 @@
 
         XClientMessageEvent xclient = ev.get_xclient();
 
-        Iterator dragProtocols = XDragAndDropProtocols.getDragSourceProtocols();
+        Iterator<XDragSourceProtocol> dragProtocols =
+            XDragAndDropProtocols.getDragSourceProtocols();
         while (dragProtocols.hasNext()) {
-            XDragSourceProtocol dragProtocol =
-                (XDragSourceProtocol)dragProtocols.next();
+            XDragSourceProtocol dragProtocol = dragProtocols.next();
             if (dragProtocol.processProxyModeEvent(xclient,
                                                    getProxyModeSourceWindow())) {
                 return true;
--- a/jdk/src/solaris/classes/sun/awt/X11/XDragSourceProtocol.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XDragSourceProtocol.java	Mon Jun 02 13:53:52 2014 -0700
@@ -26,6 +26,7 @@
 package sun.awt.X11;
 
 import java.awt.datatransfer.Transferable;
+import java.awt.datatransfer.DataFlavor;
 
 import java.awt.dnd.DnDConstants;
 import java.awt.dnd.InvalidDnDOperationException;
@@ -84,7 +85,7 @@
      * @throws XException if some X call failed.
      */
     public final void initializeDrag(int actions, Transferable contents,
-                                     Map formatMap, long[] formats)
+                                     Map<Long, DataFlavor> formatMap, long[] formats)
       throws InvalidDnDOperationException,
              IllegalArgumentException, XException {
         XToolkit.awtLock();
@@ -110,7 +111,8 @@
     /* The caller must hold AWT_LOCK. */
     protected abstract void initializeDragImpl(int actions,
                                                Transferable contents,
-                                               Map formatMap, long[] formats)
+                                               Map<Long, DataFlavor> formatMap,
+                                               long[] formats)
       throws InvalidDnDOperationException, IllegalArgumentException, XException;
 
     /**
--- a/jdk/src/solaris/classes/sun/awt/X11/XDropTargetContextPeer.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XDropTargetContextPeer.java	Mon Jun 02 13:53:52 2014 -0700
@@ -89,12 +89,12 @@
         /* If the event was not consumed, send a response to the source. */
         try {
             if (ctxt != 0 && !e.isConsumed()) {
-                Iterator dropTargetProtocols =
+                Iterator<XDropTargetProtocol> dropTargetProtocols =
                     XDragAndDropProtocols.getDropTargetProtocols();
 
                 while (dropTargetProtocols.hasNext()) {
                     XDropTargetProtocol dropTargetProtocol =
-                        (XDropTargetProtocol)dropTargetProtocols.next();
+                        dropTargetProtocols.next();
                     if (dropTargetProtocol.sendResponse(ctxt, e.getID(),
                                                         returnValue)) {
                         break;
@@ -116,12 +116,12 @@
 
         if (ctxt != 0) {
             try {
-                Iterator dropTargetProtocols =
+                Iterator<XDropTargetProtocol> dropTargetProtocols =
                     XDragAndDropProtocols.getDropTargetProtocols();
 
                 while (dropTargetProtocols.hasNext()) {
                     XDropTargetProtocol dropTargetProtocol =
-                        (XDropTargetProtocol)dropTargetProtocols.next();
+                        dropTargetProtocols.next();
                     if (dropTargetProtocol.sendDropDone(ctxt, success,
                                                         dropAction)) {
                         break;
@@ -140,12 +140,12 @@
         long ctxt = getNativeDragContext();
 
         if (ctxt != 0) {
-            Iterator dropTargetProtocols =
+            Iterator<XDropTargetProtocol> dropTargetProtocols =
                 XDragAndDropProtocols.getDropTargetProtocols();
 
             while (dropTargetProtocols.hasNext()) {
                 XDropTargetProtocol dropTargetProtocol =
-                    (XDropTargetProtocol)dropTargetProtocols.next();
+                    dropTargetProtocols.next();
                 // getData throws IAE if ctxt is not for this protocol.
                 try {
                     return dropTargetProtocol.getData(ctxt, format);
@@ -221,12 +221,11 @@
 
     public void forwardEventToEmbedded(long embedded, long ctxt,
                                        int eventID) {
-        Iterator dropTargetProtocols =
+        Iterator<XDropTargetProtocol> dropTargetProtocols =
             XDragAndDropProtocols.getDropTargetProtocols();
 
         while (dropTargetProtocols.hasNext()) {
-            XDropTargetProtocol dropTargetProtocol =
-                (XDropTargetProtocol)dropTargetProtocols.next();
+            XDropTargetProtocol dropTargetProtocol = dropTargetProtocols.next();
             if (dropTargetProtocol.forwardEventToEmbedded(embedded, ctxt,
                                                           eventID)) {
                 break;
--- a/jdk/src/solaris/classes/sun/awt/X11/XDropTargetEventProcessor.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XDropTargetEventProcessor.java	Mon Jun 02 13:53:52 2014 -0700
@@ -79,12 +79,11 @@
         }
 
         if (protocol == null) {
-            Iterator dropTargetProtocols =
+            Iterator<XDropTargetProtocol> dropTargetProtocols =
                 XDragAndDropProtocols.getDropTargetProtocols();
 
             while (dropTargetProtocols.hasNext()) {
-                XDropTargetProtocol dropTargetProtocol =
-                    (XDropTargetProtocol)dropTargetProtocols.next();
+                XDropTargetProtocol dropTargetProtocol = dropTargetProtocols.next();
                 // Don't try to process it again with the current protocol.
                 if (dropTargetProtocol == curProtocol) {
                     continue;
--- a/jdk/src/solaris/classes/sun/awt/X11/XDropTargetProtocol.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XDropTargetProtocol.java	Mon Jun 02 13:53:52 2014 -0700
@@ -295,7 +295,8 @@
     }
 
     /* Access to HashMap is synchronized on this XDropTargetProtocol instance. */
-    private final HashMap embedderRegistry = new HashMap();
+    private final HashMap<Long, EmbedderRegistryEntry> embedderRegistry =
+        new HashMap<>();
 
     protected final void putEmbedderRegistryEntry(long embedder,
                                                   boolean overriden,
@@ -310,8 +311,7 @@
 
     protected final EmbedderRegistryEntry getEmbedderRegistryEntry(long embedder) {
         synchronized (this) {
-            return
-                (EmbedderRegistryEntry)embedderRegistry.get(Long.valueOf(embedder));
+            return embedderRegistry.get(Long.valueOf(embedder));
         }
     }
 
--- a/jdk/src/solaris/classes/sun/awt/X11/XDropTargetRegistry.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XDropTargetRegistry.java	Mon Jun 02 13:53:52 2014 -0700
@@ -141,10 +141,10 @@
         }
         public long[] getSites() {
             long[] ret = new long[sites.size()];
-            Iterator iter = sites.iterator();
+            Iterator<Long> iter = sites.iterator();
             int index = 0;
             while (iter.hasNext()) {
-                Long l = (Long)iter.next();
+                Long l = iter.next();
                 ret[index++] = l.longValue();
             }
             return ret;
@@ -199,14 +199,13 @@
     private EmbeddedDropSiteEntry registerEmbedderDropSite(long embedder) {
         assert XToolkit.isAWTLockHeldByCurrentThread();
 
-        Iterator dropTargetProtocols =
+        Iterator<XDropTargetProtocol> dropTargetProtocols =
             XDragAndDropProtocols.getDropTargetProtocols();
         // The list of protocols supported by the embedder.
-        List<XDropTargetProtocol> embedderProtocols = new ArrayList();
+        List<XDropTargetProtocol> embedderProtocols = new ArrayList<>();
 
         while (dropTargetProtocols.hasNext()) {
-            XDropTargetProtocol dropTargetProtocol =
-                (XDropTargetProtocol)dropTargetProtocols.next();
+            XDropTargetProtocol dropTargetProtocol = dropTargetProtocols.next();
             if (dropTargetProtocol.isProtocolSupported(embedder)) {
                 embedderProtocols.add(dropTargetProtocol);
             }
@@ -262,7 +261,7 @@
 
     private void registerProtocols(long embedder, boolean protocols,
                                    List<XDropTargetProtocol> supportedProtocols) {
-        Iterator dropTargetProtocols = null;
+        Iterator<XDropTargetProtocol> dropTargetProtocols = null;
 
         /*
          * By default, we register a drop site that supports all dnd
@@ -289,8 +288,7 @@
         XlibWrapper.XGrabServer(XToolkit.getDisplay());
         try {
             while (dropTargetProtocols.hasNext()) {
-                XDropTargetProtocol dropTargetProtocol =
-                    (XDropTargetProtocol)dropTargetProtocols.next();
+                XDropTargetProtocol dropTargetProtocol = dropTargetProtocols.next();
                 if ((protocols == XEMBED_PROTOCOLS) ==
                     dropTargetProtocol.isXEmbedSupported()) {
                     dropTargetProtocol.registerEmbedderDropSite(embedder);
@@ -310,14 +308,13 @@
 
         assert XToolkit.isAWTLockHeldByCurrentThread();
 
-        Iterator dropTargetProtocols =
+        Iterator<XDropTargetProtocol> dropTargetProtocols =
             XDragAndDropProtocols.getDropTargetProtocols();
         // The list of protocols supported by the embedder.
-        List<XDropTargetProtocol> embedderProtocols = new ArrayList();
+        List<XDropTargetProtocol> embedderProtocols = new ArrayList<>();
 
         while (dropTargetProtocols.hasNext()) {
-            XDropTargetProtocol dropTargetProtocol =
-                (XDropTargetProtocol)dropTargetProtocols.next();
+            XDropTargetProtocol dropTargetProtocol = dropTargetProtocols.next();
             if (dropTargetProtocol.isProtocolSupported(embedder)) {
                 embedderProtocols.add(dropTargetProtocol);
             }
@@ -361,8 +358,7 @@
         XlibWrapper.XGrabServer(XToolkit.getDisplay());
         try {
             while (dropTargetProtocols.hasNext()) {
-                XDropTargetProtocol dropTargetProtocol =
-                    (XDropTargetProtocol)dropTargetProtocols.next();
+                XDropTargetProtocol dropTargetProtocol = dropTargetProtocols.next();
                 if (!isXEmbedServer || !dropTargetProtocol.isXEmbedSupported()) {
                     dropTargetProtocol.registerEmbedderDropSite(embedder);
                 }
@@ -376,7 +372,7 @@
                                             EmbeddedDropSiteEntry entry) {
         assert XToolkit.isAWTLockHeldByCurrentThread();
 
-        Iterator dropTargetProtocols =
+        Iterator<XDropTargetProtocol> dropTargetProtocols =
             XDragAndDropProtocols.getDropTargetProtocols();
 
         /* Grab server, since we are working with the window that belongs to
@@ -384,8 +380,7 @@
         XlibWrapper.XGrabServer(XToolkit.getDisplay());
         try {
             while (dropTargetProtocols.hasNext()) {
-                XDropTargetProtocol dropTargetProtocol =
-                    (XDropTargetProtocol)dropTargetProtocols.next();
+                XDropTargetProtocol dropTargetProtocol = dropTargetProtocols.next();
                 dropTargetProtocol.unregisterEmbedderDropSite(embedder);
             }
 
@@ -470,14 +465,14 @@
                     registerProtocols(toplevel, XEMBED_PROTOCOLS,
                                       entry.getSupportedProtocols());
                 } else {
-                    Iterator dropTargetProtocols =
+                    Iterator<XDropTargetProtocol> dropTargetProtocols =
                         XDragAndDropProtocols.getDropTargetProtocols();
 
                     // Register the embedded window as a plain drop site with
                     // all DnD protocols that are supported by XEmbed.
                     while (dropTargetProtocols.hasNext()) {
                         XDropTargetProtocol dropTargetProtocol =
-                            (XDropTargetProtocol)dropTargetProtocols.next();
+                            dropTargetProtocols.next();
                         if (dropTargetProtocol.isXEmbedSupported()) {
                             dropTargetProtocol.registerEmbedderDropSite(window);
                         }
@@ -558,12 +553,12 @@
         }
 
         if (toplevel == window) {
-            Iterator dropTargetProtocols =
+            Iterator<XDropTargetProtocol> dropTargetProtocols =
                 XDragAndDropProtocols.getDropTargetProtocols();
 
             while (dropTargetProtocols.hasNext()) {
                 XDropTargetProtocol dropTargetProtocol =
-                    (XDropTargetProtocol)dropTargetProtocols.next();
+                    dropTargetProtocols.next();
                 dropTargetProtocol.registerDropTarget(toplevel);
             }
         } else {
@@ -584,13 +579,13 @@
         long toplevel = getToplevelWindow(window);
 
         if (toplevel == window) {
-            Iterator dropProtocols =
+            Iterator<XDropTargetProtocol> dropProtocols =
                 XDragAndDropProtocols.getDropTargetProtocols();
 
             removeDelayedRegistrationEntry(window);
 
             while (dropProtocols.hasNext()) {
-                XDropTargetProtocol dropProtocol = (XDropTargetProtocol)dropProtocols.next();
+                XDropTargetProtocol dropProtocol = dropProtocols.next();
                 dropProtocol.unregisterDropTarget(window);
             }
         } else {
@@ -615,12 +610,11 @@
             }
             registerEmbeddedDropSite(canvasWindow, clientWindow);
 
-            Iterator dropTargetProtocols =
+            Iterator<XDropTargetProtocol> dropTargetProtocols =
                 XDragAndDropProtocols.getDropTargetProtocols();
 
             while (dropTargetProtocols.hasNext()) {
-                XDropTargetProtocol dropTargetProtocol =
-                    (XDropTargetProtocol)dropTargetProtocols.next();
+                XDropTargetProtocol dropTargetProtocol = dropTargetProtocols.next();
                 dropTargetProtocol.registerEmbeddedDropSite(clientWindow);
             }
 
@@ -634,12 +628,11 @@
         if (logger.isLoggable(PlatformLogger.Level.FINE)) {
             logger.fine("        XEmbed drop site will be unregistered for " + Long.toHexString(clientWindow));
         }
-        Iterator dropTargetProtocols =
+        Iterator<XDropTargetProtocol> dropTargetProtocols =
             XDragAndDropProtocols.getDropTargetProtocols();
 
         while (dropTargetProtocols.hasNext()) {
-            XDropTargetProtocol dropTargetProtocol =
-                (XDropTargetProtocol)dropTargetProtocols.next();
+            XDropTargetProtocol dropTargetProtocol = dropTargetProtocols.next();
             dropTargetProtocol.unregisterEmbeddedDropSite(clientWindow);
         }
 
--- a/jdk/src/solaris/classes/sun/awt/X11/XEmbeddingContainer.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XEmbeddingContainer.java	Mon Jun 02 13:53:52 2014 -0700
@@ -32,7 +32,7 @@
 import sun.awt.AWTAccessor;
 
 public class XEmbeddingContainer extends XEmbedHelper implements XEventDispatcher {
-    HashMap children = new HashMap();
+    HashMap<Long, java.awt.peer.ComponentPeer> children = new HashMap<>();
 
     XEmbeddingContainer() {
     }
--- a/jdk/src/solaris/classes/sun/awt/X11/XFileDialogPeer.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XFileDialogPeer.java	Mon Jun 02 13:53:52 2014 -0700
@@ -146,9 +146,9 @@
         savedDir = target.getDirectory();
         // Shouldn't save 'user.dir' to 'savedDir'
         // since getDirectory() will be incorrect after handleCancel
-        userDir = (String)AccessController.doPrivileged(
-            new PrivilegedAction() {
-                public Object run() {
+        userDir = AccessController.doPrivileged(
+            new PrivilegedAction<String>() {
+                public String run() {
                     return System.getProperty("user.dir");
                 }
             });
--- a/jdk/src/solaris/classes/sun/awt/X11/XListPeer.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XListPeer.java	Mon Jun 02 13:53:52 2014 -0700
@@ -70,7 +70,7 @@
     ListPainter painter;
 
     // TODO: ick - Vector?
-    Vector                      items;
+    Vector<String>              items;
     boolean                     multipleSelections;
     int                         active = NONE;
 
@@ -139,7 +139,7 @@
         super.preInit(params);
 
         // Stuff that must be initialized before layout() is called
-        items = new Vector();
+        items = new Vector<>();
         createVerScrollbar();
         createHorScrollbar();
 
@@ -281,7 +281,7 @@
         int m = 0;
         int end = items.size();
         for(int i = 0 ; i < end ; i++) {
-            int l = fm.stringWidth(((String)items.elementAt(i)));
+            int l = fm.stringWidth(items.elementAt(i));
             m = Math.max(m, l);
         }
         return m;
@@ -292,7 +292,7 @@
      */
     int getItemWidth(int i) {
         FontMetrics fm = getFontMetrics(getFont());
-        return fm.stringWidth((String)items.elementAt(i));
+        return fm.stringWidth(items.elementAt(i));
     }
 
     /**
@@ -659,7 +659,7 @@
                         ( clickCount % 2 == 0 ) ) {
                 postEvent(new ActionEvent(target,
                                           ActionEvent.ACTION_PERFORMED,
-                                          (String)items.elementAt(currentIndex),
+                                          items.elementAt(currentIndex),
                                           mouseEvent.getWhen(),
                                           mouseEvent.getModifiers()));  // No ext mods
             } else if (active == WINDOW) {
@@ -986,7 +986,7 @@
               if (selected.length > 0) {
                   postEvent(new ActionEvent((List)target,
                                             ActionEvent.ACTION_PERFORMED,
-                                            (String)items.elementAt(getFocusIndex()),
+                                            items.elementAt(getFocusIndex()),
                                             e.getWhen(),
                                             e.getModifiers()));  // ActionEvent doesn't have
                   // extended modifiers.
@@ -1343,7 +1343,7 @@
      */
     public void clear() {
         selected = new int[0];
-        items = new Vector();
+        items = new Vector<>();
         currentIndex = -1;
         // Fixed 6291736: ITEM_STATE_CHANGED triggered after List.removeAll(), XToolkit
         // We should update 'focusIndex' variable more carefully
@@ -1926,7 +1926,7 @@
                     } else {
                         g.setColor(getListForeground());
                     }
-                    String str = (String)items.elementAt(index);
+                    String str = items.elementAt(index);
                     g.drawString(str, x - hsb.getValue(), y + fontAscent);
                 } else {
                     // Clear the remaining area around the item - focus area and the rest of border
--- a/jdk/src/solaris/classes/sun/awt/X11/XMSelection.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XMSelection.java	Mon Jun 02 13:53:52 2014 -0700
@@ -60,7 +60,7 @@
     String selectionName;
 
     /* list of listeners to be called for events */
-    Vector listeners;
+    Vector<XMSelectionListener> listeners;
 
     /* X atom array (one per screen) for this selection */
     XAtom atoms[];
@@ -75,7 +75,7 @@
 
     static XAtom XA_MANAGER;
 
-    static HashMap selectionMap;
+    static HashMap<Long, XMSelection> selectionMap;
 
     static {
         long display = XToolkit.getDisplay();
@@ -90,7 +90,7 @@
             initScreen(display,screen);
         }
 
-        selectionMap = new HashMap();
+        selectionMap = new HashMap<>();
     }
 
     static void initScreen(long display, final int screen) {
@@ -227,7 +227,7 @@
 
 
     static XMSelection getInstance(long selection) {
-        return (XMSelection) selectionMap.get(Long.valueOf(selection));
+        return selectionMap.get(Long.valueOf(selection));
     }
 
 
@@ -259,7 +259,7 @@
 
     public synchronized void addSelectionListener(XMSelectionListener listener) {
         if (listeners == null) {
-            listeners = new Vector();
+            listeners = new Vector<>();
         }
         listeners.add(listener);
     }
@@ -270,7 +270,7 @@
         }
     }
 
-    synchronized Collection getListeners() {
+    synchronized Collection<XMSelectionListener> getListeners() {
         return listeners;
     }
 
@@ -310,9 +310,9 @@
             log.fine("Selection Changed : Screen = " + screen + "Event =" + ev);
         }
         if (listeners != null) {
-            Iterator iter = listeners.iterator();
+            Iterator<XMSelectionListener> iter = listeners.iterator();
             while (iter.hasNext()) {
-                XMSelectionListener disp = (XMSelectionListener) iter.next();
+                XMSelectionListener disp = iter.next();
                 disp.selectionChanged(screen, this, ev.get_window(), ev);
             }
         }
@@ -323,9 +323,9 @@
             log.fine("Owner dead : Screen = " + screen + "Event =" + de);
         }
         if (listeners != null) {
-            Iterator iter = listeners.iterator();
+            Iterator<XMSelectionListener> iter = listeners.iterator();
             while (iter.hasNext()) {
-                XMSelectionListener disp = (XMSelectionListener) iter.next();
+                XMSelectionListener disp = iter.next();
                 disp.ownerDeath(screen, this, de.get_window());
 
             }
@@ -349,9 +349,9 @@
 
     synchronized void dispatchOwnerChangedEvent(XEvent ev, int screen, long owner, long data, long timestamp) {
         if (listeners != null) {
-            Iterator iter = listeners.iterator();
+            Iterator<XMSelectionListener> iter = listeners.iterator();
             while (iter.hasNext()) {
-                XMSelectionListener disp = (XMSelectionListener) iter.next();
+                XMSelectionListener disp = iter.next();
                 disp.ownerChanged(screen,this, owner, data, timestamp);
             }
         }
--- a/jdk/src/solaris/classes/sun/awt/X11/XMenuBarPeer.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XMenuBarPeer.java	Mon Jun 02 13:53:52 2014 -0700
@@ -195,10 +195,10 @@
     void postInit(XCreateWindowParams params) {
         super.postInit(params);
         // Get menus from the target.
-        Vector targetMenuVector = AWTAccessor.getMenuBarAccessor()
-                                      .getMenus(menuBarTarget);
+        Vector<Menu> targetMenuVector = AWTAccessor.getMenuBarAccessor()
+                                                   .getMenus(menuBarTarget);
         Menu targetHelpMenu = AWTAccessor.getMenuBarAccessor()
-                                  .getHelpMenu(menuBarTarget);
+                                         .getHelpMenu(menuBarTarget);
         reloadItems(targetMenuVector);
         if (targetHelpMenu != null) {
             addHelpMenu(targetHelpMenu);
--- a/jdk/src/solaris/classes/sun/awt/X11/XMenuPeer.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XMenuPeer.java	Mon Jun 02 13:53:52 2014 -0700
@@ -143,7 +143,7 @@
      * Access to target's fields
      *
      ************************************************/
-    Vector getTargetItems() {
+    Vector<MenuItem> getTargetItems() {
         return AWTAccessor.getMenuAccessor().getItems((Menu)getTarget());
     }
 
--- a/jdk/src/solaris/classes/sun/awt/X11/XMenuWindow.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XMenuWindow.java	Mon Jun 02 13:53:52 2014 -0700
@@ -164,7 +164,7 @@
             this.menuPeer = menuPeer;
             this.target = menuPeer.getContainer().target;
             // Get menus from the target.
-            Vector targetItemVector = null;
+            Vector<MenuItem> targetItemVector = null;
             targetItemVector = getMenuTargetItems();
             reloadItems(targetItemVector);
         }
@@ -356,7 +356,7 @@
      * Reads vector of items from target
      * This function is overriden in XPopupMenuPeer
      */
-    Vector getMenuTargetItems() {
+    Vector<MenuItem> getMenuTargetItems() {
         return menuPeer.getTargetItems();
     }
 
--- a/jdk/src/solaris/classes/sun/awt/X11/XPopupMenuPeer.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XPopupMenuPeer.java	Mon Jun 02 13:53:52 2014 -0700
@@ -134,7 +134,7 @@
     public void show(Event e) {
         target = (Component)e.target;
         // Get menus from the target.
-        Vector targetItemVector = getMenuTargetItems();
+        Vector<MenuItem> targetItemVector = getMenuTargetItems();
         if (targetItemVector != null) {
             reloadItems(targetItemVector);
             //Fix for 6287092: JCK15a: api/java_awt/interactive/event/EventTests.html#EventTest0015 fails, mustang
@@ -188,7 +188,7 @@
         return AWTAccessor.getMenuItemAccessor().isEnabled(popupMenuTarget);
     }
 
-    Vector getMenuTargetItems() {
+    Vector<MenuItem> getMenuTargetItems() {
         if (popupMenuTarget == null) {
             return null;
         }
--- a/jdk/src/solaris/classes/sun/awt/X11/XSelection.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XSelection.java	Mon Jun 02 13:53:52 2014 -0700
@@ -25,6 +25,7 @@
 
 package sun.awt.X11;
 
+import java.awt.datatransfer.DataFlavor;
 import java.awt.datatransfer.Transferable;
 
 import java.io.ByteArrayOutputStream;
@@ -87,7 +88,7 @@
     /* The contents supplied by the current owner. */
     private Transferable contents = null;
     /* The format-to-flavor map for the current owner. */
-    private Map formatMap = null;
+    private Map<Long, DataFlavor> formatMap = null;
     /* The formats supported by the current owner was set. */
     private long[] formats = null;
     /* The AppContext in which the current owner was set. */
@@ -134,7 +135,8 @@
         return selectionAtom;
     }
 
-    public synchronized boolean setOwner(Transferable contents, Map formatMap,
+    public synchronized boolean setOwner(Transferable contents,
+                                         Map<Long, DataFlavor> formatMap,
                                          long[] formats, long time)
     {
         long owner = XWindow.getXAWTRootWindow().getWindow();
--- a/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java	Mon Jun 02 13:53:52 2014 -0700
@@ -36,6 +36,7 @@
 import java.awt.dnd.MouseDragGestureRecognizer;
 import java.awt.dnd.InvalidDnDOperationException;
 import java.awt.dnd.peer.DragSourceContextPeer;
+import java.awt.font.TextAttribute;
 import java.awt.im.InputMethodHighlight;
 import java.awt.im.spi.InputMethodDescriptor;
 import java.awt.image.ColorModel;
@@ -51,7 +52,7 @@
 import sun.font.FontConfigManager;
 import sun.java2d.SunGraphicsEnvironment;
 import sun.misc.*;
-import sun.misc.ThreadGroupUtils;
+import sun.awt.util.ThreadGroupUtils;
 import sun.print.PrintJob2D;
 import sun.security.action.GetPropertyAction;
 import sun.security.action.GetBooleanAction;
@@ -99,9 +100,9 @@
     private FontConfigManager fcManager = new FontConfigManager();
 
     static int arrowCursor;
-    static TreeMap winMap = new TreeMap();
-    static HashMap specialPeerMap = new HashMap();
-    static HashMap winToDispatcher = new HashMap();
+    static TreeMap<Long, XBaseWindow> winMap = new TreeMap<>();
+    static HashMap<Object, Object> specialPeerMap = new HashMap<>();
+    static HashMap<Long, Collection<XEventDispatcher>> winToDispatcher = new HashMap<>();
     private static long _display;
     static UIDefaults uidefaults;
     static X11GraphicsEnvironment localEnv;
@@ -358,16 +359,16 @@
     }
     static XBaseWindow windowToXWindow(long window) {
         synchronized(winMap) {
-            return (XBaseWindow) winMap.get(Long.valueOf(window));
+            return winMap.get(Long.valueOf(window));
         }
     }
 
     static void addEventDispatcher(long window, XEventDispatcher dispatcher) {
         synchronized(winToDispatcher) {
             Long key = Long.valueOf(window);
-            Collection dispatchers = (Collection)winToDispatcher.get(key);
+            Collection<XEventDispatcher> dispatchers = winToDispatcher.get(key);
             if (dispatchers == null) {
-                dispatchers = new Vector();
+                dispatchers = new Vector<>();
                 winToDispatcher.put(key, dispatchers);
             }
             dispatchers.add(dispatcher);
@@ -376,7 +377,7 @@
     static void removeEventDispatcher(long window, XEventDispatcher dispatcher) {
         synchronized(winToDispatcher) {
             Long key = Long.valueOf(window);
-            Collection dispatchers = (Collection)winToDispatcher.get(key);
+            Collection<XEventDispatcher> dispatchers = winToDispatcher.get(key);
             if (dispatchers != null) {
                 dispatchers.remove(dispatcher);
             }
@@ -493,18 +494,18 @@
         }
         XBaseWindow.dispatchToWindow(ev);
 
-        Collection dispatchers = null;
+        Collection<XEventDispatcher> dispatchers = null;
         synchronized(winToDispatcher) {
             Long key = Long.valueOf(xany.get_window());
-            dispatchers = (Collection)winToDispatcher.get(key);
+            dispatchers = winToDispatcher.get(key);
             if (dispatchers != null) { // Clone it to avoid synchronization during dispatching
-                dispatchers = new Vector(dispatchers);
+                dispatchers = new Vector<>(dispatchers);
             }
         }
         if (dispatchers != null) {
-            Iterator iter = dispatchers.iterator();
+            Iterator<XEventDispatcher> iter = dispatchers.iterator();
             while (iter.hasNext()) {
-                XEventDispatcher disp = (XEventDispatcher)iter.next();
+                XEventDispatcher disp = iter.next();
                 disp.dispatchEvent(ev);
             }
         }
@@ -764,7 +765,7 @@
 
         Insets insets = new Insets(0, 0, 0, 0);
 
-        java.util.List search = new LinkedList();
+        java.util.List<Object> search = new LinkedList<>();
         search.add(root);
         search.add(0);
         while (!search.isEmpty())
@@ -929,6 +930,7 @@
         return XDragSourceContextPeer.createDragSourceContextPeer(dge);
     }
 
+    @SuppressWarnings("unchecked")
     public <T extends DragGestureRecognizer> T
     createDragGestureRecognizer(Class<T> recognizerClass,
                     DragSource ds,
@@ -1147,7 +1149,7 @@
         return 2;  // Black and white.
     }
 
-    public Map mapInputMethodHighlight(InputMethodHighlight highlight)     {
+    public Map<TextAttribute, ?> mapInputMethodHighlight( InputMethodHighlight highlight) {
         return XInputMethod.mapInputMethodHighlight(highlight);
     }
     @Override
@@ -1338,31 +1340,25 @@
     static void dumpPeers() {
         if (log.isLoggable(PlatformLogger.Level.FINE)) {
             log.fine("Mapped windows:");
-            Iterator iter = winMap.entrySet().iterator();
-            while (iter.hasNext()) {
-                Map.Entry entry = (Map.Entry)iter.next();
-                log.fine(entry.getKey() + "->" + entry.getValue());
-                if (entry.getValue() instanceof XComponentPeer) {
-                    Component target = (Component)((XComponentPeer)entry.getValue()).getTarget();
+            winMap.forEach((k, v) -> {
+                log.fine(k + "->" + v);
+                if (v instanceof XComponentPeer) {
+                    Component target = (Component)((XComponentPeer)v).getTarget();
                     log.fine("\ttarget: " + target);
                 }
-            }
+            });
 
             SunToolkit.dumpPeers(log);
 
             log.fine("Mapped special peers:");
-            iter = specialPeerMap.entrySet().iterator();
-            while (iter.hasNext()) {
-                Map.Entry entry = (Map.Entry)iter.next();
-                log.fine(entry.getKey() + "->" + entry.getValue());
-            }
+            specialPeerMap.forEach((k, v) -> {
+                log.fine(k + "->" + v);
+            });
 
             log.fine("Mapped dispatchers:");
-            iter = winToDispatcher.entrySet().iterator();
-            while (iter.hasNext()) {
-                Map.Entry entry = (Map.Entry)iter.next();
-                log.fine(entry.getKey() + "->" + entry.getValue());
-            }
+            winToDispatcher.forEach((k, v) -> {
+                log.fine(k + "->" + v);
+            });
         }
     }
 
@@ -1586,16 +1582,16 @@
      * <code>loadXSettings</code>.  It is called from the System EDT
      * if triggered by an XSETTINGS change.
      */
-    void parseXSettings(int screen_XXX_ignored,Map updatedSettings) {
+    void parseXSettings(int screen_XXX_ignored,Map<String, Object> updatedSettings) {
 
         if (updatedSettings == null || updatedSettings.isEmpty()) {
             return;
         }
 
-        Iterator i = updatedSettings.entrySet().iterator();
+        Iterator<Map.Entry<String, Object>> i = updatedSettings.entrySet().iterator();
         while (i.hasNext()) {
-            Map.Entry e = (Map.Entry)i.next();
-            String name = (String)e.getKey();
+            Map.Entry<String, Object> e = i.next();
+            String name = e.getKey();
 
             name = "gnome." + name;
             setDesktopProperty(name, e.getValue());
@@ -1692,7 +1688,7 @@
             long window = 0;
             try{
                 // get any application window
-                window = ((Long)(winMap.firstKey())).longValue();
+                window = winMap.firstKey().longValue();
             }catch(NoSuchElementException nex) {
                 // get root window
                 window = getDefaultRootWindow();
@@ -1798,7 +1794,7 @@
     }
 
 
-    private static SortedMap timeoutTasks;
+    private static SortedMap<Long, java.util.List<Runnable>> timeoutTasks;
 
     /**
      * Removed the task from the list of waiting-to-be called tasks.
@@ -1819,10 +1815,10 @@
                 }
                 return;
             }
-            Collection values = timeoutTasks.values();
-            Iterator iter = values.iterator();
+            Collection<java.util.List<Runnable>> values = timeoutTasks.values();
+            Iterator<java.util.List<Runnable>> iter = values.iterator();
             while (iter.hasNext()) {
-                java.util.List list = (java.util.List)iter.next();
+                java.util.List<Runnable> list = iter.next();
                 boolean removed = false;
                 if (list.contains(task)) {
                     list.remove(task);
@@ -1869,13 +1865,13 @@
             }
 
             if (timeoutTasks == null) {
-                timeoutTasks = new TreeMap();
+                timeoutTasks = new TreeMap<>();
             }
 
             Long time = Long.valueOf(System.currentTimeMillis() + interval);
-            java.util.List tasks = (java.util.List)timeoutTasks.get(time);
+            java.util.List<Runnable> tasks = timeoutTasks.get(time);
             if (tasks == null) {
-                tasks = new ArrayList(1);
+                tasks = new ArrayList<>(1);
                 timeoutTasks.put(time, tasks);
             }
             tasks.add(task);
@@ -1897,7 +1893,7 @@
             if (timeoutTasks == null || timeoutTasks.isEmpty()) {
                 return -1L;
             }
-            return (Long)timeoutTasks.firstKey();
+            return timeoutTasks.firstKey();
         } finally {
             awtUnlock();
         }
@@ -1918,13 +1914,13 @@
         }
 
         Long currentTime = Long.valueOf(System.currentTimeMillis());
-        Long time = (Long)timeoutTasks.firstKey();
+        Long time = timeoutTasks.firstKey();
 
         while (time.compareTo(currentTime) <= 0) {
-            java.util.List tasks = (java.util.List)timeoutTasks.remove(time);
+            java.util.List<Runnable> tasks = timeoutTasks.remove(time);
 
-            for (Iterator iter = tasks.iterator(); iter.hasNext();) {
-                Runnable task = (Runnable)iter.next();
+            for (Iterator<Runnable> iter = tasks.iterator(); iter.hasNext();) {
+                Runnable task = iter.next();
 
                 if (timeoutTaskLog.isLoggable(PlatformLogger.Level.FINER)) {
                     timeoutTaskLog.finer("XToolkit.callTimeoutTasks(): current time={0}" +
@@ -1943,7 +1939,7 @@
             if (timeoutTasks.isEmpty()) {
                 break;
             }
-            time = (Long)timeoutTasks.firstKey();
+            time = timeoutTasks.firstKey();
         }
     }
 
--- a/jdk/src/solaris/classes/sun/awt/X11/XTrayIconPeer.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XTrayIconPeer.java	Mon Jun 02 13:53:52 2014 -0700
@@ -85,7 +85,7 @@
         // Fix for 6317038: as EmbeddedFrame is instance of Frame, it is blocked
         // by modal dialogs, but in the case of TrayIcon it shouldn't. So we
         // set ModalExclusion property on it.
-        AccessController.doPrivileged(new PrivilegedAction() {
+        AccessController.doPrivileged(new PrivilegedAction<Object>() {
             public Object run() {
                 eframe.setModalExclusionType(Dialog.ModalExclusionType.TOOLKIT_EXCLUDE);
                 return null;
--- a/jdk/src/solaris/classes/sun/awt/X11/XWM.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XWM.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1072,6 +1072,7 @@
      * Returns all protocols supporting given protocol interface
      */
     <T> Collection<T> getProtocols(Class<T> protocolInterface) {
+        @SuppressWarnings("unchecked")
         Collection<T> res = (Collection<T>) protocolsMap.get(protocolInterface);
         if (res != null) {
             return res;
@@ -1322,9 +1323,9 @@
         }
     }
 
-    HashMap storedInsets = new HashMap();
+    HashMap<Class<?>, Insets> storedInsets = new HashMap<>();
     Insets guessInsets(XDecoratedPeer window) {
-        Insets res = (Insets)storedInsets.get(window.getClass());
+        Insets res = storedInsets.get(window.getClass());
         if (res == null) {
             switch (WMID) {
               case ENLIGHTEN_WM:
--- a/jdk/src/solaris/classes/sun/awt/X11/XWindow.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XWindow.java	Mon Jun 02 13:53:52 2014 -0700
@@ -59,7 +59,7 @@
     static int lastX = 0, lastY = 0;
     static long lastTime = 0;
     static long lastButton = 0;
-    static WeakReference lastWindowRef = null;
+    static WeakReference<XWindow> lastWindowRef = null;
     static int clickCount = 0;
 
     // used to check if we need to re-create surfaceData.
@@ -692,7 +692,7 @@
         if (type == XConstants.ButtonPress) {
             //Allow this mouse button to generate CLICK event on next ButtonRelease
             mouseButtonClickAllowed |= XlibUtil.getButtonMask(lbutton);
-            XWindow lastWindow = (lastWindowRef != null) ? ((XWindow)lastWindowRef.get()):(null);
+            XWindow lastWindow = (lastWindowRef != null) ? (lastWindowRef.get()):(null);
             /*
                multiclick checking
             */
@@ -705,7 +705,7 @@
                 clickCount++;
             } else {
                 clickCount = 1;
-                lastWindowRef = new WeakReference(this);
+                lastWindowRef = new WeakReference<>(this);
                 lastButton = lbutton;
                 lastX = x;
                 lastY = y;
@@ -820,7 +820,7 @@
         */
         int x = xme.get_x();
         int y = xme.get_y();
-        XWindow lastWindow = (lastWindowRef != null) ? ((XWindow)lastWindowRef.get()):(null);
+        XWindow lastWindow = (lastWindowRef != null) ? (lastWindowRef.get()):(null);
 
         if (!(lastWindow == this &&
               (xme.get_time() - lastTime) < XToolkit.getMultiClickTime()  &&
--- a/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java	Mon Jun 02 13:53:52 2014 -0700
@@ -950,7 +950,7 @@
         // make new hash of toplevels of all windows from 'windows' hash.
         // FIXME: do not call them "toplevel" as it is misleading.
         //
-        HashSet toplevels = new HashSet();
+        HashSet<Long> toplevels = new HashSet<>();
         long topl = 0, mytopl = 0;
 
         for (XWindowPeer xp : windows) {
--- a/jdk/src/solaris/classes/sun/awt/X11CustomCursor.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/classes/sun/awt/X11CustomCursor.java	Mon Jun 02 13:53:52 2014 -0700
@@ -47,7 +47,7 @@
     protected void createNativeCursor(Image im, int[] pixels, int width, int height,
                                       int xHotSpot, int yHotSpot) {
 
-        class CCount implements Comparable {
+        class CCount implements Comparable<CCount> {
             int color;
             int count;
 
@@ -56,8 +56,8 @@
                 count = ct;
             }
 
-            public int compareTo(Object cc) {
-                return ((CCount)cc).count - count;
+            public int compareTo(CCount cc) {
+                return cc.count - count;
             }
         }
 
--- a/jdk/src/solaris/classes/sun/awt/X11FontManager.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/classes/sun/awt/X11FontManager.java	Mon Jun 02 13:53:52 2014 -0700
@@ -59,7 +59,7 @@
      * E.g., the -0-0-0-0-p-0- reported by X is -*-%d-*-*-p-*- in the font
      * configuration files. We need to remove that part for comparisons.
      */
-    private static Map fontNameMap = new HashMap();
+    private static Map<String, String> fontNameMap = new HashMap<>();
 
     /*
      * xlfdMap is a map from a platform path like
@@ -72,7 +72,7 @@
      * the full XLFD string like :-
      * "-ricoh-hg gothic b-medium-r-normal--0-0-0-0-m-0-jisx0201.1976-0"
      */
-    private static Map xlfdMap = new HashMap();
+    private static Map<String, Vector<String>> xlfdMap = new HashMap<>();
 
     /* xFontDirsMap is also a map from a font ID to a font filepath.
      * The difference from fontNameMap is just that it does not have
@@ -88,7 +88,7 @@
      * X11 font directory, then precautions must be taken to include both
      * directories.
      */
-     private static Map xFontDirsMap;
+     private static Map<String, String> xFontDirsMap;
 
      /*
       * This is the set of font directories needed to be on the X font path
@@ -121,7 +121,7 @@
      * of the singleton GE instance is already synchronised and that is
      * the only code path that accesses this map.
      */
-     private static HashMap registeredDirs = new HashMap();
+     private static HashMap<String, Object> registeredDirs = new HashMap<>();
 
      /* Array of directories to be added to the X11 font path.
       * Used by static method called from Toolkits which use X11 fonts.
@@ -183,7 +183,7 @@
                  * Add this XLFD (platform name) to the list of known
                  * ones for this file.
                  */
-                Vector xVal = (Vector) xlfdMap.get(fileName);
+                Vector<String> xVal = xlfdMap.get(fileName);
                 if (xVal == null) {
                     /* Try to be robust on Linux distros which move fonts
                      * around by verifying that the fileName represents a
@@ -194,7 +194,7 @@
                         fileName = null;
                     }
                     if (fileName != null) {
-                        xVal = new Vector();
+                        xVal = new Vector<>();
                         xVal.add(platName);
                         xlfdMap.put(fileName, xVal);
                     }
@@ -211,7 +211,7 @@
         }
 
         if (fontID != null) {
-            fileName = (String)fontNameMap.get(fontID);
+            fileName = fontNameMap.get(fontID);
             /* On Linux check for the Lucida Oblique fonts */
             if (fileName == null && FontUtilities.isLinux && !isOpenJDK()) {
                 if (oblmap == null) {
@@ -235,7 +235,7 @@
                     FontUtilities.getLogger()
                             .warning("** Finished registering all font paths");
                 }
-                fileName = (String)fontNameMap.get(fontID);
+                fileName = fontNameMap.get(fontID);
             }
             if (fileName == null && !isHeadless()) {
                 /* Query X11 directly to see if this font is available
@@ -245,7 +245,7 @@
             }
             if (fileName == null) {
                 fontID = switchFontIDForName(platName);
-                fileName = (String)fontNameMap.get(fontID);
+                fileName = fontNameMap.get(fontID);
             }
             if (fileName != null) {
                 fontNameMap.put(fontID, fileName);
@@ -257,8 +257,8 @@
     @Override
     protected String[] getNativeNames(String fontFileName,
             String platformName) {
-        Vector nativeNames;
-        if ((nativeNames=(Vector)xlfdMap.get(fontFileName))==null) {
+        Vector<String> nativeNames;
+        if ((nativeNames=xlfdMap.get(fontFileName))==null) {
             if (platformName == null) {
                 return null;
             } else {
@@ -271,7 +271,7 @@
             }
         } else {
             int len = nativeNames.size();
-            return (String[])nativeNames.toArray(new String[len]);
+            return nativeNames.toArray(new String[len]);
         }
     }
 
@@ -366,7 +366,7 @@
                             }
                             String fontPart = st.sval.substring(breakPos+1);
                             String fontID = specificFontIDForName(fontPart);
-                            String sVal = (String) fontNameMap.get(fontID);
+                            String sVal = fontNameMap.get(fontID);
 
                             if (FontUtilities.debugFonts()) {
                                 PlatformLogger logger = FontUtilities.getLogger();
@@ -386,14 +386,14 @@
                                  * wants to use the native rasteriser.
                                  */
                                 if (xFontDirsMap == null) {
-                                    xFontDirsMap = new HashMap();
+                                    xFontDirsMap = new HashMap<>();
                                 }
                                 xFontDirsMap.put(fontID, path);
                                 fullPath = file.getCanonicalPath();
                             } catch (IOException e) {
                                 fullPath = path + File.separator + fileName;
                             }
-                            Vector xVal = (Vector) xlfdMap.get(fullPath);
+                            Vector<String> xVal = xlfdMap.get(fullPath);
                             if (FontUtilities.debugFonts()) {
                                 FontUtilities.getLogger()
                                       .info("fullPath=" + fullPath +
@@ -408,7 +408,7 @@
                                 }
                                 fontNameMap.put(fontID, fullPath);
                                 if (xVal == null) {
-                                    xVal = new Vector();
+                                    xVal = new Vector<>();
                                     xlfdMap.put (fullPath, xVal);
                                 }
                                 xVal.add(fontPart);
@@ -447,8 +447,8 @@
          * will typically not ever need to initialise it so it can be null.
          */
         xFontDirsMap = null;
-        xlfdMap = new HashMap(1);
-        fontNameMap = new HashMap(1);
+        xlfdMap = new HashMap<>(1);
+        fontNameMap = new HashMap<>(1);
     }
 
     private String getObliqueLucidaFontID(String fontID) {
@@ -579,10 +579,10 @@
         String fileName = null;
         String fontID = specificFontIDForName(name);
         if (fontID != null) {
-            fileName = (String)fontNameMap.get(fontID);
+            fileName = fontNameMap.get(fontID);
             if (fileName == null) {
                 fontID = switchFontIDForName(name);
-                fileName = (String)fontNameMap.get(fontID);
+                fileName = fontNameMap.get(fontID);
             }
             if (fileName == null) {
                 fileName = getDefaultFontFile();
@@ -685,7 +685,7 @@
         getPlatformFontPathFromFontConfig();
         if (xFontDirsMap != null) {
             String fontID = specificFontIDForName(platformName);
-            String dirName = (String)xFontDirsMap.get(fontID);
+            String dirName = xFontDirsMap.get(fontID);
             if (dirName != null) {
                 fontConfigDirs.add(dirName);
             }
--- a/jdk/src/solaris/classes/sun/awt/X11GraphicsDevice.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/classes/sun/awt/X11GraphicsDevice.java	Mon Jun 02 13:53:52 2014 -0700
@@ -42,7 +42,7 @@
 import sun.java2d.xr.XRGraphicsConfig;
 import sun.java2d.loops.SurfaceType;
 
-import sun.misc.ThreadGroupUtils;
+import sun.awt.util.ThreadGroupUtils;
 
 /**
  * This is an implementation of a GraphicsDevice object for a single
@@ -56,7 +56,7 @@
     implements DisplayChangedListener
 {
     int screen;
-    HashMap x11ProxyKeyMap = new HashMap();
+    HashMap<SurfaceType, Object> x11ProxyKeyMap = new HashMap<>();
 
     private static AWTPermission fullScreenExclusivePermission;
     private static Boolean xrandrExtSupported;
@@ -127,7 +127,7 @@
 
     GraphicsConfiguration[] configs;
     GraphicsConfiguration defaultConfig;
-    HashSet doubleBufferVisuals;
+    HashSet<Integer> doubleBufferVisuals;
 
     /**
      * Returns all of the graphics
@@ -159,7 +159,7 @@
 
             boolean dbeSupported = isDBESupported();
             if (dbeSupported && doubleBufferVisuals == null) {
-                doubleBufferVisuals = new HashSet();
+                doubleBufferVisuals = new HashSet<>();
                 getDoubleBufferVisuals(screen);
             }
             for ( ; i < num; i++) {
@@ -249,7 +249,7 @@
                 int depth = getConfigDepth(0, screen);
                 boolean doubleBuffer = false;
                 if (isDBESupported() && doubleBufferVisuals == null) {
-                    doubleBufferVisuals = new HashSet();
+                    doubleBufferVisuals = new HashSet<>();
                     getDoubleBufferVisuals(screen);
                     doubleBuffer =
                         doubleBufferVisuals.contains(Integer.valueOf(visNum));
--- a/jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java	Mon Jun 02 13:53:52 2014 -0700
@@ -72,7 +72,7 @@
 
     static {
         java.security.AccessController.doPrivileged(
-                          new java.security.PrivilegedAction() {
+                          new java.security.PrivilegedAction<Object>() {
             public Object run() {
                 System.loadLibrary("awt");
 
@@ -254,12 +254,12 @@
             return true;
         }
 
-        Boolean result = (Boolean)java.security.AccessController.doPrivileged(
-            new java.security.PrivilegedAction() {
-            public Object run() {
+        Boolean result = java.security.AccessController.doPrivileged(
+            new java.security.PrivilegedAction<Boolean>() {
+            public Boolean run() {
                 InetAddress remAddr[] = null;
-                Enumeration locals = null;
-                Enumeration interfaces = null;
+                Enumeration<InetAddress> locals = null;
+                Enumeration<NetworkInterface> interfaces = null;
                 try {
                     interfaces = NetworkInterface.getNetworkInterfaces();
                     remAddr = InetAddress.getAllByName(hostName);
@@ -275,10 +275,11 @@
                 }
 
                 for (; interfaces.hasMoreElements();) {
-                    locals = ((NetworkInterface)interfaces.nextElement()).getInetAddresses();
+                    locals = interfaces.nextElement().getInetAddresses();
                     for (; locals.hasMoreElements();) {
+                        final InetAddress localAddr = locals.nextElement();
                         for (int i = 0; i < remAddr.length; i++) {
-                            if (locals.nextElement().equals(remAddr[i])) {
+                            if (localAddr.equals(remAddr[i])) {
                                 return Boolean.TRUE;
                             }
                         }
--- a/jdk/src/solaris/classes/sun/awt/X11InputMethod.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/classes/sun/awt/X11InputMethod.java	Mon Jun 02 13:53:52 2014 -0700
@@ -100,7 +100,7 @@
     private boolean   isLastTemporary = false;
     private boolean   isActive = false;
     private boolean   isActiveClient = false;
-    private static Map[] highlightStyles;
+    private static Map<TextAttribute, ?>[] highlightStyles;
     private boolean disposed = false;
 
     //reset the XIC if necessary
@@ -136,31 +136,29 @@
 
     // Initialize highlight mapping table
     static {
-        Map styles[] = new Map[4];
-        HashMap map;
+        @SuppressWarnings({"unchecked", "rawtypes"})
+        Map<TextAttribute, ?> styles[] = new Map[4];
+        HashMap<TextAttribute, Object> map;
 
         // UNSELECTED_RAW_TEXT_HIGHLIGHT
-        map = new HashMap(1);
-        map.put(TextAttribute.WEIGHT,
-                  TextAttribute.WEIGHT_BOLD);
+        map = new HashMap<>(1);
+        map.put(TextAttribute.WEIGHT, TextAttribute.WEIGHT_BOLD);
         styles[0] = Collections.unmodifiableMap(map);
 
         // SELECTED_RAW_TEXT_HIGHLIGHT
-        map = new HashMap(1);
-        map.put(TextAttribute.SWAP_COLORS,
-                  TextAttribute.SWAP_COLORS_ON);
+        map = new HashMap<>(1);
+        map.put(TextAttribute.SWAP_COLORS, TextAttribute.SWAP_COLORS_ON);
         styles[1] = Collections.unmodifiableMap(map);
 
         // UNSELECTED_CONVERTED_TEXT_HIGHLIGHT
-        map = new HashMap(1);
+        map = new HashMap<>(1);
         map.put(TextAttribute.INPUT_METHOD_UNDERLINE,
-                  TextAttribute.UNDERLINE_LOW_ONE_PIXEL);
+                TextAttribute.UNDERLINE_LOW_ONE_PIXEL);
         styles[2] = Collections.unmodifiableMap(map);
 
         // SELECTED_CONVERTED_TEXT_HIGHLIGHT
-        map = new HashMap(1);
-        map.put(TextAttribute.SWAP_COLORS,
-                  TextAttribute.SWAP_COLORS_ON);
+        map = new HashMap<>(1);
+        map.put(TextAttribute.SWAP_COLORS, TextAttribute.SWAP_COLORS_ON);
         styles[3] = Collections.unmodifiableMap(map);
 
         highlightStyles = styles;
@@ -433,7 +431,7 @@
     /**
      * @see java.awt.Toolkit#mapInputMethodHighlight
      */
-    public static Map mapInputMethodHighlight(InputMethodHighlight highlight) {
+    public static Map<TextAttribute, ?> mapInputMethodHighlight(InputMethodHighlight highlight) {
         int index;
         int state = highlight.getState();
         if (state == InputMethodHighlight.RAW_TEXT) {
--- a/jdk/src/solaris/classes/sun/awt/XSettings.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/classes/sun/awt/XSettings.java	Mon Jun 02 13:53:52 2014 -0700
@@ -52,7 +52,7 @@
      *     settings manager.
      * @return a <code>Map</code> of changed settings.
      */
-    public Map update(byte[] data) {
+    public Map<String, Object> update(byte[] data) {
         return (new Update(data)).update();
     }
 
@@ -79,7 +79,7 @@
         private int nsettings = 0;
         private boolean isValid;
 
-        private HashMap updatedSettings;
+        private HashMap<String, Object> updatedSettings;
 
 
         /**
@@ -113,7 +113,7 @@
             idx = 8;
             nsettings = getINT32();
 
-            updatedSettings = new HashMap();
+            updatedSettings = new HashMap<>();
 
             isValid = true;
         }
@@ -213,7 +213,7 @@
         /**
          * Update settings.
          */
-        public Map update() {
+        public Map<String, Object> update() {
             if (!isValid) {
                 return null;
             }
--- a/jdk/src/solaris/classes/sun/awt/motif/MFontConfiguration.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/classes/sun/awt/motif/MFontConfiguration.java	Mon Jun 02 13:53:52 2014 -0700
@@ -67,7 +67,7 @@
      * the fontconfig files.
      */
     protected void initReorderMap() {
-        reorderMap = new HashMap();
+        reorderMap = new HashMap<>();
         if (osName == null) {  /* null means SunOS */
             initReorderMapForSolaris();
         } else {
@@ -240,7 +240,7 @@
                 return "sun.awt.Symbol";
             }
         }
-        String encoding = (String) encodingMap.get(xlfdEncoding);
+        String encoding = encodingMap.get(xlfdEncoding);
         if (encoding == null) {
             encoding = "default";
         }
@@ -288,7 +288,7 @@
 
     /* methods for table setup ***********************************************/
 
-    private static HashMap encodingMap = new HashMap();
+    private static HashMap<String, String> encodingMap = new HashMap<>();
 
     private void initTables() {
         // encodingMap maps XLFD encoding component to
--- a/jdk/src/solaris/classes/sun/java2d/pisces/META-INF/services/sun.java2d.pipe.RenderingEngine	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-# Jules Rendering Engine module
-sun.java2d.jules.JulesRenderingEngine
-
-#  Pisces Rendering Engine module
-sun.java2d.pisces.PiscesRenderingEngine
--- a/jdk/src/solaris/classes/sun/java2d/x11/X11SurfaceData.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/classes/sun/java2d/x11/X11SurfaceData.java	Mon Jun 02 13:53:52 2014 -0700
@@ -72,7 +72,7 @@
 
     protected int depth;
 
-    private static native void initIDs(Class xorComp, boolean tryDGA);
+    private static native void initIDs(Class<?> xorComp, boolean tryDGA);
     protected native void initSurface(int depth, int width, int height,
                                       long drawable);
 
@@ -515,6 +515,7 @@
         return getSurfaceType(gc, transparency, false);
     }
 
+    @SuppressWarnings("fallthrough")
     public static SurfaceType getSurfaceType(X11GraphicsConfig gc,
                                              int transparency,
                                              boolean pixmapSurface)
--- a/jdk/src/solaris/native/java/util/TimeZone_md.c	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/native/java/util/TimeZone_md.c	Mon Jun 02 13:53:52 2014 -0700
@@ -652,11 +652,11 @@
  * using <java_home>/lib/tzmappings. If the TZ value is not found, it
  * trys some libc implementation dependent mappings. If it still
  * can't map to a Java time zone ID, it falls back to the GMT+/-hh:mm
- * form. `country', which can be null, is not used for UNIX platforms.
+ * form.
  */
 /*ARGSUSED1*/
 char *
-findJavaTZ_md(const char *java_home_dir, const char *country)
+findJavaTZ_md(const char *java_home_dir)
 {
     char *tz;
     char *javatz = NULL;
--- a/jdk/src/solaris/native/java/util/TimeZone_md.h	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/native/java/util/TimeZone_md.h	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
 #ifndef _TIMEZONE_MD_H
 #define _TIMEZONE_MD_H
 
-char *findJavaTZ_md(const char *java_home_dir, const char *region);
+char *findJavaTZ_md(const char *java_home_dir);
 char *getGMTOffsetID();
 
 #endif
--- a/jdk/src/solaris/native/sun/awt/awt.h	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/native/sun/awt/awt.h	Mon Jun 02 13:53:52 2014 -0700
@@ -34,9 +34,9 @@
 #include "jni_util.h"
 #include "debug_util.h"
 
-#ifndef HEADLESS
+#if !defined(HEADLESS) && !defined(MACOSX)
 #include <X11/Intrinsic.h>
-#endif /* !HEADLESS */
+#endif /* !HEADLESS && !MACOSX */
 
 
 /* The JVM instance: defined in awt_MToolkit.c */
@@ -110,9 +110,9 @@
 #define AWT_NOTIFY()         AWT_NOTIFY_IMPL()
 #define AWT_NOTIFY_ALL()     AWT_NOTIFY_ALL_IMPL()
 
-#ifndef HEADLESS
+#if !defined(HEADLESS) && !defined(MACOSX)
 extern Display         *awt_display; /* awt_GraphicsEnv.c */
 extern Boolean          awt_ModLockIsShiftLock; /* XToolkit.c */
-#endif /* !HEADLESS */
+#endif /* !HEADLESS && !MACOSX */
 
 #endif /* ! _AWT_ */
--- a/jdk/src/solaris/native/sun/awt/awt_LoadLibrary.c	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/native/sun/awt/awt_LoadLibrary.c	Mon Jun 02 13:53:52 2014 -0700
@@ -35,8 +35,6 @@
 #include <sys/param.h>
 #include <sys/utsname.h>
 
-#include "awt_Plugin.h"
-
 #ifdef AIX
 #include "porting_aix.h" /* For the 'dladdr' function. */
 #endif
@@ -236,55 +234,3 @@
 
     (*XsessionWMcommand)(env, jargv);
 }
-
-
-#define REFLECT_VOID_FUNCTION(name, arglist, paramlist)                 \
-typedef void name##_type arglist;                                       \
-void name arglist                                                       \
-{                                                                       \
-    static name##_type *name##_ptr = NULL;                              \
-    if (name##_ptr == NULL && awtHandle == NULL) {                      \
-        return;                                                         \
-    }                                                                   \
-    name##_ptr = (name##_type *)                                        \
-        dlsym(awtHandle, #name);                                        \
-    if (name##_ptr == NULL) {                                           \
-        return;                                                         \
-    }                                                                   \
-    (*name##_ptr)paramlist;                                             \
-}
-
-#define REFLECT_FUNCTION(return_type, name, arglist, paramlist)         \
-typedef return_type name##_type arglist;                                \
-return_type name arglist                                                \
-{                                                                       \
-    static name##_type *name##_ptr = NULL;                              \
-    if (name##_ptr == NULL && awtHandle == NULL) {                      \
-        return NULL;                                                    \
-    }                                                                   \
-    name##_ptr = (name##_type *)                                        \
-        dlsym(awtHandle, #name);                                        \
-    if (name##_ptr == NULL) {                                           \
-        return NULL;                                                    \
-    }                                                                   \
-    return (*name##_ptr)paramlist;                                      \
-}
-
-
-/*
- * These entry point must remain in libawt.so ***for Java Plugin ONLY***
- * Reflect this call over to the correct libawt_<toolkit>.so.
- */
-
-REFLECT_VOID_FUNCTION(getAwtLockFunctions,
-                      (void (**AwtLock)(JNIEnv *), void (**AwtUnlock)(JNIEnv *),
-                       void (**AwtNoFlushUnlock)(JNIEnv *), void *reserved),
-                      (AwtLock, AwtUnlock, AwtNoFlushUnlock, reserved))
-
-REFLECT_VOID_FUNCTION(getAwtData,
-                      (int32_t *awt_depth, Colormap *awt_cmap, Visual **awt_visual,
-                       int32_t *awt_num_colors, void *pReserved),
-                      (awt_depth, awt_cmap, awt_visual,
-                       awt_num_colors, pReserved))
-
-REFLECT_FUNCTION(Display *, getAwtDisplay, (void), ())
--- a/jdk/src/solaris/native/sun/awt/awt_Plugin.c	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,149 +0,0 @@
-/*
- * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#ifdef HEADLESS
-    #error This file should not be included in headless library
-#endif
-
-#include <jni.h>
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#include <awt.h>
-#include <awt_p.h>
-
-/*
- * Fix 4221246: Provide utility function for Netscape to use to
- * get AWT display, depth, colormap, and number of colors.
- *
- */
-
-Display *getAwtDisplay(void)
-{
-  return awt_display;
-}
-
-void getExtAwtData(Display      *display,
-                   int32_t      screen,
-                   int32_t      *awt_depth,
-                   Colormap     *awt_cmap,
-                   Visual       **awt_visual,
-                   int32_t      *awt_num_colors,
-                   void         *pReserved)
-{
-  AwtGraphicsConfigDataPtr defaultConfig = NULL;
-
-#ifdef DEBUG
-  if (pReserved != NULL) {
-    jio_fprintf(stderr,
-                "getExtAwtData: warning: reserved pointer is not null\n");
-  }
-#endif
-
-  if (screen >= 0) {
-    defaultConfig = getDefaultConfig(screen);
-  }
-
-  if (defaultConfig) {
-    if (awt_depth != NULL) {
-      *awt_depth = defaultConfig->awt_depth;
-    }
-
-    if (awt_cmap != NULL) {
-      *awt_cmap = defaultConfig->awt_cmap;
-    }
-
-    if (awt_visual != NULL) {
-      *awt_visual = defaultConfig->awt_visInfo.visual;
-    }
-
-    if (awt_num_colors != NULL) {
-      *awt_num_colors = defaultConfig->awt_num_colors;
-    }
-  }
-}
-
-/*
- * getAwtData provided for compatibility with Solaris 1.2 Java Plug-in
- *
- */
-void getAwtData(int32_t          *awt_depth,
-                Colormap     *awt_cmap,
-                Visual       **awt_visual,
-                int32_t          *awt_num_colors,
-                void         *pReserved)
-{
-  Display *display = getAwtDisplay();
-
-  getExtAwtData(display,
-                DefaultScreen(display),
-                awt_depth,
-                awt_cmap,
-                awt_visual,
-                awt_num_colors,
-                pReserved);
-}
-
-/*
- * Fix 4221246: Provide utility funtion for Netscape to get
- * function pointers to AWT lock functions.
- *
- */
-
-static void awt_lock_wrapper(JNIEnv *env) {
-  AWT_LOCK();
-}
-
-static void awt_unlock_wrapper(JNIEnv *env) {
-  AWT_UNLOCK();
-}
-
-static void awt_noflush_unlock_wrapper(JNIEnv *env) {
-  AWT_NOFLUSH_UNLOCK();
-}
-
-void getAwtLockFunctions(void (**AwtLock)(JNIEnv *),
-                         void (**AwtUnlock)(JNIEnv *),
-                         void (**AwtNoFlushUnlock)(JNIEnv *),
-                         void *pReserved)
-{
-#ifdef DEBUG
-  if (pReserved != NULL) {
-    jio_fprintf(stderr,
-                "getAwtLockFunctions: warning: reserved pointer is not null\n");
-  }
-#endif
-
-  if (AwtLock != NULL) {
-    *AwtLock = awt_lock_wrapper;
-  }
-
-  if (AwtUnlock != NULL) {
-    *AwtUnlock = awt_unlock_wrapper;
-  }
-
-  if (AwtNoFlushUnlock != NULL) {
-    *AwtNoFlushUnlock = awt_noflush_unlock_wrapper;
-  }
-}
--- a/jdk/src/solaris/native/sun/awt/awt_Plugin.h	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Fix 4221246: Export functions for Netscape to use to get AWT info
- */
-
-#ifndef _AWT_PLUGIN_H_
-#define _AWT_PLUGIN_H_
-
-#include <jni.h>
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-
-void getAwtLockFunctions(void (**AwtLock)(JNIEnv *),
-                         void (**AwtUnlock)(JNIEnv *),
-                         void (**AwtNoFlushUnlock)(JNIEnv *),
-                         void *);
-
-void getExtAwtData(Display *,
-                   int32_t,
-                   int32_t *,      /* awt_depth */
-                   Colormap *,     /* awt_cmap  */
-                   Visual **,      /* awt_visInfo.visual */
-                   int32_t *,      /* awt_num_colors */
-                   void *);
-
-void getAwtData(int32_t *, Colormap *, Visual **, int32_t *, void *);
-
-Display *getAwtDisplay(void);
-
-#endif /* _AWT_PLUGIN_H_ */
--- a/jdk/src/solaris/native/sun/awt/color.h	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/native/sun/awt/color.h	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,13 +28,13 @@
 #include "awt.h"
 #include "colordata.h"
 
-#ifndef HEADLESS
+#if !defined(HEADLESS) && !defined(MACOSX)
 typedef struct {
     unsigned int Depth;
     XPixmapFormatValues wsImageFormat;
     ImgColorData clrdata;
     ImgConvertFcn *convert[NUM_IMGCV];
 } awtImageData;
-#endif /* !HEADLESS */
+#endif /* !HEADLESS && !MACOSX */
 
 #endif           /* _COLOR_H_ */
--- a/jdk/src/solaris/native/sun/awt/img_util_md.h	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/native/sun/awt/img_util_md.h	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
 
 #include "color.h"
 
-#ifndef HEADLESS
+#if !defined(HEADLESS) && !defined(MACOSX)
 typedef struct {
     ImgConvertData cvdata;      /* The data needed by ImgConvertFcn's */
     struct Hsun_awt_image_ImageRepresentation *hJavaObject;     /* backptr */
@@ -68,7 +68,7 @@
 #define MaskScan(cvdata)                                        \
         ((((IRData *)cvdata)->maskim->bytes_per_line) >> 2)
 
-#endif /* !HEADLESS */
+#endif /* !HEADLESS && !MACOSX */
 
 #define MaskOffset(x)           ((x) >> 5)
 
--- a/jdk/src/solaris/native/sun/awt/utility/rect.h	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/native/sun/awt/utility/rect.h	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2014 Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,8 +28,18 @@
 #ifndef _AWT_RECT_H
 #define _AWT_RECT_H
 
+#ifndef MACOSX
 #include <X11/Xlib.h>
 typedef XRectangle RECT_T;
+#else
+// OSX still needs this for BitmapToYXBandedRectangles
+typedef struct {
+    int x;
+    int y;
+    int width;
+    int height;
+} RECT_T;
+#endif /* !MACOSX */
 
 #define RECT_EQ_X(r1,r2)        ((r1).x==(r2).x && (r1).width==(r2).width)
 
--- a/jdk/src/solaris/native/sun/misc/VM_md.c	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/native/sun/misc/VM_md.c	Mon Jun 02 13:53:52 2014 -0700
@@ -27,12 +27,26 @@
 #include "jni_util.h"
 
 
-JNIEXPORT jboolean JNICALL
-Java_sun_misc_VM_isSetUID(JNIEnv *env, jclass thisclass) {
+JNIEXPORT jlong JNICALL
+Java_sun_misc_VM_getuid(JNIEnv *env, jclass thisclass) {
+
+    return getuid();
+}
+
+JNIEXPORT jlong JNICALL
+Java_sun_misc_VM_geteuid(JNIEnv *env, jclass thisclass) {
+
+    return geteuid();
+}
 
-    /* Return true if we are in a set UID or set GID process. */
-    if (getuid() != geteuid() || getgid() != getegid()) {
-        return JNI_TRUE;
-    }
-    return JNI_FALSE;
+JNIEXPORT jlong JNICALL
+Java_sun_misc_VM_getgid(JNIEnv *env, jclass thisclass) {
+
+    return getgid();
 }
+
+JNIEXPORT jlong JNICALL
+Java_sun_misc_VM_getegid(JNIEnv *env, jclass thisclass) {
+
+    return getegid();
+}
--- a/jdk/src/solaris/native/sun/nio/ch/FileChannelImpl.c	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/native/sun/nio/ch/FileChannelImpl.c	Mon Jun 02 13:53:52 2014 -0700
@@ -39,6 +39,8 @@
 
 #if defined(__linux__) || defined(__solaris__)
 #include <sys/sendfile.h>
+#elif defined(_AIX)
+#include <sys/socket.h>
 #elif defined(_ALLBSD_SOURCE)
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -207,9 +209,7 @@
 
     numBytes = count;
 
-#ifdef __APPLE__
     result = sendfile(srcFD, dstFD, position, &numBytes, NULL, 0);
-#endif
 
     if (numBytes > 0)
         return numBytes;
@@ -228,7 +228,48 @@
     }
 
     return result;
+
+#elif defined(_AIX)
+    jlong max = (jlong)java_lang_Integer_MAX_VALUE;
+    struct sf_parms sf_iobuf;
+    jlong result;
+
+    if (position > max)
+        return IOS_UNSUPPORTED_CASE;
+
+    if (count > max)
+        count = max;
+
+    memset(&sf_iobuf, 0, sizeof(sf_iobuf));
+    sf_iobuf.file_descriptor = srcFD;
+    sf_iobuf.file_offset = (off_t)position;
+    sf_iobuf.file_bytes = count;
+
+    result = send_file(&dstFD, &sf_iobuf, SF_SYNC_CACHE);
+
+    /* AIX send_file() will return 0 when this operation complete successfully,
+     * return 1 when partial bytes transfered and return -1 when an error has
+     * Occured.
+     */
+    if (result == -1) {
+        if (errno == EWOULDBLOCK)
+            return IOS_UNAVAILABLE;
+        if ((errno == EINVAL) && ((ssize_t)count >= 0))
+            return IOS_UNSUPPORTED_CASE;
+        if (errno == EINTR)
+            return IOS_INTERRUPTED;
+        if (errno == ENOTSOCK)
+            return IOS_UNSUPPORTED;
+        JNU_ThrowIOExceptionWithLastError(env, "Transfer failed");
+        return IOS_THROWN;
+    }
+
+    if (sf_iobuf.bytes_sent > 0)
+        return (jlong)sf_iobuf.bytes_sent;
+
+    return IOS_UNSUPPORTED_CASE;
 #else
     return IOS_UNSUPPORTED_CASE;
 #endif
 }
+
--- a/jdk/src/solaris/native/sun/security/smartcardio/MUSCLE/pcsclite.h	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/native/sun/security/smartcardio/MUSCLE/pcsclite.h	Mon Jun 02 13:53:52 2014 -0700
@@ -62,6 +62,8 @@
 
 #define MAX_ATR_SIZE                    33      /* Maximum ATR size */
 
+#ifndef __APPLE__
+
 typedef struct
 {
         const char *szReader;
@@ -73,6 +75,23 @@
 }
 SCARD_READERSTATE_A;
 
+#else // __APPLE__
+
+#pragma pack(1)
+typedef struct
+{
+        const char *szReader;
+        void *pvUserData;
+        uint32_t dwCurrentState;
+        uint32_t dwEventState;
+        uint32_t cbAtr;
+        unsigned char rgbAtr[MAX_ATR_SIZE];
+}
+SCARD_READERSTATE_A;
+#pragma pack()
+
+#endif // __APPLE__
+
 typedef SCARD_READERSTATE_A SCARD_READERSTATE, *PSCARD_READERSTATE_A,
         *LPSCARD_READERSTATE_A;
 
--- a/jdk/src/solaris/native/sun/security/smartcardio/pcsc_md.c	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/solaris/native/sun/security/smartcardio/pcsc_md.c	Mon Jun 02 13:53:52 2014 -0700
@@ -136,5 +136,9 @@
     if ((*env)->ExceptionCheck(env)) {
          return;
     }
+#ifndef __APPLE__
     scardControl          = (FPTR_SCardControl)         findFunction(env, hModule, "SCardControl");
+#else
+    scardControl          = (FPTR_SCardControl)         findFunction(env, hModule, "SCardControl132");
+#endif // __APPLE__
 }
--- a/jdk/src/windows/classes/java/lang/ProcessImpl.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/windows/classes/java/lang/ProcessImpl.java	Mon Jun 02 13:53:52 2014 -0700
@@ -25,15 +25,15 @@
 
 package java.lang;
 
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileDescriptor;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
 import java.io.IOException;
-import java.io.File;
 import java.io.InputStream;
 import java.io.OutputStream;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.FileDescriptor;
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
 import java.lang.ProcessBuilder.Redirect;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
@@ -483,6 +483,14 @@
     private static native void terminateProcess(long handle);
 
     @Override
+    public long getPid() {
+        int pid = getProcessId0(handle);
+        return pid;
+    }
+
+    private static native int getProcessId0(long handle);
+
+    @Override
     public boolean isAlive() {
         return isProcessAlive(handle);
     }
--- a/jdk/src/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java	Mon Jun 02 13:53:52 2014 -0700
@@ -39,7 +39,7 @@
 
 import static sun.awt.shell.Win32ShellFolder2.*;
 import sun.awt.OSInfo;
-import sun.misc.ThreadGroupUtils;
+import sun.awt.util.ThreadGroupUtils;
 
 // NOTE: This class supersedes Win32ShellFolderManager, which was removed
 //       from distribution after version 1.4.2.
--- a/jdk/src/windows/classes/sun/awt/windows/WDataTransferer.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/windows/classes/sun/awt/windows/WDataTransferer.java	Mon Jun 02 13:53:52 2014 -0700
@@ -59,6 +59,7 @@
 
 import java.net.URL;
 
+import java.nio.charset.Charset;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.HashMap;
@@ -268,9 +269,9 @@
         if (format == CFSTR_INETURL &&
                 URL.class.equals(flavor.getRepresentationClass()))
         {
-            String charset = getDefaultTextCharset();
-            if (localeTransferable != null && localeTransferable.
-                                                                    isDataFlavorSupported(javaTextEncodingFlavor))
+            String charset = Charset.defaultCharset().name();
+            if (localeTransferable != null
+                    && localeTransferable.isDataFlavorSupported(javaTextEncodingFlavor))
             {
                 try {
                     charset = new String((byte[])localeTransferable.
--- a/jdk/src/windows/classes/sun/awt/windows/WToolkit.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/windows/classes/sun/awt/windows/WToolkit.java	Mon Jun 02 13:53:52 2014 -0700
@@ -40,7 +40,7 @@
 import sun.awt.AWTPermissions;
 import sun.awt.LightweightFrame;
 import sun.awt.SunToolkit;
-import sun.misc.ThreadGroupUtils;
+import sun.awt.util.ThreadGroupUtils;
 import sun.awt.Win32GraphicsDevice;
 import sun.awt.Win32GraphicsEnvironment;
 import sun.awt.datatransfer.DataTransferer;
--- a/jdk/src/windows/classes/sun/java2d/d3d/D3DScreenUpdateManager.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/windows/classes/sun/java2d/d3d/D3DScreenUpdateManager.java	Mon Jun 02 13:53:52 2014 -0700
@@ -38,7 +38,7 @@
 import java.util.HashMap;
 
 import sun.awt.AWTAccessor;
-import sun.misc.ThreadGroupUtils;
+import sun.awt.util.ThreadGroupUtils;
 import sun.awt.Win32GraphicsConfig;
 import sun.awt.windows.WComponentPeer;
 import sun.java2d.InvalidPipeException;
--- a/jdk/src/windows/lib/tzmappings	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/windows/lib/tzmappings	Mon Jun 02 13:53:52 2014 -0700
@@ -137,8 +137,8 @@
 Central Standard Time:36,37::America/Chicago:
 Eastern:38,39::America/New_York:
 Eastern Standard Time:38,39::America/New_York:
-E. Europe:4,5:BY:Europe/Minsk:
-E. Europe Standard Time:4,5:BY:Europe/Minsk:
+E. Europe:4,5::EET:
+E. Europe Standard Time:4,5::EET:
 Egypt:4,68::Africa/Cairo:
 Egypt Standard Time:4,68::Africa/Cairo:
 South Africa:4,69::Africa/Harare:
@@ -192,5 +192,6 @@
 Kaliningrad Standard Time:925,925:RU:Europe/Kaliningrad:
 Turkey Standard Time:926,926::Asia/Istanbul:
 Bahia Standard Time:927,927::America/Bahia:
-Western Brazilian Standard Time:928,928:BR:America/Rio_Branco:
-Armenian Standard Time:929,929:AM:Asia/Yerevan:
+Libya Standard Time:928,928:LY:Africa/Tripoli:
+Western Brazilian Standard Time:929,929:BR:America/Rio_Branco:
+Armenian Standard Time:930,930:AM:Asia/Yerevan:
--- a/jdk/src/windows/native/java/lang/ProcessImpl_md.c	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/windows/native/java/lang/ProcessImpl_md.c	Mon Jun 02 13:53:52 2014 -0700
@@ -248,6 +248,17 @@
         }
 }
 
+/*
+ * Class:     java_lang_ProcessImpl
+ * Method:    getProcessId0
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_java_lang_ProcessImpl_getProcessId0
+  (JNIEnv *env, jclass clazz, jlong handle) {
+    DWORD pid = GetProcessId((HANDLE) jlong_to_ptr(handle));
+    return (jint)pid;
+}
+
 /* Please, read about the MS inheritance problem
    http://support.microsoft.com/kb/315939
    and critical section/synchronized block solution. */
--- a/jdk/src/windows/native/java/util/TimeZone_md.c	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/windows/native/java/util/TimeZone_md.c	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -394,31 +394,34 @@
  *
  * value_type is one of the following values:
  *      VALUE_KEY for exact key matching
- *      VALUE_MAPID for MapID and country-based mapping (this is
+ *      VALUE_MAPID for MapID (this is
  *      required for the old Windows, such as NT 4.0 SP3).
  */
 static char *matchJavaTZ(const char *java_home_dir, int value_type, char *tzName,
-                         char *mapID, const char *country)
+                         char *mapID)
 {
     int line;
     int IDmatched = 0;
     FILE *fp;
     char *javaTZName = NULL;
     char *items[TZ_NITEMS];
-    char mapFileName[_MAX_PATH + 1];
+    char *mapFileName;
     char lineBuffer[MAX_ZONE_CHAR * 4];
-    char bestMatch[MAX_ZONE_CHAR];
-    int noMapID = *mapID == '\0';       /* no mapID on Vista */
+    int noMapID = *mapID == '\0';       /* no mapID on Vista and later */
 
-    bestMatch[0] = '\0';
-
+    mapFileName = malloc(strlen(java_home_dir) + strlen(MAPPINGS_FILE) + 1);
+    if (mapFileName == NULL) {
+        return NULL;
+    }
     strcpy(mapFileName, java_home_dir);
     strcat(mapFileName, MAPPINGS_FILE);
 
     if ((fp = fopen(mapFileName, "r")) == NULL) {
         jio_fprintf(stderr, "can't open %s.\n", mapFileName);
+        free((void *) mapFileName);
         return NULL;
     }
+    free((void *) mapFileName);
 
     line = 0;
     while (fgets(lineBuffer, sizeof(lineBuffer), fp) != NULL) {
@@ -469,18 +472,6 @@
                 javaTZName = _strdup(items[TZ_JAVA_NAME]);
                 break;
             }
-            /*
-             * Try to find the most likely time zone.
-             */
-            if (*items[TZ_REGION] == '\0') {
-                strncpy(bestMatch, items[TZ_JAVA_NAME], MAX_ZONE_CHAR);
-            } else if (country != NULL && strcmp(items[TZ_REGION], country) == 0) {
-                if (value_type == VALUE_MAPID) {
-                    javaTZName = _strdup(items[TZ_JAVA_NAME]);
-                    break;
-                }
-                strncpy(bestMatch, items[TZ_JAVA_NAME], MAX_ZONE_CHAR);
-            }
         } else {
             if (IDmatched == 1) {
                 /*
@@ -492,9 +483,6 @@
     }
     fclose(fp);
 
-    if (javaTZName == NULL && bestMatch[0] != '\0') {
-        javaTZName = _strdup(bestMatch);
-    }
     return javaTZName;
 
  illegal_format:
@@ -506,7 +494,7 @@
 /*
  * Detects the platform time zone which maps to a Java time zone ID.
  */
-char *findJavaTZ_md(const char *java_home_dir, const char *country)
+char *findJavaTZ_md(const char *java_home_dir)
 {
     char winZoneName[MAX_ZONE_CHAR];
     char winMapID[MAX_MAPID_LENGTH];
@@ -521,7 +509,7 @@
             std_timezone = _strdup(winZoneName);
         } else {
             std_timezone = matchJavaTZ(java_home_dir, result,
-                                       winZoneName, winMapID, country);
+                                       winZoneName, winMapID);
         }
     }
 
--- a/jdk/src/windows/native/java/util/TimeZone_md.h	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/windows/native/java/util/TimeZone_md.h	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
 #ifndef _TIMEZONE_MD_H
 #define _TIMEZONE_MD_H
 
-char *findJavaTZ_md(const char *java_home_dir, const char *region);
+char *findJavaTZ_md(const char *java_home_dir);
 char *getGMTOffsetID();
 
 #endif
--- a/jdk/src/windows/native/sun/misc/VM_md.c	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/src/windows/native/sun/misc/VM_md.c	Mon Jun 02 13:53:52 2014 -0700
@@ -26,9 +26,30 @@
 #include "jni_util.h"
 
 
-JNIEXPORT jboolean JNICALL
-Java_sun_misc_VM_isSetUID(JNIEnv *env, jclass thisclass) {
+JNIEXPORT jlong JNICALL
+Java_sun_misc_VM_getuid(JNIEnv *env, jclass thisclass) {
+
+    /* -1 means function not available. */
+    return -1;
+}
+
+JNIEXPORT jlong JNICALL
+Java_sun_misc_VM_geteuid(JNIEnv *env, jclass thisclass) {
+
+    /* -1 means function not available. */
+    return -1;
+}
 
-    /* There is no set UID on Windows. */
-    return JNI_FALSE;
+JNIEXPORT jlong JNICALL
+Java_sun_misc_VM_getgid(JNIEnv *env, jclass thisclass) {
+
+    /* -1 means function not available. */
+    return -1;
 }
+
+JNIEXPORT jlong JNICALL
+Java_sun_misc_VM_getegid(JNIEnv *env, jclass thisclass) {
+
+    /* -1 means function not available. */
+    return -1;
+}
--- a/jdk/test/ProblemList.txt	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/test/ProblemList.txt	Mon Jun 02 13:53:52 2014 -0700
@@ -261,6 +261,10 @@
 # 8041934
 com/sun/jdi/RepStep.java                                        generic-all
 
+# 8044419
+com/sun/jdi/JdbReadTwiceTest.sh                                 generic-all
+
+
 ############################################################################
 
 # jdk_util
--- a/jdk/test/com/sun/jdi/BadHandshakeTest.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/test/com/sun/jdi/BadHandshakeTest.java	Mon Jun 02 13:53:52 2014 -0700
@@ -26,7 +26,7 @@
  * @summary Check that a bad handshake doesn't cause a debuggee to abort
  * @library /lib/testlibrary
  *
- * @build VMConnection BadHandshakeTest Exit0
+ * @build jdk.testlibrary.* VMConnection BadHandshakeTest Exit0
  * @run main BadHandshakeTest
  *
  */
@@ -110,12 +110,12 @@
         }
 
         // Connect to the debuggee and handshake with garbage
-        Socket s = new Socket(InetAddress.getLocalHost(), port);
+        Socket s = new Socket("localhost", port);
         s.getOutputStream().write("Here's a poke in the eye".getBytes("UTF-8"));
         s.close();
 
         // Re-connect and to a partial handshake - don't disconnect
-        s = new Socket(InetAddress.getLocalHost(), port);
+        s = new Socket("localhost", port);
         s.getOutputStream().write("JDWP-".getBytes("UTF-8"));
 
 
--- a/jdk/test/com/sun/jdi/ExclusiveBind.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/test/com/sun/jdi/ExclusiveBind.java	Mon Jun 02 13:53:52 2014 -0700
@@ -27,8 +27,7 @@
  *          at the same time.
  * @library /lib/testlibrary
  *
- * @build jdk.testlibrary.ProcessTools jdk.testlibrary.JDKToolLauncher jdk.testlibrary.Utils
- * @build VMConnection ExclusiveBind HelloWorld
+ * @build jdk.testlibrary.* VMConnection ExclusiveBind HelloWorld
  * @run main ExclusiveBind
  */
 import java.net.ServerSocket;
--- a/jdk/test/com/sun/jdi/OptionTest.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/test/com/sun/jdi/OptionTest.java	Mon Jun 02 13:53:52 2014 -0700
@@ -157,6 +157,37 @@
                 throw new Exception("Test failed: jdwp doesn't like " + cmds[1]);
             }
         }
+
+        System.out.println("Testing invalid address string");
+
+        // Test invalid addresses
+        String badAddresses[] = {
+            ":",
+            "localhost:",
+            "localhost:abc",
+            "localhost:65536",
+            "localhost:65F"
+        };
+
+        for (String badAddress : badAddresses) {
+
+            String badOptions = "transport=dt_socket" +
+                              ",address=" + badAddress +
+                              ",server=y" +
+                              ",suspend=n";
+            String cmds[] = {javaExe, "-agentlib:jdwp=" + badOptions, targetClass};
+            OptionTest myTest = new OptionTest();
+            String results[] = myTest.run(VMConnection.insertDebuggeeVMOptions(cmds));
+
+            if (!results[RETSTAT].equals("0") && results[STDERR].startsWith("ERROR:")) {
+                // We got expected error, test passed
+            }
+            else {
+                throw new Exception("Test failed: jdwp accept invalid address '" + badAddress + "'");
+            }
+        }
+
         System.out.println("Test passed: status = 0");
     }
 }
+
--- a/jdk/test/com/sun/jdi/RunToExit.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/test/com/sun/jdi/RunToExit.java	Mon Jun 02 13:53:52 2014 -0700
@@ -161,6 +161,9 @@
         Connector.IntegerArgument port_arg =
             (Connector.IntegerArgument)conn_args.get("port");
         port_arg.setValue(port);
+
+        System.out.println("Connection arguments: " + conn_args);
+
         VirtualMachine vm = conn.attach(conn_args);
 
         // The first event is always a VMStartEvent, and it is always in
--- a/jdk/test/com/sun/jndi/ldap/LdapTimeoutTest.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/test/com/sun/jndi/ldap/LdapTimeoutTest.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -64,11 +64,12 @@
         env.put(Context.SECURITY_PRINCIPAL, "user");
         env.put(Context.SECURITY_CREDENTIALS, "password");
 
-        env.put("com.sun.jndi.ldap.connect.timeout", "10");
-        env.put("com.sun.jndi.ldap.read.timeout", "3000");
-
         InitialContext ctx = null;
         try {
+            new LdapTimeoutTest().deadServerNoTimeout(env);
+
+            env.put("com.sun.jndi.ldap.connect.timeout", "10");
+            env.put("com.sun.jndi.ldap.read.timeout", "3000");
             new LdapTimeoutTest().ldapReadTimeoutTest(env, false);
             new LdapTimeoutTest().ldapReadTimeoutTest(env, true);
             new LdapTimeoutTest().simpleAuthConnectTest(env);
@@ -84,7 +85,7 @@
     void ldapReadTimeoutTest(Hashtable env, boolean ssl) {
         InitialContext ctx = null;
         if (ssl) env.put(Context.SECURITY_PROTOCOL, "ssl");
-        ScheduledFuture killer = killSwitch();
+        ScheduledFuture killer = killSwitch(5000);
         long start = System.nanoTime();
         try {
             ctx = new InitialDirContext(env);
@@ -112,7 +113,7 @@
 
     void simpleAuthConnectTest(Hashtable env) {
         InitialContext ctx = null;
-        ScheduledFuture killer = killSwitch();
+        ScheduledFuture killer = killSwitch(5000);
         long start = System.nanoTime();
         try {
             ctx = new InitialDirContext(env);
@@ -139,6 +140,32 @@
         }
     }
 
+    void deadServerNoTimeout(Hashtable env) {
+        InitialContext ctx = null;
+        ScheduledFuture killer = killSwitch(30000);
+        long start = System.nanoTime();
+        try {
+            ctx = new InitialDirContext(env);
+            SearchControls scl = new SearchControls();
+            scl.setSearchScope(SearchControls.SUBTREE_SCOPE);
+            NamingEnumeration<SearchResult> answer = ((InitialDirContext)ctx)
+                .search("ou=People,o=JNDITutorial", "(objectClass=*)", scl);
+            // shouldn't reach here
+            fail();
+        } catch (NamingException e) {
+            long end = System.nanoTime();
+            if (TimeUnit.NANOSECONDS.toMillis(end - start) < 14000) {
+                System.err.println("fail: timeout should be at least 15 seconds, actual time: "
+                                   + TimeUnit.NANOSECONDS.toMillis(end - start));
+                fail();
+            } else {
+                pass();
+            }
+        } finally {
+            if (!shutItDown(killer, ctx)) fail();
+        }
+    }
+
     boolean shutItDown(ScheduledFuture killer, InitialContext ctx) {
         killer.cancel(true);
         try {
@@ -149,15 +176,15 @@
         }
     }
 
-    ScheduledFuture killSwitch() {
+    ScheduledFuture killSwitch(int ms) {
         final Thread current = Thread.currentThread();
         return LdapTimeoutTest.pool.schedule(new Callable<Void>() {
             public Void call() throws Exception {
                 System.err.println("Fail: killSwitch()");
-                current.interrupt();
+                System.exit(0);
                 return null;
             }
-        }, 5000, TimeUnit.MILLISECONDS);
+        }, ms, TimeUnit.MILLISECONDS);
     }
 
     static class Server extends Thread {
--- a/jdk/test/com/sun/tools/attach/TempDirTest.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/test/com/sun/tools/attach/TempDirTest.java	Mon Jun 02 13:53:52 2014 -0700
@@ -38,8 +38,8 @@
  * @bug 8033104
  * @summary Test to make sure attach and jvmstat works correctly when java.io.tmpdir is set
  * @library /lib/testlibrary
- * @run build Application Shutdown RunnerUtil
- * @run main/timeout=10 TempDirTest
+ * @run build jdk.testlibrary.* Application Shutdown RunnerUtil
+ * @run main TempDirTest
  */
 
 public class TempDirTest {
--- a/jdk/test/demo/jvmti/mtrace/JFrameCreateTime.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/test/demo/jvmti/mtrace/JFrameCreateTime.java	Mon Jun 02 13:53:52 2014 -0700
@@ -32,24 +32,28 @@
  *   was very slow (VisualMust debugger people reported this).
  */
 
+import java.awt.GraphicsEnvironment;
 import javax.swing.*;
 
 public class JFrameCreateTime {
     public static void main(String[] args) {
         JFrame f;
         long start, end;
-
-        start = System.currentTimeMillis();
-        f = new JFrame("JFrame");
-        end = System.currentTimeMillis();
-
-        System.out.println("JFrame first creation took " + (end - start) + " ms");
+        if (GraphicsEnvironment.isHeadless()) {
+            System.out.println("JFrameCreateTime test was skipped due to headless mode");
+        } else {
+            start = System.currentTimeMillis();
+            f = new JFrame("JFrame");
+            end = System.currentTimeMillis();
 
-        start = System.currentTimeMillis();
-        f = new JFrame("JFrame");
-        end = System.currentTimeMillis();
+            System.out.println("JFrame first creation took " + (end - start) + " ms");
 
-        System.out.println("JFrame second creation took " + (end - start) + " ms");
-        System.exit(0);
+            start = System.currentTimeMillis();
+            f = new JFrame("JFrame");
+            end = System.currentTimeMillis();
+
+            System.out.println("JFrame second creation took " + (end - start) + " ms");
+            System.exit(0);
+        }
     }
 }
--- a/jdk/test/demo/jvmti/mtrace/TraceJFrame.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/test/demo/jvmti/mtrace/TraceJFrame.java	Mon Jun 02 13:53:52 2014 -0700
@@ -37,7 +37,7 @@
 public class TraceJFrame {
     public static void main(String args[]) throws Exception {
         if (GraphicsEnvironment.isHeadless()) {
-            System.out.println("JFrame test was skipped due to headless mode");
+            System.out.println("TraceJFrame test was skipped due to headless mode");
         } else {
             DemoRun demo;
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Choice/RemoveAllShrinkTest/RemoveAllShrinkTest.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+  @test
+  @bug 4851798 8041896
+  @summary Tests Choice List shrinks after removeAll
+  @run main RemoveAllShrinkTest
+*/
+
+import java.awt.*;
+import java.awt.event.*;
+
+
+public class RemoveAllShrinkTest {
+
+    public static void main(String[] args) {
+        Frame f = new Frame();
+        Choice choice = new Choice();
+
+        for (int i = 0; i < 10; ++i) {
+            choice.addItem("Item " + i);
+        }
+
+        f.add(choice, BorderLayout.NORTH);
+        Panel panel = new Panel();
+        panel.setBackground(Color.RED);
+        f.add(panel);
+
+        f.setSize(200, 200);
+        f.setVisible(true);
+        f.toFront();
+
+        choice.removeAll();
+
+        try {
+            Robot robot = new Robot();
+            robot.setAutoWaitForIdle(true);
+            robot.setAutoDelay(50);
+
+            robot.waitForIdle();
+            Thread.sleep(200);
+
+            Point pt = choice.getLocationOnScreen();
+            robot.mouseMove(pt.x + choice.getWidth() - choice.getHeight() / 2,
+                    pt.y + choice.getHeight() / 2);
+            robot.mousePress(InputEvent.BUTTON1_MASK);
+            robot.mouseRelease(InputEvent.BUTTON1_MASK);
+
+            Thread.sleep(400);
+
+            Point pt1 = panel.getLocationOnScreen();
+
+            Color color = robot.getPixelColor(pt1.x + panel.getWidth() / 2,
+                    pt1.y + panel.getHeight() / 2);
+
+            if (!color.equals(Color.RED)) {
+                throw new RuntimeException("RemoveAllShrinkTest failed. " + color);
+            }
+        } catch (Exception e) {
+            throw new RuntimeException("The test was not completed.\n\n" + e);
+        }
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Frame/SetMaximizedBounds/SetMaximizedBounds.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+
+/*
+ * @test
+ * @summary When Frame.setExtendedState(Frame.MAXIMIZED_BOTH)
+ *          is called for a Frame after been called setMaximizedBounds() with
+ *          certain value, Frame bounds must equal to this value.
+ *
+ * @library ../../../../lib/testlibrary
+ * @build ExtendedRobot
+ * @run main SetMaximizedBounds
+ */
+
+public class SetMaximizedBounds {
+
+    Frame frame;
+    Rectangle bound;
+    boolean supported;
+    ExtendedRobot robot;
+    static Rectangle max = new Rectangle(100,100,400,400);
+
+    public void doTest() throws Exception {
+        robot = new ExtendedRobot();
+
+        EventQueue.invokeAndWait( () -> {
+            frame = new Frame( "TestFrame ");
+            frame.setLayout(new FlowLayout());
+
+            if (Toolkit.getDefaultToolkit().isFrameStateSupported(Frame.MAXIMIZED_BOTH)) {
+                supported = true;
+                frame.setMaximizedBounds(max);
+            } else {
+                supported = false;
+            }
+
+            frame.setSize(200, 200);
+            frame.setVisible(true);
+        });
+
+        robot.waitForIdle(2000);
+        if (supported) {
+            EventQueue.invokeAndWait( () -> {
+                frame.setExtendedState(Frame.MAXIMIZED_BOTH);
+            });
+            robot.waitForIdle(2000);
+            bound = frame.getBounds();
+            if(!bound.equals(max))
+                throw new RuntimeException("The bounds of the Frame do not equal to what"
+                    + " is specified when the frame is in Frame.MAXIMIZED_BOTH state");
+        } else {
+            System.out.println("Frame.MAXIMIZED_BOTH not supported");
+        }
+
+        frame.dispose();
+    }
+
+    public static void main(String[] args) throws Exception {
+        String os = System.getProperty("os.name").toLowerCase();
+        System.out.println(os);
+        if (os.contains("windows") || os.contains("os x"))
+            new SetMaximizedBounds().doTest();
+        else
+            System.out.println("Platform "+os+" is not supported. Supported platforms are Windows and OS X.");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/FullScreen/DisplayChangeVITest/DisplayChangeVITest.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,245 @@
+/*
+ * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please 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 6366359
+ * @summary Test that we don't crash when changing from 8 to 16/32 bit modes
+ * @author Dmitri.Trembovetski@Sun.COM area=FullScreen
+ * @run main/othervm/timeout=200 DisplayChangeVITest
+ * @run main/othervm/timeout=200 -Dsun.java2d.d3d=false DisplayChangeVITest
+ * @run main/othervm/timeout=200 -Dsun.java2d.opengl=true DisplayChangeVITest
+ */
+
+import java.awt.Color;
+import java.awt.DisplayMode;
+import java.awt.Graphics;
+import java.awt.GraphicsDevice;
+import java.awt.GraphicsEnvironment;
+import java.awt.event.KeyAdapter;
+import java.awt.event.KeyEvent;
+import java.awt.image.BufferedImage;
+import java.awt.image.VolatileImage;
+import java.lang.Exception;
+import java.lang.Thread;
+import java.util.ArrayList;
+import java.util.Random;
+import javax.swing.JFrame;
+
+/**
+ * The test enters fullscreen mode (if it's supported) and then tries
+ * to switch between display moes with different depths and dimensions
+ * while doing both rendering to the screen (via a VolatileImage)
+ * and Swing repainting just to make things more chaotic.
+ *
+ * The procedure is repeated TEST_REPS times (3 by default).
+ *
+ * Don't pay attention to what happens on the screen, it won't be pretty.
+ * If the test doesn't crash or throw exceptions, it passes, otherwise
+ * it fails.
+ */
+public class DisplayChangeVITest extends JFrame implements Runnable {
+
+    private final Random rnd = new Random();
+    private VolatileImage bb;
+    private BufferedImage sprite;
+    private VolatileImage volSprite;
+
+    private static boolean done = false;
+    private static final Object lock = new Object();
+    private static final int TEST_REPS = 3;
+
+    private ArrayList<DisplayMode> dms;
+
+    DisplayChangeVITest() {
+        selectDisplayModes();
+        addKeyListener(new KeyAdapter() {
+            public void keyPressed(KeyEvent e) {
+                if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
+                    synchronized (lock) {
+                        done = true;
+                    }
+                }
+            }
+        });
+        sprite = new BufferedImage(200, 200, BufferedImage.TYPE_INT_RGB);
+        sprite.getRaster().getDataBuffer();
+        Graphics g = sprite.getGraphics();
+        g.setColor(Color.yellow);
+        g.fillRect(0, 0, sprite.getWidth(), sprite.getHeight());
+    }
+
+    void render(Graphics g) {
+        do {
+            // volatile images validated here
+            initBackbuffer();
+
+            g.setColor(Color.black);
+            g.fillRect(0, 0, getWidth(), getHeight());
+
+            Graphics gg = bb.getGraphics();
+            gg.setColor(new Color(rnd.nextInt(0x00ffffff)));
+            gg.fillRect(0, 0, bb.getWidth(), bb.getHeight());
+            for (int x = 0; x < 10; x++) {
+                gg.drawImage(sprite, x*200, 0, null);
+                gg.drawImage(volSprite, x*200, 500, null);
+            }
+
+            g.drawImage(bb, 0, 0, null);
+        } while (bb.contentsLost());
+    }
+
+    private static void sleep(long msec) {
+        try { Thread.sleep(msec); } catch (InterruptedException e) {}
+    }
+
+    private int reps = 0;
+    public void run() {
+        GraphicsDevice gd = getGraphicsConfiguration().getDevice();
+        if (gd.isDisplayChangeSupported() && dms.size() > 0) {
+            while (!done && reps++ < TEST_REPS) {
+                for (DisplayMode dm : dms) {
+                    System.err.printf("Entering DisplayMode[%dx%dx%d]\n",
+                        dm.getWidth(), dm.getHeight(), dm.getBitDepth());
+                    gd.setDisplayMode(dm);
+
+                    initBackbuffer();
+                    for (int i = 0; i < 10; i++) {
+                        // render to the screen
+                        render(getGraphics());
+                        // ask Swing to repaint
+                        repaint();
+                        sleep(100);
+                    }
+                    sleep(1500);
+                }
+            }
+        } else {
+            System.err.println("Display mode change " +
+                               "not supported. Test passed.");
+        }
+        dispose();
+        synchronized (lock) {
+            done = true;
+            lock.notify();
+        }
+    }
+
+    private void createBackbuffer() {
+        if (bb == null ||
+            bb.getWidth() != getWidth() || bb.getHeight() != getHeight())
+        {
+            bb = createVolatileImage(getWidth(), getHeight());
+        }
+    }
+
+    private void initBackbuffer() {
+        createBackbuffer();
+
+        int res = bb.validate(getGraphicsConfiguration());
+        if (res == VolatileImage.IMAGE_INCOMPATIBLE) {
+            bb = null;
+            createBackbuffer();
+            bb.validate(getGraphicsConfiguration());
+            res = VolatileImage.IMAGE_RESTORED;
+        }
+        if (res == VolatileImage.IMAGE_RESTORED) {
+            Graphics g = bb.getGraphics();
+            g.setColor(new Color(rnd.nextInt(0x00ffffff)));
+            g.fillRect(0, 0, bb.getWidth(), bb.getHeight());
+
+            volSprite = createVolatileImage(100, 100);
+        }
+        volSprite.validate(getGraphicsConfiguration());
+    }
+
+    private void selectDisplayModes() {
+        GraphicsDevice gd =
+            GraphicsEnvironment.getLocalGraphicsEnvironment().
+                getDefaultScreenDevice();
+        dms = new ArrayList<DisplayMode>();
+        DisplayMode dmArray[] = gd.getDisplayModes();
+        boolean found8 = false, found16 = false,
+                found24 = false, found32 = false;
+        for (DisplayMode dm : dmArray) {
+            if (!found8 &&
+                (dm.getBitDepth() == 8 ||
+                 dm.getBitDepth() == DisplayMode.BIT_DEPTH_MULTI)  &&
+                (dm.getWidth() >= 800 && dm.getWidth() < 1024))
+            {
+                dms.add(dm);
+                found8 = true;
+                continue;
+            }
+            if (!found32 &&
+                (dm.getBitDepth() == 32 ||
+                 dm.getBitDepth() == DisplayMode.BIT_DEPTH_MULTI)  &&
+                dm.getWidth() >= 1280)
+            {
+                dms.add(dm);
+                found32 = true;
+                continue;
+            }
+            if (!found16 &&
+               dm.getBitDepth() == 16 &&
+                (dm.getWidth() >= 1024 && dm.getWidth() < 1280))
+            {
+                dms.add(dm);
+                found16 = true;
+                continue;
+            }
+            if (found8 && found16 && found32) {
+                break;
+            }
+        }
+        System.err.println("Found display modes:");
+        for (DisplayMode dm : dms) {
+            System.err.printf("DisplayMode[%dx%dx%d]\n",
+                dm.getWidth(), dm.getHeight(), dm.getBitDepth());
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        DisplayChangeVITest test = new DisplayChangeVITest();
+        GraphicsDevice gd =
+            GraphicsEnvironment.getLocalGraphicsEnvironment().
+                getDefaultScreenDevice();
+        if (gd.isFullScreenSupported()) {
+            gd.setFullScreenWindow(test);
+            Thread t = new Thread(test);
+            t.run();
+            synchronized (lock) {
+                while (!done) {
+                    try {
+                        lock.wait(50);
+                    } catch (InterruptedException ex) {
+                        ex.printStackTrace();
+                    }
+                }
+            }
+            System.err.println("Test Passed.");
+        } else {
+            System.err.println("Full screen not supported. Test passed.");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/GridLayout/ChangeGridSize/ChangeGridSize.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,189 @@
+/*
+ * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.awt.event.*;
+
+/*
+ * @test
+ * @summary Have different components having different preferred sizes
+ *          added to a grid layout. Change the rows and columns of the
+ *          grid layout and check the components are re-laid out.
+ *          The strategy followed is to calculate the component location
+ *          depending on the preferred sizes and gaps and click the cornors
+ *          of the components to check if events are triggered
+ * @library ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @run main ChangeGridSize
+ * @run main ChangeGridSize -hg 20 -vg 20
+ */
+
+public class ChangeGridSize {
+
+    private int width = 200;
+    private int height = 200;
+    private final int hGap, vGap;
+    private final int rows = 3;
+    private final int columns = 2;
+    private final int componentCount = 6;
+
+    private Button[] buttons;
+    private Frame frame;
+
+    private ExtendedRobot robot;
+    private GridLayout layout;
+
+    private volatile boolean actionPerformed = false;
+
+    public ChangeGridSize(int hGap, int vGap) throws Exception  {
+        this.hGap = hGap;
+        this.vGap = vGap;
+        robot = new ExtendedRobot();
+        EventQueue.invokeAndWait( () -> {
+            frame = new Frame("Test frame");
+            frame.setSize(width, height);
+            layout = new GridLayout(rows + 3, columns - 1, hGap, vGap);
+            frame.setLayout(layout);
+
+            buttons = new Button[componentCount];
+            for (int i = 0; i < componentCount; i++) {
+                buttons[i] = new Button("Button" + i);
+                frame.add(buttons[i]);
+                buttons[i].addActionListener( (event) -> { actionPerformed = true; });
+            }
+            frame.setVisible(true);
+        });
+    }
+
+    public static void main(String[] args) throws Exception {
+        int hGap = 0;
+        int vGap = 0;
+        for (int i = 0; i < args.length; i++) {
+            switch (args[i]) {
+                case "-hg":
+                    hGap = Integer.parseInt(args[++i]);
+                    break;
+                case "-vg":
+                    vGap = Integer.parseInt(args[++i]);
+                    break;
+            }
+        }
+        new ChangeGridSize(hGap, vGap).doTest();
+    }
+
+    private void resizeFrame() throws Exception {
+        EventQueue.invokeAndWait(() -> {
+            Insets insets = frame.getInsets();
+            double dH = (height-insets.top-insets.bottom - vGap*(rows-1)) % rows;
+            double dW = (width-insets.left-insets.right - hGap*(columns-1)) % columns;
+            height -= dH;
+            width -= dW;
+            frame.setSize(width, height);
+            frame.revalidate();
+        });
+        robot.waitForIdle();
+    }
+
+    private void changeGridSize() throws Exception {
+        EventQueue.invokeAndWait(() -> {
+            layout.setRows(rows);
+            layout.setColumns(columns);
+
+            frame.revalidate();
+        });
+        robot.waitForIdle();
+    }
+
+    public void testBoundaries(int topLeftX, int topLeftY, int bottomRightX, int bottomRightY) throws Exception {
+
+        actionPerformed = false;
+        robot.mouseMove(topLeftX, topLeftY);
+        robot.delay(500);
+        robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
+        robot.delay(500);
+        robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
+        robot.waitForIdle(3000);
+
+        if(!actionPerformed)
+            throw new RuntimeException("Clicking on the left top of button did not trigger action event");
+
+        actionPerformed = false;
+        robot.mouseMove(bottomRightX, bottomRightY);
+        robot.delay(500);
+        robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
+        robot.delay(500);
+        robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
+        robot.waitForIdle(3000);
+
+        if(!actionPerformed)
+            throw new RuntimeException("Clicking on the bottom right of button did not trigger action event");
+    }
+
+    private void doTest() throws Exception {
+        robot.waitForIdle();
+        changeGridSize();
+        resizeFrame();
+
+        int availableWidth = width - frame.getInsets().left -
+                frame.getInsets().right;
+        int componentWidth = (availableWidth + hGap) / columns - hGap;
+        int availableHeight = height - frame.getInsets().top -
+                frame.getInsets().bottom;
+        int componentHeight = (availableHeight + vGap) / rows - vGap;
+
+        for (int i = 0; i < buttons.length; i++) {
+            if (buttons[i].getSize().width != componentWidth ||
+                    buttons[i].getSize().height != componentHeight) {
+                throw new RuntimeException(
+                        "FAIL: Button " + i + " not of proper size" +
+                        "Expected: " + componentWidth + "*" + componentHeight +
+                        "Actual: " + buttons[i].getSize().width + "*" + buttons[i].getSize().height);
+            }
+        }
+
+        // Components are visible. They should trigger events.
+        // Now you can check for the actual size shown.
+        int currentRow = 1;
+        int currentColumn = 0;
+        for (int i = 0; i < buttons.length; i++) {
+            currentColumn++;
+            if (currentColumn > columns) {
+                currentColumn = 1;
+                currentRow++;
+            }
+
+            int topPosX = frame.getLocationOnScreen().x +
+                    frame.getInsets().left +
+                    (currentColumn - 1) * (componentWidth + hGap);
+            int topPosY = frame.getLocationOnScreen().y +
+                    frame.getInsets().top +
+                    (currentRow - 1) * (componentHeight + vGap);
+
+            int bottomPosX = topPosX + componentWidth - 1;
+            int bottomPosY = topPosY + componentHeight - 1;
+            testBoundaries(topPosX, topPosY, bottomPosX, bottomPosY);
+        }
+
+        frame.dispose();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/GridLayout/ComponentPreferredSize/ComponentPreferredSize.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,181 @@
+/*
+ * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.awt.event.InputEvent;
+
+/*
+ * @test
+ * @summary Have different components having different preferred sizes
+ *          added to a grid layout having various values of row/columns.
+ *          Check if the compnents are correctly laid out.
+ *          The strategy followed is to calculate the component location
+ *          depending on the preferred sizes and gaps and click the cornors
+ *          of the components to check if events are triggered
+ * @library ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @run main ComponentPreferredSize
+ * @run main ComponentPreferredSize -hg 20 -vg 20
+ */
+
+public class ComponentPreferredSize {
+
+    private int width = 200;
+    private int height = 200;
+    private final int hGap, vGap;
+    private final int rows = 3;
+    private final int columns = 2;
+    private final int componentCount = 6;
+
+    private Button[] buttons;
+    private Frame frame;
+
+    private ExtendedRobot robot;
+    private GridLayout layout;
+
+    private volatile boolean actionPerformed = false;
+
+    public ComponentPreferredSize(int hGap, int vGap) throws Exception {
+        this.hGap = hGap;
+        this.vGap = vGap;
+        robot = new ExtendedRobot();
+        EventQueue.invokeAndWait( () -> {
+            frame = new Frame("Test frame");
+            frame.setSize(width, height);
+            layout = new GridLayout(rows, columns, hGap, vGap);
+            frame.setLayout(layout);
+
+            buttons = new Button[componentCount];
+            for (int i = 0; i < componentCount; i++) {
+                buttons[i] = new Button("Button" + i);
+                buttons[i].setPreferredSize(new Dimension((int) Math.random() * 100,
+                        (int) Math.random() * 100));
+                frame.add(buttons[i]);
+                buttons[i].addActionListener((event) -> {actionPerformed = true;});
+            }
+
+            frame.setVisible(true);
+        });
+    }
+
+    public static void main(String[] args) throws Exception {
+        int hGap = 0;
+        int vGap = 0;
+        for (int i = 0; i < args.length; i++) {
+            switch (args[i]) {
+                case "-hg":
+                    hGap = Integer.parseInt(args[++i]);
+                    break;
+                case "-vg":
+                    vGap = Integer.parseInt(args[++i]);
+                    break;
+            }
+        }
+        new ComponentPreferredSize(hGap, vGap).doTest();
+    }
+
+    private void resizeFrame() throws Exception {
+        EventQueue.invokeAndWait(() -> {
+            Insets insets = frame.getInsets();
+            double dH = (height-insets.top-insets.bottom - vGap*(rows-1)) % rows;
+            double dW = (width-insets.left-insets.right - hGap*(columns-1)) % columns;
+            height -= dH;
+            width -= dW;
+            frame.setSize(width, height);
+            frame.revalidate();
+        });
+        robot.waitForIdle();
+    }
+
+    public void testBoundaries(int topLeftX, int topLeftY, int bottomRightX, int bottomRightY) throws Exception {
+
+        actionPerformed = false;
+        robot.mouseMove(topLeftX, topLeftY);
+        robot.delay(500);
+        robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
+        robot.delay(500);
+        robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
+        robot.waitForIdle(3000);
+
+        if(!actionPerformed)
+            throw new RuntimeException("Clicking on the left top of button did not trigger action event");
+
+        actionPerformed = false;
+        robot.mouseMove(bottomRightX, bottomRightY);
+        robot.delay(500);
+        robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
+        robot.delay(500);
+        robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
+        robot.waitForIdle(3000);
+
+        if(!actionPerformed)
+            throw new RuntimeException("Clicking on the bottom right of button did not trigger action event");
+    }
+
+    private void doTest() throws Exception {
+        robot.waitForIdle();
+        resizeFrame();
+
+        int availableWidth = width - frame.getInsets().left -
+                frame.getInsets().right;
+        int componentWidth = (availableWidth + hGap) / columns - hGap;
+        int availableHeight = height - frame.getInsets().top -
+                frame.getInsets().bottom;
+        int componentHeight = (availableHeight + vGap) / rows - vGap;
+
+        for (int i = 0; i < buttons.length; i++) {
+            if (buttons[i].getSize().width != componentWidth ||
+                    buttons[i].getSize().height != componentHeight) {
+                throw new RuntimeException(
+                        "FAIL: Button " + i + " not of proper size" +
+                        "Expected: " + componentWidth + "*" + componentHeight +
+                        "Actual: " + buttons[i].getSize().width + "*" + buttons[i].getSize().height);
+            }
+        }
+
+        // Components are visible. They should trigger events.
+        // Now you can check for the actual size shown.
+        int currentRow = 1;
+        int currentColumn = 0;
+        for (int i = 0; i < buttons.length; i++) {
+            currentColumn++;
+            if (currentColumn > columns) {
+                currentColumn = 1;
+                currentRow++;
+            }
+
+            int topPosX = frame.getLocationOnScreen().x +
+                    frame.getInsets().left +
+                    (currentColumn - 1) * (componentWidth + hGap);
+            int topPosY = frame.getLocationOnScreen().y +
+                    frame.getInsets().top +
+                    (currentRow - 1) * (componentHeight + vGap);
+
+            int bottomPosX = topPosX + componentWidth - 1;
+            int bottomPosY = topPosY + componentHeight - 1;
+            testBoundaries(topPosX, topPosY, bottomPosX, bottomPosY);
+        }
+
+        frame.dispose();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Mixing/AWT_Mixing/FrameBorderCounter.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+import java.awt.Dimension;
+import java.awt.EventQueue;
+import java.awt.Frame;
+import java.awt.Point;
+import java.awt.Robot;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.WindowEvent;
+import java.awt.event.WindowAdapter;
+
+public class FrameBorderCounter {
+
+    private static Frame frame;
+    private static Frame background;
+    private static Dimension size;
+    private static Point location;
+    private static Point entered;
+
+    public static void main(String[] args) throws Exception {
+        final Robot robot = new Robot();
+        EventQueue.invokeAndWait(new Runnable() {
+            public void run() {
+                robot.mouseMove(0, 0);
+            }
+        });
+        EventQueue.invokeAndWait(new Runnable() {
+            public void run() {
+                background = new Frame();
+                background.setBounds(100, 100, 300, 300);
+                background.addMouseListener(new MouseAdapter() {
+                    @Override
+                    public void mouseEntered(MouseEvent e) {
+                        entered = e.getLocationOnScreen();
+                        System.err.println("[ENTERED] : " + entered);
+                    }
+                });
+                background.setVisible(true);
+            }
+        });
+        EventQueue.invokeAndWait(new Runnable() {
+            public void run() {
+                frame = new Frame("Frame");
+                frame.setBounds(200, 200, 100, 100);
+                frame.addWindowListener(new WindowAdapter() {
+                    public void windowClosing(WindowEvent e) {
+                        System.exit(0);
+                    }
+                });
+                frame.setVisible(true);
+            }
+        });
+        Thread.sleep(1000);
+        EventQueue.invokeAndWait(new Runnable() {
+            public void run() {
+                location = frame.getLocationOnScreen();
+                size = frame.getSize();
+            }
+        });
+        int out = 20;
+        for (int x = location.x + size.width - out; x <= location.x + size.width + out; ++x) {
+            robot.mouseMove(x, location.y + size.height / 2);
+            Thread.sleep(50);
+        }
+        System.err.println("[LOCATION] : " + location);
+        System.err.println("[SIZE] : " + size);
+        Thread.sleep(250);
+        int shift = entered.x - location.x - size.width - 1;
+        System.err.println("Done");
+        System.out.println(shift);
+        frame.dispose();
+        background.dispose();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Mixing/AWT_Mixing/GlassPaneOverlappingTestBase.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,144 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Container;
+import java.awt.Point;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.InputEvent;
+import java.lang.reflect.InvocationTargetException;
+import javax.swing.JFrame;
+import javax.swing.SpringLayout;
+import javax.swing.SwingUtilities;
+
+/**
+ * Base class for testing overlapping of Swing and AWT component put into GlassPane.
+ * Validates drawing and event delivery at the components intersection.
+ * <p> See {@link OverlappingTestBase} for usage
+ *
+ * @author Sergey Grinev
+ */
+public abstract class GlassPaneOverlappingTestBase extends SimpleOverlappingTestBase {
+
+    /**
+     * If true components is additionally tested to be correctly drawn after resize.
+     */
+    protected boolean testResize = true;
+    private JFrame f = null;
+    private volatile Point ancestorLoc;
+
+    /**
+     * Setups GlassPane with lightweight component returned by {@link SimpleOverlappingTestBase#getSwingComponent() }
+     * Called by base class.
+     */
+    @Override
+    protected void prepareControls() {
+        wasLWClicked = false;
+
+        if(f != null) {
+            f.setVisible(false);
+        }
+        f = new JFrame("Mixing : GlassPane Overlapping test");
+        f.setLayout(new SpringLayout());
+        f.setSize(200, 200);
+
+        propagateAWTControls(f);
+
+        f.getGlassPane().setVisible(true);
+        Container glassPane = (Container) f.getGlassPane();
+        glassPane.setLayout(null);
+
+        testedComponent = getSwingComponent();
+        if (useDefaultClickValidation) {
+            testedComponent.addMouseListener(new MouseAdapter() {
+
+                @Override
+                public void mouseClicked(MouseEvent e) {
+                    //System.err.println("lw mouse clicked");
+                    wasLWClicked = true;
+                }
+            });
+        }
+        testedComponent.setBounds(0, 0, testedComponent.getPreferredSize().width, testedComponent.getPreferredSize().height);
+        glassPane.add(testedComponent);
+
+        f.setVisible(true);
+    }
+
+    public GlassPaneOverlappingTestBase() {
+        super();
+    }
+
+    public GlassPaneOverlappingTestBase(boolean defaultClickValidation) {
+        super(defaultClickValidation);
+    }
+
+    /**
+     * Run test by {@link OverlappingTestBase#clickAndBlink(java.awt.Robot, java.awt.Point) } validation for current lightweight component.
+     * <p>Also resize component and repeat validation in the resized area.
+     * <p>Called by base class.
+     * @return true if test passed
+     * @see GlassPaneOverlappingTestBase#testResize
+     */
+    @Override
+    protected boolean performTest() {
+        if (!super.performTest()) {
+            return false;
+        }
+        if (testResize) {
+            wasLWClicked = false;
+            try {
+                SwingUtilities.invokeAndWait(new Runnable() {
+
+                    public void run() {
+                        testedComponent.setBounds(0, 0, testedComponent.getPreferredSize().width, testedComponent.getPreferredSize().height + 20);
+                        ancestorLoc = f.getLocationOnScreen();
+                    }
+                });
+            } catch (InterruptedException ex) {
+                fail(ex.getMessage());
+            } catch (InvocationTargetException ex) {
+                fail(ex.getMessage());
+            }
+            Point lLoc = testedComponent.getLocationOnScreen();
+            lLoc.translate(1, testedComponent.getPreferredSize().height + 1);
+
+            /* this is a workaround for certain jtreg(?) focus issue:
+               tests fail starting after failing mixing tests but always pass alone.
+             */
+            Util.waitForIdle(robot);
+            ancestorLoc.translate(f.getWidth()/2-15, 2);
+            robot.mouseMove(ancestorLoc.x, ancestorLoc.y);
+            Util.waitForIdle(robot);
+            robot.mousePress(InputEvent.BUTTON1_MASK);
+            robot.delay(50);
+            robot.mouseRelease(InputEvent.BUTTON1_MASK);
+            Util.waitForIdle(robot);
+
+            clickAndBlink(robot, lLoc);
+            return wasLWClicked;
+        } else {
+            return true;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Mixing/AWT_Mixing/HierarchyBoundsListenerMixingTest.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,692 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+import java.awt.*;
+import java.awt.event.*;
+import java.lang.reflect.InvocationTargetException;
+import javax.swing.SwingUtilities;
+import java.io.*;
+
+/**
+ * AWT Mixing test for HierarchyBoundsListener ancestors.
+ * <p>See <a href="https://bugs.openjdk.java.net/browse/JDK-6768230">CR6768230</a> for details.
+ */
+/*
+@test
+@bug 6768230
+@summary Mixing test for HierarchyBoundsListener ancestors
+@build FrameBorderCounter
+@run main HierarchyBoundsListenerMixingTest
+ */
+public class HierarchyBoundsListenerMixingTest {
+
+    protected void prepareControls() {
+        dummy = new Frame();
+        dummy.setSize(100, 100);
+        dummy.setLocation(0, 350);
+        dummy.setVisible(true);
+
+        frame = new Frame("Test Frame");
+        frame.setLayout(new FlowLayout());
+
+        panel = new Panel();
+        button = new Button("Button");
+        label = new Label("Label");
+        list = new List();
+        list.add("One");
+        list.add("Two");
+        list.add("Three");
+        choice = new Choice();
+        choice.add("Red");
+        choice.add("Orange");
+        choice.add("Yellow");
+        checkbox = new Checkbox("Checkbox");
+        scrollbar = new Scrollbar(Scrollbar.HORIZONTAL, 0, 1, 0, 255);
+        textfield = new TextField(15);
+        textarea = new TextArea(5, 15);
+
+        components = new Component[] {
+            panel, button, label, list, choice, checkbox, scrollbar, textfield, textarea
+        };
+        ancestorResized = new boolean[components.length];
+        ancestorMoved = new boolean[components.length];
+
+        frame.addWindowListener(new WindowAdapter() {
+            @Override
+            public void windowClosing(WindowEvent event) {
+                System.err.println("User closed the window");
+                System.exit(1);
+            }
+        });
+
+        HierarchyBoundsListener listener = new HierarchyBoundsListenerImpl();
+        for (int i = 0; i < components.length; i++) {
+            components[i].addHierarchyBoundsListener(listener);
+            frame.add(components[i]);
+        }
+        frame.setSize(300, 300);
+        frame.setVisible(true);
+    }
+
+    private int frameBorderCounter() {
+        String JAVA_HOME = System.getProperty("java.home");
+
+        try {
+            Process p = Runtime.getRuntime().exec(JAVA_HOME + "/bin/java FrameBorderCounter");
+            try {
+                p.waitFor();
+            } catch (InterruptedException e) {
+                e.printStackTrace();
+                throw new RuntimeException(e);
+            }
+            if (p.exitValue() != 0) {
+                throw new RuntimeException("FrameBorderCounter exited with not null code!\n" + readInputStream(p.getErrorStream()));
+            }
+            return Integer.parseInt(readInputStream(p.getInputStream()).trim());
+        } catch (IOException e) {
+            e.printStackTrace();
+            throw new RuntimeException(e);
+        }
+    }
+
+    private String readInputStream(InputStream is) throws IOException {
+        byte[] buffer = new byte[4096];
+        int len = 0;
+        StringBuilder sb = new StringBuilder();
+        try (InputStreamReader isr = new InputStreamReader(is)) {
+            while ((len = is.read(buffer)) > 0) {
+                sb.append(new String(buffer, 0, len));
+            }
+        }
+        return sb.toString();
+    }
+
+    protected boolean performTest() {
+        int BORDER_SHIFT = frameBorderCounter();
+        BORDER_SHIFT = Math.abs(BORDER_SHIFT) == 1 ? BORDER_SHIFT : BORDER_SHIFT / 2;
+        Robot robot = null;
+        try {
+            robot = new Robot();
+            Thread.sleep(delay * 10);
+        } catch (Exception e) {
+            e.printStackTrace();
+            System.exit(1);
+        }
+
+        robot.mouseMove((int) components[0].getLocationOnScreen().x + components[0].getSize().width / 2,
+                        (int) components[0].getLocationOnScreen().y + components[0].getSize().height / 2);
+        robot.delay(delay);
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.delay(delay);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+        robot.delay(delay);
+
+        resetValues();
+        try {
+            EventQueue.invokeAndWait(new Runnable() {
+                public void run() {
+                    frame.setSize(new Dimension(frame.getSize().width + 10, frame.getSize().height + 10));
+                    frame.invalidate();
+                    frame.validate();
+                }
+            });
+        } catch (Exception e) {
+            e.printStackTrace();
+            passed = false;
+        }
+        if (! resizeTriggered) {
+            synchronized (resizeLock) {
+                try {
+                    resizeLock.wait(delay * 10);
+                } catch (Exception e) {
+                }
+            }
+        }
+        for (int i = 0; i < components.length; i++) {
+            if (! ancestorResized[i]) {
+                System.err.println("FAIL: Frame resized using API call. " +
+                                   "Ancestor resized event did not occur for " + components[i].getClass());
+                passed = false;
+            }
+        }
+        if (moveCount > 0) {
+            System.err.println("FAIL: Ancestor moved event occured when Frame resized using API");
+            passed = false;
+        }
+        robot.delay(delay * 5);
+
+        resetValues();
+        int x = (int) frame.getLocationOnScreen().x;
+        int y = (int) frame.getLocationOnScreen().y;
+        int w = frame.getSize().width;
+        int h = frame.getSize().height;
+
+        robot.mouseMove(x + w + BORDER_SHIFT, y + h / 2);
+        robot.delay(delay);
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.delay(delay);
+        for (int i = 0; i < 20; i++) {
+            robot.mouseMove(x + w + i + BORDER_SHIFT, y + h / 2);
+            robot.delay(50);
+        }
+        robot.delay(delay);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+
+        if (! resizeTriggered) {
+            synchronized (resizeLock) {
+                try {
+                    resizeLock.wait(delay * 10);
+                } catch (Exception e) {
+                }
+            }
+        }
+
+        for (int i = 0; i < components.length; i++) {
+            if (! ancestorResized[i]) {
+                System.err.println("FAIL: Frame resized using mouse action. " +
+                                   "Ancestor resized event did not occur for " +
+                                   components[i].getClass());
+                passed = false;
+            }
+        }
+        if (moveCount > 0) {
+            System.err.println("FAIL: Ancestor moved event occured when Frame resized using mouse");
+            passed = false;
+        }
+
+        resetValues();
+        try {
+            EventQueue.invokeAndWait(new Runnable() {
+                public void run() {
+                    frame.setLocation(frame.getLocation().x + 20, frame.getLocation().y + 20);
+                    frame.invalidate();
+                    frame.validate();
+                }
+            });
+        } catch (Exception e) {
+            e.printStackTrace();
+            passed = false;
+        }
+        if (! moveTriggered) {
+            synchronized (moveLock) {
+                try {
+                    moveLock.wait(delay * 10);
+                } catch (Exception e) {
+                }
+            }
+        }
+        for (int i = 0; i < components.length; i++) {
+            if (! ancestorMoved[i]) {
+                System.err.println("FAIL: Frame moved using API call. " +
+                                   "Ancestor moved event did not occur for " + components[i].getClass());
+                passed = false;
+            }
+        }
+        if (resizeCount > 0) {
+            System.err.println("FAIL: Ancestor resized event occured when Frame moved using API");
+            passed = false;
+        }
+        robot.delay(delay * 10);
+
+        resetValues();
+        x = (int) frame.getLocationOnScreen().x;
+        y = (int) frame.getLocationOnScreen().y;
+        w = frame.getSize().width;
+        h = frame.getSize().height;
+
+        //Click on the dummy frame so that the test frame loses focus. This is to workaround
+        //a bug in Linux AS.
+        robot.mouseMove((int) dummy.getLocationOnScreen().x + dummy.getSize().width / 2,
+                        (int) dummy.getLocationOnScreen().y + dummy.getSize().height / 2);
+        robot.delay(delay);
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.delay(delay);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+        robot.delay(delay);
+
+        robot.mouseMove(x + w / 2, y + 10);
+        robot.delay(delay);
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.delay(delay);
+        for (int i = 1; i <= 20; i++) {
+            robot.mouseMove(x + w / 2 + i, y + 10);
+            robot.delay(50);
+        }
+        robot.delay(delay);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+
+        if (! moveTriggered) {
+            synchronized (moveLock) {
+                try {
+                    moveLock.wait(delay * 10);
+                } catch (Exception e) {
+                }
+            }
+        }
+
+        for (int i = 0; i < components.length; i++) {
+            if (! ancestorMoved[i]) {
+                System.err.println("FAIL: Frame moved using mouse action. " +
+                                   "Ancestor moved event did not occur for " + components[i].getClass());
+                passed = false;
+            }
+        }
+        if (resizeCount > 0) {
+            System.err.println("FAIL: Ancestor resized event occured when Frame moved using mouse");
+            passed = false;
+        }
+
+        return passed;
+    }
+
+    private void resetValues() {
+        moveTriggered = false;
+        resizeTriggered = false;
+        moveCount = 0;
+        resizeCount = 0;
+        for (int i = 0; i < ancestorResized.length; i++) {
+            ancestorResized[i] = false;
+            ancestorMoved[i] = false;
+        }
+    }
+
+    private void keyType(int key, Robot robot) throws Exception {
+        robot.keyPress(key);
+        robot.delay(keyDelay);
+        robot.keyRelease(key);
+        robot.delay(keyDelay);
+    }
+
+    class HierarchyBoundsListenerImpl implements HierarchyBoundsListener {
+        // checks for Ancestor_Moved events
+        public void ancestorMoved(HierarchyEvent ce) {
+            if (check) {
+                System.out.println("Moved " + ce.getComponent());
+            }
+            for (int i = 0; i < components.length; i++) {
+                if (components[i].equals(ce.getComponent())) {
+                    //setting this array for purpose of checking ancestor_moved.
+                    ancestorMoved[i] = true;
+                    moveCount++;
+                    if (moveCount == components.length) {
+                        moveTriggered = true;
+                        synchronized (moveLock) {
+                            try {
+                                moveLock.notifyAll();
+                            } catch (Exception e) {
+                            }
+                        }
+                    }
+                }
+            }
+        }
+        // checks for Ancestor_Moved events
+        public void ancestorResized(HierarchyEvent ce) {
+            if (check) {
+                System.out.println("Resized " + ce.getComponent());
+            }
+            for (int i = 0; i < components.length; i++) {
+                if (components[i].equals(ce.getComponent())) {
+                    if (! frame.equals(ce.getChanged()) || ce.getChangedParent() != null) {
+                        System.err.println("FAIL: Invalid value of HierarchyEvent.getXXX");
+                        System.err.println("ce.getChanged() : " + ce.getChanged());
+                        System.err.println("ce.getChangedParent() : " + ce.getChangedParent());
+                        passed = false;
+                    }
+                    //setting this array for purpose of checking ancestor_resized
+                    ancestorResized[i] = true;
+                    resizeCount++;
+                    if (resizeCount == components.length) {
+                        resizeTriggered = true;
+                        synchronized (resizeLock) {
+                            try {
+                                resizeLock.notifyAll();
+                            } catch (Exception e) {
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    private Frame frame, dummy;
+    private Panel panel;
+    private Button button;
+    private Label label;
+    private List list;
+    private Choice choice;
+    private Checkbox checkbox;
+    private Scrollbar scrollbar;
+    private TextField textfield;
+    private TextArea textarea;
+    private Component[] components;
+    private boolean[] ancestorResized;
+    private boolean[] ancestorMoved;
+
+    private int delay = 500;
+    private int keyDelay = 50;
+    private int moveCount = 0;
+    private int resizeCount = 0;
+
+    private boolean passed = true;
+    private boolean moveTriggered = false;
+    private boolean resizeTriggered = false;
+    private final Object moveLock = new Object();
+    private final Object resizeLock = new Object();
+
+    private boolean check = false;
+
+    private void invoke() throws InterruptedException {
+        try {
+            SwingUtilities.invokeAndWait(new Runnable() {
+
+                public void run() {
+                    prepareControls();
+                }
+            });
+            try {
+                Thread.sleep(1000); // wait for graphic effects on systems like Win7
+            } catch (InterruptedException ex) {
+            }
+            if (!performTest()) {
+                fail("Test failed");
+            }
+        } catch (InvocationTargetException ex) {
+            fail(ex.getMessage());
+        }
+    }
+
+    /*****************************************************
+     * Standard Test Machinery Section
+     * DO NOT modify anything in this section -- it's a
+     * standard chunk of code which has all of the
+     * synchronisation necessary for the test harness.
+     * By keeping it the same in all tests, it is easier
+     * to read and understand someone else's test, as
+     * well as insuring that all tests behave correctly
+     * with the test harness.
+     * There is a section following this for test-
+     * classes
+     ******************************************************/
+    private static void init() throws InterruptedException {
+        //*** Create instructions for the user here ***
+        //System.setProperty("sun.awt.disableMixing", "true");
+
+        String[] instructions = {
+            "This is an AUTOMATIC test, simply wait until it is done.",
+            "The result (passed or failed) will be shown in the",
+            "message window below."
+        };
+        Sysout.createDialog();
+        Sysout.printInstructions(instructions);
+
+        HierarchyBoundsListenerMixingTest instance = new HierarchyBoundsListenerMixingTest();
+
+        instance.invoke();
+
+        pass();
+    }//End  init()
+    private static boolean theTestPassed = false;
+    private static boolean testGeneratedInterrupt = false;
+    private static String failureMessage = "";
+    private static Thread mainThread = null;
+    private static int sleepTime = 300000;
+
+    // Not sure about what happens if multiple of this test are
+    //  instantiated in the same VM.  Being static (and using
+    //  static vars), it aint gonna work.  Not worrying about
+    //  it for now.
+    public static void main(String args[]) throws InterruptedException {
+        mainThread = Thread.currentThread();
+        try {
+            init();
+        } catch (TestPassedException e) {
+            //The test passed, so just return from main and harness will
+            // interepret this return as a pass
+            return;
+        }
+        //At this point, neither test pass nor test fail has been
+        // called -- either would have thrown an exception and ended the
+        // test, so we know we have multiple threads.
+
+        //Test involves other threads, so sleep and wait for them to
+        // called pass() or fail()
+        try {
+            Thread.sleep(sleepTime);
+            //Timed out, so fail the test
+            throw new RuntimeException("Timed out after " + sleepTime / 1000 + " seconds");
+        } catch (InterruptedException e) {
+            //The test harness may have interrupted the test.  If so, rethrow the exception
+            // so that the harness gets it and deals with it.
+            if (!testGeneratedInterrupt) {
+                throw e;
+            }
+
+            //reset flag in case hit this code more than once for some reason (just safety)
+            testGeneratedInterrupt = false;
+
+            if (theTestPassed == false) {
+                throw new RuntimeException(failureMessage);
+            }
+        }
+
+    }//main
+
+    public static synchronized void setTimeoutTo(int seconds) {
+        sleepTime = seconds * 1000;
+    }
+
+    public static synchronized void pass() {
+        Sysout.println("The test passed.");
+        Sysout.println("The test is over, hit  Ctl-C to stop Java VM");
+        //first check if this is executing in main thread
+        if (mainThread == Thread.currentThread()) {
+            //Still in the main thread, so set the flag just for kicks,
+            // and throw a test passed exception which will be caught
+            // and end the test.
+            theTestPassed = true;
+            throw new TestPassedException();
+        }
+        theTestPassed = true;
+        testGeneratedInterrupt = true;
+        mainThread.interrupt();
+    }//pass()
+
+    public static synchronized void fail() {
+        //test writer didn't specify why test failed, so give generic
+        fail("it just plain failed! :-)");
+    }
+
+    public static synchronized void fail(String whyFailed) {
+        Sysout.println("The test failed: " + whyFailed);
+        Sysout.println("The test is over, hit  Ctl-C to stop Java VM");
+        //check if this called from main thread
+        if (mainThread == Thread.currentThread()) {
+            //If main thread, fail now 'cause not sleeping
+            throw new RuntimeException(whyFailed);
+        }
+        theTestPassed = false;
+        testGeneratedInterrupt = true;
+        failureMessage = whyFailed;
+        mainThread.interrupt();
+    }//fail()
+}// class LWComboBox
+class TestPassedException extends RuntimeException {
+}
+
+//*********** End Standard Test Machinery Section **********
+//************ Begin classes defined for the test ****************
+// if want to make listeners, here is the recommended place for them, then instantiate
+//  them in init()
+
+/* Example of a class which may be written as part of a test
+class NewClass implements anInterface
+{
+static int newVar = 0;
+
+public void eventDispatched(AWTEvent e)
+{
+//Counting events to see if we get enough
+eventCount++;
+
+if( eventCount == 20 )
+{
+//got enough events, so pass
+
+LWComboBox.pass();
+}
+else if( tries == 20 )
+{
+//tried too many times without getting enough events so fail
+
+LWComboBox.fail();
+}
+
+}// eventDispatched()
+
+}// NewClass class
+
+ */
+//************** End classes defined for the test *******************
+/****************************************************
+Standard Test Machinery
+DO NOT modify anything below -- it's a standard
+chunk of code whose purpose is to make user
+interaction uniform, and thereby make it simpler
+to read and understand someone else's test.
+ ****************************************************/
+/**
+This is part of the standard test machinery.
+It creates a dialog (with the instructions), and is the interface
+for sending text messages to the user.
+To print the instructions, send an array of strings to Sysout.createDialog
+WithInstructions method.  Put one line of instructions per array entry.
+To display a message for the tester to see, simply call Sysout.println
+with the string to be displayed.
+This mimics System.out.println but works within the test harness as well
+as standalone.
+ */
+class Sysout {
+
+    private static TestDialog dialog;
+
+    public static void createDialogWithInstructions(String[] instructions) {
+        dialog = new TestDialog(new Frame(), "Instructions");
+        dialog.printInstructions(instructions);
+        dialog.setVisible(true);
+        println("Any messages for the tester will display here.");
+    }
+
+    public static void createDialog() {
+        dialog = new TestDialog(new Frame(), "Instructions");
+        String[] defInstr = {"Instructions will appear here. ", ""};
+        dialog.printInstructions(defInstr);
+        dialog.setVisible(true);
+        println("Any messages for the tester will display here.");
+    }
+
+    public static void printInstructions(String[] instructions) {
+        dialog.printInstructions(instructions);
+    }
+
+    public static void println(String messageIn) {
+        dialog.displayMessage(messageIn);
+        System.out.println(messageIn);
+    }
+}// Sysout  class
+
+/**
+This is part of the standard test machinery.  It provides a place for the
+test instructions to be displayed, and a place for interactive messages
+to the user to be displayed.
+To have the test instructions displayed, see Sysout.
+To have a message to the user be displayed, see Sysout.
+Do not call anything in this dialog directly.
+ */
+class TestDialog extends Dialog {
+
+    TextArea instructionsText;
+    TextArea messageText;
+    int maxStringLength = 80;
+
+    //DO NOT call this directly, go through Sysout
+    public TestDialog(Frame frame, String name) {
+        super(frame, name);
+        int scrollBoth = TextArea.SCROLLBARS_BOTH;
+        instructionsText = new TextArea("", 15, maxStringLength, scrollBoth);
+        add("North", instructionsText);
+
+        messageText = new TextArea("", 5, maxStringLength, scrollBoth);
+        add("Center", messageText);
+
+        pack();
+
+        setVisible(true);
+    }// TestDialog()
+
+    //DO NOT call this directly, go through Sysout
+    public void printInstructions(String[] instructions) {
+        //Clear out any current instructions
+        instructionsText.setText("");
+
+        //Go down array of instruction strings
+
+        String printStr, remainingStr;
+        for (int i = 0; i < instructions.length; i++) {
+            //chop up each into pieces maxSringLength long
+            remainingStr = instructions[i];
+            while (remainingStr.length() > 0) {
+                //if longer than max then chop off first max chars to print
+                if (remainingStr.length() >= maxStringLength) {
+                    //Try to chop on a word boundary
+                    int posOfSpace = remainingStr.lastIndexOf(' ', maxStringLength - 1);
+
+                    if (posOfSpace <= 0) {
+                        posOfSpace = maxStringLength - 1;
+                    }
+
+                    printStr = remainingStr.substring(0, posOfSpace + 1);
+                    remainingStr = remainingStr.substring(posOfSpace + 1);
+                } //else just print
+                else {
+                    printStr = remainingStr;
+                    remainingStr = "";
+                }
+
+                instructionsText.append(printStr + "\n");
+
+            }// while
+
+        }// for
+
+    }//printInstructions()
+
+    //DO NOT call this directly, go through Sysout
+    public void displayMessage(String messageIn) {
+        messageText.append(messageIn + "\n");
+        System.out.println(messageIn);
+    }
+}// TestDialog  class
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JButtonInGlassPaneOverlapping.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+import javax.swing.*;
+
+/**
+ * AWT/Swing overlapping test for {@link javax.swing.JButton } component in GlassPane.
+ * <p>See base class for details.
+ */
+/*
+@test
+@summary Simple Overlapping test for javax.swing.JButton
+@author sergey.grinev@oracle.com: area=awt.mixing
+@run main JButtonInGlassPaneOverlapping
+ */
+public class JButtonInGlassPaneOverlapping extends GlassPaneOverlappingTestBase {
+
+    @Override
+    protected JComponent getSwingComponent() {
+        JButton ch = new JButton();
+        ch.setText("Swing component");
+        return ch;
+    }
+
+    // this strange plumbing stuff is required due to "Standard Test Machinery" in base class
+    public static void main(String args[]) throws InterruptedException {
+        instance = new JButtonInGlassPaneOverlapping();
+        OverlappingTestBase.doMain(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JButtonOverlapping.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+import javax.swing.*;
+
+/**
+ * AWT/Swing overlapping test for {@link javax.swing.JButton } component.
+ * <p>See base class for details.
+ */
+/*
+@test
+@summary Simple Overlapping test for javax.swing.JButton
+@author sergey.grinev@oracle.com: area=awt.mixing
+@run main JButtonOverlapping
+ */
+public class JButtonOverlapping extends SimpleOverlappingTestBase {
+
+    @Override
+    protected JComponent getSwingComponent() {
+        JButton ch = new JButton();
+        ch.setText("Swing component");
+        return ch;
+    }
+
+    // this strange plumbing stuff is required due to "Standard Test Machinery" in base class
+    public static void main(String args[]) throws InterruptedException {
+        instance = new JButtonOverlapping();
+        OverlappingTestBase.doMain(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JColorChooserOverlapping.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+
+/**
+ * AWT/Swing overlapping test for {@link javax.swing.JColorChooser } component.
+ * <p>See base class for details.
+ */
+/*
+@test
+@summary Simple Overlapping test for javax.swing.JColorChooser
+@author sergey.grinev@oracle.com: area=awt.mixing
+@run main JColorChooserOverlapping
+ */
+public class JColorChooserOverlapping extends SimpleOverlappingTestBase {
+
+    public JColorChooserOverlapping() {
+        super(false);
+    }
+
+    @Override
+    protected JComponent getSwingComponent() {
+        wasLWClicked = true;
+        JColorChooser ch = new JColorChooser();
+        return ch;
+    }
+
+    // this strange plumbing stuff is required due to "Standard Test Machinery" in base class
+    public static void main(String args[]) throws InterruptedException {
+        instance = new JColorChooserOverlapping();
+        OverlappingTestBase.doMain(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JComboBoxOverlapping.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Point;
+import java.awt.Robot;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import javax.swing.BoxLayout;
+import javax.swing.JComboBox;
+import javax.swing.JFrame;
+
+/**
+ * AWT/Swing overlapping test for {@link javax.swing.JCombobox } component.
+ * <p>This test creates combobox and test if heavyweight component is drawn correctly then dropdown is shown.
+ * <p>See base class for details.
+ */
+/*
+@test
+@summary Overlapping test for javax.swing.JScrollPane
+@author sergey.grinev@oracle.com: area=awt.mixing
+@run main JComboBoxOverlapping
+ */
+public class JComboBoxOverlapping extends OverlappingTestBase {
+
+    private boolean lwClicked = false;
+    private Point loc;
+    private Point loc2;
+
+    {testEmbeddedFrame = true;}
+
+    protected void prepareControls() {
+        final JFrame frame = new JFrame("Mixing : Dropdown Overlapping test");
+        frame.getContentPane().setLayout(new BoxLayout(frame.getContentPane(), BoxLayout.Y_AXIS));
+        frame.setSize(200, 200);
+        frame.setVisible(true);
+
+        final JComboBox cb = new JComboBox(petStrings);
+        cb.setPreferredSize(new Dimension(frame.getContentPane().getWidth(), 20));
+        cb.addActionListener(new ActionListener() {
+
+            public void actionPerformed(ActionEvent e) {
+                if (e.getSource() == cb) {
+                    lwClicked = true;
+                }
+            }
+        });
+
+        frame.add(cb);
+        propagateAWTControls(frame);
+        frame.setVisible(true);
+        loc = cb.getLocationOnScreen();
+        loc2 = frame.getContentPane().getLocationOnScreen();
+    }
+
+    @Override
+    protected boolean performTest() {
+        // run robot
+        Robot robot = Util.createRobot();
+        robot.setAutoDelay(ROBOT_DELAY);
+
+        loc2.translate(75, 75);
+        pixelPreCheck(robot, loc2, currentAwtControl);
+
+        loc.translate(3, 3);
+        clickAndBlink(robot, loc, false);
+
+        clickAndBlink(robot, loc2, false);
+
+        return lwClicked;
+    }
+
+    // this strange plumbing stuff is required due to "Standard Test Machinery" in base class
+    public static void main(String args[]) throws InterruptedException {
+        instance = new JComboBoxOverlapping();
+        OverlappingTestBase.doMain(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JEditorPaneInGlassPaneOverlapping.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+import java.awt.Point;
+import javax.swing.*;
+
+/**
+ * AWT/Swing overlapping test for {@link javax.swing.JBEditorPane } component in GlassPane.
+ * <p>See base class for details.
+ */
+/*
+@test
+@summary Simple Overlapping test for javax.swing.JLabel
+@author sergey.grinev@oracle.com: area=awt.mixing
+@run main JEditorPaneInGlassPaneOverlapping
+ */
+public class JEditorPaneInGlassPaneOverlapping extends GlassPaneOverlappingTestBase {
+
+    @Override
+    protected JComponent getSwingComponent() {
+        JEditorPane ch = new JEditorPane();
+        ch.setText("<b>Swing component</b>");
+        OverlappingTestBase.shift = new Point(12, 12);
+        return ch;
+    }
+
+    // this strange plumbing stuff is required due to "Standard Test Machinery" in base class
+    public static void main(String args[]) throws InterruptedException {
+        instance = new JEditorPaneInGlassPaneOverlapping();
+        OverlappingTestBase.doMain(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JEditorPaneOverlapping.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+
+/**
+ * AWT/Swing overlapping test for {@link javax.swing.JEditorPane } component.
+ * <p>See base class for details.
+ */
+/*
+@test
+@summary Simple Overlapping test for javax.swing.JLabel
+@author sergey.grinev@oracle.com: area=awt.mixing
+@run main JEditorPaneOverlapping
+ */
+public class JEditorPaneOverlapping extends SimpleOverlappingTestBase {
+
+    @Override
+    protected JComponent getSwingComponent() {
+        JEditorPane ch = new JEditorPane();
+        ch.setText("<b>Swing component</b>");
+        return ch;
+    }
+
+    // this strange plumbing stuff is required due to "Standard Test Machinery" in base class
+    public static void main(String args[]) throws InterruptedException {
+        instance = new JEditorPaneOverlapping();
+        OverlappingTestBase.doMain(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JGlassPaneInternalFrameOverlapping.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,127 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Container;
+import java.awt.Point;
+import java.awt.Robot;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import javax.swing.JFrame;
+import javax.swing.JInternalFrame;
+import javax.swing.SwingUtilities;
+
+/**
+ * AWT/Swing overlapping test with JInternalFrame being put in GlassPane.
+ * See <a href="https://bugs.openjdk.java.net/browse/JDK-6637655">JDK-6637655</a> and
+ * <a href="https://bugs.openjdk.java.net/browse/JDK-6985776">JDK-6985776</a>.
+ * <p>See base class for details.
+ */
+/*
+@test
+@bug 6637655 6985776
+@summary Overlapping test for javax.swing.JScrollPane
+@author sergey.grinev@oracle.com: area=awt.mixing
+@run main JGlassPaneInternalFrameOverlapping
+ */
+public class JGlassPaneInternalFrameOverlapping extends OverlappingTestBase {
+
+    private boolean lwClicked = true;
+    private Point lLoc;
+    private Point lLoc2;
+    private JInternalFrame internalFrame;
+
+    protected boolean performTest() {
+        try {
+            SwingUtilities.invokeAndWait(new Runnable() {
+                public void run() {
+                    lLoc = internalFrame.getContentPane().getLocationOnScreen();
+                    lLoc2 = lLoc.getLocation();
+                    lLoc2.translate(0, internalFrame.getContentPane().getHeight() + 10);
+                }
+            });
+        } catch (Exception e) {
+            e.printStackTrace();
+            System.exit(1);
+        }
+        // run robot
+        Robot robot = Util.createRobot();
+        robot.setAutoDelay(ROBOT_DELAY);
+
+        clickAndBlink(robot, lLoc);
+
+        Color c = robot.getPixelColor(lLoc2.x, lLoc2.y);
+        robot.mouseMove(lLoc2.x, lLoc2.y);
+        if (!c.equals(AWT_BACKGROUND_COLOR) &&
+            currentAwtControl.getClass() != java.awt.Scrollbar.class &&
+            currentAwtControl.getClass() != java.awt.Choice.class) {
+            fail("The HW component did not pass pixel color check and is not drawn correctly");
+        }
+
+        return lwClicked;
+    }
+
+   // {debugClassName = "Choice";}
+
+    @Override
+    protected void prepareControls() {
+        JFrame frame = new JFrame("Glass Pane children test");
+        frame.setLayout(null);
+
+        Container contentPane = frame.getContentPane();
+        contentPane.setLayout(new BorderLayout());
+        super.propagateAWTControls(contentPane);
+
+        Container glassPane = (Container) frame.getRootPane().getGlassPane();
+        glassPane.setVisible(true);
+        glassPane.setLayout(null);
+
+        internalFrame = new JInternalFrame("Internal Frame", true);
+        internalFrame.setBounds(50, 0, 200, 100);
+        internalFrame.setVisible(true);
+        glassPane.add(internalFrame);
+
+        internalFrame.addMouseListener(new MouseAdapter() {
+
+            @Override
+            public void mouseClicked(MouseEvent e) {
+                lwClicked = true;
+            }
+        });
+
+        frame.setSize(300, 180);
+        frame.setLocationRelativeTo(null);
+        frame.setVisible(true);
+    }
+
+    // this strange plumbing stuff is required due to "Standard Test Machinery" in base class
+    public static void main(String args[]) throws InterruptedException {
+        if (System.getProperty("os.name").toLowerCase().contains("os x")) {
+            System.out.println("Aqua L&F ignores setting color to component. Test passes on Mac OS X.");
+            return;
+        }
+        instance = new JGlassPaneInternalFrameOverlapping();
+        OverlappingTestBase.doMain(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JGlassPaneMoveOverlapping.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,167 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Container;
+import java.awt.Point;
+import java.awt.Robot;
+import java.awt.event.InputEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import javax.swing.JFrame;
+import javax.swing.JInternalFrame;
+import javax.swing.SwingUtilities;
+
+/**
+ * AWT/Swing overlapping test with JInternalFrame being moved in GlassPane.
+ * See <a href="https://bugs.openjdk.java.net/browse/JDK-6637655">JDK-6637655</a> and
+ * <a href="https://bugs.openjdk.java.net/browse/JDK-6981919">JDK-6981919</a>.
+ * <p>See base class for details.
+ */
+/*
+@test
+@bug 6637655 6981919
+@summary Overlapping test for javax.swing.JScrollPane
+@author sergey.grinev@oracle.com: area=awt.mixing
+@run main JGlassPaneMoveOverlapping
+ */
+public class JGlassPaneMoveOverlapping extends OverlappingTestBase {
+
+    private boolean lwClicked = true;
+    private volatile Point lLoc;
+    private volatile Point lLoc2;
+
+    private JInternalFrame internalFrame;
+    private JFrame frame = null;
+    private volatile Point frameLoc;
+
+    protected boolean performTest() {
+
+        try {
+            SwingUtilities.invokeAndWait(new Runnable() {
+                public void run() {
+                    lLoc = internalFrame.getContentPane().getLocationOnScreen();
+                    lLoc2 = lLoc.getLocation();
+                    lLoc2.translate(0, internalFrame.getHeight());
+                    frameLoc = frame.getLocationOnScreen();
+                    frameLoc.translate(frame.getWidth()/2, 3);
+                }
+            });
+        } catch (Exception e) {
+            e.printStackTrace();
+            System.exit(1);
+        }
+
+        // run robot
+        Robot robot = Util.createRobot();
+        robot.setAutoDelay(ROBOT_DELAY);
+
+        // force focus on JFrame (jtreg workaround)
+        robot.mouseMove(frameLoc.x, frameLoc.y);
+        Util.waitForIdle(robot);
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.delay(50);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+        Util.waitForIdle(robot);
+
+
+        //slow move
+        robot.mouseMove(lLoc.x +  25, lLoc.y - 5);
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.delay(100);
+        robot.mouseMove(lLoc.x +  45, lLoc.y - 5);
+        robot.delay(100);
+        robot.mouseMove(lLoc.x +  internalWidth - 75, lLoc.y - 5);
+        robot.delay(100);
+        robot.mouseMove(lLoc.x +  internalWidth - 55, lLoc.y - 5);
+        robot.delay(100);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+
+        Color c2 = robot.getPixelColor(lLoc.x +  internalWidth + 15, lLoc.y - 5);
+        if (c2.equals(AWT_BACKGROUND_COLOR)) {
+            error("Foreground frame is not drawn properly");
+        }
+        Color c = robot.getPixelColor(lLoc.x +  internalWidth - 95, lLoc.y + 5);
+        robot.mouseMove(lLoc.x +  internalWidth - 95, lLoc.y + 5);
+        System.out.println("color: " + c + " " + AWT_BACKGROUND_COLOR);
+        if (!c.equals(AWT_BACKGROUND_COLOR) && currentAwtControl.getClass() != java.awt.Scrollbar.class) {
+            error("Background AWT component is not drawn properly");
+        }
+
+        return true;
+    }
+
+    // {debugClassName = "Choice";}
+
+    private static void error(String st) {
+        //System.out.println(st);
+        fail(st);
+    }
+
+    private static final int internalWidth = 200;
+
+    @Override
+    protected void prepareControls() {
+        if(frame != null) {
+            frame.setVisible(false);
+        }
+        frame = new JFrame("Glass Pane children test");
+        frame.setLayout(null);
+
+        Container contentPane = frame.getContentPane();
+        contentPane.setLayout(new BorderLayout());
+        super.propagateAWTControls(contentPane);
+
+        Container glassPane = (Container) frame.getRootPane().getGlassPane();
+        glassPane.setVisible(true);
+        glassPane.setLayout(null);
+
+        internalFrame = new JInternalFrame("Internal Frame", true);
+        internalFrame.setBounds(50, 0, internalWidth, 100);
+        internalFrame.setVisible(true);
+        glassPane.add(internalFrame);
+
+        internalFrame.addMouseListener(new MouseAdapter() {
+
+            @Override
+            public void mouseClicked(MouseEvent e) {
+                lwClicked = true;
+            }
+        });
+
+        frame.setSize(400, 180);
+        frame.setLocationRelativeTo(null);
+        frame.setVisible(true);
+    }
+
+    // this strange plumbing stuff is required due to "Standard Test Machinery" in base class
+    public static void main(String args[]) throws InterruptedException {
+        if (System.getProperty("os.name").toLowerCase().contains("os x")) {
+            System.out.println("Aqua L&F ignores setting color to component. Test passes on Mac OS X.");
+            return;
+        }
+        instance = new JGlassPaneMoveOverlapping();
+        OverlappingTestBase.doMain(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JInternalFrameMoveOverlapping.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Point;
+import java.awt.Robot;
+import java.awt.event.InputEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import javax.swing.JButton;
+import javax.swing.JDesktopPane;
+import javax.swing.JFrame;
+import javax.swing.JInternalFrame;
+
+/**
+ * AWT/Swing overlapping test for {@link javax.swing.JInternalFrame } component during move.
+ * <p>See <a href="http://monaco.sfbay.sun.com/detail.jsf?cr=6985399">CR6768230</a> for details and base class for test info.
+ */
+/*
+@test
+@bug 6985399
+@summary Overlapping test for javax.swing.JScrollPane
+@author sergey.grinev@oracle.com: area=awt.mixing
+@run main JInternalFrameMoveOverlapping
+ */
+public class JInternalFrameMoveOverlapping extends OverlappingTestBase {
+
+    private boolean lwClicked = true;
+    private Point locTopFrame;
+    private Point locTarget;
+
+    protected boolean performTest() {
+        // run robot
+        Robot robot = Util.createRobot();
+        robot.setAutoDelay(ROBOT_DELAY);
+
+        robot.mouseMove(locTopFrame.x + 25, locTopFrame.y + 25);
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        try {
+            Thread.sleep(500);
+        } catch (InterruptedException ex) {
+        }
+        robot.mouseMove(locTopFrame.x + (locTarget.x - locTopFrame.x)/2, locTopFrame.y + (locTarget.y - locTopFrame.y)/2);
+        try {
+            Thread.sleep(500);
+        } catch (InterruptedException ex) {
+        }
+        robot.mouseMove(locTarget.x, locTarget.y);
+        try {
+            Thread.sleep(500);
+        } catch (InterruptedException ex) {
+        }
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+
+        clickAndBlink(robot, locTarget);
+
+        return lwClicked;
+    }
+
+    //static {debugClassName = "Choice";}
+
+    @Override
+    protected void prepareControls() {
+
+
+        JDesktopPane desktopPane = new JDesktopPane();
+
+        JInternalFrame bottomFrame = new JInternalFrame("bottom frame", false, false, false, false);
+        bottomFrame.setSize(220, 220);
+        super.propagateAWTControls(bottomFrame);
+        desktopPane.add(bottomFrame);
+        bottomFrame.setVisible(true);
+
+        JInternalFrame topFrame = new JInternalFrame("top frame", false, false, false, false);
+        topFrame.setSize(200, 200);
+        topFrame.add(new JButton("LW Button") {
+
+            {
+                addMouseListener(new MouseAdapter() {
+
+                    @Override
+                    public void mouseClicked(MouseEvent e) {
+                        lwClicked = true;
+                    }
+                });
+            }
+        });
+        desktopPane.add(topFrame);
+        topFrame.setVisible(true);
+
+        JFrame frame = new JFrame("Test Window");
+        frame.setSize(300, 300);
+        frame.setContentPane(desktopPane);
+        frame.setVisible(true);
+
+        locTopFrame = topFrame.getLocationOnScreen();
+        locTarget = new Point(locTopFrame.x + bottomFrame.getWidth() / 2, locTopFrame.y + bottomFrame.getHeight()/2);
+    }
+
+    // this strange plumbing stuff is required due to "Standard Test Machinery" in base class
+    public static void main(String args[]) throws InterruptedException {
+        instance = new JInternalFrameMoveOverlapping();
+        OverlappingTestBase.doMain(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JInternalFrameOverlapping.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+import java.awt.Point;
+import java.awt.Robot;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import javax.swing.JButton;
+import javax.swing.JDesktopPane;
+import javax.swing.JFrame;
+import javax.swing.JInternalFrame;
+
+/**
+ * AWT/Swing overlapping test for {@link javax.swing.JInternalFrame } component.
+ * <p>See base class for test info.
+ */
+/*
+@test
+@summary Overlapping test for javax.swing.JScrollPane
+@author sergey.grinev@oracle.com: area=awt.mixing
+@run main JInternalFrameOverlapping
+ */
+public class JInternalFrameOverlapping extends OverlappingTestBase {
+
+    private boolean lwClicked = true;
+    private Point lLoc;
+
+    protected boolean performTest() {
+
+
+        // run robot
+        Robot robot = Util.createRobot();
+        robot.setAutoDelay(ROBOT_DELAY);
+
+        clickAndBlink(robot, lLoc);
+
+        return lwClicked;
+    }
+
+    /**
+     * Creating two JInternalFrames in JDesktopPanes. Put lightweight component into one frame and heavyweight into another.
+     */
+    @Override
+    protected void prepareControls() {
+        JDesktopPane desktopPane = new JDesktopPane();
+
+        JFrame frame = new JFrame("Test Window");
+        frame.setSize(300, 300);
+        frame.setContentPane(desktopPane);
+        frame.setVisible(true);
+        JInternalFrame bottomFrame = new JInternalFrame("bottom frame", false, false, false, false);
+        bottomFrame.setSize(220, 220);
+        desktopPane.add(bottomFrame);
+        bottomFrame.setVisible(true);
+
+        super.propagateAWTControls(bottomFrame);
+        JInternalFrame topFrame = new JInternalFrame("top frame", false, false, false, false);
+        topFrame.setSize(200, 200);
+        JButton jbutton = new JButton("LW Button") {{
+                addMouseListener(new MouseAdapter() {
+
+                    @Override
+                    public void mouseClicked(MouseEvent e) {
+                        lwClicked = true;
+                    }
+                });
+            }};
+        topFrame.add(jbutton);
+        desktopPane.add(topFrame);
+        topFrame.setVisible(true);
+        lLoc = jbutton.getLocationOnScreen();
+        lLoc.translate(jbutton.getWidth()/2, jbutton.getWidth()/2); //click at middle of the button
+    }
+
+    // this strange plumbing stuff is required due to "Standard Test Machinery" in base class
+    public static void main(String args[]) throws InterruptedException {
+        instance = new JInternalFrameOverlapping();
+        OverlappingTestBase.doMain(args);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JLabelInGlassPaneOverlapping.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+import java.awt.Dimension;
+import javax.swing.*;
+
+/**
+ * AWT/Swing overlapping test for {@link javax.swing.JLabel } component in GlassPane.
+ * <p>See base class for details.
+ */
+/*
+@test
+@summary Simple Overlapping test for javax.swing.JLabel
+@author sergey.grinev@oracle.com: area=awt.mixing
+@run main JLabelInGlassPaneOverlapping
+ */
+public class JLabelInGlassPaneOverlapping extends GlassPaneOverlappingTestBase {
+
+    @Override
+    protected JComponent getSwingComponent() {
+        JLabel ch = new JLabel();
+        ch.setPreferredSize(new Dimension(50, 50));
+        ch.setText("Swing component");
+        return ch;
+    }
+
+    // this strange plumbing stuff is required due to "Standard Test Machinery" in base class
+    public static void main(String args[]) throws InterruptedException {
+        instance = new JLabelInGlassPaneOverlapping();
+        OverlappingTestBase.doMain(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JLabelOverlapping.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Dimension;
+import javax.swing.*;
+
+/**
+ * AWT/Swing overlapping test for {@link javax.swing.JLabel } component.
+ * <p>See base class for details.
+ */
+/*
+@test
+@summary Simple Overlapping test for javax.swing.JLabel
+@author sergey.grinev@oracle.com: area=awt.mixing
+@run main JLabelOverlapping
+ */
+public class JLabelOverlapping extends SimpleOverlappingTestBase {
+
+    @Override
+    protected JComponent getSwingComponent() {
+        JLabel ch = new JLabel();
+        ch.setPreferredSize(new Dimension(50, 50));
+        ch.setText("Swing component");
+        return ch;
+    }
+
+    // this strange plumbing stuff is required due to "Standard Test Machinery" in base class
+    public static void main(String args[]) throws InterruptedException {
+        instance = new JLabelOverlapping();
+        OverlappingTestBase.doMain(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JListInGlassPaneOverlapping.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+import javax.swing.*;
+
+/**
+ * AWT/Swing overlapping test for {@link javax.swing.JList } component in GlassPane.
+ * <p>See base class for details.
+ */
+/*
+@test
+@summary Simple Overlapping test for javax.swing.JList
+@author sergey.grinev@oracle.com: area=awt.mixing
+@run main JListInGlassPaneOverlapping
+ */
+public class JListInGlassPaneOverlapping extends GlassPaneOverlappingTestBase {
+
+    @Override
+    protected JComponent getSwingComponent() {
+        JList ch = new JList(new String[] {"one", "two", "three"});
+        return ch;
+    }
+
+    // this strange plumbing stuff is required due to "Standard Test Machinery" in base class
+    public static void main(String args[]) throws InterruptedException {
+        instance = new JListInGlassPaneOverlapping();
+        OverlappingTestBase.doMain(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JListOverlapping.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+
+/**
+ * AWT/Swing overlapping test for {@link javax.swing.JList } component.
+ * <p>See base class for details.
+ */
+/*
+@test
+@summary Simple Overlapping test for javax.swing.JList
+@author sergey.grinev@oracle.com: area=awt.mixing
+@run main JListOverlapping
+ */
+public class JListOverlapping extends SimpleOverlappingTestBase {
+
+    @Override
+    protected JComponent getSwingComponent() {
+        JList ch = new JList(new String[] {"one", "two", "three", "four"});
+        return ch;
+    }
+
+    // this strange plumbing stuff is required due to "Standard Test Machinery" in base class
+    public static void main(String args[]) throws InterruptedException {
+        instance = new JListOverlapping();
+        OverlappingTestBase.doMain(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JMenuBarOverlapping.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,149 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+import java.awt.Color;
+import java.awt.GridLayout;
+import java.awt.Point;
+import java.awt.Robot;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import javax.swing.JFrame;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JSeparator;
+import javax.swing.SwingUtilities;
+
+/**
+ * AWT/Swing overlapping test for {@link javax.swing.JMenuBar } and {@link javax.swing.JSeparator} components.
+ * <p>This test creates menu bar and test if heavyweight component is drawn correctly then menu dropdown is shown.
+ * <p>See base class for test info.
+ */
+/*
+@test
+@summary Overlapping test for javax.swing.JScrollPane
+@author sergey.grinev@oracle.com: area=awt.mixing
+@run main JMenuBarOverlapping
+ */
+public class JMenuBarOverlapping extends OverlappingTestBase {
+
+    {testEmbeddedFrame = true;}
+
+    private boolean lwClicked = false;
+    private boolean spClicked = false;
+    private Point loc;
+    private Point loc2;
+    private Point sepLoc;
+    private JFrame frame;
+    private JMenuBar menuBar;
+    JSeparator separator;
+
+    protected void prepareControls() {
+        frame = new JFrame("Mixing : Dropdown Overlapping test");
+        frame.setLayout(new GridLayout(0,1));
+        frame.setSize(200, 200);
+        frame.setVisible(true);
+
+        menuBar = new JMenuBar();
+        JMenu menu = new JMenu("Test Menu");
+        ActionListener menuListener = new ActionListener() {
+
+            public void actionPerformed(ActionEvent event) {
+                lwClicked = true;
+            }
+        };
+
+        JMenuItem item;
+        menu.add(item = new JMenuItem("first"));
+        item.addActionListener(menuListener);
+        separator = new JSeparator();
+        separator.addMouseListener(new MouseAdapter() {
+
+            @Override
+            public void mouseClicked(MouseEvent e) {
+                spClicked = true;
+            }
+        });
+        menu.add(separator);
+
+        for (int i = 0; i < petStrings.length; i++) {
+            menu.add(item = new JMenuItem(petStrings[i]));
+            item.addActionListener(menuListener);
+        }
+        menuBar.add(menu);
+        frame.setJMenuBar(menuBar);
+
+        propagateAWTControls(frame);
+        frame.setVisible(true);
+    }
+
+    @Override
+    protected boolean performTest() {
+        try {
+            SwingUtilities.invokeAndWait(new Runnable() {
+                public void run() {
+                    loc = menuBar.getLocationOnScreen();
+                    loc2 = frame.getContentPane().getLocationOnScreen();
+                }
+            });
+        } catch (Exception e) {
+        }
+        // run robot
+        Robot robot = Util.createRobot();
+        robot.setAutoDelay(ROBOT_DELAY);
+
+        loc2.translate(75, 75);
+        pixelPreCheck(robot, loc2, currentAwtControl);
+
+        loc.translate(3, 3);
+        clickAndBlink(robot, loc, false);
+
+        clickAndBlink(robot, loc2, false);
+
+        clickAndBlink(robot, loc, false);
+        try {
+            SwingUtilities.invokeAndWait(new Runnable() {
+                public void run() {
+                    sepLoc = separator.getLocationOnScreen();
+                }
+            });
+        } catch (Exception e) {
+            e.printStackTrace();
+            System.exit(1);
+        }
+        sepLoc.translate(20, 1);
+        clickAndBlink(robot, sepLoc, false);
+
+        clickAndBlink(robot, loc, false); // close menu before running next step
+        return lwClicked && spClicked;
+    }
+
+    // this strange plumbing stuff is required due to "Standard Test Machinery" in base class
+    public static void main(String args[]) throws InterruptedException {
+        instance = new JMenuBarOverlapping();
+        OverlappingTestBase.doMain(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JPanelInGlassPaneOverlapping.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+import java.awt.Dimension;
+import javax.swing.*;
+
+/**
+ * AWT/Swing overlapping test for {@link javax.swing.JPanel } component in GlassPane.
+ * <p>See base class for details.
+ */
+/*
+@test
+@summary Simple Overlapping test for javax.swing.JPanel
+@author sergey.grinev@oracle.com: area=awt.mixing
+@run main JPanelInGlassPaneOverlapping
+ */
+public class JPanelInGlassPaneOverlapping extends GlassPaneOverlappingTestBase {
+
+    @Override
+    protected JComponent getSwingComponent() {
+        JPanel ch = new JPanel();
+        ch.setPreferredSize(new Dimension(50, 50));
+        ch.setBorder(BorderFactory.createTitledBorder("Swing Component"));
+        return ch;
+    }
+
+    // this strange plumbing stuff is required due to "Standard Test Machinery" in base class
+    public static void main(String args[]) throws InterruptedException {
+        instance = new JPanelInGlassPaneOverlapping();
+        OverlappingTestBase.doMain(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JPanelOverlapping.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Dimension;
+import javax.swing.*;
+
+/**
+ * AWT/Swing overlapping test for {@link javax.swing.JPanel } component.
+ * <p>See base class for details.
+ */
+/*
+@test
+@summary Simple Overlapping test for javax.swing.JPanel
+@author sergey.grinev@oracle.com: area=awt.mixing
+@run main JPanelOverlapping
+ */
+public class JPanelOverlapping extends SimpleOverlappingTestBase {
+
+    @Override
+    protected JComponent getSwingComponent() {
+        JPanel ch = new JPanel();
+        ch.setPreferredSize(new Dimension(50, 50));
+        ch.setBorder(BorderFactory.createTitledBorder("Swing Component"));
+        return ch;
+    }
+
+    // this strange plumbing stuff is required due to "Standard Test Machinery" in base class
+    public static void main(String args[]) throws InterruptedException {
+        instance = new JPanelOverlapping();
+        OverlappingTestBase.doMain(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JPopupMenuOverlapping.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+import java.awt.Color;
+import java.awt.Point;
+import java.awt.Robot;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.lang.reflect.InvocationTargetException;
+import javax.swing.JFrame;
+import javax.swing.JMenuItem;
+import javax.swing.JPopupMenu;
+import javax.swing.SpringLayout;
+import javax.swing.SwingUtilities;
+
+/**
+ * AWT/Swing overlapping test for {@link javax.swing.JPopupMenu } component.
+ * <p>This test creates menu and test if heavyweight component is drawn correctly then menu dropdown is shown.
+ * <p>See base class for test info.
+ */
+/*
+@test
+@summary Overlapping test for javax.swing.JScrollPane
+@author sergey.grinev@oracle.com: area=awt.mixing
+@run main JPopupMenuOverlapping
+ */
+public class JPopupMenuOverlapping extends OverlappingTestBase {
+
+    {testEmbeddedFrame = true;}
+
+    private boolean lwClicked = false;
+    private Point loc;
+    private JPopupMenu popup;
+    private JFrame frame=null;
+
+    protected void prepareControls() {
+        if(frame != null) {
+            frame.setVisible(false);
+        }
+        frame = new JFrame("Mixing : Dropdown Overlapping test");
+        frame.setLayout(new SpringLayout());
+        frame.setSize(200, 200);
+
+        popup = new JPopupMenu();
+        ActionListener menuListener = new ActionListener() {
+
+            public void actionPerformed(ActionEvent event) {
+                lwClicked = true;
+            }
+        };
+        JMenuItem item;
+        for (int i = 0; i < petStrings.length; i++) {
+            popup.add(item = new JMenuItem(petStrings[i]));
+            item.addActionListener(menuListener);
+        }
+        propagateAWTControls(frame);
+        frame.setVisible(true);
+        loc = frame.getContentPane().getLocationOnScreen();
+    }
+
+    @Override
+    protected boolean performTest() {
+        // run robot
+        Robot robot = Util.createRobot();
+        robot.setAutoDelay(ROBOT_DELAY);
+
+        loc.translate(75, 75);
+
+        pixelPreCheck(robot, loc, currentAwtControl);
+
+        try {
+            SwingUtilities.invokeAndWait(new Runnable() {
+
+                public void run() {
+                    popup.show(frame.getContentPane(), 15, 15);
+                }
+            });
+
+            robot.waitForIdle();
+
+            clickAndBlink(robot, loc, false);
+
+            SwingUtilities.invokeAndWait(new Runnable() {
+
+                public void run() {
+                    popup.setVisible(false);
+                }
+            });
+        } catch (InterruptedException ex) {
+            fail(ex.getMessage());
+        } catch (InvocationTargetException ex) {
+            fail(ex.getMessage());
+        }
+
+        return lwClicked;
+    }
+
+    // this strange plumbing stuff is required due to "Standard Test Machinery" in base class
+    public static void main(String args[]) throws InterruptedException {
+        instance = new JPopupMenuOverlapping();
+        OverlappingTestBase.doMain(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JProgressBarInGlassPaneOverlapping.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+import java.awt.Dimension;
+import javax.swing.*;
+
+/**
+ * AWT/Swing overlapping test for {@link javax.swing.JProgressBar } component in GlassPane.
+ * <p>See base class for details.
+ */
+/*
+@test
+@summary Simple Overlapping test for javax.swing.JProgressBar
+@author sergey.grinev@oracle.com: area=awt.mixing
+@run main JProgressBarInGlassPaneOverlapping
+ */
+public class JProgressBarInGlassPaneOverlapping extends GlassPaneOverlappingTestBase {
+
+    @Override
+    protected JComponent getSwingComponent() {
+        JProgressBar ch = new JProgressBar();
+        ch.setValue(50);
+        ch.setPreferredSize(new Dimension(50, 50));
+        return ch;
+    }
+
+    // this strange plumbing stuff is required due to "Standard Test Machinery" in base class
+    public static void main(String args[]) throws InterruptedException {
+        instance = new JProgressBarInGlassPaneOverlapping();
+        OverlappingTestBase.doMain(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JProgressBarOverlapping.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Dimension;
+import javax.swing.*;
+
+/**
+ * AWT/Swing overlapping test for {@link javax.swing.JProgressBar } component.
+ * <p>See base class for details.
+ */
+/*
+@test
+@summary Simple Overlapping test for javax.swing.JProgressBar
+@author sergey.grinev@oracle.com: area=awt.mixing
+@run main JProgressBarOverlapping
+ */
+public class JProgressBarOverlapping extends SimpleOverlappingTestBase {
+
+    @Override
+    protected JComponent getSwingComponent() {
+        JProgressBar ch = new JProgressBar();
+        ch.setValue(50);
+        ch.setPreferredSize(new Dimension(50, 50));
+        return ch;
+    }
+
+    // this strange plumbing stuff is required due to "Standard Test Machinery" in base class
+    public static void main(String args[]) throws InterruptedException {
+        instance = new JProgressBarOverlapping();
+        OverlappingTestBase.doMain(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JScrollBarInGlassPaneOverlapping.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+import java.awt.Point;
+import java.awt.Dimension;
+import java.awt.event.AdjustmentEvent;
+import java.awt.event.AdjustmentListener;
+import javax.swing.*;
+
+/**
+ * AWT/Swing overlapping test for {@link javax.swing.JScrollBar } component in GlassPane.
+ * <p>See base class for details.
+ */
+/*
+@test
+@summary Simple Overlapping test for javax.swing.JScrollBar
+@author sergey.grinev@oracle.com: area=awt.mixing
+@run main JScrollBarInGlassPaneOverlapping
+ */
+public class JScrollBarInGlassPaneOverlapping extends GlassPaneOverlappingTestBase {
+
+    public JScrollBarInGlassPaneOverlapping() {
+        super(false);
+    }
+
+    @Override
+    protected JComponent getSwingComponent() {
+        JScrollBar ch = new JScrollBar(JScrollBar.VERTICAL);
+        ch.setPreferredSize(new Dimension(50, 50));
+        ch.setValue(50);
+        ch.addAdjustmentListener(new AdjustmentListener() {
+
+            public void adjustmentValueChanged(AdjustmentEvent e) {
+                wasLWClicked = true;
+            }
+        });
+        OverlappingTestBase.shift = new Point(20, 16);
+        return ch;
+    }
+
+    // this strange plumbing stuff is required due to "Standard Test Machinery" in base class
+    public static void main(String args[]) throws InterruptedException {
+        instance = new JScrollBarInGlassPaneOverlapping();
+        OverlappingTestBase.doMain(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JScrollBarOverlapping.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Point;
+import java.awt.Dimension;
+import java.awt.event.AdjustmentEvent;
+import java.awt.event.AdjustmentListener;
+import javax.swing.*;
+
+/**
+ * AWT/Swing overlapping test for {@link javax.swing.JScrollBar } component.
+ * <p>See base class for details.
+ */
+/*
+@test
+@summary Simple Overlapping test for javax.swing.JScrollBar
+@author sergey.grinev@oracle.com: area=awt.mixing
+@run main JScrollBarOverlapping
+ */
+public class JScrollBarOverlapping extends SimpleOverlappingTestBase {
+
+    public JScrollBarOverlapping() {
+        super(false);
+    }
+
+    @Override
+    protected JComponent getSwingComponent() {
+        JScrollBar ch = new JScrollBar(JScrollBar.VERTICAL);
+        ch.setPreferredSize(new Dimension(50, 50));
+        ch.setValue(50);
+        ch.addAdjustmentListener(new AdjustmentListener() {
+
+            public void adjustmentValueChanged(AdjustmentEvent e) {
+                wasLWClicked = true;
+            }
+        });
+        OverlappingTestBase.shift = new Point(20, 16);
+        return ch;
+    }
+
+    // this strange plumbing stuff is required due to "Standard Test Machinery" in base class
+    public static void main(String args[]) throws InterruptedException {
+        instance = new JScrollBarOverlapping();
+        OverlappingTestBase.doMain(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JScrollPaneOverlapping.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,129 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+import java.awt.Dimension;
+import java.awt.GridLayout;
+import java.awt.Point;
+import java.awt.Robot;
+import java.awt.event.AdjustmentEvent;
+import java.awt.event.AdjustmentListener;
+import javax.swing.JFrame;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.SwingUtilities;
+
+/**
+ * AWT/Swing overlapping test for {@link javax.swing.JScrollPane } component.
+ * <p>See base class for test info.
+ */
+/*
+@test
+@summary Overlapping test for javax.swing.JScrollPane
+@author sergey.grinev@oracle.com: area=awt.mixing
+@run main JScrollPaneOverlapping
+ */
+public class JScrollPaneOverlapping extends OverlappingTestBase {
+
+//    {testEmbeddedFrame = true;}
+
+    private boolean horizontalClicked = false;
+    private boolean verticalClicked = false;
+    private Point hLoc;
+    private Point vLoc;
+
+    private JFrame f;
+    private JPanel p;
+    private JScrollPane scrollPane;
+
+    protected void prepareControls() {
+
+        f = new JFrame("JScrollPane");
+        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        f.setSize(120, 120);
+
+        p = new JPanel(new GridLayout(0, 1));
+
+        scrollPane = new JScrollPane(p);
+        scrollPane.setPreferredSize(new Dimension(300,300));
+        scrollPane.setHorizontalScrollBarPolicy(
+                JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
+        scrollPane.setVerticalScrollBarPolicy(
+                JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
+
+        scrollPane.getHorizontalScrollBar().setValue(1);
+        scrollPane.getHorizontalScrollBar().addAdjustmentListener(new AdjustmentListener() {
+
+            public void adjustmentValueChanged(AdjustmentEvent e) {
+                horizontalClicked = true;
+            }
+        });
+
+        scrollPane.getVerticalScrollBar().setValue(1);
+        scrollPane.getVerticalScrollBar().addAdjustmentListener(new AdjustmentListener() {
+
+            public void adjustmentValueChanged(AdjustmentEvent e) {
+                verticalClicked = true;
+            }
+        });
+
+        f.getContentPane().add(scrollPane);
+        f.setVisible(true);
+        propagateAWTControls(p);
+//        JButton b = new JButton("Space extender");
+//        b.setPreferredSize(new Dimension(150,150));
+//        p.add( b );
+
+        //b.requestFocus(); // to change the look of AWT component, especially Choice
+    }
+
+    @Override
+    protected boolean performTest() {
+        // run robot
+        Robot robot = Util.createRobot();
+        robot.setAutoDelay(ROBOT_DELAY);
+
+        try {
+            SwingUtilities.invokeAndWait(new Runnable() {
+                public void run() {
+                    hLoc = scrollPane.getHorizontalScrollBar().getLocationOnScreen();
+                    vLoc = scrollPane.getVerticalScrollBar().getLocationOnScreen();
+                }
+            });
+        } catch (Exception e) {
+        }
+        hLoc.translate(2, 2);
+        vLoc.translate(2, 2);
+
+        clickAndBlink(robot, hLoc, false);
+        clickAndBlink(robot, vLoc, false);
+
+        return horizontalClicked && verticalClicked;
+    }
+
+    // this strange plumbing stuff is required due to "Standard Test Machinery" in base class
+    public static void main(String args[]) throws InterruptedException {
+        instance = new JScrollPaneOverlapping();
+        OverlappingTestBase.doMain(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JSliderInGlassPaneOverlapping.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+import java.awt.Dimension;
+import javax.swing.*;
+
+/**
+ * AWT/Swing overlapping test for {@link javax.swing.JSlider } component in GlassPane.
+ * <p>See base class for details.
+ */
+/*
+@test
+@summary Simple Overlapping test for javax.swing.JSlider
+@author sergey.grinev@oracle.com: area=awt.mixing
+@run main JSliderInGlassPaneOverlapping
+ */
+public class JSliderInGlassPaneOverlapping extends GlassPaneOverlappingTestBase {
+
+    @Override
+    protected JComponent getSwingComponent() {
+        JSlider ch = new JSlider();
+        ch.setPreferredSize(new Dimension(50, 50));
+        return ch;
+    }
+
+    // this strange plumbing stuff is required due to "Standard Test Machinery" in base class
+    public static void main(String args[]) throws InterruptedException {
+        instance = new JSliderInGlassPaneOverlapping();
+        OverlappingTestBase.doMain(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JSliderOverlapping.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Dimension;
+import javax.swing.*;
+
+/**
+ * AWT/Swing overlapping test for {@link javax.swing.JSlider } component.
+ * <p>See base class for details.
+ */
+/*
+@test
+@summary Simple Overlapping test for javax.swing.JSlider
+@author sergey.grinev@oracle.com: area=awt.mixing
+@run main JSliderOverlapping
+ */
+public class JSliderOverlapping extends SimpleOverlappingTestBase {
+
+    @Override
+    protected JComponent getSwingComponent() {
+        JSlider ch = new JSlider();
+        ch.setPreferredSize(new Dimension(50, 50));
+        return ch;
+    }
+
+    // this strange plumbing stuff is required due to "Standard Test Machinery" in base class
+    public static void main(String args[]) throws InterruptedException {
+        instance = new JSliderOverlapping();
+        OverlappingTestBase.doMain(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JSpinnerInGlassPaneOverlapping.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+import java.awt.Dimension;
+import javax.swing.event.ChangeEvent;
+import javax.swing.*;
+import javax.swing.event.ChangeListener;
+
+/**
+ * AWT/Swing overlapping test for {@link javax.swing.JSpinner } component in GlassPane.
+ * <p>See base class for details.
+ */
+/*
+@test
+@summary Simple Overlapping test for javax.swing.JSpinner
+@author sergey.grinev@oracle.com: area=awt.mixing
+@run main JSpinnerInGlassPaneOverlapping
+ */
+public class JSpinnerInGlassPaneOverlapping extends GlassPaneOverlappingTestBase {
+
+    {testResize = false;}
+
+    public JSpinnerInGlassPaneOverlapping() {
+        super(false);
+    }
+
+//    static {debugClassName = "Choice";}
+    @Override
+    protected JComponent getSwingComponent() {
+        JSpinner ch = new JSpinner();
+        ch.setPreferredSize(new Dimension(30, 50));
+        ch.addChangeListener(new ChangeListener() {
+
+            public void stateChanged(ChangeEvent e) {
+                wasLWClicked = true;
+            }
+        });
+        return ch;
+    }
+
+    // this strange plumbing stuff is required due to "Standard Test Machinery" in base class
+    public static void main(String args[]) throws InterruptedException {
+        instance = new JSpinnerInGlassPaneOverlapping();
+        OverlappingTestBase.doMain(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JSpinnerOverlapping.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Dimension;
+import javax.swing.event.ChangeEvent;
+import javax.swing.*;
+import javax.swing.event.ChangeListener;
+
+/**
+ * AWT/Swing overlapping test for {@link javax.swing.JSpinner } component.
+ * <p>See base class for details.
+ */
+/*
+@test
+@summary Simple Overlapping test for javax.swing.JSpinner
+@author sergey.grinev@oracle.com: area=awt.mixing
+@run main JSpinnerOverlapping
+ */
+public class JSpinnerOverlapping extends SimpleOverlappingTestBase {
+
+    public JSpinnerOverlapping() {
+        super(false);
+    }
+
+//    static {debugClassName = "Choice";}
+    @Override
+    protected JComponent getSwingComponent() {
+        JSpinner ch = new JSpinner();
+        ch.setPreferredSize(new Dimension(30, 50));
+        ch.addChangeListener(new ChangeListener() {
+
+            public void stateChanged(ChangeEvent e) {
+                wasLWClicked = true;
+            }
+        });
+        return ch;
+    }
+
+    // this strange plumbing stuff is required due to "Standard Test Machinery" in base class
+    public static void main(String args[]) throws InterruptedException {
+        instance = new JSpinnerOverlapping();
+        OverlappingTestBase.doMain(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JSplitPaneOverlapping.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,130 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.GridLayout;
+import java.awt.Point;
+import java.awt.Robot;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.InputEvent;
+import javax.swing.JButton;
+import javax.swing.JFrame;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JSplitPane;
+import javax.swing.SwingUtilities;
+
+/**
+ * AWT/Swing overlapping test for {@link javax.swing.JSplitPane } component.
+ * <p>This test creates puts heavyweight and lightweight components into different panels and test if splitter image and components itself are drawn correctly.
+ * <p>See base class for test info.
+ */
+/*
+@test
+@bug 6986109
+@summary Overlapping test for javax.swing.JSplitPane
+@author sergey.grinev@oracle.com: area=awt.mixing
+@run main JSplitPaneOverlapping
+ */
+public class JSplitPaneOverlapping extends OverlappingTestBase {
+
+    private boolean clicked = false;
+    private Point splitterLoc;
+    private JScrollPane sp1;
+    private JScrollPane sp2;
+
+    protected void prepareControls() {
+        JFrame frame = new JFrame("SplitPane Mixing");
+        JPanel p = new JPanel(new GridLayout());
+        p.setPreferredSize(new Dimension(500, 500));
+        propagateAWTControls(p);
+        sp1 = new JScrollPane(p);
+
+        JButton button = new JButton("JButton");
+        button.setBackground(Color.RED);
+        button.addActionListener(new ActionListener() {
+
+            public void actionPerformed(ActionEvent e) {
+                clicked = true;
+            }
+        });
+        sp2 = new JScrollPane(button);
+
+        JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, sp1, sp2);
+        splitPane.setOneTouchExpandable(false);
+        splitPane.setDividerLocation(150);
+
+        splitPane.setPreferredSize(new Dimension(400, 200));
+
+        frame.getContentPane().add(splitPane);
+        frame.pack();
+        frame.setVisible(true);
+    }
+
+    private static final boolean ignoreFail = false;
+
+    @Override
+    protected boolean performTest() {
+        try {
+            SwingUtilities.invokeAndWait(new Runnable() {
+                public void run() {
+                    splitterLoc = sp2.getLocationOnScreen();
+                    Point leftLoc = sp1.getLocationOnScreen();
+                    leftLoc.translate(sp1.getWidth(), 0);
+                    splitterLoc.translate(-(splitterLoc.x - leftLoc.x) / 2, 30);
+                }
+            });
+        } catch (Exception e) {
+            e.printStackTrace();
+            System.exit(1);
+        }
+        // run robot
+        Robot robot = Util.createRobot();
+        robot.setAutoDelay(ROBOT_DELAY);
+
+        robot.mouseMove(splitterLoc.x, splitterLoc.y);
+        Util.waitForIdle(robot);
+
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.mouseMove(splitterLoc.x - 50, splitterLoc.y);
+        Color c = robot.getPixelColor(splitterLoc.x - 50, splitterLoc.y);
+        System.out.println("Actual: "+c+", (not) expected: "+AWT_VERIFY_COLOR+" at "+(splitterLoc.x - 50)+", "+ splitterLoc.y);
+        if (!ignoreFail && c.equals(AWT_VERIFY_COLOR)) {
+            fail("The JSplitPane drag-n-drop image did not pass pixel color check and is overlapped");
+        }
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+
+        clickAndBlink(robot, splitterLoc);
+
+        return clicked;
+    }
+
+    // this strange plumbing stuff is required due to "Standard Test Machinery" in base class
+    public static void main(String args[]) throws InterruptedException {
+        instance = new JSplitPaneOverlapping();
+        OverlappingTestBase.doMain(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JTableInGlassPaneOverlapping.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+import javax.swing.JComponent;
+import javax.swing.JTable;
+import javax.swing.event.TableModelEvent;
+import javax.swing.event.TableModelListener;
+
+/**
+ * AWT/Swing overlapping test for {@link javax.swing.JTable } component in GlassPane.
+ * <p>See base class for details.
+ */
+/*
+@test
+@summary Simple Overlapping test for JTable
+@author sergey.grinev@oracle.com: area=awt.mixing
+@run main JTableInGlassPaneOverlapping
+ */
+public class JTableInGlassPaneOverlapping extends GlassPaneOverlappingTestBase {
+
+    {
+        testResize = false;
+    }
+
+    @Override
+    protected JComponent getSwingComponent() {
+        // Create columns names
+        String columnNames[] = {"Column 1", "Column 2", "Column 3"};
+
+        // Create some data
+        String dataValues[][] = {
+            {"12", "234", "67"},
+            {"-123", "43", "853"},
+            {"93", "89.2", "109"},
+            {"279", "9033", "3092"},
+            {"12", "234", "67"},
+            {"-123", "43", "853"},
+            {"93", "89.2", "109"},
+            {"279", "9033", "3092"},
+            {"12", "234", "67"},
+            {"-123", "43", "853"},
+            {"93", "89.2", "109"},
+            {"279", "9033", "3092"},
+            {"12", "234", "67"},
+            {"-123", "43", "853"},
+            {"93", "89.2", "109"},
+            {"279", "9033", "3092"}
+        };
+
+        // Create a new table instance
+        JTable jt = new JTable(dataValues, columnNames);
+        jt.getModel().addTableModelListener(new TableModelListener() {
+
+            public void tableChanged(TableModelEvent e) {
+                System.err.println("table changed");
+            }
+        });
+        return jt;
+    }
+
+    // this strange plumbing stuff is required due to "Standard Test Machinery" in base class
+    public static void main(String args[]) throws InterruptedException {
+        instance = new JTableInGlassPaneOverlapping();
+        OverlappingTestBase.doMain(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JTableOverlapping.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+
+/**
+ * AWT/Swing overlapping test for {@link javax.swing.JTable } component.
+ * <p>See base class for details.
+ */
+/*
+@test
+@summary Simple Overlapping test for JTable
+@author sergey.grinev@oracle.com: area=awt.mixing
+@run main JTableOverlapping
+ */
+public class JTableOverlapping extends SimpleOverlappingTestBase {
+
+    @Override
+    protected JComponent getSwingComponent() {
+        // Create columns names
+        String columnNames[] = { "Column 1", "Column 2", "Column 3" };
+
+        // Create some data
+        String dataValues[][] =
+        {
+            { "12", "234", "67" },
+            { "-123", "43", "853" },
+            { "93", "89.2", "109" },
+            { "279", "9033", "3092" },
+            { "12", "234", "67" },
+            { "-123", "43", "853" },
+            { "93", "89.2", "109" },
+            { "279", "9033", "3092" },
+            { "12", "234", "67" },
+            { "-123", "43", "853" },
+            { "93", "89.2", "109" },
+            { "279", "9033", "3092" },
+            { "12", "234", "67" },
+            { "-123", "43", "853" },
+            { "93", "89.2", "109" },
+            { "279", "9033", "3092" }
+        };
+
+        // Create a new table instance
+        return new JTable( dataValues, columnNames );
+    }
+
+    // this strange plumbing stuff is required due to "Standard Test Machinery" in base class
+    public static void main(String args[]) throws InterruptedException {
+        instance = new JTableOverlapping();
+        OverlappingTestBase.doMain(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JTextAreaInGlassPaneOverlapping.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+import java.awt.Dimension;
+import javax.swing.*;
+
+/**
+ * AWT/Swing overlapping test for {@link javax.swing.JTextArea } component in GlassPane.
+ * <p>See base class for details.
+ */
+/*
+@test
+@summary Simple Overlapping test for javax.swing.JLabel
+@author sergey.grinev@oracle.com: area=awt.mixing
+@run main JTextAreaInGlassPaneOverlapping
+ */
+public class JTextAreaInGlassPaneOverlapping extends GlassPaneOverlappingTestBase {
+
+    @Override
+    protected JComponent getSwingComponent() {
+        JTextArea ch = new JTextArea();
+        ch.setPreferredSize(new Dimension(50, 50));
+        ch.setText("Swing component");
+        return ch;
+    }
+
+    // this strange plumbing stuff is required due to "Standard Test Machinery" in base class
+    public static void main(String args[]) throws InterruptedException {
+        instance = new JTextAreaInGlassPaneOverlapping();
+        OverlappingTestBase.doMain(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JTextAreaOverlapping.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Dimension;
+import javax.swing.*;
+
+/**
+ * AWT/Swing overlapping test for {@link javax.swing.JTextArea } component.
+ * <p>See base class for details.
+ */
+/*
+@test
+@summary Simple Overlapping test for javax.swing.JLabel
+@author sergey.grinev@oracle.com: area=awt.mixing
+@run main JTextAreaOverlapping
+ */
+public class JTextAreaOverlapping extends SimpleOverlappingTestBase {
+
+    @Override
+    protected JComponent getSwingComponent() {
+        JTextArea ch = new JTextArea();
+        ch.setPreferredSize(new Dimension(50, 50));
+        ch.setText("Swing component");
+        return ch;
+    }
+
+    // this strange plumbing stuff is required due to "Standard Test Machinery" in base class
+    public static void main(String args[]) throws InterruptedException {
+        instance = new JTextAreaOverlapping();
+        OverlappingTestBase.doMain(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JTextFieldInGlassPaneOverlapping.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+import java.awt.Dimension;
+import javax.swing.*;
+
+/**
+ * AWT/Swing overlapping test for {@link javax.swing.JTextField } component in GlassPane.
+ * <p>See base class for details.
+ */
+/*
+@test
+@summary Simple Overlapping test for javax.swing.JLabel
+@author sergey.grinev@oracle.com: area=awt.mixing
+@run main JTextFieldInGlassPaneOverlapping
+ */
+public class JTextFieldInGlassPaneOverlapping extends GlassPaneOverlappingTestBase {
+
+    @Override
+    protected JComponent getSwingComponent() {
+        JTextField ch = new JTextField();
+        ch.setPreferredSize(new Dimension(50, 50));
+        ch.setText("Swing component");
+        return ch;
+    }
+
+    // this strange plumbing stuff is required due to "Standard Test Machinery" in base class
+    public static void main(String args[]) throws InterruptedException {
+        instance = new JTextFieldInGlassPaneOverlapping();
+        OverlappingTestBase.doMain(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JTextFieldOverlapping.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Dimension;
+import javax.swing.*;
+
+/**
+ * AWT/Swing overlapping test for {@link javax.swing.JTextField } component.
+ * <p>See base class for details.
+ */
+/*
+@test
+@summary Simple Overlapping test for javax.swing.JLabel
+@author sergey.grinev@oracle.com: area=awt.mixing
+@run main JTextFieldOverlapping
+ */
+public class JTextFieldOverlapping extends SimpleOverlappingTestBase {
+
+    @Override
+    protected JComponent getSwingComponent() {
+        JTextField ch = new JTextField();
+        ch.setPreferredSize(new Dimension(50, 50));
+        ch.setText("Swing component");
+        return ch;
+    }
+
+    // this strange plumbing stuff is required due to "Standard Test Machinery" in base class
+    public static void main(String args[]) throws InterruptedException {
+        instance = new JTextFieldOverlapping();
+        OverlappingTestBase.doMain(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JToggleButtonInGlassPaneOverlapping.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+import javax.swing.*;
+
+/**
+ * AWT/Swing overlapping test for {@link javax.swing.JToggleButton } component in GlassPane.
+ * <p>See base class for details.
+ */
+/*
+@test
+@summary Simple Overlapping test for javax.swing.JToggleButton
+@author sergey.grinev@oracle.com: area=awt.mixing
+@run main JToggleButtonInGlassPaneOverlapping
+ */
+public class JToggleButtonInGlassPaneOverlapping extends GlassPaneOverlappingTestBase {
+
+    @Override
+    protected JComponent getSwingComponent() {
+        JToggleButton ch = new JToggleButton();
+        ch.setText("Swing component");
+        return ch;
+    }
+
+    // this strange plumbing stuff is required due to "Standard Test Machinery" in base class
+    public static void main(String args[]) throws InterruptedException {
+        instance = new JToggleButtonInGlassPaneOverlapping();
+        OverlappingTestBase.doMain(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JToggleButtonOverlapping.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+
+/**
+ * AWT/Swing overlapping test for {@link javax.swing.JToggleButton } component.
+ * <p>See base class for details.
+ */
+/*
+@test
+@summary Simple Overlapping test for javax.swing.JToggleButton
+@author sergey.grinev@oracle.com: area=awt.mixing
+@run main JToggleButtonOverlapping
+ */
+public class JToggleButtonOverlapping extends SimpleOverlappingTestBase {
+
+    @Override
+    protected JComponent getSwingComponent() {
+        JToggleButton ch = new JToggleButton();
+        ch.setText("Swing component");
+        return ch;
+    }
+
+    // this strange plumbing stuff is required due to "Standard Test Machinery" in base class
+    public static void main(String args[]) throws InterruptedException {
+        instance = new JToggleButtonOverlapping();
+        OverlappingTestBase.doMain(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Mixing/AWT_Mixing/MixingFrameResizing.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,127 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Point;
+import java.awt.Robot;
+import java.awt.event.InputEvent;
+import javax.swing.JFrame;
+import javax.swing.SpringLayout;
+import javax.swing.SwingUtilities;
+
+/**
+ * AWT/Swing overlapping test.
+ * <p>This test puts heavyweight component into JFrame and verifies that it's being drawn correctly after resizing the frame.
+ * <p>See base class for test info.
+ */
+/*
+@test
+@bug 6777370
+@summary Issues when resizing the JFrame with HW components
+@author sergey.grinev@oracle.com: area=awt.mixing
+@run main MixingFrameResizing
+ */
+public class MixingFrameResizing extends OverlappingTestBase {
+
+    {testEmbeddedFrame = true;}
+
+    private JFrame frame = null;
+    private Point lLoc;
+    private Point lLoc2;
+    private Dimension size;
+
+    protected void prepareControls() {
+        if(frame != null) {
+            frame.setVisible(false);
+        }
+        frame = new JFrame("Mixing : Frame Resizing test");
+        frame.setLayout(new SpringLayout());
+        frame.setSize(50, 50);
+        frame.setVisible(true);
+        propagateAWTControls(frame);
+        Util.waitTillShown(frame);
+    }
+
+    @Override
+    protected boolean performTest() {
+        int BORDER_SHIFT = frameBorderCounter();
+        BORDER_SHIFT = Math.abs(BORDER_SHIFT) == 1 ? BORDER_SHIFT : (BORDER_SHIFT / 2);
+        try {
+            SwingUtilities.invokeAndWait(new Runnable() {
+                public void run() {
+                    lLoc = frame.getLocationOnScreen();
+                    size = frame.getSize();
+                    lLoc2 = frame.getContentPane().getLocationOnScreen();
+                }
+            });
+        } catch (Exception e) {
+            e.printStackTrace();
+            System.exit(1);
+        }
+        Robot robot = Util.createRobot();
+        robot.setAutoDelay(ROBOT_DELAY/2);
+
+        // resize window
+        robot.mouseMove(lLoc.x + size.width / 2 + BORDER_SHIFT, lLoc.y + size.height + BORDER_SHIFT);
+        Util.waitForIdle(robot);
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        for (int i = 0; i < 10; i++) {
+            robot.mouseMove(lLoc.x + size.width / 2 + BORDER_SHIFT, lLoc.y + size.height + BORDER_SHIFT + 20 * i);
+        }
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+
+        robot.mouseMove(lLoc.x + size.width + BORDER_SHIFT, lLoc.y + size.height + BORDER_SHIFT);
+        Util.waitForIdle(robot);
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        for (int i = 0; i < 10; i++) {
+            robot.mouseMove(lLoc.x + size.width + BORDER_SHIFT + 20 * i, lLoc.y + size.height + BORDER_SHIFT);
+        }
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+
+        Util.waitForIdle(robot);
+        // check if component is visible on the opened space
+        try {
+            Thread.sleep(300); //some more wait for Solaris (for some reason)
+        }catch(Exception ex) {}
+        lLoc2.translate(75, 75);
+        Color c = robot.getPixelColor(lLoc2.x, lLoc2.y);
+        System.out.println("Actual: "+c+", expected: "+AWT_VERIFY_COLOR);
+
+        if (!c.equals(AWT_VERIFY_COLOR)) {
+            fail("HW component is not visible after resizing");
+        }
+
+        return true;
+    }
+
+    // this strange plumbing stuff is required due to "Standard Test Machinery" in base class
+    public static void main(String args[]) throws InterruptedException {
+        if (System.getProperty("os.name").toLowerCase().contains("os x")) {
+            System.out.println("Aqua L&F ignores setting color to component. Test passes on Mac OS X.");
+            return;
+        }
+        instance = new MixingFrameResizing();
+        OverlappingTestBase.doMain(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Mixing/AWT_Mixing/MixingPanelsResizing.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,462 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+import java.awt.*;
+import java.awt.event.InputEvent;
+import javax.swing.*;
+import java.io.*;
+
+/**
+ * AWT/Swing overlapping test for Panel and JPanel behavior during resizing.
+ * <p>See <a href="https://bugs.openjdk.java.net/browse/JDK-6786219">JDK-6786219</a> for details
+ */
+/*
+@test
+@bug 6786219
+@summary Issues when resizing the frame after mixing of heavy weight & light weight components
+@author sergey.grinev@oracle.com: area=awt.mixing
+@build FrameBorderCounter
+@run main MixingPanelsResizing
+ */
+public class MixingPanelsResizing {
+
+    static volatile boolean failed = false;
+
+    private static JFrame frame;
+    private static JButton jbutton;
+    private static Button awtButton;
+    private static JButton jbutton2;
+    private static Button awtButton2;
+    private static final Color jbColor = Color.RED;
+    private static final Color awtColor = Color.ORANGE;
+    private static final Color jb2Color = Color.BLUE;
+    private static final Color awt2Color = Color.CYAN;
+    private static final int ROBOT_DELAY = 500;
+
+    private static Point lLoc;
+    private static int borderShift;
+
+    private static int frameBorderCounter() {
+        String JAVA_HOME = System.getProperty("java.home");
+        try {
+            Process p = Runtime.getRuntime().exec(JAVA_HOME + "/bin/java FrameBorderCounter");
+            try {
+                p.waitFor();
+            } catch (InterruptedException e) {
+                e.printStackTrace();
+                throw new RuntimeException(e);
+            }
+            if (p.exitValue() != 0) {
+                throw new RuntimeException("FrameBorderCounter exited with not null code!\n" + readInputStream(p.getErrorStream()));
+            }
+            return Integer.parseInt(readInputStream(p.getInputStream()).trim());
+        } catch (IOException e) {
+            e.printStackTrace();
+            throw new RuntimeException(e);
+        }
+    }
+
+    private static String readInputStream(InputStream is) throws IOException {
+        byte[] buffer = new byte[4096];
+        int len = 0;
+        StringBuilder sb = new StringBuilder();
+        try (InputStreamReader isr = new InputStreamReader(is)) {
+            while ((len = is.read(buffer)) > 0) {
+                sb.append(new String(buffer, 0, len));
+            }
+        }
+        return sb.toString();
+    }
+
+    private static void init() throws Exception {
+        //*** Create instructions for the user here ***
+
+        borderShift = frameBorderCounter();
+        borderShift = Math.abs(borderShift) == 1 ? borderShift : (borderShift / 2);
+        String[] instructions = {
+            "This is an AUTOMATIC test, simply wait until it is done.",
+            "The result (passed or failed) will be shown in the",
+            "message window below."
+        };
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                Sysout.createDialog();
+                Sysout.printInstructions(instructions);
+
+                // prepare controls
+
+                frame = new JFrame();
+
+                Panel awtPanel = new Panel();
+                awtPanel.setBackground(Color.GREEN);
+                awtButton = new Button("AWTButton");
+                awtPanel.add(awtButton);
+                awtButton.setForeground(awtColor);
+                awtButton.setBackground(awtColor);
+                jbutton = new JButton("SwingButton");
+                awtPanel.add(jbutton);
+                jbutton.setForeground(jbColor);
+                jbutton.setBackground(jbColor);
+
+                JPanel jPanel = new JPanel();
+                jbutton2 = new JButton("SwingButton2");
+                jPanel.add(jbutton2);
+                jbutton2.setForeground(jb2Color);
+                jbutton2.setBackground(jb2Color);
+                awtButton2 = new Button("AWT Button2");
+                jPanel.add(awtButton2);
+                awtButton2.setForeground(awt2Color);
+                awtButton2.setBackground(awt2Color);
+                jPanel.setBackground(Color.YELLOW);
+
+                frame.add(awtPanel, BorderLayout.SOUTH);
+                frame.add(jPanel, BorderLayout.NORTH);
+
+                frame.pack();
+                frame.setVisible(true);
+            }
+        });
+
+        /////////////////////////
+
+        final Robot robot = Util.createRobot();
+        robot.setAutoDelay(ROBOT_DELAY);
+
+        Util.waitForIdle(robot);
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                lLoc = frame.getLocationOnScreen();
+                lLoc.translate(frame.getWidth() + borderShift, frame.getHeight() + borderShift);
+            }
+        });
+
+        //grow
+        robot.mouseMove(lLoc.x, lLoc.y);
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+
+        Runnable test = new Runnable() {
+
+            public void run() {
+                Point btnLoc = jbutton.getLocationOnScreen();
+                Color c = robot.getPixelColor(btnLoc.x + 5, btnLoc.y + 5);
+                if (!c.equals(jbColor)) {
+                    fail("JButton was not redrawn properly on AWT Panel during move");
+                }
+
+                btnLoc = awtButton.getLocationOnScreen();
+                c = robot.getPixelColor(btnLoc.x + 5, btnLoc.y + 5);
+                if (!c.equals(awtColor)) {
+                    fail("AWT Button was not redrawn properly on AWT Panel during move");
+                }
+
+                btnLoc = jbutton2.getLocationOnScreen();
+                c = robot.getPixelColor(btnLoc.x + 5, btnLoc.y + 5);
+                if (!c.equals(jb2Color)) {
+                    fail("JButton was not redrawn properly on JPanel during move");
+                }
+
+                btnLoc = awtButton2.getLocationOnScreen();
+                c = robot.getPixelColor(btnLoc.x + 5, btnLoc.y + 5);
+                if (!c.equals(awt2Color)) {
+                    fail("ATW Button was not redrawn properly on JPanel during move");
+                }
+            }
+        };
+
+        for (int i = 0; i < 30; i++) {
+            test.run();
+            robot.mouseMove(lLoc.x + 20 * i, lLoc.y + 10 * i);
+        }
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+
+        //back
+        System.out.println("fast back");
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        for (int i = 5; i >= 0; i--) {
+            test.run();
+            robot.mouseMove(lLoc.x + 120 * i, lLoc.y + 60 * i);
+        }
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+
+        pass();
+    }//End  init()
+    /*****************************************************
+     * Standard Test Machinery Section
+     * DO NOT modify anything in this section -- it's a
+     * standard chunk of code which has all of the
+     * synchronisation necessary for the test harness.
+     * By keeping it the same in all tests, it is easier
+     * to read and understand someone else's test, as
+     * well as insuring that all tests behave correctly
+     * with the test harness.
+     * There is a section following this for test-
+     * classes
+     ******************************************************/
+    private static boolean theTestPassed = false;
+    private static boolean testGeneratedInterrupt = false;
+    private static String failureMessage = "";
+    private static Thread mainThread = null;
+    private static int sleepTime = 300000;
+
+    // Not sure about what happens if multiple of this test are
+    //  instantiated in the same VM.  Being static (and using
+    //  static vars), it aint gonna work.  Not worrying about
+    //  it for now.
+    public static void main(String args[]) throws Exception {
+        if (!Toolkit.getDefaultToolkit().isDynamicLayoutActive()) {
+            System.out.println("Dynamic layout is not active. Test passes.");
+            return;
+        }
+        mainThread = Thread.currentThread();
+        try {
+            init();
+        } catch (TestPassedException e) {
+            //The test passed, so just return from main and harness will
+            // interepret this return as a pass
+            return;
+        }
+        //At this point, neither test pass nor test fail has been
+        // called -- either would have thrown an exception and ended the
+        // test, so we know we have multiple threads.
+
+        //Test involves other threads, so sleep and wait for them to
+        // called pass() or fail()
+        try {
+            Thread.sleep(sleepTime);
+            //Timed out, so fail the test
+            throw new RuntimeException("Timed out after " + sleepTime / 1000 + " seconds");
+        } catch (InterruptedException e) {
+            //The test harness may have interrupted the test.  If so, rethrow the exception
+            // so that the harness gets it and deals with it.
+            if (!testGeneratedInterrupt) {
+                throw e;
+            }
+
+            //reset flag in case hit this code more than once for some reason (just safety)
+            testGeneratedInterrupt = false;
+
+            if (theTestPassed == false) {
+                throw new RuntimeException(failureMessage);
+            }
+        }
+
+    }//main
+
+    public static synchronized void setTimeoutTo(int seconds) {
+        sleepTime = seconds * 1000;
+    }
+
+    public static synchronized void pass() {
+        Sysout.println("The test passed.");
+        Sysout.println("The test is over, hit  Ctl-C to stop Java VM");
+        //first check if this is executing in main thread
+        if (mainThread == Thread.currentThread()) {
+            //Still in the main thread, so set the flag just for kicks,
+            // and throw a test passed exception which will be caught
+            // and end the test.
+            theTestPassed = true;
+            throw new TestPassedException();
+        }
+        theTestPassed = true;
+        testGeneratedInterrupt = true;
+        mainThread.interrupt();
+    }//pass()
+
+    public static synchronized void fail() {
+        //test writer didn't specify why test failed, so give generic
+        fail("it just plain failed! :-)");
+    }
+
+    public static synchronized void fail(String whyFailed) {
+        Sysout.println("The test failed: " + whyFailed);
+        Sysout.println("The test is over, hit  Ctl-C to stop Java VM");
+        //check if this called from main thread
+        if (mainThread == Thread.currentThread()) {
+            //If main thread, fail now 'cause not sleeping
+            throw new RuntimeException(whyFailed);
+        }
+        theTestPassed = false;
+        testGeneratedInterrupt = true;
+        failureMessage = whyFailed;
+        mainThread.interrupt();
+    }//fail()
+}// class JButtonInGlassPane
+class TestPassedException extends RuntimeException {
+}
+
+//*********** End Standard Test Machinery Section **********
+//************ Begin classes defined for the test ****************
+// if want to make listeners, here is the recommended place for them, then instantiate
+//  them in init()
+
+/* Example of a class which may be written as part of a test
+class NewClass implements anInterface
+{
+static int newVar = 0;
+
+public void eventDispatched(AWTEvent e)
+{
+//Counting events to see if we get enough
+eventCount++;
+
+if( eventCount == 20 )
+{
+//got enough events, so pass
+
+JButtonInGlassPane.pass();
+}
+else if( tries == 20 )
+{
+//tried too many times without getting enough events so fail
+
+JButtonInGlassPane.fail();
+}
+
+}// eventDispatched()
+
+}// NewClass class
+
+ */
+//************** End classes defined for the test *******************
+/****************************************************
+Standard Test Machinery
+DO NOT modify anything below -- it's a standard
+chunk of code whose purpose is to make user
+interaction uniform, and thereby make it simpler
+to read and understand someone else's test.
+ ****************************************************/
+/**
+This is part of the standard test machinery.
+It creates a dialog (with the instructions), and is the interface
+for sending text messages to the user.
+To print the instructions, send an array of strings to Sysout.createDialog
+WithInstructions method.  Put one line of instructions per array entry.
+To display a message for the tester to see, simply call Sysout.println
+with the string to be displayed.
+This mimics System.out.println but works within the test harness as well
+as standalone.
+ */
+class Sysout {
+
+    private static TestDialog dialog;
+
+    public static void createDialogWithInstructions(String[] instructions) {
+        dialog = new TestDialog(new Frame(), "Instructions");
+        dialog.printInstructions(instructions);
+        dialog.setVisible(true);
+        println("Any messages for the tester will display here.");
+    }
+
+    public static void createDialog() {
+        dialog = new TestDialog(new Frame(), "Instructions");
+        String[] defInstr = {"Instructions will appear here. ", ""};
+        dialog.printInstructions(defInstr);
+        dialog.setVisible(true);
+        println("Any messages for the tester will display here.");
+    }
+
+    public static void printInstructions(String[] instructions) {
+        dialog.printInstructions(instructions);
+    }
+
+    public static void println(String messageIn) {
+        dialog.displayMessage(messageIn);
+        System.out.println(messageIn);
+    }
+}// Sysout  class
+
+/**
+This is part of the standard test machinery.  It provides a place for the
+test instructions to be displayed, and a place for interactive messages
+to the user to be displayed.
+To have the test instructions displayed, see Sysout.
+To have a message to the user be displayed, see Sysout.
+Do not call anything in this dialog directly.
+ */
+class TestDialog extends Dialog {
+
+    TextArea instructionsText;
+    TextArea messageText;
+    int maxStringLength = 80;
+
+    //DO NOT call this directly, go through Sysout
+    public TestDialog(Frame frame, String name) {
+        super(frame, name);
+        int scrollBoth = TextArea.SCROLLBARS_BOTH;
+        instructionsText = new TextArea("", 15, maxStringLength, scrollBoth);
+        add("North", instructionsText);
+
+        messageText = new TextArea("", 5, maxStringLength, scrollBoth);
+        add("Center", messageText);
+
+        pack();
+
+        setVisible(true);
+    }// TestDialog()
+
+    //DO NOT call this directly, go through Sysout
+    public void printInstructions(String[] instructions) {
+        //Clear out any current instructions
+        instructionsText.setText("");
+
+        //Go down array of instruction strings
+
+        String printStr, remainingStr;
+        for (int i = 0; i < instructions.length; i++) {
+            //chop up each into pieces maxSringLength long
+            remainingStr = instructions[i];
+            while (remainingStr.length() > 0) {
+                //if longer than max then chop off first max chars to print
+                if (remainingStr.length() >= maxStringLength) {
+                    //Try to chop on a word boundary
+                    int posOfSpace = remainingStr.lastIndexOf(' ', maxStringLength - 1);
+
+                    if (posOfSpace <= 0) {
+                        posOfSpace = maxStringLength - 1;
+                    }
+
+                    printStr = remainingStr.substring(0, posOfSpace + 1);
+                    remainingStr = remainingStr.substring(posOfSpace + 1);
+                } //else just print
+                else {
+                    printStr = remainingStr;
+                    remainingStr = "";
+                }
+
+                instructionsText.append(printStr + "\n");
+
+            }// while
+
+        }// for
+
+    }//printInstructions()
+
+    //DO NOT call this directly, go through Sysout
+    public void displayMessage(String messageIn) {
+        messageText.append(messageIn + "\n");
+        System.out.println(messageIn);
+    }
+}// TestDialog  class
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Mixing/AWT_Mixing/OpaqueOverlapping.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,164 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+import com.sun.awt.AWTUtilities;
+import java.awt.Frame;
+import java.awt.Panel;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.Robot;
+import java.awt.event.InputEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import javax.swing.JButton;
+import javax.swing.SwingUtilities;
+
+/**
+ * AWT/Swing overlapping test for opaque Swing components.
+ * <p>This test verify if AWT components are drawn correctly under opaque components.
+ * <p>See <a href="https://bugs.openjdk.java.net/browse/JDK-6776743">JDK-6776743</a> for details
+ * <p>See base class for test info.
+ */
+/*
+@test
+@bug 6776743
+@summary Opaque overlapping test for each AWT component
+@run main OpaqueOverlapping
+ */
+public class OpaqueOverlapping extends OverlappingTestBase {
+
+    {
+        useClickValidation = false;
+        failMessage = "Opacity test mismatchs";
+
+        // CR 6994264 (Choice autohides dropdown on Solaris 10)
+        skipClassNames = new String[] { "Choice" };
+    }
+    private String testSeq;
+    private final static String checkSeq = "010000101";
+    private Point heavyLoc;
+    private JButton light;
+    private Frame frame = null;
+
+    protected void prepareControls() {
+        testSeq = "";
+        // Create components
+        if(frame != null) {
+            frame.setVisible(false);
+        }
+        frame = new Frame("OpaqueOverlapping mixing test");
+        final Panel panel = new Panel();
+        panel.setLayout(null);
+
+        propagateAWTControls(panel);
+
+        // Overlap the buttons
+        currentAwtControl.setBounds(30, 30, 200, 200);
+
+        light = new JButton("  LW Button  ");
+        light.setBounds(10, 10, 50, 50);
+
+        // Put the components into the frame
+        panel.add(light);
+        frame.add(panel);
+        frame.setBounds(50, 50, 400, 400);
+        frame.setVisible(true);
+
+        currentAwtControl.addMouseListener(new MouseAdapter() {
+            @Override
+            public void mouseClicked(MouseEvent e) {
+                panel.setComponentZOrder(light, 0);
+                frame.validate();
+                testSeq = testSeq + "0";
+            }
+        });
+        light.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent e) {
+                panel.setComponentZOrder(currentAwtControl, 0);
+                frame.validate();
+                testSeq = testSeq + "1";
+            }
+        });
+    }
+
+    @Override
+    protected boolean performTest() {
+        try {
+            SwingUtilities.invokeAndWait(new Runnable() {
+                public void run() {
+                    heavyLoc = currentAwtControl.getLocationOnScreen();
+                }
+            });
+        } catch (Exception e) {
+        }
+        Robot robot = Util.createRobot();
+        robot.setAutoDelay(ROBOT_DELAY);
+
+        Util.waitForIdle(robot);
+
+        // Move the mouse pointer to the position where both
+        //    components overlap
+        robot.mouseMove(heavyLoc.x + 5, heavyLoc.y + 5);
+
+        // Now perform the click at this point for 9 times
+        // In the middle of the process toggle the opaque
+        // flag value.
+        for (int i = 0; i < 9; ++i) {
+            if (i == 3) {
+                AWTUtilities.setComponentMixingCutoutShape(light,
+                        new Rectangle());
+            }
+            if (i == 6) {
+                AWTUtilities.setComponentMixingCutoutShape(light,
+                        null);
+            }
+
+            robot.mousePress(InputEvent.BUTTON1_MASK);
+            robot.mouseRelease(InputEvent.BUTTON1_MASK);
+            Util.waitForIdle(robot);
+
+            if (currentAwtControl.getClass() == java.awt.Choice.class && i != 1 && i != 6 && i != 8) {
+                // due to the fact that Choice doesn't get mouseClicked event if its dropdown is shown
+                robot.mousePress(InputEvent.BUTTON1_MASK);
+                robot.mouseRelease(InputEvent.BUTTON1_MASK);
+                Util.waitForIdle(robot);
+            }
+        }
+
+        Util.waitForIdle(robot);
+
+        boolean result = testSeq.equals(checkSeq);
+        if (!result) {
+            System.err.println("Expected: " + checkSeq);
+            System.err.println("Observed: " + testSeq);
+        }
+        return result;
+    }
+
+    // this strange plumbing stuff is required due to "Standard Test Machinery" in base class
+    public static void main(String args[]) throws InterruptedException {
+        instance = new OpaqueOverlapping();
+        OverlappingTestBase.doMain(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Mixing/AWT_Mixing/OpaqueOverlappingChoice.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+/**
+ * AWT/Swing overlapping test for opaque Choice.
+ *
+ * This test case was separated from {@link OpaqueOverlapping} due to CR 6994264 (Choice autohides dropdown on Solaris 10)
+ */
+/*
+@test
+@bug 6994264
+@summary Opaque overlapping test for Choice AWT component
+@run main OpaqueOverlappingChoice
+ */
+public class OpaqueOverlappingChoice extends OpaqueOverlapping  {
+    {
+        onlyClassName = "Choice";
+        skipClassNames = null;
+    }
+
+    // this strange plumbing stuff is required due to "Standard Test Machinery" in base class
+    public static void main(String args[]) throws InterruptedException {
+        instance = new OpaqueOverlappingChoice();
+        OverlappingTestBase.doMain(args);
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Mixing/AWT_Mixing/OverlappingTestBase.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,800 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.awt.event.*;
+import java.awt.peer.ComponentPeer;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import javax.swing.*;
+import sun.awt.*;
+import java.io.*;
+
+/**
+ * <p>This class provides basis for AWT Mixing testing.
+ * <p>It provides all standard test machinery and should be used by
+ * extending and overriding next methods:
+ * <li> {@link OverlappingTestBase#prepareControls()} - setup UI components
+ * <li> {@link OverlappingTestBase#performTest()} -  run particular test
+ * Those methods would be run in the loop for each AWT component.
+ * <p>Current AWT component should be added to the tested UI by {@link OverlappingTestBase#propagateAWTControls(java.awt.Container) ()}.
+ * There AWT components are prepared to be tested as being overlayed by other (e.g. Swing) components - they are colored to
+ * {@link OverlappingTestBase#AWT_BACKGROUND_COLOR} and throws failure on catching mouse event.
+ * <p> Validation of component being overlayed should be tested by {@link OverlappingTestBase#clickAndBlink(java.awt.Robot, java.awt.Point) }
+ * See each method javadoc for more details.
+ *
+ * <p>Due to test machinery limitations all test should be run from their own main() by calling next coe
+ * <code>
+ *     public static void main(String args[]) throws InterruptedException {
+ *        instance = new YourTestInstance();
+ *        OverlappingTestBase.doMain(args);
+ *     }
+ * </code>
+ *
+ * @author Sergey Grinev
+ */
+public abstract class OverlappingTestBase {
+    // working variables
+    private static volatile boolean wasHWClicked = false;
+    private static volatile boolean passed = true;
+    // constants
+    /**
+     * Default color for AWT component used for validate correct drawing of overlapping. <b>Never</b> use it for lightweight components.
+     */
+    protected static final Color AWT_BACKGROUND_COLOR = new Color(21, 244, 54);
+    protected static Color AWT_VERIFY_COLOR = AWT_BACKGROUND_COLOR;
+    protected static final int ROBOT_DELAY = 500;
+    private static final String[] simpleAwtControls = {"Button", "Checkbox", "Label", "TextArea"};
+    /**
+     * Generic strings array. To be used for population of List based controls.
+     */
+    protected static final String[] petStrings = {"Bird", "Cat", "Dog", "Rabbit", "Rhynocephalia Granda", "Bear", "Tiger", "Mustang"};
+    // "properties"
+    /**
+     * Tests customization. Set this variable to test only control from java.awt
+     * <p>Usage of this variable should be marked with CR being the reason.
+     * <p>Do not use this variable simultaneously with {@link OverlappingTestBase#skipClassNames}
+     */
+    protected String onlyClassName = null;
+    /**
+     * For customizing tests. List classes' simple names to skip them from testings.
+     * <p>Usage of this variable should be marked with CR being the reason.
+     */
+    protected String[] skipClassNames = null;
+    /**
+     * Set to false to avoid event delivery validation
+     * @see OverlappingTestBase#clickAndBlink(java.awt.Robot, java.awt.Point, boolean)
+     */
+    protected boolean useClickValidation = true;
+    /**
+     * Set to false if test doesn't supposed to verify EmbeddedFrame
+     */
+    protected boolean testEmbeddedFrame = false;
+    /**
+     * Set this variable to true if testing embedded frame is impossible (on Mac, for instance, for now).
+     * The testEmbeddedFrame is explicitly set to true in dozen places.
+     */
+    protected boolean skipTestingEmbeddedFrame = false;
+
+    public static final boolean isMac = System.getProperty("os.name").toLowerCase().contains("os x");
+    private boolean isFrameBorderCalculated;
+    private int borderShift;
+
+    {    if (Toolkit.getDefaultToolkit().getClass().getName().matches(".*L.*Toolkit")) {
+             // No EmbeddedFrame in LWToolkit/LWCToolkit, yet
+             // And it should be programmed some other way, too, in any case
+             System.err.println("skipTestingEmbeddedFrame");
+             skipTestingEmbeddedFrame = true;
+         }else {
+             System.err.println("do not skipTestingEmbeddedFrame");
+         }
+    }
+
+    protected int frameBorderCounter() {
+        if (!isFrameBorderCalculated) {
+            try {
+                new FrameBorderCounter(); // force compilation by jtreg
+                String JAVA_HOME = System.getProperty("java.home");
+                Process p = Runtime.getRuntime().exec(JAVA_HOME + "/bin/java FrameBorderCounter");
+                try {
+                    p.waitFor();
+                } catch (InterruptedException e) {
+                    e.printStackTrace();
+                    throw new RuntimeException(e);
+                }
+                if (p.exitValue() != 0) {
+                    throw new RuntimeException("FrameBorderCounter exited with not null code!\n" + readInputStream(p.getErrorStream()));
+                }
+                borderShift = Integer.parseInt(readInputStream(p.getInputStream()).trim());
+                isFrameBorderCalculated = true;
+            } catch (IOException e) {
+                e.printStackTrace();
+                System.exit(1);
+            }
+        }
+        return borderShift;
+    }
+
+    public void getVerifyColor() {
+        try {
+            final int size = 200;
+            final SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+            final Point[] p = new Point[1];
+            SwingUtilities.invokeAndWait(new Runnable() {
+                public void run(){
+                    JFrame frame = new JFrame("set back");
+                    frame.getContentPane().setBackground(AWT_BACKGROUND_COLOR);
+                    frame.setSize(size, size);
+                    frame.setUndecorated(true);
+                    frame.setVisible(true);
+                    frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
+                    p[0] = frame.getLocation();
+                }
+            });
+            Robot robot = new Robot();
+            toolkit.realSync();
+            Thread.sleep(ROBOT_DELAY);
+            AWT_VERIFY_COLOR = robot.getPixelColor(p[0].x+size/2, p[0].y+size/2);
+            System.out.println("Color will be compared with " + AWT_VERIFY_COLOR + " instead of " + AWT_BACKGROUND_COLOR);
+        } catch (Exception e) {
+            System.err.println("Cannot get verify color: "+e.getMessage());
+        }
+    }
+
+    private String readInputStream(InputStream is) throws IOException {
+        byte[] buffer = new byte[4096];
+        int len = 0;
+        StringBuilder sb = new StringBuilder();
+        try (InputStreamReader isr = new InputStreamReader(is)) {
+            while ((len = is.read(buffer)) > 0) {
+                sb.append(new String(buffer, 0, len));
+            }
+        }
+        return sb.toString();
+    }
+
+    private void setupControl(final Component control) {
+        if (useClickValidation) {
+            control.addMouseListener(new MouseAdapter() {
+                @Override
+                public void mouseClicked(MouseEvent e) {
+                    System.err.println("ERROR: " + control.getClass() + " received mouse click.");
+                    wasHWClicked = true;
+                }
+            });
+        }
+        control.setBackground(AWT_BACKGROUND_COLOR);
+        control.setForeground(AWT_BACKGROUND_COLOR);
+        control.setPreferredSize(new Dimension(150, 150));
+        control.setFocusable(false);
+    }
+
+    private void addAwtControl(java.util.List<Component> container, final Component control) {
+        String simpleName = control.getClass().getSimpleName();
+        if (onlyClassName != null && !simpleName.equals(onlyClassName)) {
+            return;
+        }
+        if (skipClassNames != null) {
+            for (String skipMe : skipClassNames) {
+                if (simpleName.equals(skipMe)) {
+                    return;
+                }
+            }
+        }
+        setupControl(control);
+        container.add(control);
+    }
+
+    private void addSimpleAwtControl(java.util.List<Component> container, String className) {
+        try {
+            Class definition = Class.forName("java.awt." + className);
+            Constructor constructor = definition.getConstructor(new Class[]{String.class});
+            java.awt.Component component = (java.awt.Component) constructor.newInstance(new Object[]{"AWT Component " + className});
+            addAwtControl(container, component);
+        } catch (Exception ex) {
+            System.err.println(ex.getMessage());
+            fail("Setup error, this jdk doesn't have awt conrol " + className);
+        }
+    }
+
+    /**
+     * Adds current AWT control to container
+     * <p>N.B.: if testEmbeddedFrame == true this method will also add EmbeddedFrame over Canvas
+     * and it should be called <b>after</b> Frame.setVisible(true) call
+     * @param container container to hold AWT component
+     */
+    protected final void propagateAWTControls(Container container) {
+        if (currentAwtControl != null) {
+            container.add(currentAwtControl);
+        } else { // embedded frame
+            try {
+
+                //create embedder
+                Canvas embedder = new Canvas();
+                embedder.setBackground(Color.RED);
+                embedder.setPreferredSize(new Dimension(150, 150));
+                container.add(embedder);
+                container.setVisible(true); // create peer
+
+                long frameWindow = 0;
+                String getWindowMethodName = "getHWnd";
+                if (Toolkit.getDefaultToolkit().getClass().getName().contains("XToolkit")) {
+                    getWindowMethodName = "getWindow";
+                }
+                ComponentPeer peer = embedder.getPeer();
+//                System.err.println("Peer: " + peer);
+                Method getWindowMethod = peer.getClass().getMethod(getWindowMethodName);
+                frameWindow = (Long) getWindowMethod.invoke(peer);
+//                System.err.println("frame peer ID: " + frameWindow);
+
+                String eframeClassName = "sun.awt.windows.WEmbeddedFrame";
+                if (Toolkit.getDefaultToolkit().getClass().getName().contains("XToolkit")) {
+                    eframeClassName = "sun.awt.X11.XEmbeddedFrame";
+                }
+                Class eframeClass = Class.forName(eframeClassName);
+                Constructor eframeCtor = eframeClass.getConstructor(long.class);
+                EmbeddedFrame eframe = (EmbeddedFrame) eframeCtor.newInstance(frameWindow);
+                setupControl(eframe);
+                eframe.setSize(new Dimension(150, 150));
+                eframe.setVisible(true);
+//                System.err.println(eframe.getSize());
+            } catch (Exception ex) {
+                ex.printStackTrace();
+                fail("Failed to instantiate EmbeddedFrame: " + ex.getMessage());
+            }
+        }
+    }
+    private static final Font hugeFont = new Font("Arial", Font.BOLD, 70);
+
+    private java.util.List<Component> getAWTControls() {
+        java.util.List<Component> components = new ArrayList<Component>();
+
+        for (String clazz : simpleAwtControls) {
+            addSimpleAwtControl(components, clazz);
+        }
+
+        TextField tf = new TextField();
+        tf.setFont(hugeFont);
+        addAwtControl(components, tf);
+
+        // more complex controls
+        Choice c = new Choice();
+        for (int i = 0; i < petStrings.length; i++) {
+            c.add(petStrings[i]);
+        }
+        addAwtControl(components, c);
+        c.setPreferredSize(null);
+        c.setFont(hugeFont); // to make control bigger as setPrefferedSize don't do his job here
+
+        List l = new List(petStrings.length);
+        for (int i = 0; i < petStrings.length; i++) {
+            l.add(petStrings[i]);
+        }
+        addAwtControl(components, l);
+
+        Canvas canvas = new Canvas();
+        canvas.setSize(100, 200);
+        addAwtControl(components, canvas);
+
+        Scrollbar sb = new Scrollbar(Scrollbar.VERTICAL, 500, 1, 0, 500);
+        addAwtControl(components, sb);
+
+        Scrollbar sb2 = new Scrollbar(Scrollbar.HORIZONTAL, 500, 1, 0, 500);
+        addAwtControl(components, sb2);
+
+        return components;
+    }
+    /**
+     * Default shift for {@link OverlappingTestBase#clickAndBlink(java.awt.Robot, java.awt.Point) }
+     */
+    protected static Point shift = new Point(16, 16);
+
+    /**
+     * Verifies point using specified AWT Robot. Supposes <code>defaultShift == true</code> for {@link OverlappingTestBase#clickAndBlink(java.awt.Robot, java.awt.Point, boolean) }.
+     * This method is used to verify controls by providing just their plain screen coordinates.
+     * @param robot AWT Robot. Usually created by {@link Util#createRobot() }
+     * @param lLoc point to verify
+     * @see OverlappingTestBase#clickAndBlink(java.awt.Robot, java.awt.Point, boolean)
+     */
+    protected void clickAndBlink(Robot robot, Point lLoc) {
+        clickAndBlink(robot, lLoc, true);
+    }
+    /**
+     * Default failure message for color check
+     * @see OverlappingTestBase#performTest()
+     */
+    protected String failMessageColorCheck = "The LW component did not pass pixel color check and is overlapped";
+    /**
+     * Default failure message event check
+     * @see OverlappingTestBase#performTest()
+     */
+    protected String failMessage = "The LW component did not received the click.";
+
+    private static boolean isValidForPixelCheck(Component component) {
+        if ((component instanceof java.awt.Scrollbar) || isMac && (component instanceof java.awt.Button)) {
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * Preliminary validation - should be run <b>before</b> overlapping happens to ensure test is correct.
+     * @param robot AWT Robot. Usually created by {@link Util#createRobot() }
+     * @param lLoc point to validate to be <b>of</b> {@link OverlappingTestBase#AWT_BACKGROUND_COLOR}
+     * @param component tested component, should be pointed out as not all components are valid for pixel check.
+     */
+    protected void pixelPreCheck(Robot robot, Point lLoc, Component component) {
+        if (isValidForPixelCheck(component)) {
+            int tries = 10;
+            Color c = null;
+            while (tries-- > 0) {
+                c = robot.getPixelColor(lLoc.x, lLoc.y);
+                System.out.println("Precheck. color: "+c+" compare with "+AWT_VERIFY_COLOR);
+                if (c.equals(AWT_VERIFY_COLOR)) {
+                    return;
+                }
+                try {
+                    Thread.sleep(100);
+                } catch (InterruptedException e) {
+                }
+            }
+            System.err.println(lLoc + ": " + c);
+            fail("Dropdown test setup failure, colored part of AWT component is not located at click area");
+        }
+    }
+
+    /**
+     * Verifies point using specified AWT Robot.
+     * <p>Firstly, verifies point by color pixel check
+     * <p>Secondly, verifies event delivery by mouse click
+     * @param robot AWT Robot. Usually created by {@link Util#createRobot() }
+     * @param lLoc point to verify
+     * @param defaultShift if true verified position will be shifted by {@link OverlappingTestBase#shift }.
+     */
+    protected void clickAndBlink(Robot robot, Point lLoc, boolean defaultShift) {
+        Point loc = lLoc.getLocation();
+        //check color
+        Util.waitForIdle(robot);
+        try{
+            Thread.sleep(500);
+        }catch(Exception exx){
+            exx.printStackTrace();
+        }
+
+        if (defaultShift) {
+            loc.translate(shift.x, shift.y);
+        }
+        if (!(System.getProperty("os.name").toLowerCase().contains("os x"))) {
+            Color c = robot.getPixelColor(loc.x, loc.y);
+            System.out.println("C&B. color: "+c+" compare with "+AWT_VERIFY_COLOR);
+            if (c.equals(AWT_VERIFY_COLOR)) {
+                fail(failMessageColorCheck);
+                passed = false;
+            }
+
+            // perform click
+            Util.waitForIdle(robot);
+        }
+
+        robot.mouseMove(loc.x, loc.y);
+
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+        Util.waitForIdle(robot);
+    }
+
+    /**
+     * This method should be overriden with code which setups UI for testing.
+     * Code in this method <b>will</b> be called only from AWT thread so Swing operations can be called directly.
+     *
+     * @see {@link OverlappingTestBase#propagateAWTControls(java.awt.Container) } for instructions about adding tested AWT control to UI
+     */
+    protected abstract void prepareControls();
+
+    /**
+     * This method should be overriden with test execution. It will <b>not</b> be called from AWT thread so all Swing operations should be treated accordingly.
+     * @return true if test passed. Otherwise fail with default fail message.
+     * @see {@link OverlappingTestBase#failMessage} default fail message
+     */
+    protected abstract boolean performTest();
+    /**
+     * This method can be overriden with cleanup routines. It will be called from AWT thread so all Swing operations should be treated accordingly.
+     */
+    protected void cleanup() {
+        // intentionally do nothing
+    }
+    /**
+     * Currect tested AWT Control. Usually shouldn't be accessed directly.
+     *
+     * @see {@link OverlappingTestBase#propagateAWTControls(java.awt.Container) } for instructions about adding tested AWT control to UI
+     */
+    protected Component currentAwtControl;
+
+    private void testComponent(Component component) throws InterruptedException, InvocationTargetException {
+        currentAwtControl = component;
+        System.out.println("Testing " + currentAwtControl.getClass().getSimpleName());
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                prepareControls();
+            }
+        });
+        if (component != null) {
+            Util.waitTillShown(component);
+        }
+        Util.waitForIdle(null);
+        try {
+            Thread.sleep(500); // wait for graphic effects on systems like Win7
+        } catch (InterruptedException ex) {
+        }
+        if (!instance.performTest()) {
+            fail(failMessage);
+            passed = false;
+        }
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                cleanup();
+            }
+        });
+    }
+
+    private void testEmbeddedFrame() throws InvocationTargetException, InterruptedException {
+        System.out.println("Testing EmbeddedFrame");
+        currentAwtControl = null;
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                prepareControls();
+            }
+        });
+        Util.waitForIdle(null);
+        try {
+            Thread.sleep(500); // wait for graphic effects on systems like Win7
+        } catch (InterruptedException ex) {
+        }
+        if (!instance.performTest()) {
+            fail(failMessage);
+            passed = false;
+        }
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                cleanup();
+            }
+        });
+    }
+
+    private void testAwtControls() throws InterruptedException {
+        try {
+            for (Component component : getAWTControls()) {
+                testComponent(component);
+            }
+            if (testEmbeddedFrame && !skipTestingEmbeddedFrame) {
+                testEmbeddedFrame();
+            }
+        } catch (InvocationTargetException ex) {
+            ex.printStackTrace();
+            fail(ex.getMessage());
+        }
+    }
+    /**
+     * Used by standard test machinery. See usage at {@link OverlappingTestBase }
+     */
+    protected static OverlappingTestBase instance;
+
+    protected OverlappingTestBase() {
+        getVerifyColor();
+    }
+
+    /*****************************************************
+     * Standard Test Machinery Section
+     * DO NOT modify anything in this section -- it's a
+     * standard chunk of code which has all of the
+     * synchronisation necessary for the test harness.
+     * By keeping it the same in all tests, it is easier
+     * to read and understand someone else's test, as
+     * well as insuring that all tests behave correctly
+     * with the test harness.
+     * There is a section following this for test-
+     * classes
+     ******************************************************/
+    private static void init() throws InterruptedException {
+        //*** Create instructions for the user here ***
+        //System.setProperty("sun.awt.disableMixing", "true");
+
+        String[] instructions = {
+            "This is an AUTOMATIC test, simply wait until it is done.",
+            "The result (passed or failed) will be shown in the",
+            "message window below."
+        };
+        Sysout.createDialog();
+        Sysout.printInstructions(instructions);
+
+        instance.testAwtControls();
+
+        if (wasHWClicked) {
+            fail("HW component received the click.");
+            passed = false;
+        }
+        if (passed) {
+            pass();
+        }
+    }//End  init()
+    private static boolean theTestPassed = false;
+    private static boolean testGeneratedInterrupt = false;
+    private static String failureMessage = "";
+    private static Thread mainThread = null;
+    private static int sleepTime = 300000;
+
+    // Not sure about what happens if multiple of this test are
+    //  instantiated in the same VM.  Being static (and using
+    //  static vars), it aint gonna work.  Not worrying about
+    //  it for now.
+    /**
+     * Starting point for test runs. See usage at {@link OverlappingTestBase }
+     * @param args regular main args, not used.
+     * @throws InterruptedException
+     */
+    public static void doMain(String args[]) throws InterruptedException {
+        mainThread = Thread.currentThread();
+        try {
+            init();
+        } catch (TestPassedException e) {
+            //The test passed, so just return from main and harness will
+            // interepret this return as a pass
+            return;
+        }
+        //At this point, neither test pass nor test fail has been
+        // called -- either would have thrown an exception and ended the
+        // test, so we know we have multiple threads.
+
+        //Test involves other threads, so sleep and wait for them to
+        // called pass() or fail()
+        try {
+            Thread.sleep(sleepTime);
+            //Timed out, so fail the test
+            throw new RuntimeException("Timed out after " + sleepTime / 1000 + " seconds");
+        } catch (InterruptedException e) {
+            //The test harness may have interrupted the test.  If so, rethrow the exception
+            // so that the harness gets it and deals with it.
+            if (!testGeneratedInterrupt) {
+                throw e;
+            }
+
+            //reset flag in case hit this code more than once for some reason (just safety)
+            testGeneratedInterrupt = false;
+
+            if (theTestPassed == false) {
+                throw new RuntimeException(failureMessage);
+            }
+        }
+
+    }//main
+
+    /**
+     * Test will fail if not passed after this timeout. Default timeout is 300 seconds.
+     * @param seconds timeout in seconds
+     */
+    public static synchronized void setTimeoutTo(int seconds) {
+        sleepTime = seconds * 1000;
+    }
+
+    /**
+     * Set test as passed. Usually shoudn't be called directly.
+     */
+    public static synchronized void pass() {
+        Sysout.println("The test passed.");
+        Sysout.println("The test is over, hit  Ctl-C to stop Java VM");
+        //first check if this is executing in main thread
+        if (mainThread == Thread.currentThread()) {
+            //Still in the main thread, so set the flag just for kicks,
+            // and throw a test passed exception which will be caught
+            // and end the test.
+            theTestPassed = true;
+            throw new TestPassedException();
+        }
+        theTestPassed = true;
+        testGeneratedInterrupt = true;
+        mainThread.interrupt();
+    }//pass()
+
+    /**
+     * Fail test generic message.
+     */
+    public static synchronized void fail() {
+        //test writer didn't specify why test failed, so give generic
+        fail("it just plain failed! :-)");
+    }
+
+    /**
+     * Fail test providing specific reason.
+     * @param whyFailed reason
+     */
+    public static synchronized void fail(String whyFailed) {
+        Sysout.println("The test failed: " + whyFailed);
+        Sysout.println("The test is over, hit  Ctl-C to stop Java VM");
+        //check if this called from main thread
+        if (mainThread == Thread.currentThread()) {
+            //If main thread, fail now 'cause not sleeping
+            throw new RuntimeException(whyFailed);
+        }
+        theTestPassed = false;
+        testGeneratedInterrupt = true;
+        failureMessage = whyFailed;
+        mainThread.interrupt();
+    }//fail()
+}// class LWComboBox
+class TestPassedException extends RuntimeException {
+}
+
+//*********** End Standard Test Machinery Section **********
+//************ Begin classes defined for the test ****************
+// if want to make listeners, here is the recommended place for them, then instantiate
+//  them in init()
+
+/* Example of a class which may be written as part of a test
+class NewClass implements anInterface
+{
+static int newVar = 0;
+
+public void eventDispatched(AWTEvent e)
+{
+//Counting events to see if we get enough
+eventCount++;
+
+if( eventCount == 20 )
+{
+//got enough events, so pass
+
+LWComboBox.pass();
+}
+else if( tries == 20 )
+{
+//tried too many times without getting enough events so fail
+
+LWComboBox.fail();
+}
+
+}// eventDispatched()
+
+}// NewClass class
+
+ */
+//************** End classes defined for the test *******************
+/****************************************************
+Standard Test Machinery
+DO NOT modify anything below -- it's a standard
+chunk of code whose purpose is to make user
+interaction uniform, and thereby make it simpler
+to read and understand someone else's test.
+ ****************************************************/
+/**
+This is part of the standard test machinery.
+It creates a dialog (with the instructions), and is the interface
+for sending text messages to the user.
+To print the instructions, send an array of strings to Sysout.createDialog
+WithInstructions method.  Put one line of instructions per array entry.
+To display a message for the tester to see, simply call Sysout.println
+with the string to be displayed.
+This mimics System.out.println but works within the test harness as well
+as standalone.
+ */
+class Sysout {
+    private static TestDialog dialog;
+
+    public static void createDialogWithInstructions(String[] instructions) {
+        dialog = new TestDialog(new Frame(), "Instructions");
+        dialog.printInstructions(instructions);
+        //dialog.setVisible(true);
+        println("Any messages for the tester will display here.");
+    }
+
+    public static void createDialog() {
+        dialog = new TestDialog(new Frame(), "Instructions");
+        String[] defInstr = {"Instructions will appear here. ", ""};
+        dialog.printInstructions(defInstr);
+        //dialog.setVisible(true);
+        println("Any messages for the tester will display here.");
+    }
+
+    public static void printInstructions(String[] instructions) {
+        dialog.printInstructions(instructions);
+    }
+
+    public static void println(String messageIn) {
+        dialog.displayMessage(messageIn);
+        System.out.println(messageIn);
+    }
+}// Sysout  class
+
+/**
+This is part of the standard test machinery.  It provides a place for the
+test instructions to be displayed, and a place for interactive messages
+to the user to be displayed.
+To have the test instructions displayed, see Sysout.
+To have a message to the user be displayed, see Sysout.
+Do not call anything in this dialog directly.
+ */
+class TestDialog extends Dialog {
+    TextArea instructionsText;
+    TextArea messageText;
+    int maxStringLength = 80;
+
+    //DO NOT call this directly, go through Sysout
+    public TestDialog(Frame frame, String name) {
+        super(frame, name);
+        int scrollBoth = TextArea.SCROLLBARS_BOTH;
+        instructionsText = new TextArea("", 15, maxStringLength, scrollBoth);
+        add("North", instructionsText);
+
+        messageText = new TextArea("", 5, maxStringLength, scrollBoth);
+        add("Center", messageText);
+
+        pack();
+
+       //setVisible(true);
+    }// TestDialog()
+
+    //DO NOT call this directly, go through Sysout
+    public void printInstructions(String[] instructions) {
+        //Clear out any current instructions
+        instructionsText.setText("");
+
+        //Go down array of instruction strings
+
+        String printStr, remainingStr;
+        for (int i = 0; i < instructions.length; i++) {
+            //chop up each into pieces maxSringLength long
+            remainingStr = instructions[i];
+            while (remainingStr.length() > 0) {
+                //if longer than max then chop off first max chars to print
+                if (remainingStr.length() >= maxStringLength) {
+                    //Try to chop on a word boundary
+                    int posOfSpace = remainingStr.lastIndexOf(' ', maxStringLength - 1);
+
+                    if (posOfSpace <= 0) {
+                        posOfSpace = maxStringLength - 1;
+                    }
+
+                    printStr = remainingStr.substring(0, posOfSpace + 1);
+                    remainingStr = remainingStr.substring(posOfSpace + 1);
+                } //else just print
+                else {
+                    printStr = remainingStr;
+                    remainingStr = "";
+                }
+
+                instructionsText.append(printStr + "\n");
+
+            }// while
+
+        }// for
+
+    }//printInstructions()
+
+    //DO NOT call this directly, go through Sysout
+    public void displayMessage(String messageIn) {
+        messageText.append(messageIn + "\n");
+        System.out.println(messageIn);
+    }
+}// TestDialog  class
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Mixing/AWT_Mixing/SimpleOverlappingTestBase.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,160 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.awt.event.*;
+import javax.swing.*;
+
+/**
+ * Base class for testing overlapping of Swing and AWT component put into one frame.
+ * Validates drawing and event delivery at the components intersection.
+ * <p> See base class for usage
+ *
+ * @author Sergey Grinev
+*/
+public abstract class SimpleOverlappingTestBase extends OverlappingTestBase {
+
+    {
+        testEmbeddedFrame = true;
+    }
+
+    /**
+     * Event delivery validation. If set to true (default) tested lightweight component will be provided
+     * with mouse listener which should be called in order for test to pass.
+     */
+    protected final boolean useDefaultClickValidation;
+
+    /**
+     * Constructor which sets {@link SimpleOverlappingTestBase#useDefaultClickValidation }
+     * @param defaultClickValidation
+     */
+    protected SimpleOverlappingTestBase(boolean defaultClickValidation) {
+        super();
+        this.useDefaultClickValidation = defaultClickValidation;
+    }
+
+    public SimpleOverlappingTestBase() {
+        this(true);
+    }
+
+    //overridables
+    /**
+     * Successors override this method providing swing component for testing
+     * @return swing component to test
+     */
+    protected abstract JComponent getSwingComponent();
+
+    /**
+     * For tests debugging. Please, ignore.
+     */
+    protected static final boolean debug = false;
+
+    /**
+     * Should be set to true if test isn't using {@link SimpleOverlappingTestBase#useDefaultClickValidation }
+     */
+    protected volatile boolean wasLWClicked = false;
+
+    /**
+     * Current tested lightweight component
+     * @see SimpleOverlappingTestBase#getSwingComponent()
+     */
+    protected JComponent testedComponent;
+
+    /**
+     * Setups simple frame with lightweight component returned by {@link SimpleOverlappingTestBase#getSwingComponent() }
+     * Called by base class.
+     */
+    protected void prepareControls() {
+        wasLWClicked = false;
+
+        final JFrame f = new JFrame("Mixing : Simple Overlapping test");
+        f.setLayout(new SpringLayout());
+        f.setSize(200, 200);
+
+        testedComponent = getSwingComponent();
+
+        if (useDefaultClickValidation) {
+            testedComponent.addMouseListener(new MouseAdapter() {
+
+                @Override
+                public void mouseClicked(MouseEvent e) {
+                    wasLWClicked = true;
+                    f.setVisible(false);
+                }
+            });
+        }
+
+        if (!debug) {
+            f.add(testedComponent);
+        } else {
+            System.err.println("Warning: DEBUG MODE");
+        }
+
+        propagateAWTControls(f);
+
+        f.setVisible(true);
+    }
+
+    /**
+     * AWT Robot instance. Shouldn't be used in most cases.
+     */
+    protected Robot robot;
+
+    /**
+     * Run test by {@link OverlappingTestBase#clickAndBlink(java.awt.Robot, java.awt.Point) } validation for current lightweight component.
+     * <p>Called by base class.
+     * @return true if test passed
+     */
+    protected boolean performTest() {
+        testedComponent.requestFocus();
+
+        // run robot
+        robot = Util.createRobot();
+        robot.setAutoDelay(20);
+
+        // get coord
+        Point lLoc = !debug ? testedComponent.getLocationOnScreen() : new Point(70, 30);
+        Util.waitForIdle(null);
+        /* this is a workaround for certain jtreg(?) focus issue:
+           tests fail starting after failing mixing tests but always pass alone.
+         */
+        JFrame ancestor = (JFrame)(testedComponent.getTopLevelAncestor());
+        if( ancestor != null ) {
+            Point ancestorLoc = ancestor.getLocationOnScreen();
+            ancestorLoc.translate(ancestor.getWidth()/2-15, 2);
+            robot.mouseMove(ancestorLoc.x, ancestorLoc.y);
+            Util.waitForIdle(robot);
+            robot.mousePress(InputEvent.BUTTON1_MASK);
+            robot.delay(50);
+            robot.mouseRelease(InputEvent.BUTTON1_MASK);
+            Util.waitForIdle(robot);
+        }
+
+        clickAndBlink(robot, lLoc);
+        Util.waitForIdle(null);
+
+        return wasLWClicked;
+    }
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Mixing/AWT_Mixing/Util.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,601 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Component;
+import java.awt.Frame;
+import java.awt.Dialog;
+import java.awt.Window;
+import java.awt.Button;
+import java.awt.Point;
+import java.awt.Dimension;
+import java.awt.Rectangle;
+import java.awt.Robot;
+import java.awt.Toolkit;
+import java.awt.IllegalComponentStateException;
+import java.awt.AWTException;
+import java.awt.AWTEvent;
+
+import java.awt.event.InputEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.awt.event.ActionEvent;
+import java.awt.event.FocusEvent;
+import java.awt.event.WindowListener;
+import java.awt.event.WindowFocusListener;
+import java.awt.event.FocusListener;
+import java.awt.event.ActionListener;
+
+import java.awt.peer.FramePeer;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import java.security.PrivilegedAction;
+import java.security.AccessController;
+
+import java.util.concurrent.atomic.AtomicBoolean;
+
+/**
+ * <p>This class contains utilities useful for regression testing.
+ * <p>When using jtreg you would include this class into the build
+ * list via something like:
+ * <pre>
+     &amp;library ../../../../share/lib/AWT_Mixing/src/regtesthelpers/
+     &amp;build Util
+     &amp;run main YourTest
+   </pre>
+ * Note that if you are about to create a test based on
+ * Applet-template, then put those lines into html-file, not in java-file.
+ * <p> And put an
+ * import regtesthelpers.Util;
+ * into the java source of test.
+*/
+public final class Util {
+    private Util() {} // this is a helper class with static methods :)
+
+    /*
+     * @throws RuntimeException when creation failed
+     */
+    public static Robot createRobot() {
+        try {
+            return new Robot();
+        } catch (AWTException e) {
+            throw new RuntimeException("Error: unable to create robot", e);
+        }
+    }
+
+    public static Frame createEmbeddedFrame(final Frame embedder)
+        throws ClassNotFoundException, NoSuchFieldException, IllegalAccessException, NoSuchMethodException,
+               InstantiationException, InvocationTargetException
+    {
+        Toolkit tk = Toolkit.getDefaultToolkit();
+        FramePeer frame_peer = (FramePeer) embedder.getPeer();
+        System.out.println("frame's peer = " + frame_peer);
+        if ("sun.awt.windows.WToolkit".equals(tk.getClass().getName())) {
+            Class comp_peer_class =
+                Class.forName("sun.awt.windows.WComponentPeer");
+            System.out.println("comp peer class = " + comp_peer_class);
+            Field hwnd_field = comp_peer_class.getDeclaredField("hwnd");
+            hwnd_field.setAccessible(true);
+            System.out.println("hwnd_field =" + hwnd_field);
+            long hwnd = hwnd_field.getLong(frame_peer);
+            System.out.println("hwnd = " + hwnd);
+
+            Class clazz = Class.forName("sun.awt.windows.WEmbeddedFrame");
+            Constructor constructor = clazz.getConstructor (new Class [] {Long.TYPE});
+            return (Frame) constructor.newInstance (new Object[] {hwnd});
+        } else if ("sun.awt.X11.XToolkit".equals(tk.getClass().getName())) {
+            Class x_base_window_class = Class.forName("sun.awt.X11.XBaseWindow");
+            System.out.println("x_base_window_class = " + x_base_window_class);
+            Method get_window = x_base_window_class.getMethod("getWindow", new Class[0]);
+            System.out.println("get_window = " + get_window);
+            long window = (Long) get_window.invoke(frame_peer, new Object[0]);
+            System.out.println("window = " + window);
+            Class clazz = Class.forName("sun.awt.X11.XEmbeddedFrame");
+            Constructor constructor = clazz.getConstructor (new Class [] {Long.TYPE, Boolean.TYPE});
+            return (Frame) constructor.newInstance (new Object[] {window, true});
+        }
+
+        throw new RuntimeException("Unexpected toolkit - " + tk);
+    }
+
+    /**
+     * Makes the window visible and waits until it's shown.
+     */
+    public static void showWindowWait(Window win) {
+        win.setVisible(true);
+        waitTillShown(win);
+    }
+
+    /**
+     * Moves mouse pointer in the center of given {@code comp} component
+     * using {@code robot} parameter.
+     */
+    public static void pointOnComp(final Component comp, final Robot robot) {
+        Rectangle bounds = new Rectangle(comp.getLocationOnScreen(), comp.getSize());
+        robot.mouseMove(bounds.x + bounds.width / 2, bounds.y + bounds.height / 2);
+    }
+
+    /**
+     * Moves mouse pointer in the center of a given {@code comp} component
+     * and performs a left mouse button click using the {@code robot} parameter
+     * with the {@code delay} delay between press and release.
+     */
+    public static void clickOnComp(final Component comp, final Robot robot, int delay) {
+        pointOnComp(comp, robot);
+        robot.delay(delay);
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.delay(delay);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+    }
+
+    /**
+     * Moves mouse pointer in the center of a given {@code comp} component
+     * and performs a left mouse button click using the {@code robot} parameter
+     * with the default delay between press and release.
+     */
+    public static void clickOnComp(final Component comp, final Robot robot) {
+        clickOnComp(comp, robot, 50);
+    }
+
+    /*
+     * Clicks on a title of Frame/Dialog.
+     * WARNING: it may fail on some platforms when the window is not wide enough.
+     */
+    public static void clickOnTitle(final Window decoratedWindow, final Robot robot) {
+        Point p = decoratedWindow.getLocationOnScreen();
+        Dimension d = decoratedWindow.getSize();
+
+        if (decoratedWindow instanceof Frame || decoratedWindow instanceof Dialog) {
+            robot.mouseMove(p.x + (int)(d.getWidth()/2), p.y + (int)decoratedWindow.getInsets().top/2);
+            robot.delay(50);
+            robot.mousePress(InputEvent.BUTTON1_MASK);
+            robot.delay(50);
+            robot.mouseRelease(InputEvent.BUTTON1_MASK);
+        }
+    }
+
+    public static void waitForIdle(final Robot robot) {
+        // we do not use robot for now, use SunToolkit.realSync() instead
+        ((sun.awt.SunToolkit)Toolkit.getDefaultToolkit()).realSync();
+    }
+
+    public static Field getField(final Class klass, final String fieldName) {
+        return AccessController.doPrivileged(new PrivilegedAction<Field>() {
+            public Field run() {
+                try {
+                    Field field = klass.getDeclaredField(fieldName);
+                    assert (field != null);
+                    field.setAccessible(true);
+                    return field;
+                } catch (SecurityException se) {
+                    throw new RuntimeException("Error: unexpected exception caught!", se);
+                } catch (NoSuchFieldException nsfe) {
+                    throw new RuntimeException("Error: unexpected exception caught!", nsfe);
+                }
+            }
+        });
+    }
+
+    /*
+     * Waits for a notification and for a boolean condition to become true.
+     * The method returns when the above conditions are fullfilled or when the timeout
+     * occurs.
+     *
+     * @param condition the object to be notified and the booelan condition to wait for
+     * @param timeout the maximum time to wait in milliseconds
+     * @param catchExceptions if {@code true} the method catches InterruptedException
+     * @return the final boolean value of the {@code condition}
+     * @throws InterruptedException if the awaiting proccess has been interrupted
+     */
+    public static boolean waitForConditionEx(final AtomicBoolean condition, long timeout)
+      throws InterruptedException
+        {
+            synchronized (condition) {
+                long startTime = System.currentTimeMillis();
+                while (!condition.get()) {
+                    condition.wait(timeout);
+                    if (System.currentTimeMillis() - startTime >= timeout ) {
+                        break;
+                    }
+                }
+            }
+            return condition.get();
+        }
+
+    /*
+     * The same as {@code waitForConditionEx(AtomicBoolean, long)} except that it
+     * doesn't throw InterruptedException.
+     */
+    public static boolean waitForCondition(final AtomicBoolean condition, long timeout) {
+        try {
+            return waitForConditionEx(condition, timeout);
+        } catch (InterruptedException e) {
+            throw new RuntimeException("Error: unexpected exception caught!", e);
+        }
+    }
+
+    /*
+     * The same as {@code waitForConditionEx(AtomicBoolean, long)} but without a timeout.
+     */
+    public static void waitForConditionEx(final AtomicBoolean condition)
+      throws InterruptedException
+        {
+            synchronized (condition) {
+                while (!condition.get()) {
+                    condition.wait();
+                }
+            }
+        }
+
+    /*
+     * The same as {@code waitForConditionEx(AtomicBoolean)} except that it
+     * doesn't throw InterruptedException.
+     */
+    public static void waitForCondition(final AtomicBoolean condition) {
+        try {
+            waitForConditionEx(condition);
+        } catch (InterruptedException e) {
+            throw new RuntimeException("Error: unexpected exception caught!", e);
+        }
+    }
+
+    public static void waitTillShownEx(final Component comp) throws InterruptedException {
+        while (true) {
+            try {
+                Thread.sleep(100);
+                comp.getLocationOnScreen();
+                break;
+            } catch (IllegalComponentStateException e) {}
+        }
+    }
+    public static void waitTillShown(final Component comp) {
+        try {
+            waitTillShownEx(comp);
+        } catch (InterruptedException e) {
+            throw new RuntimeException("Error: unexpected exception caught!", e);
+        }
+    }
+
+    /**
+     * Drags from one point to another with the specified mouse button pressed.
+     *
+     * @param robot a robot to use for moving the mouse, etc.
+     * @param startPoint a start point of the drag
+     * @param endPoint an end point of the drag
+     * @param button one of {@code InputEvent.BUTTON1_MASK},
+     *     {@code InputEvent.BUTTON2_MASK}, {@code InputEvent.BUTTON3_MASK}
+     *
+     * @throws IllegalArgumentException if {@code button} is not one of
+     *     {@code InputEvent.BUTTON1_MASK}, {@code InputEvent.BUTTON2_MASK},
+     *     {@code InputEvent.BUTTON3_MASK}
+     */
+    public static void drag(Robot robot, Point startPoint, Point endPoint, int button) {
+        if (!(button == InputEvent.BUTTON1_MASK || button == InputEvent.BUTTON2_MASK
+                || button == InputEvent.BUTTON3_MASK))
+        {
+            throw new IllegalArgumentException("invalid mouse button");
+        }
+
+        robot.mouseMove(startPoint.x, startPoint.y);
+        robot.mousePress(button);
+        try {
+            mouseMove(robot, startPoint, endPoint);
+        } finally {
+            robot.mouseRelease(button);
+        }
+    }
+
+    /**
+     * Moves the mouse pointer from one point to another.
+     * Uses Bresenham's algorithm.
+     *
+     * @param robot a robot to use for moving the mouse
+     * @param startPoint a start point of the drag
+     * @param endPoint an end point of the drag
+     */
+    public static void mouseMove(Robot robot, Point startPoint, Point endPoint) {
+        int dx = endPoint.x - startPoint.x;
+        int dy = endPoint.y - startPoint.y;
+
+        int ax = Math.abs(dx) * 2;
+        int ay = Math.abs(dy) * 2;
+
+        int sx = signWOZero(dx);
+        int sy = signWOZero(dy);
+
+        int x = startPoint.x;
+        int y = startPoint.y;
+
+        int d = 0;
+
+        if (ax > ay) {
+            d = ay - ax/2;
+            while (true){
+                robot.mouseMove(x, y);
+                robot.delay(50);
+
+                if (x == endPoint.x){
+                    return;
+                }
+                if (d >= 0){
+                    y = y + sy;
+                    d = d - ax;
+                }
+                x = x + sx;
+                d = d + ay;
+            }
+        } else {
+            d = ax - ay/2;
+            while (true){
+                robot.mouseMove(x, y);
+                robot.delay(50);
+
+                if (y == endPoint.y){
+                    return;
+                }
+                if (d >= 0){
+                    x = x + sx;
+                    d = d - ay;
+                }
+                y = y + sy;
+                d = d + ax;
+            }
+        }
+    }
+
+    private static int signWOZero(int i){
+        return (i > 0)? 1: -1;
+    }
+
+    private static int sign(int n) {
+        return n < 0 ? -1 : n == 0 ? 0 : 1;
+    }
+
+    /** Returns {@code WindowListener} instance that diposes {@code Window} on
+     *  "window closing" event.
+     *
+     * @return    the {@code WindowListener} instance that could be set
+     *            on a {@code Window}. After that
+     *            the {@code Window} is disposed when "window closed"
+     *            event is sent to the {@code Window}
+     */
+    public static WindowListener getClosingWindowAdapter() {
+        return new WindowAdapter () {
+            public void windowClosing(WindowEvent e) {
+                e.getWindow().dispose();
+            }
+        };
+    }
+
+    /*
+     * The values directly map to the ones of
+     * sun.awt.X11.XWM & sun.awt.motif.MToolkit classes.
+     */
+    public final static int
+        UNDETERMINED_WM = 1,
+        NO_WM = 2,
+        OTHER_WM = 3,
+        OPENLOOK_WM = 4,
+        MOTIF_WM = 5,
+        CDE_WM = 6,
+        ENLIGHTEN_WM = 7,
+        KDE2_WM = 8,
+        SAWFISH_WM = 9,
+        ICE_WM = 10,
+        METACITY_WM = 11,
+        COMPIZ_WM = 12,
+        LG3D_WM = 13;
+
+    /*
+     * Returns -1 in case of not X Window or any problems.
+     */
+    public static int getWMID() {
+        Class clazz = null;
+        try {
+            if ("sun.awt.X11.XToolkit".equals(Toolkit.getDefaultToolkit().getClass().getName())) {
+                clazz = Class.forName("sun.awt.X11.XWM");
+            } else if ("sun.awt.motif.MToolkit".equals(Toolkit.getDefaultToolkit().getClass().getName())) {
+                clazz = Class.forName("sun.awt.motif.MToolkit");
+            }
+        } catch (ClassNotFoundException cnfe) {
+            cnfe.printStackTrace();
+        }
+        if (clazz == null) {
+            return -1;
+        }
+
+        try {
+            final Class _clazz = clazz;
+            Method m_getWMID = (Method)AccessController.doPrivileged(new PrivilegedAction() {
+                    public Object run() {
+                        try {
+                            Method method = _clazz.getDeclaredMethod("getWMID", new Class[] {});
+                            if (method != null) {
+                                method.setAccessible(true);
+                            }
+                            return method;
+                        } catch (NoSuchMethodException e) {
+                            assert false;
+                        } catch (SecurityException e) {
+                            assert false;
+                        }
+                        return null;
+                    }
+                });
+            return ((Integer)m_getWMID.invoke(null, new Object[] {})).intValue();
+        } catch (IllegalAccessException iae) {
+            iae.printStackTrace();
+        } catch (InvocationTargetException ite) {
+            ite.printStackTrace();
+        }
+        return -1;
+    }
+
+
+    ////////////////////////////
+    // Some stuff to test focus.
+    ////////////////////////////
+
+    private static WindowGainedFocusListener wgfListener = new WindowGainedFocusListener();
+    private static FocusGainedListener fgListener = new FocusGainedListener();
+    private static ActionPerformedListener apListener = new ActionPerformedListener();
+
+    private abstract static class EventListener {
+        AtomicBoolean notifier = new AtomicBoolean(false);
+        Component comp;
+        boolean printEvent;
+
+        public void listen(Component comp, boolean printEvent) {
+            this.comp = comp;
+            this.printEvent = printEvent;
+            notifier.set(false);
+            setListener(comp);
+        }
+
+        public AtomicBoolean getNotifier() {
+            return notifier;
+        }
+
+        abstract void setListener(Component comp);
+
+        void printAndNotify(AWTEvent e) {
+            if (printEvent) {
+                System.err.println(e);
+            }
+            synchronized (notifier) {
+                notifier.set(true);
+                notifier.notifyAll();
+            }
+        }
+    }
+
+    private static class WindowGainedFocusListener extends EventListener implements WindowFocusListener {
+
+        void setListener(Component comp) {
+            ((Window)comp).addWindowFocusListener(this);
+        }
+
+        public void windowGainedFocus(WindowEvent e) {
+
+            ((Window)comp).removeWindowFocusListener(this);
+            printAndNotify(e);
+        }
+
+        public void windowLostFocus(WindowEvent e) {}
+    }
+
+    private static class FocusGainedListener extends EventListener implements FocusListener {
+
+        void setListener(Component comp) {
+            comp.addFocusListener(this);
+        }
+
+        public void focusGained(FocusEvent e) {
+            comp.removeFocusListener(this);
+            printAndNotify(e);
+        }
+
+        public void focusLost(FocusEvent e) {}
+    }
+
+    private static class ActionPerformedListener extends EventListener implements ActionListener {
+
+        void setListener(Component comp) {
+            ((Button)comp).addActionListener(this);
+        }
+
+        public void actionPerformed(ActionEvent e) {
+            ((Button)comp).removeActionListener(this);
+            printAndNotify(e);
+        }
+    }
+
+    private static boolean trackEvent(int eventID, Component comp, Runnable action, int time, boolean printEvent) {
+        EventListener listener = null;
+
+        switch (eventID) {
+        case WindowEvent.WINDOW_GAINED_FOCUS:
+            listener = wgfListener;
+            break;
+        case FocusEvent.FOCUS_GAINED:
+            listener = fgListener;
+            break;
+        case ActionEvent.ACTION_PERFORMED:
+            listener = apListener;
+            break;
+        }
+
+        listener.listen(comp, printEvent);
+        action.run();
+        return Util.waitForCondition(listener.getNotifier(), time);
+    }
+
+    /*
+     * Tracks WINDOW_GAINED_FOCUS event for a window caused by an action.
+     * @param window the window to track the event for
+     * @param action the action to perform
+     * @param time the max time to wait for the event
+     * @param printEvent should the event received be printed or doesn't
+     * @return true if the event has been received, otherwise false
+     */
+    public static boolean trackWindowGainedFocus(Window window, Runnable action, int time, boolean printEvent) {
+        return trackEvent(WindowEvent.WINDOW_GAINED_FOCUS, window, action, time, printEvent);
+    }
+
+    /*
+     * Tracks FOCUS_GAINED event for a component caused by an action.
+     * @see #trackWindowGainedFocus
+     */
+    public static boolean trackFocusGained(Component comp, Runnable action, int time, boolean printEvent) {
+        return trackEvent(FocusEvent.FOCUS_GAINED, comp, action, time, printEvent);
+    }
+
+    /*
+     * Tracks ACTION_PERFORMED event for a button caused by an action.
+     * @see #trackWindowGainedFocus
+     */
+    public static boolean trackActionPerformed(Button button, Runnable action, int time, boolean printEvent) {
+        return trackEvent(ActionEvent.ACTION_PERFORMED, button, action, time, printEvent);
+    }
+
+    /*
+     * Requests focus on the component provided and waits for the result.
+     * @return true if the component has been focused, false otherwise.
+     */
+    public static boolean focusComponent(Component comp, int time) {
+        return focusComponent(comp, time, false);
+    }
+    public static boolean focusComponent(final Component comp, int time, boolean printEvent) {
+        return trackFocusGained(comp,
+                                new Runnable() {
+                                    public void run() {
+                                        comp.requestFocus();
+                                    }
+                                },
+                                time, printEvent);
+
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Mixing/AWT_Mixing/ViewportOverlapping.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,151 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+import java.awt.GridLayout;
+import java.awt.Point;
+import java.awt.Robot;
+import java.awt.event.InputEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import javax.swing.BorderFactory;
+import javax.swing.JButton;
+import javax.swing.JComponent;
+import javax.swing.JFrame;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.SwingUtilities;
+
+/**
+ * AWT/Swing overlapping test for viewport
+ * <p>This test verify if AWT components are drawn correctly being partially shown through viewport
+ * <p>See <a href="http://monaco.sfbay.sun.com/detail.jsf?cr=6778882">CR6778882</a> for details
+ * <p>See base class for test info.
+ */
+/*
+@test
+@bug 6778882
+@summary Viewport overlapping test for each AWT component
+@author sergey.grinev@oracle.com: area=awt.mixing
+@run main ViewportOverlapping
+ */
+public class ViewportOverlapping extends OverlappingTestBase {
+
+    private volatile int frameClicked;
+    private Point hLoc;
+    private Point vLoc;
+    private Point testLoc;
+    private Point resizeLoc;
+
+    private JFrame f;
+    private JPanel p;
+    private JButton b;
+    private JScrollPane scrollPane;
+
+    protected void prepareControls() {
+        p = new JPanel(new GridLayout(0, 1));
+        propagateAWTControls(p);
+        b = new JButton("Space extender");
+        p.add(b);
+        p.setPreferredSize(new Dimension(500, 500));
+        scrollPane = new JScrollPane(p);
+
+        f = new JFrame();
+        f.addMouseListener(new MouseAdapter() {
+
+            @Override
+            public void mouseClicked(MouseEvent e) {
+                frameClicked++;
+            }
+        });
+        f.getContentPane().add(scrollPane, BorderLayout.CENTER);
+        ((JComponent) f.getContentPane()).setBorder(
+                BorderFactory.createEmptyBorder(50, 50, 50, 50));
+        f.setSize(400, 400);
+        f.setLocationRelativeTo(null);
+        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        f.setVisible(true);
+    }
+
+    @Override
+    protected boolean performTest() {
+        try {
+            SwingUtilities.invokeAndWait(new Runnable() {
+                public void run() {
+                    // prepare test data
+                    frameClicked = 0;
+
+                    b.requestFocus();
+
+                    scrollPane.getHorizontalScrollBar().setUnitIncrement(40);
+                    scrollPane.getVerticalScrollBar().setUnitIncrement(40);
+
+                    hLoc = scrollPane.getHorizontalScrollBar().getLocationOnScreen();
+                    hLoc.translate(scrollPane.getHorizontalScrollBar().getWidth() - 3, 3);
+                    vLoc = scrollPane.getVerticalScrollBar().getLocationOnScreen();
+                    vLoc.translate(3, scrollPane.getVerticalScrollBar().getHeight() - 3);
+
+                    testLoc = p.getLocationOnScreen();
+                    testLoc.translate(-3, -3);
+
+                    resizeLoc = f.getLocationOnScreen();
+                    resizeLoc.translate(f.getWidth() - 1, f.getHeight() - 1);
+                }
+            });
+        } catch (Exception e) {
+            e.printStackTrace();
+            System.exit(1);
+        }
+        // run robot
+        Robot robot = Util.createRobot();
+        robot.setAutoDelay(ROBOT_DELAY);
+
+        robot.mouseMove(hLoc.x, hLoc.y);
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+        Util.waitForIdle(robot);
+
+        robot.mouseMove(vLoc.x, vLoc.y);
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+        Util.waitForIdle(robot);
+
+        clickAndBlink(robot, testLoc, false);
+        robot.mouseMove(resizeLoc.x, resizeLoc.y);
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.mouseMove(resizeLoc.x + 5, resizeLoc.y + 5);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+        Util.waitForIdle(robot);
+
+        clickAndBlink(robot, testLoc, false);
+        return frameClicked == 2;
+    }
+
+    // this strange plumbing stuff is required due to "Standard Test Machinery" in base class
+    public static void main(String args[]) throws InterruptedException {
+        instance = new ViewportOverlapping();
+        OverlappingTestBase.doMain(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Robot/ModifierRobotKey/ModifierRobotKeyTest.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,230 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+import java.awt.*;
+import java.awt.event.*;
+
+import static jdk.testlibrary.Asserts.assertTrue;
+
+/*
+ * @test
+ * @summary Make sure that modifier key mask is set when robot press
+ * some key with one or more modifiers.
+ *
+ * @library ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @run main ModifierRobotKeyTest
+ */
+
+public class ModifierRobotKeyTest extends KeyAdapter {
+
+    private boolean focusGained = false;
+    private boolean startTest = false;
+    private ExtendedRobot robot;
+    private Frame frame;
+    private Canvas canvas;
+
+    private volatile boolean tempPress = false;
+
+    private int[] textKeys, modifierKeys, inputMasks;
+    private boolean[] modifierStatus, textStatus;
+
+    private final static int waitDelay = 5000;
+    private Object tempLock = new Object();
+    private Object keyLock = new Object();
+
+    public static void main(String[] args) throws Exception {
+        ModifierRobotKeyTest test = new ModifierRobotKeyTest();
+        test.doTest();
+    }
+
+    public ModifierRobotKeyTest() throws Exception {
+        modifierKeys =  new int[3];
+        modifierKeys[0] = KeyEvent.VK_SHIFT;
+        modifierKeys[1] = KeyEvent.VK_CONTROL;
+        modifierKeys[2] = KeyEvent.VK_ALT;
+
+        inputMasks = new int[3];
+        inputMasks[0] =  InputEvent.SHIFT_MASK;
+        inputMasks[1] =  InputEvent.CTRL_MASK;
+        inputMasks[2] =  InputEvent.ALT_MASK;
+
+        modifierStatus = new boolean[modifierKeys.length];
+
+        textKeys = new int[2];
+        textKeys[0] = KeyEvent.VK_A;
+
+        String os = System.getProperty("os.name").toLowerCase();
+
+        if (os.contains("solaris") || os.contains("sunos"))
+            textKeys[1] = KeyEvent.VK_S;
+        else if (os.contains("os x"))
+            textKeys[1] = KeyEvent.VK_K;
+        else
+            textKeys[1] = KeyEvent.VK_I;
+
+        textStatus = new boolean[textKeys.length];
+
+        EventQueue.invokeAndWait( () -> { initializeGUI(); });
+    }
+
+    public void keyPressed(KeyEvent event) {
+
+        tempPress = true;
+        synchronized (tempLock) { tempLock.notifyAll(); }
+
+        if (! startTest) {
+            return;
+        }
+        for (int x = 0; x < inputMasks.length; x++) {
+            if ((event.getModifiers() & inputMasks[x]) != 0) {
+                System.out.println("Modifier set: " + event.getKeyModifiersText(inputMasks[x]));
+                modifierStatus[x] = true;
+            }
+        }
+        for (int x = 0; x < textKeys.length; x++) {
+            if (event.getKeyCode() == textKeys[x]) {
+                System.out.println("Text set: " + event.getKeyText(textKeys[x]));
+                textStatus[x] = true;
+            }
+        }
+
+        synchronized (keyLock) { keyLock.notifyAll(); }
+    }
+
+    private void initializeGUI() {
+        frame = new Frame("Test frame");
+        canvas = new Canvas();
+        canvas.addFocusListener(new FocusAdapter() {
+            public void focusGained(FocusEvent event) { focusGained = true; }
+        });
+        canvas.addKeyListener(this);
+        frame.setLayout(new BorderLayout());
+        frame.add(canvas);
+        frame.setSize(200, 200);
+        frame.setVisible(true);
+    }
+
+    public void doTest() throws Exception {
+        robot = new ExtendedRobot();
+
+        robot.mouseMove((int) frame.getLocationOnScreen().getX() + frame.getSize().width / 2,
+                        (int) frame.getLocationOnScreen().getY() + frame.getSize().height / 2);
+        robot.click(MouseEvent.BUTTON1_MASK);
+        robot.waitForIdle();
+
+        assertTrue(focusGained, "FAIL: Canvas gained focus!");
+
+        for (int i = 0; i < modifierKeys.length; i++) {
+            for (int j = 0; j < textKeys.length; j++) {
+                tempPress = false;
+                robot.keyPress(modifierKeys[i]);
+                robot.waitForIdle();
+                if (! tempPress) {
+                    synchronized (tempLock) { tempLock.wait(waitDelay); }
+                }
+                assertTrue(tempPress, "FAIL: keyPressed triggered for i=" + i);
+
+                resetStatus();
+                startTest = true;
+                robot.keyPress(textKeys[j]);
+                robot.waitForIdle();
+                if (! modifierStatus[i] || ! textStatus[j]) {
+                    synchronized (keyLock) { keyLock.wait(waitDelay); }
+                }
+
+
+                assertTrue(modifierStatus[i] && textStatus[j],
+                        "FAIL: KeyEvent not proper!"+
+                        "Key checked: i=" + i + "; j=" + j+
+                        "ModifierStatus = " + modifierStatus[i]+
+                        "TextStatus = " + textStatus[j]);
+                startTest = false;
+                robot.keyRelease(textKeys[j]);
+                robot.waitForIdle();
+                robot.keyRelease(modifierKeys[i]);
+                robot.waitForIdle();
+            }
+        }
+
+        for (int i = 0; i < modifierKeys.length; i++) {
+            for (int j = i + 1; j < modifierKeys.length; j++) {
+                for (int k = 0; k < textKeys.length; k++) {
+                    tempPress = false;
+                    robot.keyPress(modifierKeys[i]);
+                    robot.waitForIdle();
+                    if (! tempPress) {
+                        synchronized (tempLock) { tempLock.wait(waitDelay); }
+                    }
+
+                    assertTrue(tempPress, "FAIL: MultiKeyTest: keyPressed triggered for i=" + i);
+
+                    tempPress = false;
+                    robot.keyPress(modifierKeys[j]);
+                    robot.waitForIdle();
+                    if (! tempPress) {
+                        synchronized (tempLock) { tempLock.wait(waitDelay); }
+                    }
+                    assertTrue(tempPress, "FAIL: MultiKeyTest keyPressed triggered for j=" + j);
+
+                    resetStatus();
+                    startTest = true;
+                    robot.keyPress(textKeys[k]);
+                    robot.waitForIdle();
+                    if (! modifierStatus[i] || ! modifierStatus[j] || ! textStatus[k]) {
+                        synchronized (keyLock) {
+                            keyLock.wait(waitDelay);
+                        }
+                    }
+                    assertTrue(modifierStatus[i] && modifierStatus[j] && textStatus[k],
+                            "FAIL: KeyEvent not proper!"+
+                            "Key checked: i=" + i + "; j=" + j + "; k=" + k+
+                            "Modifier1Status = " + modifierStatus[i]+
+                            "Modifier2Status = " + modifierStatus[j]+
+                            "TextStatus = " + textStatus[k]);
+
+                    startTest = false;
+                    robot.keyRelease(textKeys[k]);
+                    robot.waitForIdle();
+                    robot.keyRelease(modifierKeys[j]);
+                    robot.waitForIdle();
+                    robot.keyRelease(modifierKeys[i]);
+                    robot.waitForIdle();
+                }
+            }
+        }
+
+        frame.dispose();
+    }
+
+    private void resetStatus() {
+        for (int i = 0; i < modifierStatus.length; i++) {
+            modifierStatus[i] = false;
+        }
+        for (int i = 0; i < textStatus.length; i++) {
+            textStatus[i] = false;
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Toolkit/LockingKeyStateTest/LockingKeyStateTest.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,126 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.awt.event.KeyEvent;
+
+/*
+  @test
+  @summary verify LOCK buttons toogle
+  @author Yuri.Nesterenko, Dmitriy.Ermashov
+  @library ../../../../lib/testlibrary
+  @build ExtendedRobot
+  @run main LockingKeyStateTest
+*/
+
+public class LockingKeyStateTest {
+
+    Frame frame;
+    ExtendedRobot robot;
+
+    // Note that Kana lock you may actually toggle only if you have one.
+    static int[] lockingKeys = { KeyEvent.VK_CAPS_LOCK, KeyEvent.VK_NUM_LOCK,
+            KeyEvent.VK_SCROLL_LOCK, KeyEvent.VK_KANA_LOCK };
+    boolean[] getSupported = new boolean[lockingKeys.length];
+    boolean[] setSupported = new boolean[lockingKeys.length];
+    boolean[] state0 = new boolean[lockingKeys.length];
+
+    Toolkit toolkit = Toolkit.getDefaultToolkit();
+
+    LockingKeyStateTest() throws Exception {
+        robot = new ExtendedRobot();
+        EventQueue.invokeAndWait( this::createGui );
+    }
+
+    void toggleAllTrue(){toggleAll(true);}
+    void toggleAllFalse(){toggleAll(false);}
+    void toggleAll(boolean b) {
+        for(int i = 0; i < lockingKeys.length; i++) {
+            if(setSupported[i]) {
+                toolkit.setLockingKeyState(lockingKeys[i], b);
+            }
+        }
+    }
+
+    void checkAllTrue(){checkAll(true);}
+    void checkAllFalse(){checkAll(false);}
+    void checkAll(boolean b) {
+        for(int i = 0; i < lockingKeys.length; i++) {
+            if(getSupported[i]  && setSupported[i]) {
+                if (!(toolkit.getLockingKeyState(lockingKeys[i]) == b))
+                    throw new RuntimeException("State of "+KeyEvent.getKeyText(lockingKeys[i])+" is not "+b);
+                System.out.println("OK, state of "+KeyEvent.getKeyText(lockingKeys[i])+" is "+b);
+            }
+        }
+    }
+
+    void restoreAll() {
+        for(int i = 0; i < lockingKeys.length; i++) {
+            if(setSupported[i] && getSupported[i]) {
+                toolkit.setLockingKeyState(lockingKeys[i], state0[i]);
+            }
+        }
+    }
+
+    public void createGui() {
+        for(int i = 0; i < lockingKeys.length; i++) {
+            getSupported[i] = false;
+            setSupported[i] = false;
+            try {
+                state0[i] = toolkit.getLockingKeyState(lockingKeys[i]);
+                getSupported[i] = true;
+                toolkit.setLockingKeyState(lockingKeys[i], state0[i]);
+                setSupported[i] = true;
+            } catch (UnsupportedOperationException uoe) {
+            }
+            System.out.println(" State get/set of "+KeyEvent.getKeyText(lockingKeys[i])+" is supported? "+
+                    getSupported[i]+", "+setSupported[i]);
+        }
+        frame = new Frame("LockingKeyStateTest Title");
+        frame.setSize(200,200);
+        frame.setVisible(true);
+    }
+
+    void doTest() throws Exception{
+        robot.waitForIdle();
+        robot.mouseMove(frame.getLocationOnScreen().x + frame.getWidth() / 2,
+                frame.getLocationOnScreen().y + frame.getHeight() / 2);
+        robot.click();
+
+        EventQueue.invokeAndWait( this::toggleAllTrue );
+        robot.waitForIdle(2000);
+        EventQueue.invokeAndWait( this::checkAllTrue );
+        EventQueue.invokeAndWait( this::toggleAllFalse );
+        robot.waitForIdle(2000);
+        EventQueue.invokeAndWait( this::checkAllFalse );
+        EventQueue.invokeAndWait( this::restoreAll );
+        robot.waitForIdle();
+
+        frame.dispose();
+    }
+
+    public static void main(String argv[]) throws Exception {
+        LockingKeyStateTest af = new LockingKeyStateTest();
+        af.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/datatransfer/MappingGenerationTest/MappingGenerationTest.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,183 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.SystemFlavorMap;
+import java.util.List;
+
+/*
+  @test
+  @bug 4512530 8027148
+  @summary tests that mappings for text flavors are generated properly
+  @author das@sparc.spb.su area=datatransfer
+*/
+
+public class MappingGenerationTest {
+
+    private static final SystemFlavorMap fm =
+        (SystemFlavorMap)SystemFlavorMap.getDefaultFlavorMap();
+
+    public static void main(String[] args)  {
+        test1();
+        test2();
+        test3();
+        test4();
+        test5();
+        test6();
+    }
+
+    /**
+     * Verifies that Lists returned from getNativesForFlavor() and
+     * getFlavorsForNative() are not modified with a subsequent call
+     * to addUnencodedNativeForFlavor() and addFlavorForUnencodedNative()
+     * respectively.
+     */
+    public static void test1() {
+        DataFlavor df = new DataFlavor("text/plain-test1", null);
+        String nat = "native1";
+
+        List<String> natives = fm.getNativesForFlavor(df);
+        fm.addUnencodedNativeForFlavor(df, nat);
+        List<String> nativesNew = fm.getNativesForFlavor(df);
+        if (natives.equals(nativesNew)) {
+            System.err.println("orig=" + natives);
+            System.err.println("new=" + nativesNew);
+            throw new RuntimeException("Test failed");
+        }
+
+        List<DataFlavor> flavors = fm.getFlavorsForNative(nat);
+        fm.addFlavorForUnencodedNative(nat, df);
+        List<DataFlavor> flavorsNew = fm.getFlavorsForNative(nat);
+        if (flavors.equals(flavorsNew)) {
+            System.err.println("orig=" + flavors);
+            System.err.println("new=" + flavorsNew);
+            throw new RuntimeException("Test failed");
+        }
+    }
+
+    /**
+     * Verifies that SystemFlavorMap is not affected by modification of
+     * the Lists returned from getNativesForFlavor() and
+     * getFlavorsForNative().
+     */
+    public static void test2() {
+        DataFlavor df = new DataFlavor("text/plain-test2", null);
+        String nat = "native2";
+        DataFlavor extraDf = new DataFlavor("text/test", null);
+
+        List<String> natives = fm.getNativesForFlavor(df);
+        natives.add("Should not be here");
+        java.util.List nativesNew = fm.getNativesForFlavor(df);
+        if (natives.equals(nativesNew)) {
+            System.err.println("orig=" + natives);
+            System.err.println("new=" + nativesNew);
+            throw new RuntimeException("Test failed");
+        }
+
+        List<DataFlavor> flavors = fm.getFlavorsForNative(nat);
+        flavors.add(extraDf);
+        java.util.List flavorsNew = fm.getFlavorsForNative(nat);
+        if (flavors.equals(flavorsNew)) {
+            System.err.println("orig=" + flavors);
+            System.err.println("new=" + flavorsNew);
+            throw new RuntimeException("Test failed");
+        }
+    }
+
+    /**
+     * Verifies that addUnencodedNativeForFlavor() for a particular text flavor
+     * doesn't affect mappings for other flavors.
+     */
+    public static void test3() {
+        DataFlavor df1 = new DataFlavor("text/plain-test3", null);
+        DataFlavor df2 = new DataFlavor("text/plain-test3; charset=Unicode; class=java.io.Reader", null);
+        String nat = "native3";
+        List<String> natives = fm.getNativesForFlavor(df2);
+        fm.addUnencodedNativeForFlavor(df1, nat);
+        List<String> nativesNew = fm.getNativesForFlavor(df2);
+        if (!natives.equals(nativesNew)) {
+            System.err.println("orig=" + natives);
+            System.err.println("new=" + nativesNew);
+            throw new RuntimeException("Test failed");
+        }
+    }
+
+    /**
+     * Verifies that addUnencodedNativeForFlavor() really adds the specified
+     * flavor-to-native mapping to the existing mappings.
+     */
+    public static void test4() {
+        DataFlavor df = new DataFlavor("text/plain-test4; charset=Unicode; class=java.io.Reader", null);
+        String nat = "native4";
+        List<String> natives = fm.getNativesForFlavor(df);
+        if (!natives.contains(nat)) {
+            fm.addUnencodedNativeForFlavor(df, nat);
+            List<String> nativesNew = fm.getNativesForFlavor(df);
+            natives.add(nat);
+            if (!natives.equals(nativesNew)) {
+                System.err.println("orig=" + natives);
+                System.err.println("new=" + nativesNew);
+                throw new RuntimeException("Test failed");
+            }
+        }
+    }
+
+    /**
+     * Verifies that a flavor doesn't have any flavor-to-native mappings after
+     * a call to setNativesForFlavor() with this flavor and an empty native
+     * array as arguments.
+     */
+    public static void test5() {
+        final DataFlavor flavor =
+            new DataFlavor("text/plain-TEST5; charset=Unicode", null);
+
+        fm.getNativesForFlavor(flavor);
+
+        fm.setNativesForFlavor(flavor, new String[0]);
+
+        List<String> natives = fm.getNativesForFlavor(flavor);
+
+        if (!natives.isEmpty()) {
+            System.err.println("natives=" + natives);
+            throw new RuntimeException("Test failed");
+        }
+    }
+
+    /**
+     * Verifies that a native doesn't have any native-to-flavor mappings after
+     * a call to setFlavorsForNative() with this native and an empty flavor
+     * array as arguments.
+     */
+    public static void test6() {
+        final String nat = "STRING";
+        fm.getFlavorsForNative(nat);
+        fm.setFlavorsForNative(nat, new DataFlavor[0]);
+
+        List<DataFlavor> flavors = fm.getFlavorsForNative(nat);
+
+        if (!flavors.isEmpty()) {
+            System.err.println("flavors=" + flavors);
+            throw new RuntimeException("Test failed");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/dnd/DragInterceptorAppletTest/DragInterceptorAppletTest.html	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,48 @@
+<!--
+ Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.
+
+ This code is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ or visit www.oracle.com if you need additional information or have any
+ questions.
+-->
+
+<html>
+<!--  
+  @test
+  @bug 6887703
+  @summary Unsigned applet can retrieve the dragged information before drop action occurs
+  @author : area=dnd
+  @library ../../regtesthelpers
+  @library ../../regtesthelpers/process
+  @build Util
+  @build ProcessResults ProcessCommunicator 
+  @run applet/othervm DragInterceptorAppletTest.html
+
+-->
+<head>
+<title> Unsigned applet can retrieve the dragged information before drop action occurs </title>
+</head>
+<body>
+
+<h1>DragInterceptorAppletTest<br>Bug ID: 6887703</h1>
+
+<p> This is an AUTOMATIC test, simply wait for completion </p>
+
+<APPLET CODE="DragInterceptorAppletTest.class" WIDTH=200 HEIGHT=200></APPLET>
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/dnd/DragInterceptorAppletTest/DragInterceptorAppletTest.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,154 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please 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 6887703
+  @summary Unsigned applet can retrieve the dragged information before drop action occurs
+  @author : area=dnd
+  @run applet DragInterceptorAppletTest.html
+*/
+
+/**
+ * DragInterceptorAppletTest.java
+ *
+ * summary: Unsigned applet can retrieve the dragged information before drop action occurs
+ */
+
+import static java.lang.Thread.sleep;
+
+import test.java.awt.regtesthelpers.process.ProcessCommunicator;
+import test.java.awt.regtesthelpers.process.ProcessResults;
+import test.java.awt.regtesthelpers.Util;
+import java.applet.Applet;
+import java.awt.*;
+import java.awt.event.InputEvent;
+
+public class DragInterceptorAppletTest extends Applet {
+
+    public void init() {
+        setLayout(new BorderLayout());
+    }//End  init()
+
+    public void start() {
+
+        SourceFrame sourceFrame = new SourceFrame();
+
+        Util.waitForIdle(null);
+
+        String [] args = new String [] {
+            String.valueOf(sourceFrame.getNextLocationX()),
+            String.valueOf(sourceFrame.getNextLocationY()),
+            String.valueOf(sourceFrame.getDragSourcePointX()),
+            String.valueOf(sourceFrame.getDragSourcePointY()),
+        };
+        String classpath = System.getProperty("java.class.path");
+        ProcessResults processResults =
+            ProcessCommunicator.executeChildProcess(this.getClass(),classpath,args);
+
+        verifyTestResults(processResults);
+
+    }// start()
+
+    private static void verifyTestResults(ProcessResults processResults) {
+
+    switch (processResults.getExitValue()) {
+        case InterprocessMessages.DATA_WAS_INTERCEPTED_AND_EXCEPTION_HANDLER_WAS_NOT_TRIGGERED:
+            processResults.printProcessErrorOutput(System.err);
+            throw new RuntimeException("TEST IS FAILED: Target applet can intercept data " +
+                    "without a clipboard permission and an exception handler was not triggered.");
+            //Unreachable...
+
+        case InterprocessMessages.DATA_WAS_INTERCEPTED:
+            processResults.printProcessErrorOutput(System.err);
+            throw new RuntimeException("TEST IS FAILED: Target applet can intercept data " +
+                    "without a clipboard permission");
+            //Unreachable...
+
+        case InterprocessMessages.EXCEPTION_HANDLER_WAS_NOT_TRIGGERED:
+            processResults.printProcessErrorOutput(System.err);
+            throw new RuntimeException("TEST IS FAILED: An exception handler was not triggered.");
+            //Unreachable...
+
+    }
+
+        //    The child process throws an exception. do not look at the stderr.
+        processResults.verifyStdErr(System.err);
+        processResults.verifyProcessExitValue(System.err);
+        processResults.printProcessStandartOutput(System.out);
+    }
+
+    //We cannot make an instance of the applet without the default constructor
+    public DragInterceptorAppletTest() {
+        super();
+    }
+
+    //We need in this constructor to pass frame position between JVMs
+    public DragInterceptorAppletTest(Point targetFrameLocation, Point dragSourcePoint)
+            throws InterruptedException
+    {
+        DragInterceptorFrame targetFrame = new DragInterceptorFrame(targetFrameLocation);
+
+        Util.waitForIdle(null);
+
+        final Robot robot = Util.createRobot();
+
+        robot.mouseMove((int)dragSourcePoint.getX(),(int)dragSourcePoint.getY());
+        sleep(100);
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        sleep(100);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+        sleep(100);
+
+        Util.drag(robot, dragSourcePoint, targetFrame.getDropTargetPoint(),
+                InputEvent.BUTTON1_MASK);
+
+        sleep(2000);
+        ProcessCommunicator.destroyProcess();
+    }
+
+    enum InterprocessArguments {
+        TARGET_FRAME_X_POSITION_ARGUMENT,
+        TARGET_FRAME_Y_POSITION_ARGUMENT,
+        DRAG_SOURCE_POINT_X_ARGUMENT,
+        DRAG_SOURCE_POINT_Y_ARGUMENT;
+
+        int extract (String [] args) {
+            return Integer.parseInt(args[this.ordinal()]);
+        }
+    }
+
+    public static void main (String [] args) {
+        Point dragSourcePoint = new Point(InterprocessArguments.DRAG_SOURCE_POINT_X_ARGUMENT.extract(args),
+                InterprocessArguments.DRAG_SOURCE_POINT_Y_ARGUMENT.extract(args));
+        Point targetFrameLocation = new Point(InterprocessArguments.TARGET_FRAME_X_POSITION_ARGUMENT.extract(args),
+                InterprocessArguments.TARGET_FRAME_Y_POSITION_ARGUMENT.extract(args));
+        try {
+            new DragInterceptorAppletTest(targetFrameLocation, dragSourcePoint);
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+            throw new RuntimeException(e);
+        }
+    }
+
+}// class DragInterceptorAppletTest
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/dnd/DragInterceptorAppletTest/DragInterceptorFrame.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,128 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.UnsupportedFlavorException;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.awt.dnd.*;
+import java.io.IOException;
+import java.security.Permission;
+import java.security.AccessControlException;
+
+class DragInterceptorFrame extends Frame implements DropTargetListener {
+
+    private static int exitMessage = InterprocessMessages.TEST_PASSED;
+    private static boolean dataIsAccessible = false;
+    private static boolean exceptionHasBeenThrown = false;
+
+    DragInterceptorFrame(Point location) {
+        System.setSecurityManager(new ClipboardDefender());
+        initGUI(location);
+        setDropTarget(new DropTarget(this, DnDConstants.ACTION_COPY,
+                this));
+    }
+
+    private void initGUI(Point location) {
+        this.setLocation(location);
+        this.addWindowListener(new WindowAdapter() {
+            public void windowClosing(WindowEvent e) {
+                DragInterceptorFrame.this.dispose();
+            }
+        });
+        setSize (200, 200);
+        this.setVisible(true);
+    }
+
+    public void dragEnter(DropTargetDragEvent dtde) {
+        // We want to set the exception handler on EDT
+        Thread.currentThread().setUncaughtExceptionHandler (
+            new Thread.UncaughtExceptionHandler() {
+                public void uncaughtException(Thread t, Throwable e) {
+                    exceptionHasBeenThrown = true;
+                }
+            }
+        );
+        examineTransferable(dtde);
+    }
+
+    public void dragOver(DropTargetDragEvent dtde) {
+        examineTransferable(dtde);
+    }
+
+    public void dropActionChanged(DropTargetDragEvent dtde) {
+        examineTransferable(dtde);
+    }
+
+    public void dragExit(DropTargetEvent dte) {}
+
+    public void drop(DropTargetDropEvent dtde) {
+
+        if (dataIsAccessible && !exceptionHasBeenThrown) {
+            exitMessage = InterprocessMessages.DATA_WAS_INTERCEPTED_AND_EXCEPTION_HANDLER_WAS_NOT_TRIGGERED;
+        } else if (dataIsAccessible) {
+            exitMessage = InterprocessMessages.DATA_WAS_INTERCEPTED;
+        } else if (!exceptionHasBeenThrown) {
+            exitMessage = InterprocessMessages.EXCEPTION_HANDLER_WAS_NOT_TRIGGERED;
+        }
+
+        // This returns the diagnostic code from the child VM
+        System.exit(exitMessage);
+    }
+
+    Point getDropTargetPoint() {
+        return new Point((int)getLocationOnScreen().getX()+(getWidth()/2),
+                (int)getLocationOnScreen().getY()+(getHeight()/2));
+    }
+
+    private void examineTransferable(DropTargetDragEvent dtde) {
+        if (dtde.getCurrentDataFlavorsAsList().contains(DataFlavor.stringFlavor)) {
+            dtde.acceptDrag(DnDConstants.ACTION_COPY);
+            try{
+                if (null != dtde.getTransferable().getTransferData(DataFlavor.stringFlavor)) {
+                    dataIsAccessible = true;
+                }
+            } catch (IOException e) {
+                e.printStackTrace();
+                exitMessage = InterprocessMessages.UNEXPECTED_IO_EXCEPTION;
+            } catch (UnsupportedFlavorException e) {
+                e.printStackTrace();
+                exitMessage = InterprocessMessages.UNEXPECTED_UNSUPPORTED_FLAVOR_EXCEPTION;
+            }
+        }
+    }
+
+    static class ClipboardDefender extends SecurityManager {
+        public void checkPermission(Permission p) {
+           if (p instanceof java.awt.AWTPermission &&
+                   p.getName().equals("accessClipboard")) {
+               throw new AccessControlException("access denied ");
+           }
+        }
+    }
+
+    public static void main(String[] args) {
+        new DragInterceptorFrame(new Point(200,200));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/dnd/DragInterceptorAppletTest/InterprocessMessages.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+public interface InterprocessMessages {
+    final static int TEST_PASSED = 0;
+    final static int DATA_WAS_INTERCEPTED = 212;
+    final static int EXCEPTION_HANDLER_WAS_NOT_TRIGGERED = 213;
+    final static int DATA_WAS_INTERCEPTED_AND_EXCEPTION_HANDLER_WAS_NOT_TRIGGERED  = 214;
+
+    final static int UNEXPECTED_IO_EXCEPTION = 400;
+    final static int UNEXPECTED_UNSUPPORTED_FLAVOR_EXCEPTION = 401;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/dnd/DragInterceptorAppletTest/SourceFrame.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import test.java.awt.regtesthelpers.Util;
+
+import java.awt.*;
+import java.awt.datatransfer.StringSelection;
+import java.awt.dnd.DragGestureListener;
+import java.awt.dnd.DragSource;
+import java.awt.dnd.DnDConstants;
+import java.awt.dnd.DragGestureEvent;
+
+class SourceFrame extends Frame implements DragGestureListener {
+
+    SourceFrame() {
+        super("Source File List Frame");
+        initGUI();
+        new DragSource().createDefaultDragGestureRecognizer(this,
+                DnDConstants.ACTION_COPY,this);
+    }
+
+    private void initGUI() {
+        this.addWindowListener(Util.getClosingWindowAdapter());
+        this.setLocation(300,250);
+        this.setSize(200,200);
+        this.setVisible(true);
+    }
+
+    int getNextLocationX() {
+        return getX()+getWidth();
+    }
+
+    int getNextLocationY() {
+        return getY();
+    }
+
+    int getDragSourcePointX() {
+        return (int)getLocationOnScreen().getX()+(getWidth()/2);
+    }
+
+   int getDragSourcePointY() {
+        return (int)getLocationOnScreen().getY()+ (getHeight()/2);
+    }
+
+    public void dragGestureRecognized(DragGestureEvent dge) {
+        dge.startDrag(null, new StringSelection("A TEXT"));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/dnd/InterJVMGetDropSuccessTest/InterJVMGetDropSuccessTest.html	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,43 @@
+<!--
+ Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.
+
+ This code is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ or visit www.oracle.com if you need additional information or have any
+ questions.
+-->
+
+<html>
+<!--  
+  @test
+  @bug 4658741
+  @summary verifies that getDropSuccess() returns correct value for inter-JVM DnD
+  @author das@sparc.spb.su area=dnd
+  @run applet InterJVMGetDropSuccessTest.html
+  -->
+<head>
+<title>  </title>
+</head>
+<body>
+
+<h1>InterJVMGetDropSuccessTest<br>Bug ID: 4658741</h1>
+
+<p> This is an AUTOMATIC test, simply wait for completion </p>
+
+<APPLET CODE="InterJVMGetDropSuccessTest.class" WIDTH=200 HEIGHT=200></APPLET>
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/dnd/InterJVMGetDropSuccessTest/InterJVMGetDropSuccessTest.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,499 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+  test
+  @bug 4658741
+  @summary verifies that getDropSuccess() returns correct value for inter-JVM DnD
+  @author das@sparc.spb.su area=dnd
+  @run applet InterJVMGetDropSuccessTest.html
+*/
+
+// Note there is no @ in front of test above.  This is so that the
+//  harness will not mistake this file as a test file.  It should
+//  only see the html file as a test file. (the harness runs all
+//  valid test files, so it would run this test twice if this file
+//  were valid as well as the html file.)
+// Also, note the area= after Your Name in the author tag.  Here, you
+//  should put which functional area the test falls in.  See the
+//  AWT-core home page -> test areas and/or -> AWT team  for a list of
+//  areas.
+// Note also the 'InterJVMGetDropSuccessTest.html' in the run tag.  This should
+//  be changed to the name of the test.
+
+
+/**
+ * InterJVMGetDropSuccessTest.java
+ *
+ * summary: verifies that getDropSuccess() returns correct value for inter-JVM DnD
+ */
+
+import java.applet.Applet;
+import java.awt.*;
+import java.awt.datatransfer.*;
+import java.awt.dnd.*;
+import java.awt.event.*;
+import java.io.*;
+import javax.swing.*;
+
+
+//Automated tests should run as applet tests if possible because they
+// get their environments cleaned up, including AWT threads, any
+// test created threads, and any system resources used by the test
+// such as file descriptors.  (This is normally not a problem as
+// main tests usually run in a separate VM, however on some platforms
+// such as the Mac, separate VMs are not possible and non-applet
+// tests will cause problems).  Also, you don't have to worry about
+// synchronisation stuff in Applet tests they way you do in main
+// tests...
+
+
+public class InterJVMGetDropSuccessTest extends Applet {
+
+    private int returnCode = Util.CODE_NOT_RETURNED;
+    private boolean successCodes[] = { true, false };
+    private int dropCount = 0;
+
+    final Frame frame = new Frame("Target Frame");
+
+    final DropTargetListener dropTargetListener = new DropTargetAdapter() {
+            public void drop(DropTargetDropEvent dtde) {
+                dtde.acceptDrop(DnDConstants.ACTION_COPY);
+                dtde.dropComplete(successCodes[dropCount]);
+                dropCount++;
+            }
+        };
+    final DropTarget dropTarget = new DropTarget(frame, dropTargetListener);
+
+    public void init() {
+        //Create instructions for the user here, as well as set up
+        // the environment -- set the layout manager, add buttons,
+        // etc.
+
+        String[] instructions =
+        {
+            "This is an AUTOMATIC test",
+            "simply wait until it is done"
+        };
+        Sysout.createDialog( );
+        Sysout.printInstructions( instructions );
+
+        frame.setTitle("Test frame");
+        frame.setBounds(100, 100, 150, 150);
+    } // init()
+
+    public void start() {
+
+        frame.setVisible(true);
+
+        try {
+            Thread.sleep(Util.FRAME_ACTIVATION_TIMEOUT);
+
+            Point p = frame.getLocationOnScreen();
+            Dimension d = frame.getSize();
+
+            String javaPath = System.getProperty("java.home", "");
+            String command = javaPath + File.separator + "bin" +
+                File.separator + "java -cp " + System.getProperty("test.classes", ".") +
+                " Child " +
+                p.x + " " + p.y + " " + d.width + " " + d.height;
+
+            Process process = Runtime.getRuntime().exec(command);
+            returnCode = process.waitFor();
+
+            InputStream errorStream = process.getErrorStream();
+            int count = errorStream.available();
+            if (count > 0) {
+                byte[] b = new byte[count];
+                errorStream.read(b);
+                System.err.println("========= Child VM System.err ========");
+                System.err.print(new String(b));
+                System.err.println("======================================");
+            }
+
+            InputStream outputStream = process.getInputStream();
+            count = outputStream.available();
+            if (count > 0) {
+                byte[] b = new byte[count];
+                outputStream.read(b);
+                System.err.println("========= Child VM System.out ========");
+                System.err.print(new String(b));
+                System.err.println("======================================");
+            }
+        } catch (Throwable e) {
+            e.printStackTrace();
+            throw new RuntimeException(e);
+        }
+        switch (returnCode) {
+        case Util.CODE_NOT_RETURNED:
+            throw new RuntimeException("Child VM: failed to start");
+        case Util.CODE_FAILURE:
+            throw new RuntimeException("Child VM: abnormal termination");
+        default:
+            if (dropCount == 2) {
+                int expectedRetCode = 0;
+                if (successCodes[0]) {
+                    expectedRetCode |= Util.CODE_FIRST_SUCCESS;
+                }
+                if (successCodes[1]) {
+                    expectedRetCode |= Util.CODE_SECOND_SUCCESS;
+                }
+                if (expectedRetCode != returnCode) {
+                    throw new RuntimeException("The test failed. Expected:" +
+                                               expectedRetCode + ". Returned:" +
+                                               returnCode);
+                }
+            }
+            break;
+        }
+    } // start()
+} // class InterJVMGetDropSuccessTest
+
+final class Util implements AWTEventListener {
+    public static final int CODE_NOT_RETURNED = -1;
+    public static final int CODE_FIRST_SUCCESS = 0x2;
+    public static final int CODE_SECOND_SUCCESS = 0x2;
+    public static final int CODE_FAILURE = 0x1;
+
+    public static final int FRAME_ACTIVATION_TIMEOUT = 3000;
+
+    static final Object SYNC_LOCK = new Object();
+    static final int MOUSE_RELEASE_TIMEOUT = 1000;
+
+    static final Util theInstance = new Util();
+
+    static {
+        Toolkit.getDefaultToolkit().addAWTEventListener(theInstance, AWTEvent.MOUSE_EVENT_MASK);
+    }
+
+    public static Point getCenterLocationOnScreen(Component c) {
+        Point p = c.getLocationOnScreen();
+        Dimension d = c.getSize();
+        p.translate(d.width / 2, d.height / 2);
+        return p;
+    }
+
+    public static int sign(int n) {
+        return n < 0 ? -1 : n == 0 ? 0 : 1;
+    }
+
+    private Component clickedComponent = null;
+
+    private void reset() {
+        clickedComponent = null;
+    }
+
+    public void eventDispatched(AWTEvent e) {
+        if (e.getID() == MouseEvent.MOUSE_RELEASED) {
+            clickedComponent = (Component)e.getSource();
+            synchronized (SYNC_LOCK) {
+                SYNC_LOCK.notifyAll();
+            }
+        }
+    }
+
+    public static boolean pointInComponent(Robot robot, Point p, Component comp)
+      throws InterruptedException {
+        return theInstance.pointInComponentImpl(robot, p, comp);
+    }
+
+    private boolean pointInComponentImpl(Robot robot, Point p, Component comp)
+      throws InterruptedException {
+        robot.waitForIdle();
+        reset();
+        robot.mouseMove(p.x, p.y);
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        synchronized (SYNC_LOCK) {
+            robot.mouseRelease(InputEvent.BUTTON1_MASK);
+            SYNC_LOCK.wait(MOUSE_RELEASE_TIMEOUT);
+        }
+
+        Component c = clickedComponent;
+
+        while (c != null && c != comp) {
+            c = c.getParent();
+        }
+
+        return c == comp;
+    }
+}
+
+class Child {
+    static class DragSourceDropListener extends DragSourceAdapter {
+        private boolean finished = false;
+        private boolean dropSuccess = false;
+
+        public void reset() {
+            finished = false;
+            dropSuccess = false;
+        }
+
+        public boolean isDropFinished() {
+            return finished;
+        }
+
+        public boolean getDropSuccess() {
+            return dropSuccess;
+        }
+
+        public void dragDropEnd(DragSourceDropEvent dsde) {
+            finished = true;
+            dropSuccess = dsde.getDropSuccess();
+            synchronized (Util.SYNC_LOCK) {
+                Util.SYNC_LOCK.notifyAll();
+            }
+        }
+    }
+
+    final Frame frame = new Frame("Source Frame");
+    final DragSource dragSource = DragSource.getDefaultDragSource();
+    final DragSourceDropListener dragSourceListener = new DragSourceDropListener();
+    final Transferable transferable = new StringSelection("TEXT");
+    final DragGestureListener dragGestureListener = new DragGestureListener() {
+            public void dragGestureRecognized(DragGestureEvent dge) {
+                dge.startDrag(null, transferable, dragSourceListener);
+            }
+        };
+    final DragGestureRecognizer dragGestureRecognizer =
+        dragSource.createDefaultDragGestureRecognizer(frame, DnDConstants.ACTION_COPY,
+                                                      dragGestureListener);
+
+    public static void main(String[] args) {
+        Child child = new Child();
+        child.run(args);
+    }
+
+    public void run(String[] args) {
+        try {
+            if (args.length != 4) {
+                throw new RuntimeException("Incorrect command line arguments.");
+            }
+
+            int x = Integer.parseInt(args[0]);
+            int y = Integer.parseInt(args[1]);
+            int w = Integer.parseInt(args[2]);
+            int h = Integer.parseInt(args[3]);
+
+            frame.setBounds(300, 200, 150, 150);
+            frame.setVisible(true);
+
+            Thread.sleep(Util.FRAME_ACTIVATION_TIMEOUT);
+
+            Point sourcePoint = Util.getCenterLocationOnScreen(frame);
+
+            Point targetPoint = new Point(x + w / 2, y + h / 2);
+
+            Robot robot = new Robot();
+            robot.mouseMove(sourcePoint.x, sourcePoint.y);
+            robot.mousePress(InputEvent.BUTTON1_MASK);
+            for (Point p = new Point(sourcePoint); !p.equals(targetPoint);
+                 p.translate(Util.sign(targetPoint.x - p.x),
+                             Util.sign(targetPoint.y - p.y))) {
+                robot.mouseMove(p.x, p.y);
+                Thread.sleep(50);
+            }
+
+            synchronized (Util.SYNC_LOCK) {
+                robot.mouseRelease(InputEvent.BUTTON1_MASK);
+                Util.SYNC_LOCK.wait(Util.FRAME_ACTIVATION_TIMEOUT);
+            }
+
+            if (!dragSourceListener.isDropFinished()) {
+                throw new RuntimeException("Drop not finished");
+            }
+
+            boolean success1 = dragSourceListener.getDropSuccess();
+
+            dragSourceListener.reset();
+            robot.mouseMove(sourcePoint.x, sourcePoint.y);
+            robot.mousePress(InputEvent.BUTTON1_MASK);
+            for (Point p = new Point(sourcePoint); !p.equals(targetPoint);
+                 p.translate(Util.sign(targetPoint.x - p.x),
+                             Util.sign(targetPoint.y - p.y))) {
+                robot.mouseMove(p.x, p.y);
+                Thread.sleep(50);
+            }
+
+            synchronized (Util.SYNC_LOCK) {
+                robot.mouseRelease(InputEvent.BUTTON1_MASK);
+                Util.SYNC_LOCK.wait(Util.FRAME_ACTIVATION_TIMEOUT);
+            }
+
+            if (!dragSourceListener.isDropFinished()) {
+                throw new RuntimeException("Drop not finished");
+            }
+
+            boolean success2 = dragSourceListener.getDropSuccess();
+            int retCode = 0;
+
+            if (success1) {
+                retCode |= Util.CODE_FIRST_SUCCESS;
+            }
+            if (success2) {
+                retCode |= Util.CODE_SECOND_SUCCESS;
+            }
+            // This returns the diagnostic code from the child VM
+            System.exit(retCode);
+        } catch (Throwable e) {
+            e.printStackTrace();
+            // This returns the diagnostic code from the child VM
+            System.exit(Util.CODE_FAILURE);
+        }
+    } // run()
+} // class child
+
+/****************************************************
+ Standard Test Machinery
+ DO NOT modify anything below -- it's a standard
+  chunk of code whose purpose is to make user
+  interaction uniform, and thereby make it simpler
+  to read and understand someone else's test.
+ ****************************************************/
+
+/**
+ This is part of the standard test machinery.
+ It creates a dialog (with the instructions), and is the interface
+  for sending text messages to the user.
+ To print the instructions, send an array of strings to Sysout.createDialog
+  WithInstructions method.  Put one line of instructions per array entry.
+ To display a message for the tester to see, simply call Sysout.println
+  with the string to be displayed.
+ This mimics System.out.println but works within the test harness as well
+  as standalone.
+ */
+
+class Sysout
+ {
+   private static TestDialog dialog;
+
+   public static void createDialogWithInstructions( String[] instructions )
+    {
+      dialog = new TestDialog( new Frame(), "Instructions" );
+      dialog.printInstructions( instructions );
+      dialog.show();
+      println( "Any messages for the tester will display here." );
+    }
+
+   public static void createDialog( )
+    {
+      dialog = new TestDialog( new Frame(), "Instructions" );
+      String[] defInstr = { "Instructions will appear here. ", "" } ;
+      dialog.printInstructions( defInstr );
+      dialog.show();
+      println( "Any messages for the tester will display here." );
+    }
+
+
+   public static void printInstructions( String[] instructions )
+    {
+      dialog.printInstructions( instructions );
+    }
+
+
+   public static void println( String messageIn )
+    {
+      dialog.displayMessage( messageIn );
+    }
+
+ }// Sysout  class
+
+/**
+  This is part of the standard test machinery.  It provides a place for the
+   test instructions to be displayed, and a place for interactive messages
+   to the user to be displayed.
+  To have the test instructions displayed, see Sysout.
+  To have a message to the user be displayed, see Sysout.
+  Do not call anything in this dialog directly.
+  */
+class TestDialog extends Dialog
+ {
+
+   TextArea instructionsText;
+   TextArea messageText;
+   int maxStringLength = 80;
+
+   //DO NOT call this directly, go through Sysout
+   public TestDialog( Frame frame, String name )
+    {
+      super( frame, name );
+      int scrollBoth = TextArea.SCROLLBARS_BOTH;
+      instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth );
+      add( "North", instructionsText );
+
+      messageText = new TextArea( "", 5, maxStringLength, scrollBoth );
+      add("South", messageText);
+
+      pack();
+
+      show();
+    }// TestDialog()
+
+   //DO NOT call this directly, go through Sysout
+   public void printInstructions( String[] instructions )
+    {
+      //Clear out any current instructions
+      instructionsText.setText( "" );
+
+      //Go down array of instruction strings
+
+      String printStr, remainingStr;
+      for( int i=0; i < instructions.length; i++ )
+       {
+         //chop up each into pieces maxSringLength long
+         remainingStr = instructions[ i ];
+         while( remainingStr.length() > 0 )
+          {
+            //if longer than max then chop off first max chars to print
+            if( remainingStr.length() >= maxStringLength )
+             {
+               //Try to chop on a word boundary
+               int posOfSpace = remainingStr.
+                  lastIndexOf( ' ', maxStringLength - 1 );
+
+               if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1;
+
+               printStr = remainingStr.substring( 0, posOfSpace + 1 );
+               remainingStr = remainingStr.substring( posOfSpace + 1 );
+             }
+            //else just print
+            else
+             {
+               printStr = remainingStr;
+               remainingStr = "";
+             }
+
+            instructionsText.append( printStr + "\n" );
+
+          }// while
+
+       }// for
+
+    }//printInstructions()
+
+   //DO NOT call this directly, go through Sysout
+   public void displayMessage( String messageIn )
+    {
+      messageText.append( messageIn + "\n" );
+    }
+
+ }// TestDialog  class
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/dnd/NoFormatsCrashTest/NoFormatsCrashTest.html	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,45 @@
+<!--
+ Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.
+
+ This code is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ or visit www.oracle.com if you need additional information or have any
+ questions.
+-->
+
+<html>
+<!--  
+  @test
+  @bug 4870762
+  @summary tests that a drop target JVM doesn't crash if the source doesn't export 
+           data in native formats.
+  @author das@sparc.spb.su area=dnd
+  @run applet NoFormatsCrashTest.html
+  -->
+<head>
+<title>  </title>
+</head>
+<body>
+
+<h1>NoFormatsCrashTest<br>Bug ID: 4870762</h1>
+
+<p> This is an AUTOMATIC test, simply wait for completion </p>
+
+<APPLET CODE="NoFormatsCrashTest.class" WIDTH=200 HEIGHT=200></APPLET>
+</body>
+</html>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/dnd/NoFormatsCrashTest/NoFormatsCrashTest.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,488 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+  test
+  @bug 4870762
+  @summary tests that a drop target JVM doesn't crash if the source doesn't export
+           data in native formats.
+  @author das@sparc.spb.su area=dnd
+  @compile NoFormatsCrashTest.java
+  @run applet NoFormatsCrashTest.html
+*/
+
+// Note there is no @ in front of test above.  This is so that the
+//  harness will not mistake this file as a test file.  It should
+//  only see the html file as a test file. (the harness runs all
+//  valid test files, so it would run this test twice if this file
+//  were valid as well as the html file.)
+// Also, note the area= after Your Name in the author tag.  Here, you
+//  should put which functional area the test falls in.  See the
+//  AWT-core home page -> test areas and/or -> AWT team  for a list of
+//  areas.
+// Note also the 'NoFormatsCrashTest.html' in the run tag.  This should
+//  be changed to the name of the test.
+
+
+/**
+ * NoFormatsCrashTest.java
+ *
+ * summary: tests that a drop target JVM doesn't crash if the source doesn't export
+ *          data in native formats.
+ */
+
+import java.applet.Applet;
+import java.awt.*;
+import java.awt.datatransfer.*;
+import java.awt.dnd.*;
+import java.awt.event.*;
+import java.io.*;
+
+
+//Automated tests should run as applet tests if possible because they
+// get their environments cleaned up, including AWT threads, any
+// test created threads, and any system resources used by the test
+// such as file descriptors.  (This is normally not a problem as
+// main tests usually run in a separate VM, however on some platforms
+// such as the Mac, separate VMs are not possible and non-applet
+// tests will cause problems).  Also, you don't have to worry about
+// synchronisation stuff in Applet tests they way you do in main
+// tests...
+
+
+public class NoFormatsCrashTest extends Applet {
+
+    final Frame frame = new Frame();
+    private volatile Process process;
+
+    static final int FRAME_ACTIVATION_TIMEOUT = 2000;
+
+    public static void main(String[] args) {
+        NoFormatsCrashTest test = new NoFormatsCrashTest();
+        test.run(args);
+    }
+
+    public void run(String[] args) {
+        try {
+            if (args.length != 4) {
+                throw new RuntimeException("Incorrect command line arguments.");
+            }
+
+            int x = Integer.parseInt(args[0]);
+            int y = Integer.parseInt(args[1]);
+            int w = Integer.parseInt(args[2]);
+            int h = Integer.parseInt(args[3]);
+
+            Panel panel = new DragSourcePanel();
+
+            frame.setTitle("Drag source frame");
+            frame.setLocation(500, 200);
+            frame.add(panel);
+            frame.pack();
+            frame.setVisible(true);
+
+            Thread.sleep(FRAME_ACTIVATION_TIMEOUT);
+
+            Point sourcePoint = panel.getLocationOnScreen();
+            Dimension d = panel.getSize();
+            sourcePoint.translate(d.width / 2, d.height / 2);
+
+            Point targetPoint = new Point(x + w / 2, y + h / 2);
+
+            Robot robot = new Robot();
+            robot.mouseMove(sourcePoint.x, sourcePoint.y);
+            robot.keyPress(KeyEvent.VK_CONTROL);
+            robot.mousePress(InputEvent.BUTTON1_MASK);
+            for (; !sourcePoint.equals(targetPoint);
+                 sourcePoint.translate(sign(targetPoint.x - sourcePoint.x),
+                                       sign(targetPoint.y - sourcePoint.y))) {
+                robot.mouseMove(sourcePoint.x, sourcePoint.y);
+                Thread.sleep(50);
+            }
+            robot.mouseRelease(InputEvent.BUTTON1_MASK);
+            robot.keyRelease(KeyEvent.VK_CONTROL);
+
+            Thread.sleep(FRAME_ACTIVATION_TIMEOUT);
+
+            if (process.isAlive()) {
+                process.destroy();
+            }
+        } catch (Throwable e) {
+            e.printStackTrace();
+            throw new RuntimeException(e);
+        }
+    } // run()
+
+    public void init() {
+        //Create instructions for the user here, as well as set up
+        // the environment -- set the layout manager, add buttons,
+        // etc.
+
+        String[] instructions =
+        {
+            "This is an AUTOMATIC test",
+            "simply wait until it is done"
+        };
+        Sysout.createDialog( );
+        Sysout.printInstructions( instructions );
+
+        frame.setTitle("Drop target frame");
+        frame.setLocation(200, 200);
+
+    } // init()
+
+    public void start() {
+        DropTargetPanel panel = new DropTargetPanel();
+        frame.add(panel);
+        frame.pack();
+        frame.setVisible(true);
+
+        try {
+            Thread.sleep(FRAME_ACTIVATION_TIMEOUT);
+
+            Point p = frame.getLocationOnScreen();
+            Dimension d = frame.getSize();
+
+            String javaPath = System.getProperty("java.home", "");
+            String command = javaPath + File.separator + "bin" +
+                File.separator + "java -cp " + System.getProperty("test.classes", ".") +
+                " NoFormatsCrashTest " +
+                p.x + " " + p.y + " " + d.width + " " + d.height;
+
+            process = Runtime.getRuntime().exec(command);
+            ProcessResults pres = ProcessResults.doWaitFor(process);
+            System.err.println("Child VM return code: " + pres.exitValue);
+
+            if (pres.stderr != null && pres.stderr.length() > 0) {
+                System.err.println("========= Child VM System.err ========");
+                System.err.print(pres.stderr);
+                System.err.println("======================================");
+            }
+
+            if (pres.stdout != null && pres.stdout.length() > 0) {
+                System.err.println("========= Child VM System.out ========");
+                System.err.print(pres.stdout);
+                System.err.println("======================================");
+            }
+
+        } catch (Throwable e) {
+            e.printStackTrace();
+            throw new RuntimeException(e);
+        }
+
+        if (panel.isTestFailed()) {
+            throw new RuntimeException();
+        }
+    } // start()
+
+    public static int sign(int n) {
+        return n < 0 ? -1 : n > 0 ? 1 : 0;
+    }
+} // class NoFormatsCrashTest
+
+class TestTransferable implements Transferable {
+
+    public static DataFlavor dataFlavor = null;
+    static final Object data = new Object();
+
+    static {
+        DataFlavor df = null;
+        try {
+            df = new DataFlavor(DataFlavor.javaJVMLocalObjectMimeType +
+                                "; class=java.lang.Object");
+        } catch (ClassNotFoundException e) {
+            throw new ExceptionInInitializerError(e);
+        }
+        dataFlavor = df;
+    }
+
+    public DataFlavor[] getTransferDataFlavors() {
+        return new DataFlavor[] { dataFlavor };
+    }
+
+    public boolean isDataFlavorSupported(DataFlavor df) {
+        return dataFlavor.equals(df);
+    }
+
+    public Object getTransferData(DataFlavor df)
+      throws UnsupportedFlavorException, IOException {
+        if (!isDataFlavorSupported(df)) {
+            throw new UnsupportedFlavorException(df);
+        }
+        return data;
+    }
+}
+
+class DragSourcePanel extends Panel {
+    public DragSourcePanel() {
+        final Transferable t = new TestTransferable();
+        final DragSourceListener dsl = new DragSourceAdapter() {
+                public void dragDropEnd(DragSourceDropEvent dtde) {
+                    try {
+                        Thread.sleep(100);
+                    } catch (InterruptedException e) {
+                        e.printStackTrace();
+                    }
+                    // This finishes child VM
+                    System.exit(0);
+                }
+            };
+        final DragGestureListener dgl = new DragGestureListener() {
+                public void dragGestureRecognized(DragGestureEvent dge) {
+                    dge.startDrag(null, t, dsl);
+                }
+            };
+        final DragSource ds = DragSource.getDefaultDragSource();
+        final DragGestureRecognizer dgr =
+            ds.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY,
+                                                  dgl);
+    }
+
+    public Dimension getPreferredSize() {
+        return new Dimension(100, 100);
+    }
+}
+
+class DropTargetPanel extends Panel {
+    private boolean testFailed = false;
+    public DropTargetPanel() {
+        final DropTargetListener dtl = new DropTargetAdapter() {
+                public void dragOver(DropTargetDragEvent dtde) {
+                    try {
+                        dtde.getCurrentDataFlavorsAsList();
+                    } catch (Exception e) {
+                        testFailed = true;
+                        e.printStackTrace();
+                    }
+                }
+                public void drop(DropTargetDropEvent dtde) {
+                    dtde.rejectDrop();
+                }
+            };
+        final DropTarget dt = new DropTarget(this, dtl);
+    }
+
+    public boolean isTestFailed() {
+        return testFailed;
+    }
+
+    public Dimension getPreferredSize() {
+        return new Dimension(100, 100);
+    }
+}
+
+class ProcessResults {
+    public int exitValue;
+    public String stdout;
+    public String stderr;
+
+    public ProcessResults() {
+        exitValue = -1;
+        stdout = "";
+        stderr = "";
+    }
+
+    /**
+     * Method to perform a "wait" for a process and return its exit value.
+     * This is a workaround for <code>Process.waitFor()</code> never returning.
+     */
+    public static ProcessResults doWaitFor(Process p) {
+        ProcessResults pres = new ProcessResults();
+
+        InputStream in = null;
+        InputStream err = null;
+
+        try {
+            in = p.getInputStream();
+            err = p.getErrorStream();
+
+            boolean finished = false;
+
+            while (!finished) {
+                try {
+                    while (in.available() > 0) {
+                        pres.stdout += (char)in.read();
+                    }
+                    while (err.available() > 0) {
+                        pres.stderr += (char)err.read();
+                    }
+                    // Ask the process for its exitValue. If the process
+                    // is not finished, an IllegalThreadStateException
+                    // is thrown. If it is finished, we fall through and
+                    // the variable finished is set to true.
+                    pres.exitValue = p.exitValue();
+                    finished  = true;
+                }
+                catch (IllegalThreadStateException e) {
+                    // Process is not finished yet;
+                    // Sleep a little to save on CPU cycles
+                    Thread.currentThread().sleep(500);
+                }
+            }
+            if (in != null) in.close();
+            if (err != null) err.close();
+        }
+        catch (Throwable e) {
+            System.err.println("doWaitFor(): unexpected exception");
+            e.printStackTrace();
+            throw new RuntimeException(e);
+        }
+        return pres;
+    }
+}
+
+/****************************************************
+ Standard Test Machinery
+ DO NOT modify anything below -- it's a standard
+  chunk of code whose purpose is to make user
+  interaction uniform, and thereby make it simpler
+  to read and understand someone else's test.
+ ****************************************************/
+
+/**
+ This is part of the standard test machinery.
+ It creates a dialog (with the instructions), and is the interface
+  for sending text messages to the user.
+ To print the instructions, send an array of strings to Sysout.createDialog
+  WithInstructions method.  Put one line of instructions per array entry.
+ To display a message for the tester to see, simply call Sysout.println
+  with the string to be displayed.
+ This mimics System.out.println but works within the test harness as well
+  as standalone.
+ */
+
+class Sysout
+ {
+   private static TestDialog dialog;
+
+   public static void createDialogWithInstructions( String[] instructions )
+    {
+      dialog = new TestDialog( new Frame(), "Instructions" );
+      dialog.printInstructions( instructions );
+      dialog.show();
+      println( "Any messages for the tester will display here." );
+    }
+
+   public static void createDialog( )
+    {
+      dialog = new TestDialog( new Frame(), "Instructions" );
+      String[] defInstr = { "Instructions will appear here. ", "" } ;
+      dialog.printInstructions( defInstr );
+      dialog.show();
+      println( "Any messages for the tester will display here." );
+    }
+
+
+   public static void printInstructions( String[] instructions )
+    {
+      dialog.printInstructions( instructions );
+    }
+
+
+   public static void println( String messageIn )
+    {
+      dialog.displayMessage( messageIn );
+    }
+
+ }// Sysout  class
+
+/**
+  This is part of the standard test machinery.  It provides a place for the
+   test instructions to be displayed, and a place for interactive messages
+   to the user to be displayed.
+  To have the test instructions displayed, see Sysout.
+  To have a message to the user be displayed, see Sysout.
+  Do not call anything in this dialog directly.
+  */
+class TestDialog extends Dialog
+ {
+
+   TextArea instructionsText;
+   TextArea messageText;
+   int maxStringLength = 80;
+
+   //DO NOT call this directly, go through Sysout
+   public TestDialog( Frame frame, String name )
+    {
+      super( frame, name );
+      int scrollBoth = TextArea.SCROLLBARS_BOTH;
+      instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth );
+      add( "North", instructionsText );
+
+      messageText = new TextArea( "", 5, maxStringLength, scrollBoth );
+      add("South", messageText);
+
+      pack();
+
+      show();
+    }// TestDialog()
+
+   //DO NOT call this directly, go through Sysout
+   public void printInstructions( String[] instructions )
+    {
+      //Clear out any current instructions
+      instructionsText.setText( "" );
+
+      //Go down array of instruction strings
+
+      String printStr, remainingStr;
+      for( int i=0; i < instructions.length; i++ )
+       {
+         //chop up each into pieces maxSringLength long
+         remainingStr = instructions[ i ];
+         while( remainingStr.length() > 0 )
+          {
+            //if longer than max then chop off first max chars to print
+            if( remainingStr.length() >= maxStringLength )
+             {
+               //Try to chop on a word boundary
+               int posOfSpace = remainingStr.
+                  lastIndexOf( ' ', maxStringLength - 1 );
+
+               if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1;
+
+               printStr = remainingStr.substring( 0, posOfSpace + 1 );
+               remainingStr = remainingStr.substring( posOfSpace + 1 );
+             }
+            //else just print
+            else
+             {
+               printStr = remainingStr;
+               remainingStr = "";
+             }
+
+            instructionsText.append( printStr + "\n" );
+
+          }// while
+
+       }// for
+
+    }//printInstructions()
+
+   //DO NOT call this directly, go through Sysout
+   public void displayMessage( String messageIn )
+    {
+      messageText.append( messageIn + "\n" );
+    }
+
+ }// TestDialog  class
--- a/jdk/test/java/awt/regtesthelpers/process/ProcessCommunicator.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/test/java/awt/regtesthelpers/process/ProcessCommunicator.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,21 +25,22 @@
 
 import java.io.*;
 
-/** This class is created to solve interprocess communication problems.
+/**
+ *  This class is created to solve interprocess communication problems.
  *  When you need to write a regression test which should verify inter jvm
  *  behavior such as DnD data transfer, Clipboard data transfer, focus
  *  transfer etc., you could use the next scenario:
  *
  *  1. Write an implementation for the parent JVM, using applet test.
- *  2. Write an implimentation for the child JVM or native application, using
+ *  2. Write an implementation for the child JVM or native application, using
  *     main() function.
  *  3. Execute child process using  ProcessCommunicator.executeChildProcess()
  *     method.
- *  4. You can decide whetherthe test is passed on the basis of
+ *  4. You can decide whether the test is passed on the basis of
  *     ProcessResults class data.
  *
- *  Note: The class is not thread safe. You should access its methods only from the same
- *        thread.
+ *  Note: The class is not thread safe. You should access its methods only from
+ *        the same thread.
  */
 
 public class ProcessCommunicator {
@@ -48,31 +49,34 @@
     private static final String javaPath = javaHome + File.separator + "bin" +
             File.separator + "java ";
     private static String command = "";
+    private static volatile Process process;
 
     private ProcessCommunicator() {}
 
-    /** The same as {#link #executeChildProcess(Class,String)} except
-     *  the {@code classPathArgument} parameter. The class path
-     *  parameter is for the debug purposes
+    /**
+     * The same as {#link #executeChildProcess(Class,String)} except
+     * the {@code classPathArgument} parameter. The class path
+     * parameter is for the debug purposes
      *
-     *  @param classToExecute is passed to the child JVM
-     *  @param classPathArguments class path for the child JVM
-     *  @param args arguments that will be passed to the executed class
-     *  @return results of the executed {@code Process}
+     * @param classToExecute is passed to the child JVM
+     * @param classPathArguments class path for the child JVM
+     * @param args arguments that will be passed to the executed class
+     * @return results of the executed {@code Process}
      */
     public static ProcessResults executeChildProcess(final Class classToExecute,
                            final String classPathArguments, final String [] args)
     {
         try {
             String command = buildCommand(classToExecute, classPathArguments, args);
-            Process process = Runtime.getRuntime().exec(command);
+            process = Runtime.getRuntime().exec(command);
             return doWaitFor(process);
         } catch (IOException e) {
             throw new RuntimeException(e);
         }
     }
 
-    /** Executes child {code Process}
+    /**
+     * Executes child {code Process}
      *
      * @param classToExecute class to be executed as a child java process
      * @param args args to be passed in to the child process
@@ -86,11 +90,11 @@
 
     /**
      * Waits for a process and return its results.
-     * This is a workaround for <code>Process.waitFor()</code> never returning.
+     * This is a workaround for {@code Process.waitFor()} never returning.
      *
      * @return results of the executed {@code Process}
      */
-    private static ProcessResults doWaitFor(final Process p) {
+    public static ProcessResults doWaitFor(final Process p) {
         ProcessResults pres = new ProcessResults();
 
         final InputStream in;
@@ -133,13 +137,14 @@
         return pres;
     }
 
-    /** Builds command on the basis of the passed class name,
-     *  class path and arguments.
+    /**
+     * Builds command on the basis of the passed class name,
+     * class path and arguments.
      *
      * @param classToExecute with class will be executed in the new JVM
      * @param classPathArguments java class path (only for test purposes)
      * @param args arguments for the new application. This could be used
-     *             to pass some information from the parnent to child JVM.
+     *             to pass some information from the parent to child JVM.
      * @return command to execute the {@code Process}
      */
     private static String buildCommand(final Class classToExecute,
@@ -162,11 +167,24 @@
         return command;
     }
 
-    /** Could be used for the debug purposes.
+    /**
+     * Could be used for the debug purposes.
      *
-      * @return command that was build to execute the child process
+     * @return command that was build to execute the child process
      */
     public static String getExecutionCommand () {
         return command;
     }
+
+    /**
+     * Terminates the process created by {@code executeChildProcess} methods.
+     */
+    public static void destroyProcess() {
+        if (process != null) {
+            if (process.isAlive()) {
+                process.destroy();
+            }
+            process = null;
+        }
+    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/security/WarningWindowDisposeTest/WarningWindowDisposeCrashTest.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+  @test
+  @bug 8041490
+  @summary tests that the WarningWindow's surface is invalidated on dispose
+  @author Petr Pchelko
+  @run main/othervm WarningWindowDisposeCrashTest
+*/
+
+
+import sun.applet.AppletSecurity;
+import sun.awt.SunToolkit;
+
+import java.awt.*;
+
+public class WarningWindowDisposeCrashTest {
+    public static void main(String[] args) throws Exception {
+        System.setSecurityManager(new AppletSecurity() {
+            @Override
+            public void checkPackageAccess (String s){
+            }
+        });
+
+        Frame f = new Frame();
+        f.setVisible(true);
+        ((SunToolkit) Toolkit.getDefaultToolkit()).realSync();
+        Thread.sleep(1000);
+        f.dispose();
+        // If the bug is present VM could crash after this call
+        for (int i = 0; i < 1000; i++) Toolkit.getDefaultToolkit().sync();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/beans/Introspector/Test8040656.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,311 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.beans.Introspector;
+import java.beans.MethodDescriptor;
+
+/*
+ * @test
+ * @bug 8040656
+ * @summary Tests that a normal method is preferred to a synthetic one
+ * @author Sergey Malenkov
+ */
+
+public class Test8040656 {
+    public static void main(String[] args) throws Exception {
+        test(String.class, C.class);
+        test(String.class, C1.class);
+        test(String.class, C2.class);
+        test(String.class, C3.class);
+        test(String.class, C4.class);
+        test(String.class, C5.class);
+        test(String.class, C6.class);
+        test(String.class, C7.class);
+        test(String.class, C8.class);
+        test(String.class, C9.class);
+    }
+
+    private static void test(Class<?> type, Class<?> bean) throws Exception {
+        for (MethodDescriptor md : Introspector.getBeanInfo(bean).getMethodDescriptors()) {
+            if (md.getName().equals("getFoo")) {
+                if (type != md.getMethod().getReturnType()) {
+                    throw new Error("unexpected type");
+                }
+            }
+        }
+    }
+
+    public interface A {
+        public Object getFoo();
+    }
+
+    public class C implements A {
+        @Override
+        public String getFoo() {
+            return null;
+        }
+    }
+
+    public class C1 implements A {
+        @Override
+        public String getFoo() {
+            return null;
+        }
+
+        public String getFoo1() {
+            return null;
+        }
+    }
+
+    public class C2 implements A {
+        @Override
+        public String getFoo() {
+            return null;
+        }
+
+        public String getFoo1() {
+            return null;
+        }
+
+        public String getFoo2() {
+            return null;
+        }
+    }
+
+    public class C3 implements A {
+        @Override
+        public String getFoo() {
+            return null;
+        }
+
+        public String getFoo1() {
+            return null;
+        }
+
+        public String getFoo2() {
+            return null;
+        }
+
+        public String getFoo3() {
+            return null;
+        }
+    }
+
+    public class C4 implements A {
+        @Override
+        public String getFoo() {
+            return null;
+        }
+
+        public String getFoo1() {
+            return null;
+        }
+
+        public String getFoo2() {
+            return null;
+        }
+
+        public String getFoo3() {
+            return null;
+        }
+
+        public String getFoo4() {
+            return null;
+        }
+    }
+
+    public class C5 implements A {
+        @Override
+        public String getFoo() {
+            return null;
+        }
+
+        public String getFoo1() {
+            return null;
+        }
+
+        public String getFoo2() {
+            return null;
+        }
+
+        public String getFoo3() {
+            return null;
+        }
+
+        public String getFoo4() {
+            return null;
+        }
+
+        public String getFoo5() {
+            return null;
+        }
+    }
+
+    public class C6 implements A {
+        @Override
+        public String getFoo() {
+            return null;
+        }
+
+        public String getFoo1() {
+            return null;
+        }
+
+        public String getFoo2() {
+            return null;
+        }
+
+        public String getFoo3() {
+            return null;
+        }
+
+        public String getFoo4() {
+            return null;
+        }
+
+        public String getFoo5() {
+            return null;
+        }
+
+        public String getFoo6() {
+            return null;
+        }
+    }
+
+    public class C7 implements A {
+        @Override
+        public String getFoo() {
+            return null;
+        }
+
+        public String getFoo1() {
+            return null;
+        }
+
+        public String getFoo2() {
+            return null;
+        }
+
+        public String getFoo3() {
+            return null;
+        }
+
+        public String getFoo4() {
+            return null;
+        }
+
+        public String getFoo5() {
+            return null;
+        }
+
+        public String getFoo6() {
+            return null;
+        }
+
+        public String getFoo7() {
+            return null;
+        }
+    }
+
+    public class C8 implements A {
+        @Override
+        public String getFoo() {
+            return null;
+        }
+
+        public String getFoo1() {
+            return null;
+        }
+
+        public String getFoo2() {
+            return null;
+        }
+
+        public String getFoo3() {
+            return null;
+        }
+
+        public String getFoo4() {
+            return null;
+        }
+
+        public String getFoo5() {
+            return null;
+        }
+
+        public String getFoo6() {
+            return null;
+        }
+
+        public String getFoo7() {
+            return null;
+        }
+
+        public String getFoo8() {
+            return null;
+        }
+    }
+
+    public class C9 implements A {
+        @Override
+        public String getFoo() {
+            return null;
+        }
+
+        public String getFoo1() {
+            return null;
+        }
+
+        public String getFoo2() {
+            return null;
+        }
+
+        public String getFoo3() {
+            return null;
+        }
+
+        public String getFoo4() {
+            return null;
+        }
+
+        public String getFoo5() {
+            return null;
+        }
+
+        public String getFoo6() {
+            return null;
+        }
+
+        public String getFoo7() {
+            return null;
+        }
+
+        public String getFoo8() {
+            return null;
+        }
+
+        public String getFoo9() {
+            return null;
+        }
+    }
+}
--- a/jdk/test/java/lang/ProcessBuilder/Basic.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/test/java/lang/ProcessBuilder/Basic.java	Mon Jun 02 13:53:52 2014 -0700
@@ -26,7 +26,7 @@
  * @bug 4199068 4738465 4937983 4930681 4926230 4931433 4932663 4986689
  *      5026830 5023243 5070673 4052517 4811767 6192449 6397034 6413313
  *      6464154 6523983 6206031 4960438 6631352 6631966 6850957 6850958
- *      4947220 7018606 7034570 4244896 5049299
+ *      4947220 7018606 7034570 4244896 5049299 8003488
  * @summary Basic tests for Process and Environment Variable code
  * @run main/othervm/timeout=300 Basic
  * @run main/othervm/timeout=300 -Djdk.lang.Process.launchMechanism=fork Basic
@@ -1136,6 +1136,53 @@
         }
     }
 
+    static void checkProcessPid() {
+        long actualPid = 0;
+        long expectedPid = -1;
+        if (Windows.is()) {
+            String[] argsTasklist = {"tasklist.exe",  "/NH", "/FI",  "\"IMAGENAME eq tasklist.exe\""};
+            ProcessBuilder pb = new ProcessBuilder(argsTasklist);
+            try {
+                Process proc = pb.start();
+                expectedPid = proc.getPid();
+
+                String output = commandOutput(proc);
+                String[] splits = output.split("\\s+");
+                actualPid = Integer.valueOf(splits[2]);
+            } catch (Throwable t) {
+                unexpected(t);
+            }
+        } else if (Unix.is() || MacOSX.is()) {
+            String[]  shArgs = {"sh", "-c", "echo $$"};
+            ProcessBuilder pb = new ProcessBuilder(shArgs);
+            try {
+                Process proc = pb.start();
+                expectedPid = proc.getPid();
+
+                String output = commandOutput(proc);
+                String[] splits = output.split("\\s+");
+                actualPid = Integer.valueOf(splits[0]);
+            } catch (Throwable t) {
+                unexpected(t);
+            }
+        } else {
+            fail("No test for checkProcessPid on platform: " + System.getProperty("os.name"));
+            return;
+        }
+
+        equal(actualPid, expectedPid);
+
+        // Test the default implementation of Process.getPid
+        try {
+            DelegatingProcess p = new DelegatingProcess(null);
+            p.getPid();
+            fail("non-overridden Process.getPid method should throw UOE");
+        } catch (UnsupportedOperationException uoe) {
+            // correct
+        }
+
+    }
+
     private static void realMain(String[] args) throws Throwable {
         if (Windows.is())
             System.out.println("This appears to be a Windows system.");
@@ -1148,6 +1195,11 @@
         catch (Throwable t) { unexpected(t); }
 
         //----------------------------------------------------------------
+        // Basic tests for getPid()
+        //----------------------------------------------------------------
+        checkProcessPid();
+
+        //----------------------------------------------------------------
         // Basic tests for setting, replacing and deleting envvars
         //----------------------------------------------------------------
         try {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/annotation/TypeVariableBounds.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,129 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8038994
+ * @summary Test that getAnnotatedBounds().getType() match getBounds()
+ * @run testng TypeVariableBounds
+ */
+
+import java.io.Serializable;
+import java.lang.annotation.*;
+import java.lang.reflect.*;
+import java.util.concurrent.Callable;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Set;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+import static org.testng.Assert.*;
+
+public class TypeVariableBounds {
+    @Test(dataProvider = "classData")
+    public void testClass(Class<?> c) throws Exception {
+        assertNotEquals(c.getTypeParameters().length, 0);
+
+        TypeVariable[] tv = c.getTypeParameters();
+
+        for(TypeVariable t : tv)
+            testTv(t);
+
+    }
+
+    @Test(dataProvider = "methodData")
+    public void testMethod(Class<?>c) throws Exception {
+        Method m = c.getMethod("aMethod");
+        TypeVariable[] tv = m.getTypeParameters();
+
+        for(TypeVariable t : tv)
+            testTv(t);
+
+    }
+
+    public void testTv(TypeVariable<?> tv) {
+        Type[] t = tv.getBounds();
+        AnnotatedType[] at = tv.getAnnotatedBounds();
+
+        assertEquals(t.length, at.length, Arrays.asList(t) + " and " + Arrays.asList(at) + " should be the same length");
+
+        for (int i = 0; i < t.length; i++)
+            assertSame(at[i].getType(), t[i], "T: " + t[i] + ", AT: " + at[i] + ", AT.getType(): " + at[i].getType() + "\n");
+    }
+
+    @DataProvider
+    public Object[][] classData() { return CLASS_TESTS; }
+
+    @DataProvider
+    public Object[][] methodData() { return METHOD_TESTS; }
+
+    public static final Object[][] CLASS_TESTS = {
+        { Case1.class, },
+        { Case2.class, },
+        { Case5.class, },
+        { Case6.class, },
+    };
+
+    public static final Object[][] METHOD_TESTS = {
+        { Case3.class, },
+        { Case4.class, },
+        { Case5.class, },
+        { Case6.class, },
+    };
+
+    // Class type var
+    public static class Case1<C1T1, C1T2 extends AnnotatedElement, C1T3 extends AnnotatedElement & Type & Serializable> {}
+    public static class Case2<C2T0, @TA C2T1 extends Type, C2T2 extends @TB AnnotatedElement, C2T3 extends AnnotatedElement & @TB Type & Serializable> {}
+
+    // Method type var
+    public static class Case3 { public <C3T1, C3T2 extends AnnotatedElement, C3T3 extends AnnotatedElement & Type & Serializable> void aMethod() {}}
+    public static class Case4 { public <C4T0, @TA C4T1 extends List, C4T2 extends @TB Set, C4T3 extends Set & @TB Callable & Serializable> void aMethod() {}}
+
+    // Both
+    public static class Case5 <C5CT1, C5CT2 extends Runnable> {
+        public <C5MT1,
+               C5MT2 extends AnnotatedElement,
+               C5MT3 extends AnnotatedElement & Type & Serializable,
+               C5MT4 extends C5CT2>
+                   void aMethod() {}}
+
+    public static class Case6 <@TA C6CT1, C6CT2 extends @TB Runnable> {
+        public <@TA C6MT1,
+               C6MT2 extends @TB AnnotatedElement,
+               C6MT3 extends @TB AnnotatedElement & @TB2 Type & Serializable,
+               C6MT4 extends @TB2 C6CT2>
+                   void aMethod() {}}
+
+    @Retention(RetentionPolicy.RUNTIME)
+    @Target(ElementType.TYPE_PARAMETER)
+    public @interface TA {}
+
+    @Retention(RetentionPolicy.RUNTIME)
+    @Target(ElementType.TYPE_USE)
+    public @interface TB {}
+
+    @Retention(RetentionPolicy.RUNTIME)
+    @Target(ElementType.TYPE_USE)
+    public @interface TB2 {}
+}
--- a/jdk/test/java/lang/instrument/DaemonThread/TestDaemonThread.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/test/java/lang/instrument/DaemonThread/TestDaemonThread.java	Mon Jun 02 13:53:52 2014 -0700
@@ -26,7 +26,7 @@
  * @summary Assert in java.lang.instrument agents during shutdown when classloading occurs after shutdown
  * @library /lib/testlibrary
  *
- * @build DummyAgent DummyClass TestDaemonThreadLauncher TestDaemonThread
+ * @build jdk.testlibrary.* DummyAgent DummyClass TestDaemonThreadLauncher TestDaemonThread
  * @run shell ../MakeJAR3.sh DummyAgent
  * @run main TestDaemonThreadLauncher /timeout=240
  *
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/invoke/LambdaFormTest.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* @test
+ * @summary unit tests for java.lang.invoke.LambdaForm
+ * @run junit/othervm test.java.lang.invoke.LambdaFormTest
+ */
+package test.java.lang.invoke;
+
+import org.junit.Test;
+import java.lang.reflect.Method;
+import static org.junit.Assert.*;
+
+public class LambdaFormTest {
+    static final Method M_shortenSignature;
+    static {
+        try {
+            Class<?> impl = Class.forName("java.lang.invoke.LambdaForm", false, null);
+            Method m = impl.getDeclaredMethod("shortenSignature", String.class);
+            m.setAccessible(true);
+            M_shortenSignature = m;
+        } catch(Exception e) {
+            throw new AssertionError(e);
+        }
+    }
+
+    public static String shortenSignature(String signature) throws ReflectiveOperationException {
+        return (String)M_shortenSignature.invoke(null, signature);
+    }
+
+    @Test
+    public void testShortenSignature() throws ReflectiveOperationException {
+        for (String s : new String[] {
+                // invariant strings:
+                "L", "LL", "ILL", "LIL", "LLI", "IILL", "ILIL", "ILLI",
+                // a few mappings:
+                "LLL=L3", "LLLL=L4", "LLLLLLLLLL=L10",
+                "IIIDDD=I3D3", "IDDD=ID3", "IIDDD=IID3", "IIID=I3D", "IIIDD=I3DD"
+            }) {
+            String s2 = s.substring(s.indexOf('=')+1);
+            String s1 = s.equals(s2) ? s : s.substring(0, s.length() - s2.length() - 1);
+            // mix the above cases with before and after reps of Z*
+            for (int k = -3; k <= 3; k++) {
+                String beg = (k < 0 ? "ZZZZ".substring(-k) : "");
+                String end = (k > 0 ? "ZZZZ".substring(+k) : "");
+                String ks1 = beg+s1+end;
+                String ks2 = shortenSignature(beg)+s2+shortenSignature(end);
+                String ks3 = shortenSignature(ks1);
+                assertEquals(ks2, ks3);
+            }
+        }
+    }
+
+    public static void main(String[] args) throws ReflectiveOperationException {
+        LambdaFormTest test = new LambdaFormTest();
+        test.testShortenSignature();
+    }
+}
--- a/jdk/test/java/lang/invoke/lambda/LogGeneratedClassesTest.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/test/java/lang/invoke/lambda/LogGeneratedClassesTest.java	Mon Jun 02 13:53:52 2014 -0700
@@ -33,11 +33,9 @@
 import java.util.ArrayList;
 import java.util.List;
 import java.nio.file.Files;
-import java.nio.file.LinkOption;
 import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.nio.file.attribute.PosixFileAttributeView;
-import java.util.stream.Stream;
 
 import org.testng.annotations.AfterClass;
 import org.testng.annotations.BeforeClass;
@@ -163,34 +161,66 @@
         tr.assertZero("Should still return 0");
     }
 
+    private static boolean isWriteableDirectory(Path p) {
+        if (!Files.isDirectory(p)) {
+            return false;
+        }
+        Path test = p.resolve(Paths.get("test"));
+        try {
+            Files.createFile(test);
+            assertTrue(Files.exists(test));
+            return true;
+        } catch (IOException e) {
+            assertFalse(Files.exists(test));
+            return false;
+        } finally {
+            if (Files.exists(test)) {
+                try {
+                    Files.delete(test);
+                } catch (IOException e) {
+                    throw new Error(e);
+                }
+            }
+        }
+    }
+
     @Test
     public void testDumpDirNotWritable() throws IOException {
-        if (! Files.getFileStore(Paths.get("."))
-                   .supportsFileAttributeView(PosixFileAttributeView.class)) {
+        if (!Files.getFileStore(Paths.get("."))
+                  .supportsFileAttributeView(PosixFileAttributeView.class)) {
             // No easy way to setup readonly directory without POSIX
             // We would like to skip the test with a cause with
             //     throw new SkipException("Posix not supported");
             // but jtreg will report failure so we just pass the test
             // which we can look at if jtreg changed its behavior
+            System.out.println("WARNING: POSIX is not supported. Skipping testDumpDirNotWritable test.");
             return;
         }
 
         Files.createDirectory(Paths.get("readOnly"),
                               asFileAttribute(fromString("r-xr-xr-x")));
+        try {
+            if (isWriteableDirectory(Paths.get("readOnly"))) {
+                // Skipping the test: it's allowed to write into read-only directory
+                // (e.g. current user is super user).
+                System.out.println("WARNING: readOnly directory is writeable. Skipping testDumpDirNotWritable test.");
+                return;
+            }
 
-        TestResult tr = doExec(JAVA_CMD.getAbsolutePath(),
-                               "-cp", ".",
-                               "-Djdk.internal.lambda.dumpProxyClasses=readOnly",
-                               "-Djava.security.manager",
-                               "com.example.TestLambda");
-        assertEquals(tr.testOutput.stream()
-                                  .filter(s -> s.startsWith("WARNING"))
-                                  .peek(s -> assertTrue(s.contains("not writable")))
-                                  .count(),
-                     1, "only show error once");
-        tr.assertZero("Should still return 0");
-
-        TestUtil.removeAll(Paths.get("readOnly"));
+            TestResult tr = doExec(JAVA_CMD.getAbsolutePath(),
+                                   "-cp", ".",
+                                   "-Djdk.internal.lambda.dumpProxyClasses=readOnly",
+                                   "-Djava.security.manager",
+                                   "com.example.TestLambda");
+            assertEquals(tr.testOutput.stream()
+                                      .filter(s -> s.startsWith("WARNING"))
+                                      .peek(s -> assertTrue(s.contains("not writable")))
+                                      .count(),
+                         1, "only show error once");
+            tr.assertZero("Should still return 0");
+        } finally {
+            TestUtil.removeAll(Paths.get("readOnly"));
+        }
     }
 
     @Test
--- a/jdk/test/java/lang/management/MemoryMXBean/ResetPeakMemoryUsage.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/test/java/lang/management/MemoryMXBean/ResetPeakMemoryUsage.java	Mon Jun 02 13:53:52 2014 -0700
@@ -33,7 +33,7 @@
  * @author  Mandy Chung
  *
  * @library /lib/testlibrary/
- * @build ResetPeakMemoryUsage MemoryUtil RunUtil
+ * @build jdk.testlibrary.* ResetPeakMemoryUsage MemoryUtil RunUtil
  * @run main ResetPeakMemoryUsage
  */
 
--- a/jdk/test/java/sql/util/BaseTest.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/test/java/sql/util/BaseTest.java	Mon Jun 02 13:53:52 2014 -0700
@@ -61,29 +61,31 @@
     public void tearDownMethod() throws Exception {
     }
 
-    /**
+    /*
      * Take some form of SQLException, serialize and deserialize it
-     *
-     * @param <T> SQLException
-     * @param ex SQLException
-     * @return deserialized SQLException
-     * @throws IOException
-     * @throws ClassNotFoundException
      */
     @SuppressWarnings("unchecked")
     protected <T extends SQLException> T
             createSerializedException(T ex)
             throws IOException, ClassNotFoundException {
-        T ex1;
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        try (ObjectOutputStream oos = new ObjectOutputStream(baos) ) {
-            oos.writeObject(ex);
-        }
-        try (ObjectInputStream ois =
-                new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray()))) {
-            ex1 = (T) ois.readObject();
-        }
-        return ex1;
+        return (T) serializeDeserializeObject(ex);
     }
 
+    /*
+     * Utility method to serialize and deserialize an object
+     */
+    @SuppressWarnings("unchecked")
+    protected <T> T serializeDeserializeObject(T o)
+            throws IOException, ClassNotFoundException {
+        T o1;
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        try (ObjectOutputStream oos = new ObjectOutputStream(baos)) {
+            oos.writeObject(o);
+        }
+        try (ObjectInputStream ois
+                = new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray()))) {
+            o1 = (T) ois.readObject();
+        }
+        return o1;
+    }
 }
--- a/jdk/test/java/util/BitSet/BSMethods.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/test/java/util/BitSet/BSMethods.java	Mon Jun 02 13:53:52 2014 -0700
@@ -26,6 +26,7 @@
  *      4979017 4979028 4979031 5030267 6222207 8040806
  * @summary Test the operation of the methods of BitSet class
  * @author Mike McCloskey, Martin Buchholz
+ * @run main/othervm BSMethods
  */
 
 import java.util.*;
@@ -897,15 +898,20 @@
     private static void testToString() {
         check(new BitSet().toString().equals("{}"));
         check(makeSet(2,3,42,43,234).toString().equals("{2, 3, 42, 43, 234}"));
-        try {
-            check(makeSet(Integer.MAX_VALUE-1).toString().equals(
-                    "{" + (Integer.MAX_VALUE-1) + "}"));
-            check(makeSet(Integer.MAX_VALUE).toString().equals(
-                    "{" + Integer.MAX_VALUE + "}"));
-            check(makeSet(0, 1, Integer.MAX_VALUE-1, Integer.MAX_VALUE).toString().equals(
-                    "{0, 1, " + (Integer.MAX_VALUE-1) + ", " + Integer.MAX_VALUE + "}"));
-        } catch (IndexOutOfBoundsException exc) {
-            fail("toString() with indices near MAX_VALUE");
+
+        final long MB = 1024*1024;
+        if (Runtime.getRuntime().maxMemory() >= 512*MB) {
+            // only run it if we have enough memory
+            try {
+                check(makeSet(Integer.MAX_VALUE-1).toString().equals(
+                        "{" + (Integer.MAX_VALUE-1) + "}"));
+                check(makeSet(Integer.MAX_VALUE).toString().equals(
+                        "{" + Integer.MAX_VALUE + "}"));
+                check(makeSet(0, 1, Integer.MAX_VALUE-1, Integer.MAX_VALUE).toString().equals(
+                        "{0, 1, " + (Integer.MAX_VALUE-1) + ", " + Integer.MAX_VALUE + "}"));
+            } catch (IndexOutOfBoundsException exc) {
+                fail("toString() with indices near MAX_VALUE");
+            }
         }
     }
 
--- a/jdk/test/java/util/Properties/LoadAndStoreXML.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/test/java/util/Properties/LoadAndStoreXML.java	Mon Jun 02 13:53:52 2014 -0700
@@ -32,6 +32,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.UnsupportedEncodingException;
+import java.nio.charset.Charset;
 import java.nio.file.DirectoryStream;
 import java.nio.file.Files;
 import java.nio.file.Path;
@@ -47,6 +48,7 @@
 import java.util.PropertyPermission;
 
 public class LoadAndStoreXML {
+    static final String bomChar = "\uFEFF";
 
     /**
      * Simple policy implementation that grants a set of permissions to
@@ -125,13 +127,14 @@
      * Sanity test that properties saved with Properties#storeToXML can be
      * read with Properties#loadFromXML.
      */
-    static void testLoadAndStore(String encoding) throws IOException {
+    static void testLoadAndStore(String encoding, boolean appendBOM) throws IOException {
         System.out.println("testLoadAndStore, encoding=" + encoding);
 
         Properties props = new Properties();
+        props.put("k0", "\u6C34");
         props.put("k1", "foo");
         props.put("k2", "bar");
-        props.put("k3", "\\u0020\\u0391\\u0392\\u0393\\u0394\\u0395\\u0396\\u0397");
+        props.put("k3", "\u0020\u0391\u0392\u0393\u0394\u0395\u0396\u0397");
         props.put("k4", "\u7532\u9aa8\u6587");
         props.put("k5", "<java.home>/lib/jaxp.properties");
 
@@ -141,7 +144,17 @@
             throw new RuntimeException("OutputStream closed by storeToXML");
 
         Properties p = new Properties();
-        TestInputStream in = new TestInputStream(out.toByteArray());
+        TestInputStream in;
+        if (appendBOM) {
+            byte[] byteOrderMark = bomChar.getBytes(Charset.forName(encoding));
+            byte[] outArray = out.toByteArray();
+            byte[] inputArray = new byte[byteOrderMark.length + outArray.length];
+            System.arraycopy(byteOrderMark, 0, inputArray, 0, byteOrderMark.length);
+            System.arraycopy(outArray, 0, inputArray, byteOrderMark.length, outArray.length);
+            in = new TestInputStream(inputArray);
+        } else {
+            in = new TestInputStream(out.toByteArray());
+        }
         p.loadFromXML(in);
         if (in.isOpen())
             throw new RuntimeException("InputStream not closed by loadFromXML");
@@ -231,8 +244,12 @@
 
     public static void main(String[] args) throws IOException {
 
-        testLoadAndStore("UTF-8");
-        testLoadAndStore("UTF-16");
+        testLoadAndStore("UTF-8", false);
+        testLoadAndStore("UTF-16", false);
+        testLoadAndStore("UTF-16BE", false);
+        testLoadAndStore("UTF-16LE", false);
+        testLoadAndStore("UTF-16BE", true);
+        testLoadAndStore("UTF-16LE", true);
         testLoadWithoutEncoding();
         testLoadWithBadEncoding();
         testStoreWithBadEncoding();
@@ -250,7 +267,7 @@
         Policy.setPolicy(p);
         System.setSecurityManager(new SecurityManager());
         try {
-            testLoadAndStore("UTF-8");
+            testLoadAndStore("UTF-8", false);
         } finally {
             // turn off security manager and restore policy
             System.setSecurityManager(null);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/imageio/plugins/png/ReadMalformedPngTest.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,160 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug     6945174
+ * @summary Test verifies that PNG image readr throw correct exception
+ *          if image contains a chunk with incorrect length.
+ * @run     main ReadMalformedPngTest
+ */
+
+import java.awt.Color;
+import java.awt.GradientPaint;
+import java.awt.Graphics2D;
+import java.awt.image.BufferedImage;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import javax.imageio.IIOException;
+import javax.imageio.IIOImage;
+import javax.imageio.ImageIO;
+import javax.imageio.ImageTypeSpecifier;
+import javax.imageio.ImageWriteParam;
+import javax.imageio.ImageWriter;
+import javax.imageio.metadata.IIOMetadata;
+import javax.imageio.metadata.IIOMetadataNode;
+import javax.imageio.stream.ImageOutputStream;
+import org.w3c.dom.Node;
+
+public class ReadMalformedPngTest {
+
+    public static void main(String[] args) throws IOException {
+        ByteArrayInputStream bais = new ByteArrayInputStream(createTestPng());
+
+        IIOException expected = null;
+        try {
+            ImageIO.read(bais);
+        } catch (IIOException e) {
+            expected = e;
+        } catch (Throwable e) {
+            throw new RuntimeException("Test failed!", e);
+        }
+
+        if (expected == null) {
+            throw new RuntimeException("Test failed.");
+        }
+
+        System.out.println("Test passed.");
+    }
+
+    private static byte[] createTestPng() throws IOException {
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+
+        BufferedImage img = createTestImage();
+
+        try {
+            ImageOutputStream ios = ImageIO.createImageOutputStream(baos);
+
+            ImageWriter w = ImageIO.getImageWritersByFormatName("PNG").next();
+
+            w.setOutput(ios);
+
+            ImageWriteParam p = w.getDefaultWriteParam();
+
+            ImageTypeSpecifier t = ImageTypeSpecifier.createFromRenderedImage(img);
+
+            IIOMetadata m = w.getDefaultImageMetadata(t, p);
+
+            String nativeMetadataFormat = m.getNativeMetadataFormatName();
+
+            Node root = m.getAsTree(nativeMetadataFormat);
+
+            IIOMetadataNode textEntry = new IIOMetadataNode("tEXtEntry");
+            textEntry.setAttribute("keyword", "comment");
+            textEntry.setAttribute("value", "This is a test image for JDK-6945174");
+
+            IIOMetadataNode text = new IIOMetadataNode("tEXt");
+            text.appendChild(textEntry);
+
+            root.appendChild(text);
+
+            m.mergeTree(nativeMetadataFormat, root);
+
+            IIOImage iio_img = new IIOImage(img, null, m);
+
+            w.write(iio_img);
+
+            w.dispose();
+            ios.flush();
+            ios.close();
+        } catch (IOException e) {
+            throw new RuntimeException("Test failed.", e);
+        }
+
+        baos.flush();
+
+        byte[] data = baos.toByteArray();
+
+        adjustCommentLength(Integer.MAX_VALUE + 0x1000, data);
+
+        return data;
+    }
+
+    private static void adjustCommentLength(int v, byte[] data) {
+        final int pos = getCommentPos(data);
+        data[pos + 3] = (byte) (v & 0xFF);
+        v = v >> 8;
+        data[pos + 2] = (byte) (v & 0xFF);
+        v = v >> 8;
+        data[pos + 1] = (byte) (v & 0xFF);
+        v = v >> 8;
+        data[pos + 0] = (byte) (v & 0xFF);
+    }
+
+    private static int getCommentPos(byte[] d) {
+        int p = 8;
+        while (p + 8 < d.length) {
+            if (d[p + 4] == (byte) 0x74 && d[p + 5] == (byte) 0x45 &&
+                d[p + 6] == (byte) 0x58 && d[p + 7] == (byte) 0x74)
+            {
+                return p;
+            }
+            p++;
+        }
+        throw new RuntimeException("Test chunk was not found!");
+    }
+
+    private static BufferedImage createTestImage() {
+        final int w = 128;
+        final int h = 128;
+
+        BufferedImage img = new BufferedImage(w, h, BufferedImage.TYPE_3BYTE_BGR);
+        Graphics2D g = img.createGraphics();
+        g.setPaint(new GradientPaint(0, 0, Color.blue,
+                w, h, Color.red));
+        g.fillRect(0, 0, w, h);
+        g.dispose();
+        return img;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/sql/testng/TEST.properties	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,2 @@
+# JDBC unit tests uses TestNG
+TestNG.dirs= .
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/sql/testng/test/rowset/serial/SerialArrayTests.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,236 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package test.rowset.serial;
+
+import java.sql.Array;
+import java.sql.SQLException;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+import javax.sql.rowset.serial.SerialArray;
+import javax.sql.rowset.serial.SerialException;
+import static org.testng.Assert.*;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+import util.BaseTest;
+import util.StubArray;
+
+public class SerialArrayTests extends BaseTest {
+
+    private Object[] coffees;
+    private final String sqlType = "VARCHAR";
+    private Array a;
+    private Map<String, Class<?>> map;
+
+    @BeforeMethod
+    public void setUpMethod() throws Exception {
+        coffees = new Object[]{"Espresso", "Colombian", "French Roast",
+            "Cappuccino"};
+        a = new StubArray(sqlType, coffees);
+        map = new HashMap<>();
+    }
+
+    /*
+     * Validate a SerialArray can be created from an Array
+     */
+    @Test
+    public void test01() throws Exception {
+        SerialArray sa = new SerialArray(a);
+    }
+
+    /*
+     * Validate a SQLException is thrown if the map is null
+     */
+    @Test(expectedExceptions = SQLException.class)
+    public void test02() throws Exception {
+        SerialArray sa = new SerialArray(a, null);
+    }
+
+    /*
+     * Validate a SerialException is thrown when getResultSet() is called
+     */
+    @Test(expectedExceptions = SerialException.class)
+    public void test03() throws Exception {
+        SerialArray sa = new SerialArray(a);
+        sa.getResultSet();
+    }
+
+    /*
+     * Validate a SerialException is thrown when getResultSet() is called
+     */
+    @Test(expectedExceptions = SerialException.class)
+    public void test04() throws Exception {
+        SerialArray sa = new SerialArray(a);
+        sa.getResultSet(null);
+    }
+
+    /*
+     * Validate a SerialException is thrown when getResultSet() is called
+     */
+    @Test(expectedExceptions = SerialException.class)
+    public void test05() throws Exception {
+        SerialArray sa = new SerialArray(a);
+        sa.getResultSet(1, 1);
+    }
+
+    /*
+     * Validate a SerialException is thrown when getResultSet() is called
+     */
+    @Test(expectedExceptions = SerialException.class)
+    public void test06() throws Exception {
+        SerialArray sa = new SerialArray(a);
+        sa.getResultSet(1, 1, null);
+    }
+
+    /*
+     * Validate a SerialException is thrown when  getArray() is invoked after
+     * free() is called
+     */
+    @Test(expectedExceptions = SerialException.class)
+    public void test07() throws Exception {
+        SerialArray sa = new SerialArray(a);
+        sa.free();
+        sa.getArray();
+    }
+
+    /*
+     * Validate a SerialException is thrown when  getArray() is invoked after
+     * free() is called
+     */
+    @Test(expectedExceptions = SerialException.class)
+    public void test08() throws Exception {
+        SerialArray sa = new SerialArray(a);
+        sa.free();
+        sa.getArray(map);
+    }
+
+    /*
+     * Validate a SerialException is thrown when  getArray() is invoked after
+     * free() is called
+     */
+    @Test(expectedExceptions = SerialException.class)
+    public void test09() throws Exception {
+        SerialArray sa = new SerialArray(a);
+        sa.free();
+        sa.getArray(1, 1, map);
+    }
+
+    /*
+     * Validate a SerialException is thrown when  getArray() is invoked after
+     * free() is called
+     */
+    @Test(expectedExceptions = SerialException.class)
+    public void test10() throws Exception {
+        SerialArray sa = new SerialArray(a);
+        sa.free();
+        sa.getArray(1, 1);
+    }
+
+    /*
+     * Validate a SerialException is thrown when  getBaseType() is invoked after
+     * free() is called
+     */
+    @Test(expectedExceptions = SerialException.class)
+    public void test11() throws Exception {
+        SerialArray sa = new SerialArray(a);
+        sa.free();
+        sa.getBaseType();
+    }
+
+    /*
+     * Validate a SerialException is thrown when  getBaseTypeName() is invoked after
+     * free() is called
+     */
+    @Test(expectedExceptions = SerialException.class)
+    public void test12() throws Exception {
+        SerialArray sa = new SerialArray(a);
+        sa.free();
+        sa.getBaseTypeName();
+    }
+
+    /*
+     * Validate getArray() returns the same Object[] used to create the
+     * SerialArray
+     */
+    @Test
+    public void test13() throws Exception {
+        SerialArray sa = new SerialArray(a);
+        Object[] o = (Object[]) sa.getArray();
+        assertTrue(Arrays.equals(o, coffees));
+    }
+
+    /*
+     * Validate getArray() returns the same Object[] used to create the
+     * SerialArray
+     */
+    @Test
+    public void test14() throws Exception {
+        SerialArray sa = new SerialArray(a);
+        Object[] o = (Object[]) sa.getArray(map);
+        assertTrue(Arrays.equals(o, coffees));
+    }
+
+    /*
+     * Validate getArray() returns the same Object[] used to create the
+     * SerialArray
+     */
+    @Test
+    public void test15() throws Exception {
+        SerialArray sa = new SerialArray(a);
+        Object[] o = (Object[]) sa.getArray(1, 2);
+        assertTrue(Arrays.equals(o, Arrays.copyOfRange(coffees, 1, 3)));
+    }
+
+    /*
+     * Validate getArray() returns the same Object[] used to create the
+     * SerialArray
+     */
+    @Test
+    public void test16() throws Exception {
+        SerialArray sa = new SerialArray(a);
+        Object[] o = (Object[]) sa.getArray(1, 2, map);
+        assertTrue(Arrays.equals(o, Arrays.copyOfRange(coffees, 1, 3)));
+    }
+
+    /*
+     * clone() a SerialArray and check that it is equal to the
+     * object it was cloned from
+     */
+    @Test
+    public void test17() throws Exception {
+        SerialArray sa = new SerialArray(a);
+        SerialArray sa1 = (SerialArray) sa.clone();
+        assertTrue(sa.equals(sa1));
+    }
+
+    /*
+     * Validate that a SerialArray that is serialized & deserialized is equal to
+     * itself
+     */
+    @Test
+    public void test18() throws Exception {
+        SerialArray sa = new SerialArray(a);
+        SerialArray sa1 = serializeDeserializeObject(sa);;
+        assertTrue(sa.equals(sa1));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/sql/testng/test/rowset/serial/SerialBlobTests.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,399 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package test.rowset.serial;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.Arrays;
+import javax.sql.rowset.serial.SerialBlob;
+import javax.sql.rowset.serial.SerialException;
+import static org.testng.Assert.*;
+import org.testng.annotations.Test;
+import util.BaseTest;
+import util.StubBlob;
+
+public class SerialBlobTests extends BaseTest {
+
+    // byte[] used to populate SerialBlob
+    private byte[] bytes = new byte[]{1, 2, 3, 4, 5};
+
+    /*
+     * Validate calling free() does not throw an Exception
+     */
+    @Test
+    public void test() throws Exception {
+        SerialBlob sb = new SerialBlob(new StubBlob());
+        sb.free();
+    }
+
+    /*
+     * Validate calling getBinaryStream() after calling free() throws an
+     * SerialException
+     */
+    @Test(expectedExceptions = SerialException.class)
+    public void test01() throws Exception {
+        SerialBlob sb = new SerialBlob(new StubBlob());
+        sb.free();
+        sb.getBinaryStream();
+    }
+
+    /*
+     * Validate calling getBinaryStream() after calling free() throws an
+     * SerialException
+     */
+    @Test(expectedExceptions = SerialException.class)
+    public void test02() throws Exception {
+        SerialBlob sb = new SerialBlob(new StubBlob());
+        sb.free();
+        sb.getBinaryStream(1, 5);
+    }
+
+    /*
+     * Validate calling getBytes() after calling free() throws an
+     * SerialException
+     */
+    @Test(expectedExceptions = SerialException.class)
+    public void test03() throws Exception {
+        SerialBlob sb = new SerialBlob(new StubBlob());
+        sb.free();
+        sb.getBytes(1, 1);
+    }
+
+    /*
+     * Validate calling getLength() after calling free() throws an
+     * SerialException
+     */
+    @Test(expectedExceptions = SerialException.class)
+    public void test04() throws Exception {
+        SerialBlob sb = new SerialBlob(new StubBlob());
+        sb.free();
+        sb.length();
+    }
+
+    /*
+     * Validate calling position() after calling free() throws an
+     * SerialException
+     */
+    @Test(expectedExceptions = SerialException.class)
+    public void test05() throws Exception {
+        SerialBlob sb = new SerialBlob(new StubBlob());
+        sb.free();
+        sb.position(new byte[5], 1);
+    }
+
+    /*
+     * Validate calling position() after calling free() throws an
+     * SerialException
+     */
+    @Test(expectedExceptions = SerialException.class)
+    public void test06() throws Exception {
+        SerialBlob sb = new SerialBlob(new StubBlob());
+        sb.free();
+        sb.position(new StubBlob(), 1);
+    }
+
+    /*
+     * Validate calling free() after calling setBinaryStream() throws an
+     * SerialException
+     */
+    @Test(expectedExceptions = SerialException.class)
+    public void test07() throws Exception {
+        SerialBlob sb = new SerialBlob(new StubBlob());
+        sb.free();
+        sb.setBinaryStream(5);
+    }
+
+    /*
+     * Validate calling free() after calling setBytes() throws an
+     * SerialException
+     */
+    @Test(expectedExceptions = SerialException.class)
+    public void test08() throws Exception {
+        SerialBlob sb = new SerialBlob(new StubBlob());
+        sb.free();
+        sb.setBytes(1, new byte[5]);
+    }
+
+    /*
+     * Validate calling setBytes() after calling free() throws an
+     * SerialException
+     */
+    @Test(expectedExceptions = SerialException.class)
+    public void test09() throws Exception {
+        SerialBlob sb = new SerialBlob(new StubBlob());
+        sb.free();
+        sb.setBytes(1, new byte[10], 0, 5);
+    }
+
+    /*
+     * Validate calling truncate() after calling free() throws an
+     * SerialException
+     */
+    @Test(expectedExceptions = SerialException.class)
+    public void test10() throws Exception {
+        SerialBlob sb = new SerialBlob(new StubBlob());
+        sb.free();
+        sb.truncate(1);
+    }
+
+    /*
+     * Validate getBinaryStream returns the correct bytes
+     */
+    @Test
+    public void test11() throws Exception {
+        byte[] expected = new byte[]{1, 2, 3};
+        SerialBlob sb = new SerialBlob(bytes);
+        InputStream is = sb.getBinaryStream(1, 3);
+        for (byte b : expected) {
+            byte val = (byte) is.read();
+            assertTrue(b == val, val + " does not match " + b);
+        }
+    }
+
+    /*
+     * Validate a SerialException is thrown if pos < 0 for getBinaryStream
+     */
+    @Test(expectedExceptions = SerialException.class)
+    public void test12() throws Exception {
+        SerialBlob sb = new SerialBlob(bytes);
+        InputStream is = sb.getBinaryStream(-1, 3);
+    }
+
+    /*
+     * Validate a SerialException is thrown if pos = 0 for getBinaryStream
+     */
+    @Test(expectedExceptions = SerialException.class)
+    public void test13() throws Exception {
+        SerialBlob sb = new SerialBlob(bytes);
+        InputStream is = sb.getBinaryStream(0, 3);
+    }
+
+    /*
+     * Validate a SerialException is thrown if len > the length of the stream
+     * for getBinaryStream
+     */
+    @Test(expectedExceptions = SerialException.class)
+    public void test14() throws Exception {
+        SerialBlob sb = new SerialBlob(bytes);
+        InputStream is = sb.getBinaryStream(0, 3);
+    }
+
+    /*
+     * Validate a SerialException is thrown if length < 1
+     */
+    @Test(expectedExceptions = SerialException.class)
+    public void test15() throws Exception {
+        SerialBlob sb = new SerialBlob(bytes);
+        InputStream is = sb.getBinaryStream(1, 0);
+    }
+
+    /*
+     * Validate a SerialException is thrown if length > byte array length
+     */
+    @Test(expectedExceptions = SerialException.class)
+    public void test16() throws Exception {
+        SerialBlob sb = new SerialBlob(bytes);
+        InputStream is = sb.getBinaryStream(1, 6);
+    }
+
+    /*
+     * Validate a SerialException is thrown if pos > byte array length
+     */
+    @Test(expectedExceptions = SerialException.class)
+    public void test17() throws Exception {
+        SerialBlob sb = new SerialBlob(bytes);
+        InputStream is = sb.getBinaryStream(bytes.length + 2, 6);
+    }
+
+    /*
+     * Validate that a cloned SerializedBlob bytes match the original
+     */
+    @Test
+    public void test18() throws Exception {
+        SerialBlob sb = new SerialBlob(bytes);
+        SerialBlob sb2 = (SerialBlob) sb.clone();
+        assertTrue(
+                Arrays.equals(sb.getBytes(1, (int) sb.length()),
+                        sb2.getBytes(1, (int) sb2.length())),
+                "arrays do not match ");
+    }
+
+    /*
+     * Test clone after free has been called that the clone is not accessible
+     */
+    @Test(expectedExceptions = SerialException.class)
+    public void test19() throws Exception {
+        SerialBlob sb = new SerialBlob(bytes);
+        sb.free();
+        SerialBlob sb2 = (SerialBlob) sb.clone();
+        InputStream is = sb2.getBinaryStream(1, 3);
+    }
+
+    /*
+     * Validate that a SerialBlob that is serialized & deserialized is equal to
+     * itself
+     */
+    @Test
+    public void test20() throws Exception {
+        SerialBlob sb = new SerialBlob(bytes);
+        SerialBlob sb2 = serializeDeserializeObject(sb);
+        assertTrue(sb.equals(sb2), "SerialBlob not equal");
+    }
+
+    /*
+     * Validate a SerialException is thrown if byte[] is used to
+     * create the SeriablBlob and setBinaryStream is called
+     */
+    @Test(expectedExceptions = SerialException.class)
+    public void test21() throws Exception {
+        SerialBlob sb = new SerialBlob(bytes);
+        sb.setBinaryStream(3);
+    }
+
+    /*
+     * Validate that setBytes will properly write a set of bytes to the
+     * specified location in the SerialBlob and the correct count is returned
+     * for bytes written
+     */
+    @Test
+    public void test22() throws Exception {
+        byte[] diff = new byte[]{7, 8, 9};
+        byte[] expected = new byte[]{1, 7, 8, 9, 5};
+        SerialBlob sb = new SerialBlob(bytes);
+        int written = sb.setBytes(2, diff);
+        assertEquals(written, diff.length);
+        assertTrue(
+                Arrays.equals(sb.getBytes(1, (int) sb.length()),
+                        expected),
+                "arrays do not match ");
+    }
+
+    /*
+     * Validate that setBytes will properly write a set of bytes to the
+     * specified location in the SerialBlob and the correct count is returned
+     * for bytes written
+     */
+    @Test
+    public void test23() throws Exception {
+        int bytesToWrite = 3;
+        byte[] diff = new byte[]{7, 8, 9, 0};
+        byte[] expected = new byte[]{1, 8, 9, 0, 5};
+        SerialBlob sb = new SerialBlob(bytes);
+        int written = sb.setBytes(2, diff, 1, bytesToWrite);
+        assertEquals(written, bytesToWrite);
+        assertTrue(
+                Arrays.equals(sb.getBytes(1, (int) sb.length()),
+                        expected),
+                "arrays do not match ");
+    }
+
+    /*
+     * Validate that truncate reduces the length of the SerlizedBlob to the
+     * specified value
+     */
+    @Test
+    public void test24() throws Exception {
+        SerialBlob sb = new SerialBlob(bytes);
+        sb.truncate(0);
+        assertTrue(sb.length() == 0);
+        sb = new SerialBlob(bytes);
+        sb.truncate(3);
+        assertTrue(sb.length() == 3);
+    }
+
+    /*
+     * Validate getBinaryStream returns the correct bytes
+     */
+    @Test
+    public void test25() throws Exception {
+        byte[] expected = bytes;
+        SerialBlob sb = new SerialBlob(bytes);
+        InputStream is = sb.getBinaryStream();
+        for (byte b : expected) {
+            byte val = (byte) is.read();
+            assertTrue(b == val, val + " does not match " + b);
+        }
+    }
+
+    /*
+     * Validate setBinaryStream returns an OutputStream when passed a Blob
+     */
+    @Test
+    public void test26() throws Exception {
+        SerialBlob sb = new SerialBlob(new StubBlob());
+        OutputStream os = sb.setBinaryStream(0);
+        assertTrue(os != null);
+    }
+
+    /*
+     * Validate that position returns the correct starting location for a
+     * pattern in the SerialBlob
+     */
+    @Test
+    public void test27() throws Exception {
+        long expectedPos = 3; // starting offset is 1 vs 0
+        byte[] pattern = new byte[]{3, 4};
+        SerialBlob sb = new SerialBlob(bytes);
+        long pos = sb.position(pattern, 1);
+        assertEquals(pos, expectedPos);
+    }
+
+    /*
+     * Validate that position returns the correct starting location for a
+     * pattern in the SerialBlob
+     */
+    @Test
+    public void test28() throws Exception {
+        long expectedPos = 3; // starting offset is 1 vs 0
+        byte[] pattern = new byte[]{3, 4, 5};
+        SerialBlob sb = new SerialBlob(bytes);
+        long pos = sb.position(pattern, 2);
+        assertEquals(pos, expectedPos);
+    }
+
+    /*
+     * Validate that position returns the correct starting location for a
+     * pattern in the SerialBlob
+     */
+    @Test
+    public void test29() throws Exception {
+        long expectedPos = 2; // starting offset is 1 vs 0
+        byte[] pattern = new byte[]{4, 6};
+        SerialBlob sb = new SerialBlob(new StubBlob());
+        long pos = sb.position(pattern, 1);
+        assertEquals(pos, expectedPos);
+    }
+
+    /*
+     * Validate that position returns the correct starting location for a
+     * pattern in the SerialBlob
+     */
+    @Test
+    public void test30() throws Exception {
+        long expectedPos = 3; // starting offset is 1 vs 0
+        byte[] pattern = new byte[]{6, 8};
+        SerialBlob sb = new SerialBlob(new StubBlob());
+        long pos = sb.position(pattern, 2);
+        assertEquals(pos, expectedPos);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/sql/testng/test/rowset/serial/SerialClobTests.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,499 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package test.rowset.serial;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.Reader;
+import java.io.Writer;
+import javax.sql.rowset.serial.SerialClob;
+import javax.sql.rowset.serial.SerialException;
+import static org.testng.Assert.*;
+import org.testng.annotations.Test;
+import util.BaseTest;
+import util.StubClob;
+
+public class SerialClobTests extends BaseTest {
+
+    // char[] used to populate SerialClob
+    private final char[] chars;
+
+    public SerialClobTests() {
+        this.chars = new char[]{'h', 'e', 'l', 'l', 'o', ' ', 'w',
+            'o', 'r', 'l', 'd'};
+    }
+
+    /*
+     * Validate calling free() does not throw an Exception
+     */
+    @Test
+    public void test() throws Exception {
+        SerialClob sc = new SerialClob(new StubClob());
+        sc.free();
+    }
+
+    /*
+     * Validate calling getCharacterStream() after calling free() throws an
+     * SerialException
+     */
+    @Test(expectedExceptions = SerialException.class)
+    public void test01() throws Exception {
+        SerialClob sc = new SerialClob(new StubClob());
+        sc.free();
+        sc.getCharacterStream();
+    }
+
+    /*
+     * Validate calling getCharacterStream() after calling free() throws an
+     * SerialException
+     */
+    @Test(expectedExceptions = SerialException.class)
+    public void test02() throws Exception {
+        SerialClob sc = new SerialClob(chars);
+        sc.free();
+        sc.getCharacterStream();
+    }
+
+    /*
+     * Validate calling getCharacterStream() after calling free() throws an
+     * SerialException
+     */
+    @Test(expectedExceptions = SerialException.class)
+    public void test03() throws Exception {
+        SerialClob sc = new SerialClob(new StubClob());
+        sc.free();
+        sc.getCharacterStream(1, 5);
+    }
+
+    /*
+     * Validate calling getSubString() after calling free() throws an
+     * SerialException
+     */
+    @Test(expectedExceptions = SerialException.class)
+    public void test04() throws Exception {
+        SerialClob sc = new SerialClob(new StubClob());
+        sc.free();
+        sc.getSubString(1, 1);
+    }
+
+    /*
+     * Validate calling truncate() after calling free() throws an
+     * SerialException
+     */
+    @Test(expectedExceptions = SerialException.class)
+    public void test05() throws Exception {
+        SerialClob sc = new SerialClob(new StubClob());
+        sc.free();
+        sc.truncate(1);
+    }
+
+    /*
+     * Validate calling getAsciiStream() after calling free() throws an
+     * SerialException
+     */
+    @Test(expectedExceptions = SerialException.class)
+    public void test06() throws Exception {
+        SerialClob sc = new SerialClob(new StubClob());
+        sc.free();
+        sc.getAsciiStream();
+    }
+
+    /*
+     * Validate calling length() after calling free() throws an SerialException
+     */
+    @Test(expectedExceptions = SerialException.class)
+    public void test07() throws Exception {
+        SerialClob sc = new SerialClob(new StubClob());
+        sc.free();
+        sc.length();
+    }
+
+    /*
+     * Validate calling position() after calling free() throws an
+     * SerialException
+     */
+    @Test(expectedExceptions = SerialException.class)
+    public void test08() throws Exception {
+        SerialClob sc = new SerialClob(new StubClob());
+        sc.free();
+        sc.position("hello", 1);
+    }
+
+    /*
+     * Validate calling position() after calling free() throws an
+     * SerialException
+     */
+    @Test(expectedExceptions = SerialException.class)
+    public void test09() throws Exception {
+        SerialClob sc = new SerialClob(new StubClob());
+        sc.free();
+        sc.position(new StubClob(), 1);
+    }
+
+    /*
+     * Validate calling setAsciiStream() after calling free() throws an
+     * SerialException
+     */
+    @Test(expectedExceptions = SerialException.class)
+    public void test10() throws Exception {
+        SerialClob sc = new SerialClob(new StubClob());
+        sc.free();
+        sc.setAsciiStream(5);
+    }
+
+    /*
+     * Validate calling setCharacterStream() after calling free() throws an
+     * SerialException
+     */
+    @Test(expectedExceptions = SerialException.class)
+    public void test11() throws Exception {
+        SerialClob sc = new SerialClob(new StubClob());
+        sc.free();
+        sc.setCharacterStream(5);
+    }
+
+    /*
+     * Validate calling setString() after calling free() throws an
+     * SerialException
+     */
+    @Test(expectedExceptions = SerialException.class)
+    public void test12() throws Exception {
+        SerialClob sc = new SerialClob(new StubClob());
+        sc.free();
+        sc.setString(1, "hello");
+    }
+
+    /*
+     * Validate calling setString() after calling free() throws an
+     * SerialException
+     */
+    @Test(expectedExceptions = SerialException.class)
+    public void test13() throws Exception {
+        SerialClob sc = new SerialClob(new StubClob());
+        sc.free();
+        sc.setString(1, "hello", 0, 5);
+    }
+
+    /*
+     * Test that SerialException is thrown if pos < 0 on a call to
+     * getCharacterStream
+     */
+    @Test(expectedExceptions = SerialException.class)
+    public void test14() throws Exception {
+        SerialClob sc = new SerialClob(chars);
+        sc.getCharacterStream(-1, 5);
+    }
+
+    /*
+     * Test that SerialException is thrown if pos = 0 on a call to
+     * getCharacterStream
+     */
+    @Test(expectedExceptions = SerialException.class)
+    public void test15() throws Exception {
+        SerialClob sc = new SerialClob(chars);
+        sc.getCharacterStream(0, 5);
+    }
+
+    /*
+     * Test that SerialException is thrown if pos = 0 on a call to
+     * getCharacterStream
+     */
+    @Test(expectedExceptions = SerialException.class)
+    public void test16() throws Exception {
+        SerialClob sc = new SerialClob(chars);
+        sc.getCharacterStream(1, 100);
+    }
+
+    /*
+     * Test that SerialException is thrown if length = 0 on a call to
+     * getCharacterStream
+     */
+    @Test(expectedExceptions = SerialException.class)
+    public void test17() throws Exception {
+        SerialClob sc = new SerialClob(chars);
+        sc.getCharacterStream(1, 0);
+    }
+
+    /*
+     * Test that SerialException is thrown if pos > length on a call to
+     * getCharacterStream
+     */
+    @Test(expectedExceptions = SerialException.class)
+    public void test18() throws Exception {
+        SerialClob sc = new SerialClob(chars);
+        sc.getCharacterStream(100, 5);
+    }
+
+    /*
+     * Clone a SerialClob and check that it is equal to itself
+     */
+    @Test
+    public void test19() throws Exception {
+        SerialClob sc = new SerialClob(chars);
+        SerialClob sc1 = (SerialClob) sc.clone();
+        assertTrue(sc.equals(sc1), "SerialClobs not equal");
+    }
+
+    /*
+     * Validate that a getAsciiStream() returns an InputStream when a Clob is
+     * used to create the SerialClob
+     */
+    @Test
+    public void test20() throws Exception {
+        SerialClob sc = new SerialClob(new StubClob());
+        InputStream is = sc.getAsciiStream();
+        assertTrue(is != null);
+    }
+
+    /*
+     * Validate that a getCharacterStream() returns an Reader when a Clob is
+     * used to create the SerialClob
+     */
+    @Test
+    public void test21() throws Exception {
+        SerialClob sc = new SerialClob(new StubClob());
+        Reader is = sc.getCharacterStream();
+        assertTrue(is != null);
+    }
+
+    /*
+     * Validate that a getCharacterStream() returns an Reader when a char[] is
+     * used to create the SerialClob
+     */
+    @Test
+    public void test22() throws Exception {
+        SerialClob sc = new SerialClob(chars);
+        Reader is = sc.getCharacterStream();
+        assertTrue(is != null);
+    }
+
+    /*
+     * Validate that a getSubString() returns the correct value when a char[] is
+     * used to create the SerialClob
+     */
+    @Test
+    public void test23() throws Exception {
+        SerialClob sc = new SerialClob(chars);
+        String expected = "world";
+        assertEquals(expected, sc.getSubString(7, 5));
+    }
+
+    /*
+     * Validate that a getSubString() returns the correct value when a Clob is
+     * used to create the SerialClob
+     */
+    @Test
+    public void test24() throws Exception {
+        SerialClob sc = new SerialClob(new StubClob());
+        String expected = "test string";
+        assertEquals(expected, sc.getSubString(5, 11));
+    }
+
+    /*
+     * Validate that position() returns the correct value when a Clob is used to
+     * create the SerialClob
+     */
+    @Test
+    public void test25() throws Exception {
+        long expectedPos = 5;
+        SerialClob sc = new SerialClob(new StubClob());
+        String expected = "test string";
+        long pos = sc.position(expected, 1);
+        assertEquals(expectedPos, pos);
+    }
+
+    /*
+     * Validate that position returned is -1 when an the search string is not
+     * part of the SerialClob
+     */
+    @Test
+    public void test26() throws Exception {
+        long expectedPos = -1;
+        SerialClob sc = new SerialClob(chars);
+        String expected = "test string";
+        long pos = sc.position(expected, 1);
+        assertEquals(expectedPos, pos);
+    }
+
+    /*
+     * Validate that position() returned is -1 when an the search string is not
+     * part of the SerialClob
+     */
+    @Test
+    public void test27() throws Exception {
+        long expectedPos = -1;
+        SerialClob sc = new SerialClob(new StubClob());
+        String expected = "I am Batman";
+        long pos = sc.position(expected, 2);
+        assertEquals(expectedPos, pos);
+    }
+
+    /*
+     * Validate that position() returns the correct value when a char[] is used
+     * to create the SerialClob
+     */
+    @Test
+    public void test28() throws Exception {
+        long expectedPos = 2;
+        SerialClob sc = new SerialClob(chars);
+        String expected = "ello";
+        long pos = sc.position(expected, 1);
+        assertEquals(expectedPos, pos);
+    }
+
+    /*
+     * Validate that position() returns the correct value when a SerialClob is
+     * used for the search argument
+     */
+    @Test
+    public void test29() throws Exception {
+        long expectedPos = 21;
+        String expected = "Batman";
+        String buf = "I am Joker, not the Batman, hahaha";
+        SerialClob sc = new SerialClob(expected.toCharArray());
+        SerialClob sc1 = new SerialClob(buf.toCharArray());
+        long pos = sc1.position(sc, 1);
+        assertEquals(expectedPos, pos);
+    }
+
+    /*
+     * Validate that position() returns the correct value when a SerialClob is
+     * used for the search argument
+     */
+    @Test
+    public void test30() throws Exception {
+        long expectedPos = 17;
+        String expected = "012";
+        SerialClob sc = new SerialClob(expected.toCharArray());
+        SerialClob sc1 = new SerialClob(new StubClob());
+        long pos = sc1.position(sc, 1);
+        assertEquals(expectedPos, pos);
+    }
+
+    /*
+     * Check that setString() updates the appropriate characters in the
+     * SerialClob
+     */
+    @Test
+    public void test31() throws Exception {
+        String val = "Hello, I am Bruce Wayne";
+        String val1 = "the Batman!";
+        String expected = "Hello, I am the Batman!";
+        SerialClob sc = new SerialClob(val.toCharArray());
+        int written = sc.setString(13, val1);
+        assertEquals(val1.length(), written);
+        assertTrue(expected.equals(sc.getSubString(1, (int) sc.length())));
+    }
+
+    /*
+     * Check that setString() updates the appropriate characters in the
+     * SerialClob
+     */
+    @Test(enabled = false)
+    public void test32() throws Exception {
+        int expectedWritten = 9;
+        String val = "Hi, I am Catwoman!!!!!!";
+        String val1 = "Hahaha the Joker, who are you?!";
+        String expected = "Hi, I am the Joker!";
+        SerialClob sc = new SerialClob(val.toCharArray());
+        int written = sc.setString(10, val1, 8, expectedWritten+1);
+        assertEquals(written, expectedWritten);
+
+    }
+
+    /*
+     * Check that setCharacterStream() returns a non-null Writer for an
+     * SerialClob created from a Clob
+     */
+    @Test
+    public void test33() throws Exception {
+        SerialClob sc = new SerialClob(new StubClob());
+        Writer w = sc.setCharacterStream(1);
+        assertTrue(w != null);
+    }
+
+    /*
+     * Check that setAsciiStream() returns a non-null OutputStream for an SerialClob
+     * created from a Clob
+     */
+    @Test
+    public void test34() throws Exception {
+        SerialClob sc = new SerialClob(new StubClob());
+        OutputStream os = sc.setAsciiStream(1);
+        assertTrue(os != null);
+    }
+
+    /*
+     * Check that truncate() truncates the length of the SerialClob to the
+     * specified size
+     */
+    @Test
+    public void test35() throws Exception {
+        SerialClob sc = new SerialClob(new StubClob());
+        sc.truncate(0);
+        assertTrue(sc.length() == 0);
+        sc = new SerialClob(chars);
+        sc.truncate(5);
+        assertTrue(sc.length() == 5);
+    }
+
+    /*
+     * Check that getCharacterStream() returns a Reader and that the char[] that
+     * was specified to create the SerialClob can be returned via the Reader
+     */
+    @Test
+    public void test36() throws Exception {
+        SerialClob sc = new SerialClob(chars);
+        Reader r = sc.getCharacterStream();
+        for (char c : chars) {
+            char val = (char) r.read();
+            assertTrue(c == val, val + " does not match " + c);
+        }
+    }
+
+    /*
+     * Check that getCharacterStream() returns a Reader and that the char[] that
+     * was specified to create the SerialClob can be returned via the Reader
+     */
+    @Test(enabled = false)
+    public void test37() throws Exception {
+        SerialClob sc = new SerialClob(chars);
+        String expected = "ello w";
+        Reader r = sc.getCharacterStream(2, 6);
+        for (char c : expected.toCharArray()) {
+            char val = (char) r.read();
+            assertTrue(c == val, val + " does not match " + c);
+        }
+    }
+
+    /*
+     * Validate that a SerialClob that is serialized & deserialized is equal to
+     * itself
+     */
+    @Test
+    public void test38() throws Exception {
+        SerialClob sc = new SerialClob(chars);
+        SerialClob sc2 = serializeDeserializeObject(sc);
+        assertTrue(sc.equals(sc2), "SerialClobs not equal");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/sql/testng/test/rowset/serial/SerialDataLinkTests.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,110 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package test.rowset.serial;
+
+import java.net.URL;
+import javax.sql.rowset.serial.SerialDatalink;
+import javax.sql.rowset.serial.SerialException;
+import static org.testng.Assert.*;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+import util.BaseTest;
+
+public class SerialDataLinkTests extends BaseTest {
+
+    private URL u;
+    private URL u1;
+    private SerialDatalink dl;
+
+    @BeforeMethod
+    public void setUpMethod() throws Exception {
+        u = new URL("http://www.oracle.com/");
+        u1 = new URL("http://www.usatoday.com/");
+        dl = new SerialDatalink(u);
+    }
+
+    /*
+     * Validate that a SerialException is thrown if the URL is null
+     */
+    @Test(expectedExceptions = SerialException.class)
+    public void test() throws Exception {
+        SerialDatalink dl1 = new SerialDatalink(null);
+    }
+
+    /*
+     * Validate that getDatalink() returns the same URL used to create the
+     * SerialDatalink object
+     */
+    @Test
+    public void test01() throws Exception {
+        URL u2 = dl.getDatalink();
+        assertTrue(u2.equals(u));
+        assertTrue(u2.sameFile(u));
+    }
+
+    /*
+     * Validate that URL returned from getDatalink() differs from a URL that was
+     * not used to create the SerialDatalink
+     */
+    @Test
+    public void test02() throws Exception {
+        URL u2 = dl.getDatalink();
+        assertFalse(u2.equals(u1));
+        assertFalse(u2.sameFile(u1));
+    }
+
+    /*
+     * Create a clone of a SerialDatalink and validate that it is equal to the
+     * SerialDatalink it was cloned from
+     */
+    @Test
+    public void test03() throws Exception {
+        SerialDatalink dl2 = (SerialDatalink) dl.clone();
+        assertTrue(dl.equals(dl2));
+        SerialDatalink dl3 = new SerialDatalink(u1);
+        assertFalse(dl2.equals(dl3));
+    }
+
+    /*
+     * Validate that a SerialDatalink that is serialized & deserialized is
+     * equal to itself
+     */
+    @Test
+    public void test04() throws Exception {
+        SerialDatalink dl2 = serializeDeserializeObject(dl);
+        SerialDatalink dl3 = new SerialDatalink(u);
+        assertTrue(dl.equals(dl2));
+        assertTrue(dl3.equals(dl2));
+    }
+
+    /**
+     * Validate that a SerialDatalink that is serialized & deserialized is not equal
+     * to to a SerialDatalink created using a different URL
+     */
+    @Test
+    public void test05() throws Exception {
+        SerialDatalink dl2 = serializeDeserializeObject(dl);
+        SerialDatalink d3 = new SerialDatalink(u1);
+        assertFalse(d3.equals(dl2));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/sql/testng/test/rowset/serial/SerialExceptionTests.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package test.rowset.serial;
+
+import java.sql.SQLException;
+import javax.sql.rowset.serial.SerialException;
+import static org.testng.Assert.*;
+import org.testng.annotations.Test;
+import util.BaseTest;
+
+public class SerialExceptionTests extends BaseTest {
+
+    /*
+     * Create SerialException with no-arg constructor
+     */
+    @Test
+    public void test01() {
+        SerialException ex = new SerialException();
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /*
+     * Create SerialException with message
+     */
+    @Test
+    public void test02() {
+        SerialException ex = new SerialException(reason);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /*
+     * Validate that the ordering of the returned Exceptions is correct using
+     * for-each loop
+     */
+    @Test
+    public void test03() {
+        SerialException ex = new SerialException("Exception 1");
+        ex.initCause(t1);
+        SerialException ex1 = new SerialException("Exception 2");
+        SerialException ex2 = new SerialException("Exception 3");
+        ex2.initCause(t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        for (Throwable e : ex) {
+            assertTrue(msgs[num++].equals(e.getMessage()));
+        }
+    }
+
+    /*
+     * Validate that the ordering of the returned Exceptions is correct using
+     * traditional while loop
+     */
+    @Test
+    public void test04() {
+        SQLException ex = new SerialException("Exception 1");
+        ex.initCause(t1);
+        SerialException ex1 = new SerialException("Exception 2");
+        SerialException ex2 = new SerialException("Exception 3");
+        ex2.initCause(t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        while (ex != null) {
+            assertTrue(msgs[num++].equals(ex.getMessage()));
+            Throwable c = ex.getCause();
+            while (c != null) {
+                assertTrue(msgs[num++].equals(c.getMessage()));
+                c = c.getCause();
+            }
+            ex = ex.getNextException();
+        }
+    }
+
+    /*
+     * Serialize a SerialException and make sure you can read it back properly
+     */
+    @Test
+    public void test05() throws Exception {
+        SerialException e = new SerialException(reason);
+        SerialException ex1 = createSerializedException(e);
+        assertTrue(ex1.getMessage().equals(reason)
+                && ex1.getSQLState() == null
+                && ex1.getCause() == null
+                && ex1.getErrorCode() == 0);;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/sql/testng/test/rowset/serial/SerialJavaObjectTests.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package test.rowset.serial;
+
+import java.lang.reflect.Field;
+import java.util.Arrays;
+import javax.sql.rowset.RowSetMetaDataImpl;
+import javax.sql.rowset.serial.SerialException;
+import javax.sql.rowset.serial.SerialJavaObject;
+import static org.testng.Assert.*;
+import org.testng.annotations.Test;
+import util.BaseTest;
+
+public class SerialJavaObjectTests extends BaseTest {
+
+    /*
+     * Validate that an NPE is thrown when null is specified to create
+     * the SerialJavaObject
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void test() throws Exception {
+        SerialJavaObject sjo = new SerialJavaObject(null);
+    }
+
+    /*
+     * Validate that an SerialExcepion is thrown when the object specified
+     * contains public static fields
+     */
+    @Test(expectedExceptions = SerialException.class, enabled = false)
+    public void test01() throws Exception {
+        SerialJavaObject sjo = new SerialJavaObject(new RowSetMetaDataImpl());
+    }
+
+    /*
+     * Validate that an getFields()s returns the same Field[] for the object
+     * used to create the SerialJavaObject
+     */
+    @Test
+    public void test02() throws Exception {
+        SerialException e = new SerialException();
+        SerialJavaObject sjo = new SerialJavaObject(e);
+        Field[] f = e.getClass().getFields();
+        assertTrue(Arrays.equals(f, sjo.getFields()));
+        assertFalse(Arrays.equals("hello".getClass().getFields(),
+                sjo.getFields()));
+    }
+
+    /*
+     * clone() a SerialJavaObject and check that it is equal to the
+     * object it was cloned from
+     */
+    @Test
+    public void test03() throws Exception {
+        SerialJavaObject sjo = new SerialJavaObject("Hello");
+        SerialJavaObject sjo2 = (SerialJavaObject) sjo.clone();
+        assertTrue(sjo.equals(sjo2));
+    }
+
+    /**
+     * Validate that a SerialJavaObject that is serialized & deserialized is
+     * equal to itself
+     */
+    @Test
+    public void test04() throws Exception {
+        SerialJavaObject sjo = new SerialJavaObject("Hello");
+        SerialJavaObject sjo2 = serializeDeserializeObject(sjo);
+        assertTrue(sjo.equals(sjo2));
+    }
+
+    /*
+     * Validate that a getObject() returns an object used to create the
+     * SerialJavaObject
+     */
+    @Test
+    public void test05() throws Exception {
+        String s = "Hello world";
+        SerialJavaObject sjo = new SerialJavaObject(s);
+        assertTrue(s.equals(sjo.getObject()));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/sql/testng/test/rowset/serial/SerialRefTests.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,131 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package test.rowset.serial;
+
+import java.sql.Ref;
+import java.sql.SQLException;
+import java.util.HashMap;
+import java.util.Map;
+import javax.sql.rowset.serial.SerialRef;
+import static org.testng.Assert.*;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+import util.BaseTest;
+import util.StubRef;
+import util.SuperHero;
+
+public class SerialRefTests extends BaseTest {
+
+    private static Map<String, Class<?>> map = new HashMap<>();
+    private Ref ref;
+    private final String sqlType = "SUPERHERO";
+    private SuperHero hero;
+
+    @BeforeMethod
+    public void setUpMethod() throws Exception {
+        map.put(sqlType, Class.forName("util.SuperHero"));
+        hero = new SuperHero(sqlType, "Bruce", "Wayne", 1939, "Batman");
+        ref = new StubRef(sqlType, hero);
+    }
+
+    /*
+     * Validate that a SQLException() is thrown if the Ref is null
+     */
+    @Test(expectedExceptions = SQLException.class)
+    public void test01() throws Exception {
+        SerialRef sr = new SerialRef(null);
+    }
+
+    /*
+     * Validate that a SQLException() is thrown if the typeName is null in the
+     * Ref used to create the SerialRef
+     */
+    @Test(expectedExceptions = SQLException.class)
+    public void test02() throws Exception {
+        SerialRef sr = new SerialRef(new StubRef(null, hero));
+    }
+
+    /*
+     * Validate that getBaseTypeName() returns the same SQLType specified
+     * to create the Ref
+     */
+    @Test
+    public void test03() throws Exception {
+        SerialRef sr = new SerialRef(ref);
+        assertEquals(sr.getBaseTypeName(), sqlType);
+    }
+
+    /*
+     * Validate that getObject() returns the same object used to create the Ref
+     */
+    @Test
+    public void test04() throws Exception {
+        SerialRef sr = new SerialRef(ref);
+        assertTrue(hero.equals(sr.getObject()));
+    }
+
+    /*
+     * Validate that getObject() returns the same object used to create the Ref
+     */
+    @Test(enabled = false)
+    public void test05() throws Exception {
+        SerialRef sr = new SerialRef(ref);
+        assertTrue(hero.equals(sr.getObject(map)));
+    }
+
+    /*
+     * Validate that setObject() can be used to change the value of the object
+     * pointed to by the SerialRef
+     */
+    @Test
+    public void test06() throws Exception {
+        SerialRef sr = new SerialRef(ref);
+        assertTrue(hero.equals(sr.getObject()));
+        SuperHero h = new SuperHero(sqlType, "Dick", "Grayson", 1940, "Robin");
+        sr.setObject(h);
+        assertFalse(hero.equals(sr.getObject()));
+    }
+
+    /*
+     * clone() a SerialRef and check that it is equal to the
+     * object it was cloned from
+     */
+    @Test
+    public void test09() throws Exception {
+        SerialRef sr = new SerialRef(ref);
+        SerialRef sr1 = (SerialRef) sr.clone();
+        assertTrue(sr.equals(sr1));
+    }
+
+    /**
+     * Validate that a SerialRef that is serialized & deserialized is equal to
+     * itself for the Object & baseTypeName
+     */
+    @Test
+    public void test10() throws Exception {
+        SerialRef sr = new SerialRef(ref);
+        SerialRef sr1 = serializeDeserializeObject(sr);
+        assertTrue(sr1.getObject().equals(sr.getObject())
+                && sr1.getBaseTypeName().equals(sr.getBaseTypeName()));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/sql/testng/test/rowset/serial/SerialStructTests.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,140 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package test.rowset.serial;
+
+import java.sql.Struct;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+import javax.sql.rowset.serial.SerialStruct;
+import static org.testng.Assert.*;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+import util.BaseTest;
+import util.StubStruct;
+import util.SuperHero;
+
+public class SerialStructTests extends BaseTest {
+
+    private static Map<String, Class<?>> map = new HashMap<>();
+    private Object[] attributes;
+    private Struct struct;
+    private final String sqlType = "SUPERHERO";
+    private SuperHero hero;
+
+    @BeforeMethod
+    public void setUpMethod() throws Exception {
+        attributes = new Object[]{"Bruce", "Wayne", 1939,
+            "Batman"};
+        map.put(sqlType, Class.forName("util.SuperHero"));
+        struct = new StubStruct(sqlType, attributes);
+        hero = new SuperHero(sqlType, "Bruce", "Wayne", 1939, "Batman");
+    }
+
+    /*
+     * Validate that getSQLTypeName() returns the same SQLType specified by
+     * the Struct used to create the object
+     */
+    @Test
+    public void test01() throws Exception {
+        SerialStruct ss = new SerialStruct(struct, map);
+        assertEquals(ss.getSQLTypeName(), sqlType);
+    }
+
+    /*
+     * Validate that getSQLTypeName() returns the same SQLType specified by
+     * the Struct used to create the object
+     */
+    @Test
+    public void test02() throws Exception {
+        SerialStruct ss = new SerialStruct(hero, map);
+        assertEquals(ss.getSQLTypeName(), sqlType);
+    }
+
+    /*
+     * Validate that getAttributes() returns the same attributes specified by
+     * the Struct used to create the object
+     */
+    @Test
+    public void test03() throws Exception {
+        SerialStruct ss = new SerialStruct(struct, map);
+        assertTrue(Arrays.equals(attributes,
+                ss.getAttributes()));
+    }
+
+    /*
+     * Validate that getAttributes() returns the same attributes specified by
+     * the Struct used to create the object
+     */
+    @Test
+    public void test04() throws Exception {
+        SerialStruct ss = new SerialStruct(hero, map);
+        assertTrue(Arrays.equals(attributes,
+                ss.getAttributes()));
+    }
+
+    /*
+     * Validate that getAttributes() returns the
+     same attributes specified by
+     * the Struct used to create the object
+     */
+    @Test
+    public void test05() throws Exception {
+        SerialStruct ss = new SerialStruct(struct, map);
+        assertTrue(Arrays.equals(attributes,
+                ss.getAttributes(map)));
+    }
+
+    /*
+     * Validate that getAttributes() returns the same attributes specified by
+     * the Struct used to create the object
+     */
+    @Test
+    public void test06() throws Exception {
+        SerialStruct ss = new SerialStruct(hero, map);
+        assertTrue(Arrays.equals(attributes,
+                ss.getAttributes(map)));
+    }
+
+    /*
+     * clone() a SerialStruct and check that it is equal to the
+     * object it was cloned from
+     */
+    @Test
+    public void test07() throws Exception {
+        SerialStruct ss = new SerialStruct(struct, map);
+        SerialStruct ss1 = (SerialStruct) ss.clone();
+        assertTrue(ss.equals(ss1));
+    }
+
+    /**
+     * Validate that a SerialStruct that is serialized & deserialized is equal
+     * to itself
+     */
+    @Test
+    public void test08() throws Exception {
+        SerialStruct ss = new SerialStruct(struct, map);
+        SerialStruct ss1 = serializeDeserializeObject(ss);;
+        assertTrue(ss.equals(ss1));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/sql/testng/util/BaseTest.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package util;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.sql.SQLException;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.BeforeMethod;
+
+public class BaseTest {
+
+    protected final String reason = "reason";
+    protected final String state = "SQLState";
+    protected final String cause = "java.lang.Throwable: cause";
+    protected final Throwable t = new Throwable("cause");
+    protected final Throwable t1 = new Throwable("cause 1");
+    protected final Throwable t2 = new Throwable("cause 2");
+    protected final int errorCode = 21;
+    protected final String[] msgs = {"Exception 1", "cause 1", "Exception 2",
+        "Exception 3", "cause 2"};
+
+    @BeforeClass
+    public static void setUpClass() throws Exception {
+    }
+
+    @AfterClass
+    public static void tearDownClass() throws Exception {
+    }
+
+    @BeforeMethod
+    public void setUpMethod() throws Exception {
+    }
+
+    @AfterMethod
+    public void tearDownMethod() throws Exception {
+    }
+
+    /*
+     * Take some form of SQLException, serialize and deserialize it
+     */
+    @SuppressWarnings("unchecked")
+    protected <T extends SQLException> T
+            createSerializedException(T ex)
+            throws IOException, ClassNotFoundException {
+        return (T) serializeDeserializeObject(ex);
+    }
+
+    /*
+     * Utility method to serialize and deserialize an object
+     */
+    @SuppressWarnings("unchecked")
+    protected <T> T serializeDeserializeObject(T o)
+            throws IOException, ClassNotFoundException {
+        T o1;
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        try (ObjectOutputStream oos = new ObjectOutputStream(baos)) {
+            oos.writeObject(o);
+        }
+        try (ObjectInputStream ois
+                = new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray()))) {
+            o1 = (T) ois.readObject();
+        }
+        return o1;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/sql/testng/util/StubArray.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package util;
+
+import java.sql.Array;
+import java.sql.JDBCType;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.Arrays;
+import java.util.Map;
+
+public class StubArray implements Array {
+
+    private String typeName;
+    Object[] elements;
+
+    public StubArray(String name, Object[] values) {
+        typeName = name;
+        elements = Arrays.copyOf(values, values.length);
+
+    }
+
+    @Override
+    public String getBaseTypeName() throws SQLException {
+        return typeName;
+    }
+
+    @Override
+    public int getBaseType() throws SQLException {
+        return JDBCType.valueOf(typeName).getVendorTypeNumber();
+    }
+
+    @Override
+    public Object getArray() throws SQLException {
+        return Arrays.copyOf(elements, elements.length);
+    }
+
+    @Override
+    public Object getArray(Map<String, Class<?>> map) throws SQLException {
+        return getArray();
+    }
+
+    @Override
+    public Object getArray(long index, int count) throws SQLException {
+        return getArray();
+    }
+
+    @Override
+    public Object getArray(long index, int count, Map<String, Class<?>> map) throws SQLException {
+        return getArray();
+    }
+
+    @Override
+    public ResultSet getResultSet() throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public ResultSet getResultSet(Map<String, Class<?>> map) throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public ResultSet getResultSet(long index, int count) throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public ResultSet getResultSet(long index, int count, Map<String, Class<?>> map) throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public void free() throws SQLException {
+        elements = null;
+        typeName = null;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/sql/testng/util/StubBlob.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package util;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectOutputStream;
+import java.io.OutputStream;
+import java.sql.Blob;
+import java.sql.SQLException;
+import java.util.Arrays;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+public class StubBlob implements Blob {
+
+    private byte[] bytes;
+
+    public StubBlob() {
+        bytes = new byte[]{2, 4, 6, 8};
+    }
+
+    public long length() throws SQLException {
+        return bytes.length;
+    }
+
+    public byte[] getBytes(long pos, int length)
+            throws SQLException {
+        return Arrays.copyOfRange(bytes, (int) pos - 1, length);
+    }
+
+    public InputStream getBinaryStream()
+            throws SQLException {
+        return null;
+    }
+
+    public long position(byte[] pattern, long start)
+            throws SQLException {
+        return 0;
+    }
+
+    public long position(Blob pattern, long start)
+            throws SQLException {
+        return 0;
+    }
+
+    public int setBytes(long pos, byte[] bytes)
+            throws SQLException {
+        return 0;
+    }
+
+    public int setBytes(long pos, byte[] bytes, int offset, int len)
+            throws SQLException {
+        return 0;
+    }
+
+    public OutputStream setBinaryStream(long pos)
+            throws SQLException {
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        ObjectOutputStream oos = null;
+        try {
+            oos = new ObjectOutputStream(baos);
+        } catch (IOException ex) {
+            Logger.getLogger(StubBlob.class.getName()).log(Level.SEVERE, null, ex);
+        }
+        return oos;
+    }
+
+    public void truncate(long len)
+            throws SQLException {
+    }
+
+    public void free() throws SQLException {
+    }
+
+    public InputStream getBinaryStream(long pos, long length) throws SQLException {
+        return null;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/sql/testng/util/StubClob.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package util;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectOutputStream;
+import java.io.OutputStream;
+import java.io.Reader;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.sql.Clob;
+import java.sql.SQLException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+public class StubClob implements Clob {
+
+    public String buf = "The test string 0123456789";
+
+    @Override
+    public String getSubString(long pos, int length) throws SQLException {
+        return buf;
+    }
+
+    @Override
+    public long length() throws SQLException {
+        return buf.length();
+    }
+
+    @Override
+    public Reader getCharacterStream() throws SQLException {
+        return new StringReader(buf);
+    }
+
+    @Override
+    public InputStream getAsciiStream() throws SQLException {
+        return new java.io.StringBufferInputStream(buf);
+    }
+
+    @Override
+    public int setString(long pos, String str) throws SQLException {
+        return str.length();
+    }
+
+    @Override
+    public int setString(long pos, String str, int offset, int len) throws SQLException {
+        return len;
+    }
+
+    @Override
+    public long position(String searchstr, long start) throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public long position(Clob searchstr, long start) throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public OutputStream setAsciiStream(long pos) throws SQLException {
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        ObjectOutputStream oos = null;
+        try {
+            oos = new ObjectOutputStream(baos);
+        } catch (IOException ex) {
+            Logger.getLogger(StubBlob.class.getName()).log(Level.SEVERE, null, ex);
+        }
+        return oos;
+    }
+
+    @Override
+    public Writer setCharacterStream(long pos) throws SQLException {
+        return new StringWriter();
+    }
+
+    @Override
+    public void truncate(long len) throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public void free() throws SQLException {
+    }
+
+    @Override
+    public Reader getCharacterStream(long pos, long length) throws SQLException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/sql/testng/util/StubRef.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package util;
+
+import java.io.Serializable;
+import java.sql.Ref;
+import java.sql.SQLException;
+import java.util.Map;
+
+public class StubRef implements Ref, Serializable {
+
+    private final String baseTypeName;
+    private Object obj;
+
+    public StubRef(String type, Object o) {
+        baseTypeName = type;
+        obj = o;
+    }
+
+    @Override
+    public String getBaseTypeName() throws SQLException {
+        return baseTypeName;
+    }
+
+    @Override
+    public Object getObject(Map<String, Class<?>> map) throws SQLException {
+        return obj;
+    }
+
+    @Override
+    public Object getObject() throws SQLException {
+        return getObject(null);
+    }
+
+    @Override
+    public void setObject(Object value) throws SQLException {
+        obj = value;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/sql/testng/util/StubStruct.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package util;
+
+import java.sql.SQLException;
+import java.sql.Struct;
+import java.util.Arrays;
+import java.util.Map;
+
+public class StubStruct implements Struct {
+
+    private final String type;
+    private final Object[] attribs;
+
+    public StubStruct(String type, Object[] o) {
+        this.type = type;
+        this.attribs = Arrays.copyOf(o, o.length);
+    }
+
+    @Override
+    public String getSQLTypeName() throws SQLException {
+        return type;
+    }
+
+    @Override
+    public Object[] getAttributes() throws SQLException {
+        return attribs;
+    }
+
+    @Override
+    public Object[] getAttributes(Map<String, Class<?>> map) throws SQLException {
+        return attribs;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/sql/testng/util/SuperHero.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package util;
+
+import java.io.Serializable;
+import java.sql.SQLData;
+import java.sql.SQLException;
+import java.sql.SQLInput;
+import java.sql.SQLOutput;
+
+public class SuperHero implements SQLData, Serializable {
+
+    private String first;
+    private String last;
+    private final String type;
+    private Integer firstYear;
+    private String secretIdentity;
+
+    public SuperHero(String sqlType, String fname, String lname, Integer year,
+            String identity) {
+        first = fname;
+        last = lname;
+        type = sqlType;
+        firstYear = year;
+        secretIdentity = identity;
+    }
+
+    @Override
+    public String getSQLTypeName() throws SQLException {
+        return type;
+    }
+
+    @Override
+    public void readSQL(SQLInput stream, String typeName) throws SQLException {
+        first = stream.readString();
+        last = stream.readString();
+        firstYear = stream.readInt();
+        secretIdentity = stream.readString();
+    }
+
+    @Override
+    public void writeSQL(SQLOutput stream) throws SQLException {
+        stream.writeString(first);
+        stream.writeString(last);
+        stream.writeInt(firstYear);
+        stream.writeString(secretIdentity);
+    }
+
+    @Override
+    public String toString() {
+        return "[ name =" + first + " " + last + " "
+                + firstYear + " " + secretIdentity + " ]";
+    }
+
+    public void setIdentity(String identity) {
+        secretIdentity = identity;
+    }
+
+    public String getIdentity() {
+        return secretIdentity;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj instanceof SuperHero) {
+            SuperHero ss = (SuperHero) obj;
+            return first.equals(ss.first) && last.equals(ss.last)
+                    && firstYear.equals(ss.firstYear)
+                    && type.equals(ss.type)
+                    && secretIdentity.equals(ss.secretIdentity);
+        }
+        return false;
+    }
+
+    @Override
+    public int hashCode() {
+        return ((31 + first.hashCode()) * 31) * 31
+                + ((31 + last.hashCode()) * 31) * 31
+                + ((31 + firstYear.hashCode()) * 31) * 31
+                + ((31 + type.hashCode()) * 31) * 31
+                + secretIdentity.hashCode();
+    }
+}
--- a/jdk/test/javax/swing/JMenuItem/8031573/bug8031573.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/test/javax/swing/JMenuItem/8031573/bug8031573.java	Mon Jun 02 13:53:52 2014 -0700
@@ -28,7 +28,7 @@
 import javax.swing.SwingUtilities;
 
 /* @test
- * @bug 8031573
+ * @bug 8031573 8040279
  * @summary [macosx] Checkmarks of JCheckBoxMenuItems aren't rendered
  *           in high resolution on Retina
  * @author Alexander Scherbatiy
--- a/jdk/test/javax/swing/JOptionPane/8024926/bug8024926.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/test/javax/swing/JOptionPane/8024926/bug8024926.java	Mon Jun 02 13:53:52 2014 -0700
@@ -31,7 +31,7 @@
 
 /**
  * @test
- * @bug 8024926
+ * @bug 8024926 8040279
  * @summary [macosx] AquaIcon HiDPI support
  * @author Alexander Scherbatiy
  * @run applet/manual=yesno bug8024926.html
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JScrollBar/8039464/Test8039464.html	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,32 @@
+<!--
+ Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.
+
+ This code is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ or visit www.oracle.com if you need additional information or have any
+ questions.
+-->
+
+<html>
+<body>
+Choose the variable applet size and try to resize the applet.
+The test passes the thumb is painted correctly.
+
+<applet width="400" height="200" code="Test8039464">
+</applet>
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JScrollBar/8039464/Test8039464.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Container;
+import java.awt.Dimension;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+
+import javax.swing.JApplet;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JScrollBar;
+import javax.swing.SwingUtilities;
+import javax.swing.UIManager;
+
+/*
+ * @test
+ * @bug 8039464
+ * @summary Tests enabling/disabling of titled border's caption
+ * @author Sergey Malenkov
+ * @run applet/manual=yesno Test8039464.html
+ */
+
+public class Test8039464 extends JApplet {
+    static {
+        try {
+            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+        } catch (Exception exception) {
+            throw new Error("unexpected", exception);
+        }
+    }
+
+    @Override
+    public void init() {
+        init(this);
+    }
+
+    private static void init(Container container) {
+        container.setLayout(new GridBagLayout());
+        GridBagConstraints gbc = new GridBagConstraints();
+        gbc.fill = GridBagConstraints.BOTH;
+        gbc.gridx = 0;
+        gbc.gridy = 1;
+        JLabel label = new JLabel();
+        Dimension size = new Dimension(111, 0);
+        label.setPreferredSize(size);
+        label.setMinimumSize(size);
+        container.add(label, gbc);
+        gbc.gridx = 1;
+        gbc.weightx = 1;
+        container.add(new JScrollBar(JScrollBar.HORIZONTAL, 1, 111, 1, 1111), gbc);
+        gbc.gridx = 2;
+        gbc.gridy = 0;
+        gbc.weightx = 0;
+        gbc.weighty = 1;
+        container.add(new JScrollBar(JScrollBar.VERTICAL, 1, 111, 1, 1111), gbc);
+    }
+
+    public static void main(String[] args) throws Exception {
+        SwingUtilities.invokeLater(new Runnable() {
+            @Override
+            public void run() {
+                JFrame frame = new JFrame("8039464");
+                init(frame);
+                frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
+                frame.pack();
+                frame.setLocationRelativeTo(null);
+                frame.setVisible(true);
+            }
+        });
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JTextField/8036819/bug8036819.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @library ../../regtesthelpers
+ * @build Util
+ * @bug 8036819
+ * @summary JAB: mnemonics not read for textboxes
+ * @author Vivi An
+ * @run main bug8036819
+ */
+
+import javax.swing.*;
+import javax.swing.event.*;
+import java.awt.event.*;
+import java.awt.*;
+import sun.awt.SunToolkit;
+import javax.accessibility.*;
+
+public class bug8036819 {
+
+    public static volatile Boolean passed = false;
+
+    public static void main(String args[]) throws Throwable {
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                createAndShowGUI();
+            }
+        });
+
+        SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+        toolkit.realSync();
+
+        Robot robo = new Robot();
+        robo.setAutoDelay(300);
+
+        // Using mnemonic key to focus on the textfield
+        Util.hitMnemonics(robo, KeyEvent.VK_P);
+        toolkit.realSync();
+
+        if (!passed){
+            throw new RuntimeException("Test failed.");
+        }
+    }
+
+    private static void createAndShowGUI() {
+        JFrame mainFrame = new JFrame("bug 8036819");
+
+        JLabel usernameLabel = new JLabel("Username: ");
+        JTextField usernameField = new JTextField(20);
+        usernameLabel.setDisplayedMnemonic(KeyEvent.VK_U);
+        usernameLabel.setLabelFor(usernameField);
+
+        JLabel pwdLabel = new JLabel("Password: ");
+        JTextField pwdField = new JTextField(20);
+        pwdLabel.setDisplayedMnemonic(KeyEvent.VK_P);
+        pwdLabel.setLabelFor(pwdField);
+
+        pwdField.addKeyListener(
+            new KeyListener(){
+                @Override
+                public void keyPressed(KeyEvent keyEvent) {
+                }
+
+                @Override
+                public void keyTyped(KeyEvent keyEvent) {
+                }
+
+                @Override
+                public void keyReleased(KeyEvent keyEvent){
+                    JComponent comp = (JComponent) pwdField;
+                    AccessibleContext ac = comp.getAccessibleContext();
+                    AccessibleExtendedComponent aec = (AccessibleExtendedComponent)ac.getAccessibleComponent();
+                    AccessibleKeyBinding akb = aec.getAccessibleKeyBinding();
+                    if (akb != null){
+                         int count = akb.getAccessibleKeyBindingCount();
+                        if (count != 1){
+                            passed = false;
+                            return;
+                        }
+
+                        // there is 1 accessible key for the text field
+                        System.out.println("Retrieved AccessibleKeyBinding for textfield " + count);
+
+                        // the key code is KeyEvent.VK_P
+                        Object o = akb.getAccessibleKeyBinding(0);
+                        if (o instanceof KeyStroke){
+                            javax.swing.KeyStroke key = (javax.swing.KeyStroke)o;
+                            System.out.println("keystroke is " + key.getKeyCode());
+                            if (key.getKeyCode() == KeyEvent.VK_P)
+                                passed = true;
+                        }
+                    }
+                }
+            }
+        );
+
+        mainFrame.getContentPane().add(usernameLabel);
+        mainFrame.getContentPane().add(usernameField);
+        mainFrame.getContentPane().add(pwdLabel);
+        mainFrame.getContentPane().add(pwdField);
+
+        mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        mainFrame.setLayout(new FlowLayout(FlowLayout.LEFT));
+
+        mainFrame.setSize(200, 200);
+        mainFrame.setLocation(200, 200);
+        mainFrame.setVisible(true);
+        mainFrame.toFront();
+    }
+ }
--- a/jdk/test/javax/swing/border/Test4252164.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/test/javax/swing/border/Test4252164.java	Mon Jun 02 13:53:52 2014 -0700
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 4252164
+ * @bug 4252164 8041917
  * @summary Tests rounded LineBorder for components
  * @author Sergey Malenkov
  * @run applet/manual=yesno Test4252164.html
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/plaf/nimbus/8041725/bug8041725.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* @test
+   @bug 8041725
+   @summary JList selection colors are not UIResource instances in Nimbus L&F
+   @author Anton Litvinov
+*/
+
+import java.awt.*;
+import javax.swing.*;
+import javax.swing.plaf.*;
+import javax.swing.plaf.nimbus.*;
+
+public class bug8041725 {
+    public static void main(String[] args) throws Exception {
+        UIManager.setLookAndFeel(new NimbusLookAndFeel());
+        SwingUtilities.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                JFrame frame = new JFrame("bug8041725");
+                frame.setSize(200, 200);
+                JList list = new JList(new String[]{"Item1", "Item2", "Item3"});
+                frame.getContentPane().add(list);
+                frame.pack();
+                frame.setVisible(true);
+
+                System.err.println("Test #1: No items are selected, list is enabled.");
+                testSelectionColors(list);
+
+                System.err.println("Test #2: No items are selected, list is disabled.");
+                list.setEnabled(false);
+                testSelectionColors(list);
+
+                System.err.println("Test #3: One item is selected, list is disabled.");
+                list.setSelectedIndex(0);
+                testSelectionColors(list);
+
+                System.err.println("Test #4: One item is selected, list is enabled.");
+                list.setEnabled(true);
+                testSelectionColors(list);
+
+                frame.dispose();
+            }
+        });
+    }
+
+    private static void testSelectionColors(JList list) {
+        Color selBackColor = list.getSelectionBackground();
+        if (!(selBackColor instanceof UIResource)) {
+            throw new RuntimeException(String.format(
+                "JList.getSelectionBackground() returned instance of '%s' instead of UIResource.",
+                selBackColor.getClass()));
+        }
+        Color selForeColor = list.getSelectionForeground();
+        if (!(selForeColor instanceof UIResource)) {
+            throw new RuntimeException(String.format(
+                "JList.getSelectionForeground() returned instance of '%s' instead of UIResource.",
+                selForeColor.getClass()));
+        }
+    }
+}
--- a/jdk/test/javax/swing/text/StyledEditorKit/8016833/bug8016833.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/test/javax/swing/text/StyledEditorKit/8016833/bug8016833.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -190,9 +190,9 @@
         // not too wide
         assertTrue(out3.getWidth() * 0.8 < out2.getWidth());
         // not too low
-        assertTrue(out3.getY() - (out1.getY() + out2.getHeight()) < 3);
+        assertTrue(out3.getY() - (out1.getY() + out2.getHeight() - 1) < 4);
         // not too high
-        assertTrue(out3.getY() - (out1.getY() + out2.getHeight()) > 0);
+        assertTrue(out3.getY() - (out1.getY() + out2.getHeight() - 1) > 0);
     }
 
     void testStrikthrough() {
@@ -217,7 +217,7 @@
         // not too wide
         assertTrue(out3.getWidth() * 0.8 < out2.getWidth());
         // not too low
-        assertTrue(out3.getY() - (out1.getY() + out2.getHeight()) < 0);
+        assertTrue(out3.getY() - (out1.getY() + out2.getHeight() - 1) < 0);
         // not too high
         assertTrue(out3.getY() - out1.getY() > 1);
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/xml/ws/8043129/MailTest.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,148 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8043129
+ * @summary JAF initialisation in SAAJ clashing with the one in javax.mail
+ * @author mkos
+ * @library javax.mail.jar
+ * @build MailTest
+ * @run main MailTest
+ */
+
+import javax.activation.CommandMap;
+import javax.activation.MailcapCommandMap;
+import javax.mail.BodyPart;
+import javax.mail.Message;
+import javax.mail.MessagingException;
+import javax.mail.Multipart;
+import javax.mail.Session;
+import javax.mail.internet.InternetAddress;
+import javax.mail.internet.MimeBodyPart;
+import javax.mail.internet.MimeMessage;
+import javax.mail.internet.MimeMultipart;
+import javax.xml.soap.AttachmentPart;
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.util.Properties;
+
+public class MailTest {
+
+    String host = null;
+    String user = "";
+    String password = null;
+    String from = null;
+    String to = null;
+
+    public static void main(String[] args) {
+        MailTest t = new MailTest();
+
+        t.user = "somebody@somewhere.com";
+        t.from = "somebody@somewhere.com";
+        t.to = "somebody@somewhere.com";
+
+        t.user = "somebody@somewhere.com";
+        t.password = "somepassword";
+        t.host = "somehost";
+
+        t.sendMail();    //this works
+
+        t.addSoapAttachement();
+        t.sendMail();    //after addAttachmentPart to soapmessage it do not work
+
+        // workaroundJAFSetup();
+        // t.sendMail();    //after workaround works again
+    }
+
+    void addSoapAttachement() {
+        try {
+            MessageFactory messageFactory = MessageFactory.newInstance();
+            SOAPMessage message = messageFactory.createMessage();
+            AttachmentPart a = message.createAttachmentPart();
+            a.setContentType("binary/octet-stream");
+            message.addAttachmentPart(a);
+        } catch (SOAPException e) {
+            e.printStackTrace();
+        }
+    }
+
+    void sendMail() {
+
+        try {
+            Properties props = new Properties();
+            props.put("mail.smtp.host", host);
+            props.put("mail.smtp.auth", "true");
+
+            Session session = Session.getInstance(props);
+            session.setDebug(true);
+
+            // Define message
+            MimeMessage message = new MimeMessage(session);
+            message.setFrom(new InternetAddress(from));
+            message.addRecipients(Message.RecipientType.TO, to);
+            message.setSubject("this is a multipart test");
+
+            Multipart multipart = new MimeMultipart();
+
+            BodyPart messageBodyPart1 = new MimeBodyPart();
+            messageBodyPart1.setText("please send also this Content\n ciao!");
+            multipart.addBodyPart(messageBodyPart1);
+
+            BodyPart messageBodyPart2 = new MimeBodyPart();
+            messageBodyPart2.setContent("<b>please</b> send also this Content <br>ciao!", "text/html; charset=UTF-8");
+            multipart.addBodyPart(messageBodyPart2);
+
+            message.setContent(multipart);
+
+            /*
+                Transport tr = session.getTransport("smtp");
+                tr.connect(host,user, password);
+                tr.sendMessage(message,InternetAddress.parse(to));
+                tr.close();
+            */
+
+            ByteArrayOutputStream baos = new ByteArrayOutputStream();
+            message.writeTo(baos);
+            String output = baos.toString();
+            System.out.println("output = " + output);
+            if (output.contains("also this Content")) {
+                System.out.println("Test PASSED.");
+            } else {
+                System.out.println("Test FAILED, missing content.");
+                throw new IllegalStateException("Test FAILED, missing content.");
+            }
+        } catch (MessagingException ignored) {
+        } catch (IOException ignored) {
+        }
+    }
+
+    // this is how the error can be worked around ...
+    static void workaroundJAFSetup() {
+        MailcapCommandMap mailMap = (MailcapCommandMap) CommandMap.getDefaultCommandMap();
+        mailMap.addMailcap("multipart/mixed;;x-java-content-handler=com.sun.mail.handlers.multipart_mixed");
+    }
+}
Binary file jdk/test/javax/xml/ws/8043129/javax.mail.jar has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/awt/dnd/8024061/bug8024061.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,357 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* @test
+ * @bug 8024061
+ * @summary Checks that no exception is thrown if dragGestureRecognized
+ *          takes a while to complete.
+ */
+import sun.awt.OSInfo;
+import sun.awt.OSInfo.OSType;
+import sun.awt.SunToolkit;
+
+import java.awt.*;
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.Transferable;
+import java.awt.datatransfer.UnsupportedFlavorException;
+import java.awt.dnd.DnDConstants;
+import java.awt.dnd.DragGestureEvent;
+import java.awt.dnd.DragGestureListener;
+import java.awt.dnd.DragSource;
+import java.awt.dnd.DragSourceDragEvent;
+import java.awt.dnd.DragSourceDropEvent;
+import java.awt.dnd.DragSourceEvent;
+import java.awt.dnd.DragSourceListener;
+import java.awt.dnd.DropTarget;
+import java.awt.dnd.DropTargetDragEvent;
+import java.awt.dnd.DropTargetDropEvent;
+import java.awt.dnd.DropTargetEvent;
+import java.awt.dnd.DropTargetListener;
+import java.awt.event.InputEvent;
+
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+import javax.swing.*;
+
+/**
+ * If dragGestureRecognized() takes a while to complete and if user performs a drag quickly,
+ * an exception is thrown from DropTargetListener.dragEnter when it calls
+ * DropTargetDragEvent.getTransferable().
+ * <p>
+ * This class introduces a delay in dragGestureRecognized() to cause the exception.
+ */
+public class bug8024061 {
+    private static final DataFlavor DropObjectFlavor;
+    private static final int DELAY = 1000;
+
+    private final DnDPanel panel1 = new DnDPanel(Color.yellow);
+    private final DnDPanel panel2 = new DnDPanel(Color.pink);
+    private final JFrame frame;
+
+    private static final CountDownLatch lock = new CountDownLatch(1);
+    private static volatile Exception dragEnterException = null;
+
+    static {
+        DataFlavor flavor = null;
+        try {
+            flavor = new DataFlavor(DataFlavor.javaJVMLocalObjectMimeType);
+        } catch (ClassNotFoundException e) {
+            e.printStackTrace();
+        }
+        DropObjectFlavor = flavor;
+    }
+
+    bug8024061() {
+        frame = new JFrame("DnDWithRobot");
+        frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
+
+        Dimension d = new Dimension(100, 100);
+
+        panel1.setPreferredSize(d);
+        panel2.setPreferredSize(d);
+
+        Container content = frame.getContentPane();
+        content.setLayout(new GridLayout(1, 2, 5, 5));
+        content.add(panel1);
+        content.add(panel2);
+
+        frame.pack();
+
+        DropObject drop = new DropObject();
+        drop.place(panel1, new Point(10, 10));
+        frame.setVisible(true);
+    }
+
+    public static void main(String[] args) throws AWTException, InvocationTargetException, InterruptedException {
+        OSType type = OSInfo.getOSType();
+        if (type != OSType.LINUX && type != OSType.SOLARIS) {
+            System.out.println("This test is for Linux and Solaris only... " +
+                               "skipping!");
+            return;
+        }
+
+        final bug8024061[] dnd = {null};
+        SwingUtilities.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                dnd[0] = new bug8024061();
+            }
+        });
+        final Robot robot = new Robot();
+        robot.setAutoDelay(10);
+        SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+        toolkit.realSync();
+
+        JFrame frame = dnd[0].frame;
+        Point point = frame.getLocationOnScreen();
+        Point here = new Point(point.x + 35, point.y + 45);
+        Point there = new Point(point.x + 120, point.y + 45);
+        here.x += 25;
+        robot.mouseMove(here.x, here.y);
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        while (here.x < there.x) {
+            here.x += 20;
+            robot.mouseMove(here.x, here.y);
+            System.out.println("x = " + here.x);
+        }
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+        toolkit.realSync();
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+        System.out.println("finished");
+
+        try {
+            if (lock.await(5, TimeUnit.SECONDS)) {
+                if (dragEnterException == null) {
+                    System.out.println("Test passed.");
+                } else {
+                    System.out.println("Test failed.");
+                    dragEnterException.printStackTrace();
+                    throw new RuntimeException(dragEnterException);
+                }
+            } else {
+                System.out.println("Test failed. Timeout reached");
+                throw new RuntimeException("Timed out waiting for dragEnter()");
+            }
+        } finally {
+            frame.dispose();
+        }
+    }
+
+    class DropObject implements Transferable {
+        DnDPanel panel;
+        Color color = Color.CYAN;
+        int width = 50;
+        int height = 50;
+        int x;
+        int y;
+
+        void draw(Graphics2D g) {
+            Color savedColor = g.getColor();
+            g.setColor(color);
+            g.fillRect(x, y, width, height);
+            g.setColor(Color.lightGray);
+            g.drawRect(x, y, width, height);
+            g.setColor(savedColor);
+        }
+
+        boolean contains(int x, int y) {
+            return (x > this.x && x < this.x + width)
+                    && (y > this.y && y < this.y + height);
+        }
+
+        @Override
+        public DataFlavor[] getTransferDataFlavors() {
+            return new DataFlavor[]{DropObjectFlavor};
+        }
+
+        void place(DnDPanel panel, Point location) {
+            if (panel != this.panel) {
+                x = location.x;
+                y = location.y;
+                if (this.panel != null) {
+                    this.panel.setDropObject(null);
+                    this.panel.repaint();
+                }
+                this.panel = panel;
+                this.panel.setDropObject(this);
+                this.panel.repaint();
+            }
+        }
+
+        @Override
+        public boolean isDataFlavorSupported(DataFlavor flavor) {
+            return DropObjectFlavor.equals(flavor);
+        }
+
+        @Override
+        public Object getTransferData(DataFlavor flavor)
+                throws UnsupportedFlavorException, IOException {
+            if (isDataFlavorSupported(flavor)) {
+                return this;
+            } else {
+                throw new UnsupportedFlavorException(flavor);
+            }
+        }
+    }
+
+    class DnDPanel extends JPanel {
+        DropObject dropObject;
+        final DragSource dragSource;
+        final DropTarget dropTarget;
+        final Color color;
+        final DragGestureListener dgListener;
+        final DragSourceListener dsListener;
+        final DropTargetListener dtListener;
+
+        DnDPanel(Color color) {
+            this.color = color;
+            this.dragSource = DragSource.getDefaultDragSource();
+            dgListener = new DragGestureListener() {
+                @Override
+                public void dragGestureRecognized(DragGestureEvent dge) {
+                    Point location = dge.getDragOrigin();
+                    if (dropObject != null && dropObject.contains(location.x, location.y)) {
+                        dragSource.startDrag(dge, DragSource.DefaultCopyNoDrop, dropObject, dsListener);
+                        try {
+                            Thread.sleep(DELAY);
+                        } catch (InterruptedException e) {
+                        }
+                    }
+                }
+            };
+
+            dsListener = new DragSourceListener() {
+                @Override
+                public void dragEnter(DragSourceDragEvent dsde) {
+                }
+
+                @Override
+                public void dragOver(DragSourceDragEvent dsde) {
+                }
+
+                @Override
+                public void dropActionChanged(DragSourceDragEvent dsde) {
+                }
+
+                @Override
+                public void dragExit(DragSourceEvent dse) {
+                }
+
+                @Override
+                public void dragDropEnd(DragSourceDropEvent dsde) {
+                }
+            };
+
+            dtListener = new DropTargetListener() {
+                @Override
+                public void dragEnter(DropTargetDragEvent dtde) {
+                    if (dropObject != null) {
+                        dtde.rejectDrag();
+                        return;
+                    }
+                    dtde.acceptDrag(DnDConstants.ACTION_MOVE);
+                    try {
+                        Transferable t = dtde.getTransferable();
+                        Object data = t.getTransferData(DropObjectFlavor);
+                        if (data != null) {
+                            throw new Exception("getTransferData returned non-null");
+                        }
+                    } catch (Exception e) {
+                        dragEnterException = e;
+                        e.printStackTrace();
+                    } finally {
+                        lock.countDown();
+                    }
+                }
+
+                @Override
+                public void dragOver(DropTargetDragEvent dtde) {
+                    if (dropObject != null) {
+                        dtde.rejectDrag();
+                        return;
+                    }
+                    dtde.acceptDrag(DnDConstants.ACTION_MOVE);
+                }
+
+                @Override
+                public void dropActionChanged(DropTargetDragEvent dtde) {
+                }
+
+                @Override
+                public void dragExit(DropTargetEvent dte) {
+                }
+
+                @Override
+                public void drop(DropTargetDropEvent dtde) {
+                    if (dropObject != null) {
+                        dtde.rejectDrop();
+                        return;
+                    }
+                    try {
+                        dtde.acceptDrop(DnDConstants.ACTION_MOVE);
+                        Transferable t = dtde.getTransferable();
+                        DropObject dropObject = (DropObject) t.getTransferData(DropObjectFlavor);
+                        Point location = dtde.getLocation();
+                        dropObject.place(DnDPanel.this, location);
+                        dtde.dropComplete(true);
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+
+                }
+            };
+
+            dragSource.createDefaultDragGestureRecognizer(this,
+                    DnDConstants.ACTION_MOVE, dgListener);
+
+            dropTarget = new DropTarget(this, DnDConstants.ACTION_MOVE, dtListener, true);
+
+        }
+
+        public void paintComponent(Graphics g) {
+            super.paintComponent(g);
+            Color savedColor = g.getColor();
+            g.setColor(color);
+            g.fillRect(0, 0, getWidth(), getHeight());
+            g.setColor(savedColor);
+            if (dropObject != null) {
+                dropObject.draw((Graphics2D) g);
+            }
+        }
+
+        void setDropObject(DropObject dropObject) {
+            this.dropObject = dropObject;
+        }
+
+        DropObject findDropObject(int x, int y) {
+            if (dropObject != null && dropObject.contains(x, y)) {
+                return dropObject;
+            }
+            return null;
+        }
+    }
+}
--- a/jdk/test/sun/management/jdp/JdpDefaultsTest.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/test/sun/management/jdp/JdpDefaultsTest.java	Mon Jun 02 13:53:52 2014 -0700
@@ -28,7 +28,7 @@
  * @test JdpDefaultsTest
  * @summary Assert that we can read JDP packets from a multicast socket connection, on default IP and port.
  * @library /lib/testlibrary
- * @build ClientConnection JdpTestUtil JdpTestCase JdpOnTestCase DynamicLauncher
+ * @build jdk.testlibrary.* ClientConnection JdpTestUtil JdpTestCase JdpOnTestCase DynamicLauncher
  * @run main JdpDefaultsTest
  */
 
--- a/jdk/test/sun/management/jdp/JdpOffTest.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/test/sun/management/jdp/JdpOffTest.java	Mon Jun 02 13:53:52 2014 -0700
@@ -29,7 +29,7 @@
  * @test JdpOffTest.java
  * @summary Assert that no JDP packets are sent to the default address and port.
  * @library /lib/testlibrary
- * @build ClientConnection JdpTestUtil JdpTestCase JdpOffTestCase DynamicLauncher
+ * @build jdk.testlibrary.* ClientConnection JdpTestUtil JdpTestCase JdpOffTestCase DynamicLauncher
  * @run main JdpOffTest
  */
 
--- a/jdk/test/sun/management/jdp/JdpSpecificAddressTest.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/test/sun/management/jdp/JdpSpecificAddressTest.java	Mon Jun 02 13:53:52 2014 -0700
@@ -28,7 +28,7 @@
  * @test JdpSpecificAddressTest
  * @summary Assert that we can read JDP packets from a multicast socket connection, on specific IP and port.
  * @library /lib/testlibrary
- * @build ClientConnection JdpTestUtil JdpTestCase JdpOnTestCase DynamicLauncher
+ * @build jdk.testlibrary.* ClientConnection JdpTestUtil JdpTestCase JdpOnTestCase DynamicLauncher
  * @run main JdpSpecificAddressTest
  */
 
--- a/jdk/test/sun/management/jmxremote/bootstrap/LocalManagementTest.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/test/sun/management/jmxremote/bootstrap/LocalManagementTest.java	Mon Jun 02 13:53:52 2014 -0700
@@ -42,9 +42,7 @@
  *          without connection or username/password details.
  *          TestManager will attempt a connection to the address obtained from
  *          both agent properties and jvmstat buffer.
- * @build jdk.testlibrary.ProcessTools
- * @build jdk.testlibrary.Utils
- * @build TestManager TestApplication
+ * @build jdk.testlibrary.* TestManager TestApplication
  * @run main/othervm/timeout=300 -XX:+UsePerfData LocalManagementTest
  */
 
--- a/jdk/test/sun/management/jmxremote/bootstrap/PasswordFilePermissionTest.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/test/sun/management/jmxremote/bootstrap/PasswordFilePermissionTest.java	Mon Jun 02 13:53:52 2014 -0700
@@ -28,11 +28,7 @@
  * @library /lib/testlibrary
  * @bug 6557093
  * @summary Check SSL config file permission for out-of-the-box management
- * @build jdk.testlibrary.Utils
- * @build jdk.testlibrary.ProcessTools
- * @build jdk.testlibrary.OutputAnalyzer
- * @build AbstractFilePermissionTest
- * @build Dummy
+ * @build jdk.testlibrary.* AbstractFilePermissionTest Dummy
  * @run main/timeout=300 PasswordFilePermissionTest
  *
  * @author Taras Ledkov
--- a/jdk/test/sun/management/jmxremote/bootstrap/RmiBootstrapTest.sh	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/test/sun/management/jmxremote/bootstrap/RmiBootstrapTest.sh	Mon Jun 02 13:53:52 2014 -0700
@@ -27,11 +27,7 @@
 # @summary Test RMI Bootstrap
 #
 # @library /lib/testlibrary
-# @library /lib/testlibrary
-# @build jdk.testlibrary.Utils
-# @build TestLogger
-# @build Utils
-# @build RmiBootstrapTest
+# @build jdk.testlibrary.* TestLogger Utils RmiBootstrapTest
 # @run shell/timeout=300  RmiBootstrapTest.sh
 
 # Define the Java class test name
--- a/jdk/test/sun/management/jmxremote/bootstrap/RmiRegistrySslTest.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/test/sun/management/jmxremote/bootstrap/RmiRegistrySslTest.java	Mon Jun 02 13:53:52 2014 -0700
@@ -42,10 +42,7 @@
  * @library /lib/testlibrary
  * @bug 6228231
  * @summary Test that RMI registry uses SSL.
- * @build jdk.testlibrary.Utils
- * @build jdk.testlibrary.ProcessTools
- * @build jdk.testlibrary.OutputAnalyzer
- * @build RmiRegistrySslTestApp
+ * @build jdk.testlibrary.* RmiRegistrySslTestApp
  * @run main/timeout=300 RmiRegistrySslTest
  * @author Luis-Miguel Alventosa, Taras Ledkov
  */
--- a/jdk/test/sun/management/jmxremote/bootstrap/RmiSslBootstrapTest.sh	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/test/sun/management/jmxremote/bootstrap/RmiSslBootstrapTest.sh	Mon Jun 02 13:53:52 2014 -0700
@@ -27,10 +27,7 @@
 # @summary Test RMI Bootstrap with SSL
 #
 # @library /lib/testlibrary
-# @build jdk.testlibrary.Utils
-# @build TestLogger
-# @build Utils
-# @build RmiBootstrapTest
+# @build jdk.testlibrary.* TestLogger Utils RmiBootstrapTest
 # @run shell/timeout=300  RmiSslBootstrapTest.sh
 
 # Define the Java class test name
--- a/jdk/test/sun/management/jmxremote/bootstrap/SSLConfigFilePermissionTest.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/test/sun/management/jmxremote/bootstrap/SSLConfigFilePermissionTest.java	Mon Jun 02 13:53:52 2014 -0700
@@ -27,12 +27,7 @@
  * @test
  * @library /lib/testlibrary
  * @bug 6557093
- * @bug 6557093
- * @build jdk.testlibrary.Utils
- * @build jdk.testlibrary.ProcessTools
- * @build jdk.testlibrary.OutputAnalyzer
- * @build Dummy
- * @build AbstractFilePermissionTest
+ * @build jdk.testlibrary.* Dummy AbstractFilePermissionTest
  * @summary Check SSL config file permission for out-of-the-box management
  * @run main/timeout=300 SSLConfigFilePermissionTest
  *
--- a/jdk/test/sun/management/jmxremote/startstop/JMXStartStopTest.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/test/sun/management/jmxremote/startstop/JMXStartStopTest.java	Mon Jun 02 13:53:52 2014 -0700
@@ -54,10 +54,7 @@
  * @test
  * @bug 7110104
  * @library /lib/testlibrary
- * @build jdk.testlibrary.ProcessTools
- * @build jdk.testlibrary.JDKToolLauncher
- * @build jdk.testlibrary.Utils
- * @build JMXStartStopTest JMXStartStopDoSomething
+ * @build jdk.testlibrary.* JMXStartStopTest JMXStartStopDoSomething
  * @run main/othervm JMXStartStopTest
  * @summary Makes sure that enabling/disabling the management agent through
  *          JCMD achieves the desired results
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/nio/ch/ServerSocketAdaptorTest.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8024832
+ */
+
+import java.io.IOException;
+import java.net.ServerSocket;
+import java.net.SocketException;
+import java.nio.channels.ServerSocketChannel;
+
+public class ServerSocketAdaptorTest {
+
+    public static void main(String[] args) throws IOException {
+
+        String message = null;
+
+        try (ServerSocket s = new ServerSocket()) {
+            s.accept();
+            throw new AssertionError();
+        } catch (IOException e) {
+            message = e.getMessage();
+        }
+
+        try (ServerSocket ss = ServerSocketChannel.open().socket()) {
+
+            assert !ss.isBound() : "the assumption !ss.isBound() doesn't hold";
+
+            try {
+                ss.accept();
+                throw new AssertionError();
+            } catch (Exception e) {
+                if (e instanceof SocketException && message.equals(e.getMessage())) {
+                    return;
+                } else {
+                    throw new AssertionError(
+                            "Expected to throw SocketException with a particular message", e);
+                }
+            }
+        }
+    }
+}
--- a/jdk/test/sun/security/krb5/auto/KDC.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/test/sun/security/krb5/auto/KDC.java	Mon Jun 02 13:53:52 2014 -0700
@@ -141,6 +141,8 @@
     private BlockingQueue<Job> q = new ArrayBlockingQueue<>(100);
     // Options
     private Map<Option,Object> options = new HashMap<>();
+    // Realm-specific krb5.conf settings
+    private List<String> conf = new ArrayList<>();
 
     private Thread thread1, thread2, thread3;
     DatagramSocket u1 = null;
@@ -243,7 +245,7 @@
     /**
      * Sets an option
      * @param key the option name
-     * @param obj the value
+     * @param value the value
      */
     public void setOption(Option key, Object value) {
         if (value == null) {
@@ -373,6 +375,13 @@
     }
 
     /**
+     * Add realm-specific krb5.conf setting
+     */
+    public void addConf(String s) {
+        conf.add(s);
+    }
+
+    /**
      * Writes a krb5.conf for one or more KDC that includes KDC locations for
      * each realm and the default realm name. You can also add extra strings
      * into the file. The method should be called like:
@@ -397,6 +406,7 @@
      * [realms]
      *   REALM.NAME = {
      *     kdc = host:port_number
+     *     # realm-specific settings
      *   }
      * </pre>
      *
@@ -444,10 +454,10 @@
             }
         }
         sb.append("\n[realms]\n");
-        sb.append(realmLineForKDC(kdc));
+        sb.append(kdc.realmLine());
         for (Object o: more) {
             if (o instanceof KDC) {
-                sb.append(realmLineForKDC((KDC)o));
+                sb.append(((KDC)o).realmLine());
             }
         }
         FileOutputStream fos = new FileOutputStream(f);
@@ -1133,14 +1143,16 @@
 
     /**
      * Generates a line for a KDC to put inside [realms] of krb5.conf
-     * @param kdc the KDC
-     * @return REALM.NAME = { kdc = host:port }
+     * @return REALM.NAME = { kdc = host:port etc }
      */
-    private static String realmLineForKDC(KDC kdc) {
-        return String.format("%s = {\n    kdc = %s:%d\n}\n",
-                kdc.realm,
-                kdc.kdc,
-                kdc.port);
+    private String realmLine() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(realm).append(" = {\n    kdc = ")
+                .append(kdc).append(':').append(port).append('\n');
+        for (String s: conf) {
+            sb.append("    ").append(s).append('\n');
+        }
+        return sb.append("}\n").toString();
     }
 
     /**
--- a/jdk/test/sun/security/krb5/auto/ReplayCacheTestProc.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/test/sun/security/krb5/auto/ReplayCacheTestProc.java	Mon Jun 02 13:53:52 2014 -0700
@@ -40,7 +40,6 @@
 import java.security.MessageDigest;
 import java.util.*;
 
-import com.sun.security.auth.module.UnixSystem;
 import sun.security.jgss.GSSUtil;
 import sun.security.krb5.internal.APReq;
 import sun.security.krb5.internal.rcache.AuthTime;
@@ -79,13 +78,7 @@
                 mode = -1;
             }
 
-            try {
-                UnixSystem us = new com.sun.security.auth.module.UnixSystem();
-                uid = us.getUid();
-            } catch (Throwable e) {
-                // Cannot be only Exception, might be UnsatisfiedLinkError
-                uid = -1;
-            }
+            uid = sun.misc.VM.geteuid();
 
             KDC kdc = KDC.create(OneKDC.REALM, HOST, 0, true);
             for (int i=0; i<nu; i++) {
--- a/jdk/test/sun/security/krb5/auto/UdpTcp.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/test/sun/security/krb5/auto/UdpTcp.java	Mon Jun 02 13:53:52 2014 -0700
@@ -43,9 +43,15 @@
         OneKDC kdc = new OneKDC(null);
         kdc.writeJAASConf();
 
-        KDC.saveConfig(OneKDC.KRB5_CONF, kdc,
-                "udp_preference_limit = "
-                        + (args[0].equals("UDP") ? "1000" : "100"));
+        // Two styles of kdc_timeout setting. One global, one realm-specific.
+        if (args[0].equals("UDP")) {
+            KDC.saveConfig(OneKDC.KRB5_CONF, kdc,
+                    "kdc_timeout = 10s");
+        } else {
+            kdc.addConf("kdc_timeout = 10s");
+            KDC.saveConfig(OneKDC.KRB5_CONF, kdc,
+                    "udp_preference_limit = 1");
+        }
         Config.refresh();
 
         ByteArrayOutputStream bo = new ByteArrayOutputStream();
@@ -56,7 +62,7 @@
 
         for (String line: new String(bo.toByteArray()).split("\n")) {
             if (line.contains(">>> KDCCommunication")) {
-                if (!line.contains(args[0])) {
+                if (!line.contains(args[0]) || !line.contains("timeout=10000")) {
                     throw new Exception("No " + args[0] + " in: " + line);
                 }
             }
--- a/jdk/test/sun/security/pkcs11/PKCS11Test.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/test/sun/security/pkcs11/PKCS11Test.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -457,7 +457,7 @@
         osMap.put("SunOS-x86-32", new String[]{"/usr/lib/mps/"});
         osMap.put("SunOS-amd64-64", new String[]{"/usr/lib/mps/64/"});
         osMap.put("Linux-i386-32", new String[]{
-            "/usr/lib/i386-linux-gnu/", "/usr/lib/"});
+            "/usr/lib/i386-linux-gnu/", "/usr/lib32/", "/usr/lib/"});
         osMap.put("Linux-amd64-64", new String[]{
             "/usr/lib/x86_64-linux-gnu/", "/usr/lib/x86_64-linux-gnu/nss/",
             "/usr/lib64/"});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/security/tools/jarsigner/certpolicy.sh	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,80 @@
+#
+# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+# @test
+# @bug 8036709
+# @summary Java 7 jarsigner displays warning about cert policy tree
+#
+# @run shell certpolicy.sh
+#
+
+if [ "${TESTJAVA}" = "" ] ; then
+  JAVAC_CMD=`which javac`
+  TESTJAVA=`dirname $JAVAC_CMD`/..
+fi
+
+KT="$TESTJAVA/bin/keytool $TESTTOOLVMOPTS \
+        -keypass changeit -storepass changeit -keystore ks -keyalg rsa"
+JS="$TESTJAVA/bin/jarsigner $TESTTOOLVMOPTS -storepass changeit -keystore ks"
+JAR="$TESTJAVA/bin/jar $TESTTOOLVMOPTS"
+
+rm ks 2> /dev/null
+$KT -genkeypair -alias ca -dname CN=CA -ext bc
+$KT -genkeypair -alias int -dname CN=Int
+$KT -genkeypair -alias ee -dname CN=EE
+
+# CertificatePolicies [[PolicyId: [1.2.3]], [PolicyId: [1.2.4]]]
+# PolicyConstraints: [Require: 0; Inhibit: unspecified]
+$KT -certreq -alias int | \
+        $KT -gencert -rfc -alias ca \
+                -ext 2.5.29.32="30 0C 30 04 06 02 2A 03 30 04 06 02 2A 04" \
+                -ext "2.5.29.36=30 03 80 01 00" -ext bc | \
+        $KT -import -alias int
+
+# CertificatePolicies [[PolicyId: [1.2.3]]]
+$KT -certreq -alias ee | \
+        $KT -gencert -rfc -alias int \
+                -ext 2.5.29.32="30 06 30 04 06 02 2A 03" | \
+        $KT -import -alias ee
+
+$KT -export -alias ee -rfc > cc
+$KT -export -alias int -rfc >> cc
+$KT -export -alias ca -rfc >> cc
+
+$KT -delete -alias int
+
+ERR=''
+$JAR cvf a.jar cc
+
+# Make sure the certchain in the signed jar contains all 3 certs
+$JS -strict -certchain cc a.jar ee -debug || ERR="sign"
+$JS -strict -verify a.jar -debug || ERR="$ERR verify"
+
+if [ "$ERR" = "" ]; then
+    echo "Success"
+    exit 0
+else
+    echo "Failed: $ERR"
+    exit 1
+fi
+
--- a/jdk/test/sun/security/tools/keytool/autotest.sh	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/test/sun/security/tools/keytool/autotest.sh	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -72,6 +72,8 @@
   Linux )
     if [ $B32 = true ]; then
         LIBNAME=`find_one \
+            "/usr/lib32/libsoftokn3.so" \
+            "/usr/lib32/nss/libsoftokn3.so" \
             "/usr/lib/libsoftokn3.so" \
             "/usr/lib/i386-linux-gnu/nss/libsoftokn3.so" \
             "/usr/lib/nss/libsoftokn3.so"`
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/text/resources/Format/Bug8037343.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please 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 8037343
+ * @summary updating dateformat for es_DO
+ */
+
+import java.text.DateFormat;
+import java.util.Calendar;
+import java.util.Locale;
+
+public class Bug8037343
+{
+
+    public static void main(String[] arg)
+    {
+        final Locale esDO = new Locale("es", "DO");
+        final String expectedShort = "31/03/12";
+        final String expectedMedium = "31/03/2012";
+
+        int errors = 0;
+        DateFormat format;
+        String result;
+
+        Calendar cal = Calendar.getInstance(esDO);
+        cal.set(Calendar.DAY_OF_MONTH, 31);
+        cal.set(Calendar.MONTH, Calendar.MARCH);
+        cal.set(Calendar.YEAR, 2012);
+
+        format = DateFormat.getDateInstance(DateFormat.SHORT, esDO);
+        result = format.format(cal.getTime());
+        if (!expectedShort.equals(result)) {
+            System.out.println(String.format("Short Date format for es_DO is not as expected. Expected: [%s] Actual: [%s]", expectedShort, result));
+            errors++;
+        }
+
+        format = DateFormat.getDateInstance(DateFormat.MEDIUM, esDO);
+        result = format.format(cal.getTime());
+        if (!expectedMedium.equals(result)) {
+            System.out.println(String.format("Medium Date format for es_DO is not as expected. Expected: [%s] Actual: [%s]", expectedMedium, result));
+            errors++;
+        }
+
+        if (errors > 0) {
+            throw new RuntimeException();
+        }
+    }
+
+}
--- a/jdk/test/sun/text/resources/LocaleData	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/test/sun/text/resources/LocaleData	Mon Jun 02 13:53:52 2014 -0700
@@ -483,8 +483,8 @@
 FormatData/es_DO/TimePatterns/3=hh:mm a
 FormatData/es_DO/DatePatterns/0=EEEE d' de 'MMMM' de 'yyyy
 FormatData/es_DO/DatePatterns/1=d' de 'MMMM' de 'yyyy
-FormatData/es_DO/DatePatterns/2=MM/dd/yyyy
-FormatData/es_DO/DatePatterns/3=MM/dd/yy
+# FormatData/es_DO/DatePatterns/2=MM/dd/yyyy # Changed: see bug 8037343
+# FormatData/es_DO/DatePatterns/3=MM/dd/yy # Changed: see bug 8037343
 FormatData/es_DO/DateTimePatterns/0={1} {0}
 FormatData/es_DO/NumberElements/0=.
 FormatData/es_DO/NumberElements/1=,
@@ -7692,3 +7692,7 @@
 FormatData/es_EC/TimePatterns/1=H:mm:ss z
 FormatData/es_EC/TimePatterns/2=H:mm:ss
 FormatData/es_EC/TimePatterns/3=H:mm
+
+# bug 8037343
+FormatData/es_DO/DatePatterns/2=dd/MM/yyyy
+FormatData/es_DO/DatePatterns/3=dd/MM/yy
--- a/jdk/test/sun/text/resources/LocaleDataTest.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/test/sun/text/resources/LocaleDataTest.java	Mon Jun 02 13:53:52 2014 -0700
@@ -36,6 +36,7 @@
  *      6919624 6998391 7019267 7020960 7025837 7020583 7036905 7066203 7101495
  *      7003124 7085757 7028073 7171028 7189611 8000983 7195759 8004489 8006509
  *      7114053 7074882 7040556 8013836 8021121 6192407 6931564 8027695 8017142
+ *      8037343
  * @summary Verify locale data
  *
  */
--- a/jdk/test/sun/tools/jcmd/TestJcmdSanity.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/test/sun/tools/jcmd/TestJcmdSanity.java	Mon Jun 02 13:53:52 2014 -0700
@@ -41,7 +41,7 @@
  * @bug 7104647 7154822
  * @library /lib/testlibrary
  * @build jdk.testlibrary.*
- * @run main TestJcmdSanity
+ * @run main/othervm -XX:+UsePerfData TestJcmdSanity
  */
 public class TestJcmdSanity {
 
--- a/jdk/test/sun/tools/jstat/JStatInterval.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/test/sun/tools/jstat/JStatInterval.java	Mon Jun 02 13:53:52 2014 -0700
@@ -28,8 +28,7 @@
  * @summary Test checks case when target application finishes execution and jstat didn't complete work.
             jstat is started with interval = 100 (jstat -compiler 100) and monitored application finishes
             after 500ms. This shouldn't cause crash or hang in target application or in jstat.
- * @build jdk.testlibrary.ProcessTools jdk.testlibrary.JDKToolLauncher
- * @build JStatInterval
+ * @build jdk.testlibrary.* JStatInterval
  * @run main JStatInterval
  */
 
--- a/jdk/test/sun/tools/jstatd/TestJstatdDefaults.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/test/sun/tools/jstatd/TestJstatdDefaults.java	Mon Jun 02 13:53:52 2014 -0700
@@ -25,7 +25,7 @@
  * @test
  * @bug 4990825
  * @library /lib/testlibrary
- * @build JstatdTest JstatGCUtilParser
+ * @build jdk.testlibrary.* JstatdTest JstatGCUtilParser
  * @run main/timeout=60 TestJstatdDefaults
  */
 public class TestJstatdDefaults {
--- a/jdk/test/sun/tools/jstatd/TestJstatdExternalRegistry.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/test/sun/tools/jstatd/TestJstatdExternalRegistry.java	Mon Jun 02 13:53:52 2014 -0700
@@ -25,7 +25,7 @@
  * @test
  * @bug 4990825 7092186
  * @library /lib/testlibrary
- * @build JstatdTest JstatGCUtilParser
+ * @build jdk.testlibrary.* JstatdTest JstatGCUtilParser
  * @run main/timeout=60 TestJstatdExternalRegistry
  */
 public class TestJstatdExternalRegistry {
--- a/jdk/test/sun/tools/jstatd/TestJstatdPort.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/test/sun/tools/jstatd/TestJstatdPort.java	Mon Jun 02 13:53:52 2014 -0700
@@ -25,7 +25,7 @@
  * @test
  * @bug 4990825
  * @library /lib/testlibrary
- * @build JstatdTest JstatGCUtilParser
+ * @build jdk.testlibrary.* JstatdTest JstatGCUtilParser
  * @run main/timeout=60 TestJstatdPort
  */
 public class TestJstatdPort {
--- a/jdk/test/sun/tools/jstatd/TestJstatdPortAndServer.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/test/sun/tools/jstatd/TestJstatdPortAndServer.java	Mon Jun 02 13:53:52 2014 -0700
@@ -25,7 +25,7 @@
  * @test
  * @bug 4990825
  * @library /lib/testlibrary
- * @build JstatdTest JstatGCUtilParser
+ * @build jdk.testlibrary.* JstatdTest JstatGCUtilParser
  * @run main/timeout=60 TestJstatdPortAndServer
  */
 public class TestJstatdPortAndServer {
--- a/jdk/test/sun/tools/jstatd/TestJstatdServer.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/test/sun/tools/jstatd/TestJstatdServer.java	Mon Jun 02 13:53:52 2014 -0700
@@ -25,7 +25,7 @@
  * @test
  * @bug 4990825
  * @library /lib/testlibrary
- * @build JstatdTest JstatGCUtilParser
+ * @build jdk.testlibrary.* JstatdTest JstatGCUtilParser
  * @run main/timeout=60 TestJstatdServer
  */
 public class TestJstatdServer {
--- a/jdk/test/sun/tools/jstatd/TestJstatdUsage.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/jdk/test/sun/tools/jstatd/TestJstatdUsage.java	Mon Jun 02 13:53:52 2014 -0700
@@ -28,7 +28,7 @@
  * @test
  * @bug 4990825
  * @library /lib/testlibrary
- * @build jdk.testlibrary.JDKToolLauncher jdk.testlibrary.OutputAnalyzer
+ * @build jdk.testlibrary.*
  * @run main TestJstatdUsage
  */
 public class TestJstatdUsage {
--- a/langtools/.hgtags	Mon Jun 02 15:49:53 2014 -0400
+++ b/langtools/.hgtags	Mon Jun 02 13:53:52 2014 -0700
@@ -256,3 +256,5 @@
 f04fccfbd880c819affc3ef33e0083aab9556409 jdk9-b11
 72efbe612e494f98b9c3ede1b4a3d02304e1e9cc jdk9-b12
 2c8bb81b5d48161019218c7604fa88c67edc6105 jdk9-b13
+1df3f53b9d980b66739f05e14053381ffb0f38ee jdk9-b14
+8666a9611eb8ba711b001bf8d942282e3e2d8e3d jdk9-b15
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java	Mon Jun 02 13:53:52 2014 -0700
@@ -28,6 +28,8 @@
 import java.io.*;
 import java.text.SimpleDateFormat;
 import java.util.*;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 import com.sun.javadoc.*;
 import com.sun.tools.doclets.formats.html.markup.*;
@@ -139,42 +141,37 @@
         if (index < 0) {
             return htmlstr;
         }
-        String lowerHtml = StringUtils.toLowerCase(htmlstr);
-        final String docroot = "{@docroot}";
-        // Return index of first occurrence of {@docroot}
-        // Note: {@docRoot} is not case sensitive when passed in w/command line option
-        index = lowerHtml.indexOf(docroot, index);
-        if (index < 0) {
+        Matcher docrootMatcher = docrootPattern.matcher(htmlstr);
+        if (!docrootMatcher.find()) {
             return htmlstr;
         }
         StringBuilder buf = new StringBuilder();
-        int previndex = 0;
-        while (true) {
-            // Search for lowercase version of {@docRoot}
-            index = lowerHtml.indexOf(docroot, previndex);
-            // If next {@docRoot} tag not found, append rest of htmlstr and exit loop
-            if (index < 0) {
-                buf.append(htmlstr.substring(previndex));
-                break;
-            }
-            // If next {@docroot} tag found, append htmlstr up to start of tag
-            buf.append(htmlstr.substring(previndex, index));
-            previndex = index + docroot.length();
-            if (configuration.docrootparent.length() > 0 && htmlstr.startsWith("/..", previndex)) {
+        int prevEnd = 0;
+        do {
+            int match = docrootMatcher.start();
+            // append htmlstr up to start of next {@docroot}
+            buf.append(htmlstr.substring(prevEnd, match));
+            prevEnd = docrootMatcher.end();
+            if (configuration.docrootparent.length() > 0 && htmlstr.startsWith("/..", prevEnd)) {
                 // Insert the absolute link if {@docRoot} is followed by "/..".
                 buf.append(configuration.docrootparent);
-                previndex += 3;
+                prevEnd += 3;
             } else {
                 // Insert relative path where {@docRoot} was located
                 buf.append(pathToRoot.isEmpty() ? "." : pathToRoot.getPath());
             }
             // Append slash if next character is not a slash
-            if (previndex < htmlstr.length() && htmlstr.charAt(previndex) != '/') {
+            if (prevEnd < htmlstr.length() && htmlstr.charAt(prevEnd) != '/') {
                 buf.append('/');
             }
-        }
+        } while (docrootMatcher.find());
+        buf.append(htmlstr.substring(prevEnd));
         return buf.toString();
     }
+    //where:
+        // Note: {@docRoot} is not case sensitive when passed in w/command line option:
+        private static final Pattern docrootPattern =
+                Pattern.compile(Pattern.quote("{@docroot}"), Pattern.CASE_INSENSITIVE);
 
     /**
      * Get the script to show or hide the All classes link.
@@ -1690,13 +1687,13 @@
         }
 
         //Redirect all relative links.
-        int end, begin = StringUtils.toLowerCase(text).indexOf("<a");
+        int end, begin = StringUtils.indexOfIgnoreCase(text, "<a");
         if(begin >= 0){
             StringBuilder textBuff = new StringBuilder(text);
 
             while(begin >=0){
                 if (textBuff.length() > begin + 2 && ! Character.isWhitespace(textBuff.charAt(begin+2))) {
-                    begin = StringUtils.toLowerCase(textBuff.toString()).indexOf("<a", begin + 1);
+                    begin = StringUtils.indexOfIgnoreCase(textBuff.toString(), "<a", begin + 1);
                     continue;
                 }
 
@@ -1736,7 +1733,7 @@
                         + redirectPathFromRoot.resolve(relativeLink).getPath();
                     textBuff.replace(begin, end, relativeLink);
                 }
-                begin = StringUtils.toLowerCase(textBuff.toString()).indexOf("<a", begin + 1);
+                begin = StringUtils.indexOfIgnoreCase(textBuff.toString(), "<a", begin + 1);
             }
             return textBuff.toString();
         }
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -332,24 +332,6 @@
     }
 
     /**
-     * Parse the &lt;Code&gt; tag and return the text.
-     */
-    protected String parseCodeTag(String tag){
-        if(tag == null){
-            return "";
-        }
-
-        String lc = StringUtils.toLowerCase(tag);
-        int begin = lc.indexOf("<code>");
-        int end = lc.indexOf("</code>");
-        if(begin == -1 || end == -1 || end <= begin){
-            return tag;
-        } else {
-            return tag.substring(begin + 6, end);
-        }
-    }
-
-    /**
      * {@inheritDoc}
      */
     protected static void addImplementsInfo(HtmlDocletWriter writer,
--- a/langtools/src/share/classes/com/sun/tools/javac/api/JavacTrees.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/langtools/src/share/classes/com/sun/tools/javac/api/JavacTrees.java	Mon Jun 02 13:53:52 2014 -0700
@@ -394,7 +394,7 @@
                 paramTypes = lb.toList();
             }
 
-            ClassSymbol sym = (ClassSymbol) types.upperBound(tsym.type).tsym;
+            ClassSymbol sym = (ClassSymbol) types.cvarUpperBound(tsym.type).tsym;
 
             Symbol msym = (memberName == sym.name)
                     ? findConstructor(sym, paramTypes)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/ClassFinder.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,537 @@
+/*
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.tools.javac.code;
+
+import java.io.*;
+import java.util.EnumSet;
+import java.util.Set;
+import javax.lang.model.SourceVersion;
+import javax.tools.JavaFileObject;
+import javax.tools.JavaFileManager;
+import javax.tools.JavaFileManager.Location;
+import javax.tools.StandardJavaFileManager;
+
+import static javax.tools.StandardLocation.*;
+
+import com.sun.tools.javac.comp.Annotate;
+import com.sun.tools.javac.code.Symbol.*;
+import com.sun.tools.javac.jvm.ClassReader;
+import com.sun.tools.javac.util.*;
+
+import static com.sun.tools.javac.code.Flags.*;
+import static com.sun.tools.javac.code.Kinds.*;
+
+import static com.sun.tools.javac.main.Option.*;
+
+/**
+ *  This class provides operations to locate class definitions
+ *  from the source and class files on the paths provided to javac.
+ *
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
+ *  This code and its internal interfaces are subject to change or
+ *  deletion without notice.</b>
+ */
+public class ClassFinder {
+    /** The context key for the class finder. */
+    protected static final Context.Key<ClassFinder> classFinderKey = new Context.Key<>();
+
+    ClassReader reader;
+
+    Annotate annotate;
+
+    /** Switch: verbose output.
+     */
+    boolean verbose;
+
+    /**
+     * Switch: cache completion failures unless -XDdev is used
+     */
+    private boolean cacheCompletionFailure;
+
+    /**
+     * Switch: prefer source files instead of newer when both source
+     * and class are available
+     **/
+    protected boolean preferSource;
+
+    /**
+     * Switch: Search classpath and sourcepath for classes before the
+     * bootclasspath
+     */
+    protected boolean userPathsFirst;
+
+    /** The log to use for verbose output
+     */
+    final Log log;
+
+    /** The symbol table. */
+    Symtab syms;
+
+    /** The name table. */
+    final Names names;
+
+    /** Force a completion failure on this name
+     */
+    final Name completionFailureName;
+
+    /** Access to files
+     */
+    private final JavaFileManager fileManager;
+
+    /** Factory for diagnostics
+     */
+    JCDiagnostic.Factory diagFactory;
+
+    /** Can be reassigned from outside:
+     *  the completer to be used for ".java" files. If this remains unassigned
+     *  ".java" files will not be loaded.
+     */
+    public Completer sourceCompleter = null;
+
+    /** The path name of the class file currently being read.
+     */
+    protected JavaFileObject currentClassFile = null;
+
+    /** The class or method currently being read.
+     */
+    protected Symbol currentOwner = null;
+
+    /**
+     * Completer that delegates to the complete-method of this class.
+     */
+    private final Completer thisCompleter = new Completer() {
+        @Override
+        public void complete(Symbol sym) throws CompletionFailure {
+            ClassFinder.this.complete(sym);
+        }
+    };
+
+    public Completer getCompleter() {
+        return thisCompleter;
+    }
+
+    /** Get the ClassFinder instance for this invocation. */
+    public static ClassFinder instance(Context context) {
+        ClassFinder instance = context.get(classFinderKey);
+        if (instance == null)
+            instance = new ClassFinder(context);
+        return instance;
+    }
+
+    /** Construct a new class reader. */
+    protected ClassFinder(Context context) {
+        context.put(classFinderKey, this);
+        reader = ClassReader.instance(context);
+        names = Names.instance(context);
+        syms = Symtab.instance(context);
+        fileManager = context.get(JavaFileManager.class);
+        if (fileManager == null)
+            throw new AssertionError("FileManager initialization error");
+        diagFactory = JCDiagnostic.Factory.instance(context);
+
+        log = Log.instance(context);
+        annotate = Annotate.instance(context);
+
+        Options options = Options.instance(context);
+        verbose = options.isSet(VERBOSE);
+        cacheCompletionFailure = options.isUnset("dev");
+        preferSource = "source".equals(options.get("-Xprefer"));
+        userPathsFirst = options.isSet(XXUSERPATHSFIRST);
+
+
+        completionFailureName =
+            options.isSet("failcomplete")
+            ? names.fromString(options.get("failcomplete"))
+            : null;
+    }
+
+/************************************************************************
+ * Loading Classes
+ ***********************************************************************/
+
+    /** Completion for classes to be loaded. Before a class is loaded
+     *  we make sure its enclosing class (if any) is loaded.
+     */
+    private void complete(Symbol sym) throws CompletionFailure {
+        if (sym.kind == TYP) {
+            ClassSymbol c = (ClassSymbol)sym;
+            c.members_field = new Scope.ErrorScope(c); // make sure it's always defined
+            annotate.enterStart();
+            try {
+                completeOwners(c.owner);
+                completeEnclosing(c);
+            } finally {
+                // The flush needs to happen only after annotations
+                // are filled in.
+                annotate.enterDoneWithoutFlush();
+            }
+            fillIn(c);
+        } else if (sym.kind == PCK) {
+            PackageSymbol p = (PackageSymbol)sym;
+            try {
+                fillIn(p);
+            } catch (IOException ex) {
+                throw new CompletionFailure(sym, ex.getLocalizedMessage()).initCause(ex);
+            }
+        }
+        if (!reader.filling)
+            annotate.flush(); // finish attaching annotations
+    }
+
+    /** complete up through the enclosing package. */
+    private void completeOwners(Symbol o) {
+        if (o.kind != PCK) completeOwners(o.owner);
+        o.complete();
+    }
+
+    /**
+     * Tries to complete lexically enclosing classes if c looks like a
+     * nested class.  This is similar to completeOwners but handles
+     * the situation when a nested class is accessed directly as it is
+     * possible with the Tree API or javax.lang.model.*.
+     */
+    private void completeEnclosing(ClassSymbol c) {
+        if (c.owner.kind == PCK) {
+            Symbol owner = c.owner;
+            for (Name name : Convert.enclosingCandidates(Convert.shortName(c.name))) {
+                Symbol encl = owner.members().lookup(name).sym;
+                if (encl == null)
+                    encl = syms.classes.get(TypeSymbol.formFlatName(name, owner));
+                if (encl != null)
+                    encl.complete();
+            }
+        }
+    }
+
+    /** Fill in definition of class `c' from corresponding class or
+     *  source file.
+     */
+    private void fillIn(ClassSymbol c) {
+        if (completionFailureName == c.fullname) {
+            throw new CompletionFailure(c, "user-selected completion failure by class name");
+        }
+        currentOwner = c;
+        JavaFileObject classfile = c.classfile;
+        if (classfile != null) {
+            JavaFileObject previousClassFile = currentClassFile;
+            try {
+                if (reader.filling) {
+                    Assert.error("Filling " + classfile.toUri() + " during " + previousClassFile);
+                }
+                currentClassFile = classfile;
+                if (verbose) {
+                    log.printVerbose("loading", currentClassFile.toString());
+                }
+                if (classfile.getKind() == JavaFileObject.Kind.CLASS) {
+                    reader.readClassFile(c);
+                } else {
+                    if (sourceCompleter != null) {
+                        sourceCompleter.complete(c);
+                    } else {
+                        throw new IllegalStateException("Source completer required to read "
+                                                        + classfile.toUri());
+                    }
+                }
+                return;
+            } finally {
+                currentClassFile = previousClassFile;
+            }
+        } else {
+            JCDiagnostic diag =
+                diagFactory.fragment("class.file.not.found", c.flatname);
+            throw
+                newCompletionFailure(c, diag);
+        }
+    }
+    // where
+        /** Static factory for CompletionFailure objects.
+         *  In practice, only one can be used at a time, so we share one
+         *  to reduce the expense of allocating new exception objects.
+         */
+        private CompletionFailure newCompletionFailure(TypeSymbol c,
+                                                       JCDiagnostic diag) {
+            if (!cacheCompletionFailure) {
+                // log.warning("proc.messager",
+                //             Log.getLocalizedString("class.file.not.found", c.flatname));
+                // c.debug.printStackTrace();
+                return new CompletionFailure(c, diag);
+            } else {
+                CompletionFailure result = cachedCompletionFailure;
+                result.sym = c;
+                result.diag = diag;
+                return result;
+            }
+        }
+        private CompletionFailure cachedCompletionFailure =
+            new CompletionFailure(null, (JCDiagnostic) null);
+        {
+            cachedCompletionFailure.setStackTrace(new StackTraceElement[0]);
+        }
+
+
+    /** Load a toplevel class with given fully qualified name
+     *  The class is entered into `classes' only if load was successful.
+     */
+    public ClassSymbol loadClass(Name flatname) throws CompletionFailure {
+        boolean absent = syms.classes.get(flatname) == null;
+        ClassSymbol c = syms.enterClass(flatname);
+        if (c.members_field == null && c.completer != null) {
+            try {
+                c.complete();
+            } catch (CompletionFailure ex) {
+                if (absent) syms.classes.remove(flatname);
+                throw ex;
+            }
+        }
+        return c;
+    }
+
+/************************************************************************
+ * Loading Packages
+ ***********************************************************************/
+
+    /** Include class corresponding to given class file in package,
+     *  unless (1) we already have one the same kind (.class or .java), or
+     *         (2) we have one of the other kind, and the given class file
+     *             is older.
+     */
+    protected void includeClassFile(PackageSymbol p, JavaFileObject file) {
+        if ((p.flags_field & EXISTS) == 0)
+            for (Symbol q = p; q != null && q.kind == PCK; q = q.owner)
+                q.flags_field |= EXISTS;
+        JavaFileObject.Kind kind = file.getKind();
+        int seen;
+        if (kind == JavaFileObject.Kind.CLASS)
+            seen = CLASS_SEEN;
+        else
+            seen = SOURCE_SEEN;
+        String binaryName = fileManager.inferBinaryName(currentLoc, file);
+        int lastDot = binaryName.lastIndexOf(".");
+        Name classname = names.fromString(binaryName.substring(lastDot + 1));
+        boolean isPkgInfo = classname == names.package_info;
+        ClassSymbol c = isPkgInfo
+            ? p.package_info
+            : (ClassSymbol) p.members_field.lookup(classname).sym;
+        if (c == null) {
+            c = syms.enterClass(classname, p);
+            if (c.classfile == null) // only update the file if's it's newly created
+                c.classfile = file;
+            if (isPkgInfo) {
+                p.package_info = c;
+            } else {
+                if (c.owner == p)  // it might be an inner class
+                    p.members_field.enter(c);
+            }
+        } else if (!preferCurrent && c.classfile != null && (c.flags_field & seen) == 0) {
+            // if c.classfile == null, we are currently compiling this class
+            // and no further action is necessary.
+            // if (c.flags_field & seen) != 0, we have already encountered
+            // a file of the same kind; again no further action is necessary.
+            if ((c.flags_field & (CLASS_SEEN | SOURCE_SEEN)) != 0)
+                c.classfile = preferredFileObject(file, c.classfile);
+        }
+        c.flags_field |= seen;
+    }
+
+    /** Implement policy to choose to derive information from a source
+     *  file or a class file when both are present.  May be overridden
+     *  by subclasses.
+     */
+    protected JavaFileObject preferredFileObject(JavaFileObject a,
+                                           JavaFileObject b) {
+
+        if (preferSource)
+            return (a.getKind() == JavaFileObject.Kind.SOURCE) ? a : b;
+        else {
+            long adate = a.getLastModified();
+            long bdate = b.getLastModified();
+            // 6449326: policy for bad lastModifiedTime in ClassReader
+            //assert adate >= 0 && bdate >= 0;
+            return (adate > bdate) ? a : b;
+        }
+    }
+
+    /**
+     * specifies types of files to be read when filling in a package symbol
+     */
+    protected EnumSet<JavaFileObject.Kind> getPackageFileKinds() {
+        return EnumSet.of(JavaFileObject.Kind.CLASS, JavaFileObject.Kind.SOURCE);
+    }
+
+    /**
+     * this is used to support javadoc
+     */
+    protected void extraFileActions(PackageSymbol pack, JavaFileObject fe) {
+    }
+
+    protected Location currentLoc; // FIXME
+
+    private boolean verbosePath = true;
+
+    // Set to true when the currently selected file should be kept
+    private boolean preferCurrent;
+
+    /** Load directory of package into members scope.
+     */
+    private void fillIn(PackageSymbol p) throws IOException {
+        if (p.members_field == null)
+            p.members_field = new Scope(p);
+
+        preferCurrent = false;
+        if (userPathsFirst) {
+            scanUserPaths(p);
+            preferCurrent = true;
+            scanPlatformPath(p);
+        } else {
+            scanPlatformPath(p);
+            scanUserPaths(p);
+        }
+        verbosePath = false;
+    }
+
+    /**
+     * Scans class path and source path for files in given package.
+     */
+    private void scanUserPaths(PackageSymbol p) throws IOException {
+        Set<JavaFileObject.Kind> kinds = getPackageFileKinds();
+
+        Set<JavaFileObject.Kind> classKinds = EnumSet.copyOf(kinds);
+        classKinds.remove(JavaFileObject.Kind.SOURCE);
+        boolean wantClassFiles = !classKinds.isEmpty();
+
+        Set<JavaFileObject.Kind> sourceKinds = EnumSet.copyOf(kinds);
+        sourceKinds.remove(JavaFileObject.Kind.CLASS);
+        boolean wantSourceFiles = !sourceKinds.isEmpty();
+
+        boolean haveSourcePath = fileManager.hasLocation(SOURCE_PATH);
+
+        if (verbose && verbosePath) {
+            if (fileManager instanceof StandardJavaFileManager) {
+                StandardJavaFileManager fm = (StandardJavaFileManager)fileManager;
+                if (haveSourcePath && wantSourceFiles) {
+                    List<File> path = List.nil();
+                    for (File file : fm.getLocation(SOURCE_PATH)) {
+                        path = path.prepend(file);
+                    }
+                    log.printVerbose("sourcepath", path.reverse().toString());
+                } else if (wantSourceFiles) {
+                    List<File> path = List.nil();
+                    for (File file : fm.getLocation(CLASS_PATH)) {
+                        path = path.prepend(file);
+                    }
+                    log.printVerbose("sourcepath", path.reverse().toString());
+                }
+                if (wantClassFiles) {
+                    List<File> path = List.nil();
+                    for (File file : fm.getLocation(PLATFORM_CLASS_PATH)) {
+                        path = path.prepend(file);
+                    }
+                    for (File file : fm.getLocation(CLASS_PATH)) {
+                        path = path.prepend(file);
+                    }
+                    log.printVerbose("classpath",  path.reverse().toString());
+                }
+            }
+        }
+
+        String packageName = p.fullname.toString();
+        if (wantSourceFiles && !haveSourcePath) {
+            fillIn(p, CLASS_PATH,
+                   fileManager.list(CLASS_PATH,
+                                    packageName,
+                                    kinds,
+                                    false));
+        } else {
+            if (wantClassFiles)
+                fillIn(p, CLASS_PATH,
+                       fileManager.list(CLASS_PATH,
+                                        packageName,
+                                        classKinds,
+                                        false));
+            if (wantSourceFiles)
+                fillIn(p, SOURCE_PATH,
+                       fileManager.list(SOURCE_PATH,
+                                        packageName,
+                                        sourceKinds,
+                                        false));
+        }
+    }
+
+    /**
+     * Scans platform class path for files in given package.
+     */
+    private void scanPlatformPath(PackageSymbol p) throws IOException {
+        fillIn(p, PLATFORM_CLASS_PATH,
+               fileManager.list(PLATFORM_CLASS_PATH,
+                                p.fullname.toString(),
+                                EnumSet.of(JavaFileObject.Kind.CLASS),
+                                false));
+    }
+    // where
+        private void fillIn(PackageSymbol p,
+                            Location location,
+                            Iterable<JavaFileObject> files)
+        {
+            currentLoc = location;
+            for (JavaFileObject fo : files) {
+                switch (fo.getKind()) {
+                case CLASS:
+                case SOURCE: {
+                    // TODO pass binaryName to includeClassFile
+                    String binaryName = fileManager.inferBinaryName(currentLoc, fo);
+                    String simpleName = binaryName.substring(binaryName.lastIndexOf(".") + 1);
+                    if (SourceVersion.isIdentifier(simpleName) ||
+                        simpleName.equals("package-info"))
+                        includeClassFile(p, fo);
+                    break;
+                }
+                default:
+                    extraFileActions(p, fo);
+                }
+            }
+        }
+
+    /**
+     * Used for bad class definition files, such as bad .class files or
+     * for .java files with unexpected package or class names.
+     */
+    public static class BadClassFile extends CompletionFailure {
+        private static final long serialVersionUID = 0;
+
+        public BadClassFile(TypeSymbol sym, JavaFileObject file, JCDiagnostic diag,
+                JCDiagnostic.Factory diagFactory) {
+            super(sym, createBadClassFileDiagnostic(file, diag, diagFactory));
+        }
+        // where
+        private static JCDiagnostic createBadClassFileDiagnostic(
+                JavaFileObject file, JCDiagnostic diag, JCDiagnostic.Factory diagFactory) {
+            String key = (file.getKind() == JavaFileObject.Kind.SOURCE
+                        ? "bad.source.file.header" : "bad.class.file.header");
+            return diagFactory.fragment(key, file, diag);
+        }
+    }
+}
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Symtab.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Symtab.java	Mon Jun 02 13:53:52 2014 -0700
@@ -50,7 +50,6 @@
 import com.sun.tools.javac.code.Type.MethodType;
 import com.sun.tools.javac.code.Type.UnknownType;
 import com.sun.tools.javac.jvm.ByteCodes;
-import com.sun.tools.javac.jvm.ClassReader;
 import com.sun.tools.javac.jvm.Target;
 import com.sun.tools.javac.util.Assert;
 import com.sun.tools.javac.util.Context;
@@ -470,8 +469,8 @@
         Scope scope = new Scope(predefClass);
         predefClass.members_field = scope;
 
-        // Get the initial completer for Symbols from the ClassReader
-        initialCompleter = ClassReader.instance(context).getCompleter();
+        // Get the initial completer for Symbols from the ClassFinder
+        initialCompleter = ClassFinder.instance(context).getCompleter();
         rootPackage.completer = initialCompleter;
         unnamedPackage.completer = initialCompleter;
 
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Types.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Types.java	Mon Jun 02 13:53:52 2014 -0700
@@ -42,9 +42,8 @@
 import com.sun.tools.javac.comp.Check;
 import com.sun.tools.javac.comp.Enter;
 import com.sun.tools.javac.comp.Env;
-import com.sun.tools.javac.jvm.ClassReader;
-import com.sun.tools.javac.tree.JCTree;
 import com.sun.tools.javac.util.*;
+
 import static com.sun.tools.javac.code.BoundKind.*;
 import static com.sun.tools.javac.code.Flags.*;
 import static com.sun.tools.javac.code.Scope.*;
@@ -84,7 +83,6 @@
     final boolean allowBoxing;
     final boolean allowCovariantReturns;
     final boolean allowObjectToPrimitiveCast;
-    final ClassReader reader;
     final Check chk;
     final Enter enter;
     JCDiagnostic.Factory diags;
@@ -110,7 +108,6 @@
         allowBoxing = source.allowBoxing();
         allowCovariantReturns = source.allowCovariantReturns();
         allowObjectToPrimitiveCast = source.allowObjectToPrimitiveCast();
-        reader = ClassReader.instance(context);
         chk = Check.instance(context);
         enter = Enter.instance(context);
         capturedName = names.fromString("<captured wildcard>");
@@ -121,37 +118,34 @@
     }
     // </editor-fold>
 
-    // <editor-fold defaultstate="collapsed" desc="upperBound">
+    // <editor-fold defaultstate="collapsed" desc="bounds">
     /**
-     * The "rvalue conversion".<br>
-     * The upper bound of most types is the type
-     * itself.  Wildcards, on the other hand have upper
-     * and lower bounds.
-     * @param t a type
-     * @return the upper bound of the given type
+     * Get a wildcard's upper bound, returning non-wildcards unchanged.
+     * @param t a type argument, either a wildcard or a type
      */
-    public Type upperBound(Type t) {
-        return upperBound.visit(t);
+    public Type wildUpperBound(Type t) {
+        if (t.hasTag(WILDCARD)) {
+            WildcardType w = (WildcardType) t;
+            if (w.isSuperBound())
+                return w.bound == null ? syms.objectType : w.bound.bound;
+            else
+                return wildUpperBound(w.type);
+        }
+        else return t;
     }
-    // where
-        private final MapVisitor<Void> upperBound = new MapVisitor<Void>() {
-
-            @Override
-            public Type visitWildcardType(WildcardType t, Void ignored) {
-                if (t.isSuperBound())
-                    return t.bound == null ? syms.objectType : t.bound.bound;
-                else
-                    return visit(t.type);
-            }
-
-            @Override
-            public Type visitCapturedType(CapturedType t, Void ignored) {
-                return visit(t.bound);
-            }
-        };
-    // </editor-fold>
-
-    // <editor-fold defaultstate="collapsed" desc="wildLowerBound">
+
+    /**
+     * Get a capture variable's upper bound, returning other types unchanged.
+     * @param t a type
+     */
+    public Type cvarUpperBound(Type t) {
+        if (t.hasTag(TYPEVAR)) {
+            TypeVar v = (TypeVar) t;
+            return v.isCaptured() ? cvarUpperBound(v.bound) : v;
+        }
+        else return t;
+    }
+
     /**
      * Get a wildcard's lower bound, returning non-wildcards unchanged.
      * @param t a type argument, either a wildcard or a type
@@ -163,9 +157,7 @@
         }
         else return t;
     }
-    // </editor-fold>
-
-    // <editor-fold defaultstate="collapsed" desc="cvarLowerBound">
+
     /**
      * Get a capture variable's lower bound, returning other types unchanged.
      * @param t a type
@@ -897,7 +889,7 @@
                                              s.getAnnotationMirrors());
                         changed = true;
                     } else if (s != orig) {
-                        s = new WildcardType(upperBound(s),
+                        s = new WildcardType(wildUpperBound(s),
                                              BoundKind.EXTENDS,
                                              syms.boundClass,
                                              s.getAnnotationMirrors());
@@ -1107,7 +1099,7 @@
                         //check that u == t, where u has been set by Type.withTypeVar
                         return s.isSuperBound() &&
                                 !s.isExtendsBound() &&
-                                visit(t, upperBound(s));
+                                visit(t, wildUpperBound(s));
                     }
                 }
                 default:
@@ -1134,7 +1126,7 @@
                     return visit(s, t);
 
                 if (s.isSuperBound() && !s.isExtendsBound())
-                    return visit(t, upperBound(s)) && visit(t, wildLowerBound(s));
+                    return visit(t, wildUpperBound(s)) && visit(t, wildLowerBound(s));
 
                 if (t.isCompound() && s.isCompound()) {
                     if (!visit(supertype(t), supertype(s)))
@@ -1301,7 +1293,7 @@
                 switch(wt.kind) {
                     case UNBOUND: //similar to ? extends Object
                     case EXTENDS: {
-                        Type bound = upperBound(s);
+                        Type bound = wildUpperBound(s);
                         undetvar.addBound(InferenceBound.UPPER, bound, this);
                         break;
                     }
@@ -1362,28 +1354,6 @@
     // where
         private TypeRelation containsType = new TypeRelation() {
 
-            private Type U(Type t) {
-                while (t.hasTag(WILDCARD)) {
-                    WildcardType w = (WildcardType)t;
-                    if (w.isSuperBound())
-                        return w.bound == null ? syms.objectType : w.bound.bound;
-                    else
-                        t = w.type;
-                }
-                return t;
-            }
-
-            private Type L(Type t) {
-                while (t.hasTag(WILDCARD)) {
-                    WildcardType w = (WildcardType)t;
-                    if (w.isExtendsBound())
-                        return syms.botType;
-                    else
-                        t = w.type;
-                }
-                return t;
-            }
-
             public Boolean visitType(Type t, Type s) {
                 if (s.isPartial())
                     return containedBy(s, t);
@@ -1395,13 +1365,13 @@
 //                System.err.println();
 //                System.err.format(" does %s contain %s?%n", t, s);
 //                System.err.format(" %s U(%s) <: U(%s) %s = %s%n",
-//                                  upperBound(s), s, t, U(t),
+//                                  wildUpperBound(s), s, t, wildUpperBound(t),
 //                                  t.isSuperBound()
-//                                  || isSubtypeNoCapture(upperBound(s), U(t)));
+//                                  || isSubtypeNoCapture(wildUpperBound(s), wildUpperBound(t)));
 //                System.err.format(" %s L(%s) <: L(%s) %s = %s%n",
-//                                  L(t), t, s, wildLowerBound(s),
+//                                  wildLowerBound(t), t, s, wildLowerBound(s),
 //                                  t.isExtendsBound()
-//                                  || isSubtypeNoCapture(L(t), wildLowerBound(s)));
+//                                  || isSubtypeNoCapture(wildLowerBound(t), wildLowerBound(s)));
 //                System.err.println();
 //            }
 
@@ -1413,8 +1383,9 @@
 //                    debugContainsType(t, s);
                     return isSameWildcard(t, s)
                         || isCaptureOf(s, t)
-                        || ((t.isExtendsBound() || isSubtypeNoCapture(L(t), wildLowerBound(s))) &&
-                            (t.isSuperBound() || isSubtypeNoCapture(upperBound(s), U(t))));
+                        || ((t.isExtendsBound() || isSubtypeNoCapture(wildLowerBound(t), wildLowerBound(s))) &&
+                            // TODO: JDK-8039214, cvarUpperBound call here is incorrect
+                            (t.isSuperBound() || isSubtypeNoCapture(cvarUpperBound(wildUpperBound(s)), wildUpperBound(t))));
                 }
             }
 
@@ -1532,7 +1503,7 @@
 
             @Override
             public Boolean visitWildcardType(WildcardType t, Type s) {
-                return isCastable(upperBound(t), s, warnStack.head);
+                return isCastable(wildUpperBound(t), s, warnStack.head);
             }
 
             @Override
@@ -1773,12 +1744,12 @@
 
                 if (t.isExtendsBound()) {
                     if (s.isExtendsBound())
-                        return !isCastableRecursive(t.type, upperBound(s));
+                        return !isCastableRecursive(t.type, wildUpperBound(s));
                     else if (s.isSuperBound())
                         return notSoftSubtypeRecursive(wildLowerBound(s), t.type);
                 } else if (t.isSuperBound()) {
                     if (s.isExtendsBound())
-                        return notSoftSubtypeRecursive(t.type, upperBound(s));
+                        return notSoftSubtypeRecursive(t.type, wildUpperBound(s));
                 }
                 return false;
             }
@@ -1814,7 +1785,7 @@
                                noWarnings);
         }
         if (!s.hasTag(WILDCARD))
-            s = upperBound(s);
+            s = cvarUpperBound(s);
 
         return !isSubtype(t, relaxBound(s));
     }
@@ -1871,7 +1842,7 @@
     // <editor-fold defaultstate="collapsed" desc="Array Utils">
     public boolean isArray(Type t) {
         while (t.hasTag(WILDCARD))
-            t = upperBound(t);
+            t = wildUpperBound(t);
         return t.hasTag(ARRAY);
     }
 
@@ -1881,7 +1852,7 @@
     public Type elemtype(Type t) {
         switch (t.getTag()) {
         case WILDCARD:
-            return elemtype(upperBound(t));
+            return elemtype(wildUpperBound(t));
         case ARRAY:
             return ((ArrayType)t).elemtype;
         case FORALL:
@@ -2083,7 +2054,7 @@
 
             @Override
             public Type visitWildcardType(WildcardType t, Symbol sym) {
-                return memberType(upperBound(t), sym);
+                return memberType(wildUpperBound(t), sym);
             }
 
             @Override
@@ -2211,7 +2182,7 @@
             @Override
             public Type visitWildcardType(WildcardType t, Boolean recurse) {
                 final List<Attribute.TypeCompound> annos = t.getAnnotationMirrors();
-                Type erased = erasure(upperBound(t), recurse);
+                Type erased = erasure(wildUpperBound(t), recurse);
                 if (!annos.isEmpty()) {
                     erased = erased.annotatedType(annos);
                 }
@@ -2420,8 +2391,7 @@
                         if (t.hasErasedSupertypes()) {
                             t.interfaces_field = erasureRecursive(interfaces);
                         } else if (formals.nonEmpty()) {
-                            t.interfaces_field =
-                                upperBounds(subst(interfaces, formals, actuals));
+                            t.interfaces_field = subst(interfaces, formals, actuals);
                         }
                         else {
                             t.interfaces_field = interfaces;
@@ -2990,7 +2960,7 @@
                                          t.getAnnotationMirrors());
             } else {
                 Type st = subst(supertype(t));
-                List<Type> is = upperBounds(subst(interfaces(t)));
+                List<Type> is = subst(interfaces(t));
                 if (st == supertype(t) && is == interfaces(t))
                     return t;
                 else
@@ -3007,7 +2977,7 @@
                 return t;
             } else {
                 if (t.isExtendsBound() && bound.isExtendsBound())
-                    bound = upperBound(bound);
+                    bound = wildUpperBound(bound);
                 return new WildcardType(bound, t.kind, syms.boundClass,
                                         t.bound, t.getAnnotationMirrors());
             }
@@ -3461,8 +3431,8 @@
                     TypePair pair = new TypePair(c1, c2);
                     Type m;
                     if (mergeCache.add(pair)) {
-                        m = new WildcardType(lub(upperBound(act1.head),
-                                                 upperBound(act2.head)),
+                        m = new WildcardType(lub(wildUpperBound(act1.head),
+                                                 wildUpperBound(act2.head)),
                                              BoundKind.EXTENDS,
                                              syms.boundClass,
                                              Type.noAnnotations);
@@ -4044,16 +4014,6 @@
     // </editor-fold>
 
     // <editor-fold defaultstate="collapsed" desc="Internal utility methods">
-    private List<Type> upperBounds(List<Type> ss) {
-        if (ss.isEmpty()) return ss;
-        Type head = upperBound(ss.head);
-        List<Type> tail = upperBounds(ss.tail);
-        if (head != ss.head || tail != ss.tail)
-            return tail.prepend(head);
-        else
-            return ss;
-    }
-
     private boolean sideCast(Type from, Type to, Warner warn) {
         // We are casting from type $from$ to type $to$, which are
         // non-final unrelated types.  This method
@@ -4210,7 +4170,7 @@
         @Override
         public Void visitWildcardType(WildcardType source, Type target) throws AdaptFailure {
             if (source.isExtendsBound())
-                adaptRecursive(upperBound(source), upperBound(target));
+                adaptRecursive(wildUpperBound(source), wildUpperBound(target));
             else if (source.isSuperBound())
                 adaptRecursive(wildLowerBound(source), wildLowerBound(target));
             return null;
@@ -4227,7 +4187,7 @@
                     val = isSubtype(wildLowerBound(val), wildLowerBound(target))
                         ? target : val;
                 } else if (val.isExtendsBound() && target.isExtendsBound()) {
-                    val = isSubtype(upperBound(val), upperBound(target))
+                    val = isSubtype(wildUpperBound(val), wildUpperBound(target))
                         ? val : target;
                 } else if (!isSameType(val, target)) {
                     throw new AdaptFailure();
@@ -4338,7 +4298,7 @@
         }
 
         public Type visitType(Type t, Void s) {
-            return high ? upperBound(t) : t;
+            return t;
         }
 
         @Override
@@ -4736,7 +4696,7 @@
                 assembleClassSig(rawOuter
                         ? types.erasure(outer)
                         : outer);
-                append('.');
+                append(rawOuter ? '$' : '.');
                 Assert.check(c.flatname.startsWith(c.owner.enclClass().flatname));
                 append(rawOuter
                         ? c.flatname.subName(c.owner.enclClass().flatname.getByteLength() + 1, c.flatname.getByteLength())
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1176,7 +1176,7 @@
             //the Formal Parameter of a for-each loop is not in the scope when
             //attributing the for-each expression; we mimick this by attributing
             //the for-each expression first (against original scope).
-            Type exprType = types.upperBound(attribExpr(tree.expr, loopEnv));
+            Type exprType = types.cvarUpperBound(attribExpr(tree.expr, loopEnv));
             attribStat(tree.var, loopEnv);
             chk.checkNonVoid(tree.pos(), exprType);
             Type elemtype = types.elemtype(exprType); // perhaps expr is an array?
@@ -1193,7 +1193,7 @@
                     List<Type> iterableParams = base.allparams();
                     elemtype = iterableParams.isEmpty()
                         ? syms.objectType
-                        : types.upperBound(iterableParams.head);
+                        : types.wildUpperBound(iterableParams.head);
                 }
             }
             chk.checkType(tree.expr.pos(), elemtype, tree.var.sym.type);
@@ -4678,16 +4678,30 @@
         private void initTypeIfNeeded(JCTree that) {
             if (that.type == null) {
                 if (that.hasTag(METHODDEF)) {
-                    that.type = dummyMethodType();
+                    that.type = dummyMethodType((JCMethodDecl)that);
                 } else {
                     that.type = syms.unknownType;
                 }
             }
         }
 
+        /* Construct a dummy method type. If we have a method declaration,
+         * and the declared return type is void, then use that return type
+         * instead of UNKNOWN to avoid spurious error messages in lambda
+         * bodies (see:JDK-8041704).
+         */
+        private Type dummyMethodType(JCMethodDecl md) {
+            Type restype = syms.unknownType;
+            if (md != null && md.restype.hasTag(TYPEIDENT)) {
+                JCPrimitiveTypeTree prim = (JCPrimitiveTypeTree)md.restype;
+                if (prim.typetag == VOID)
+                    restype = syms.voidType;
+            }
+            return new MethodType(List.<Type>nil(), restype,
+                                  List.<Type>nil(), syms.methodClass);
+        }
         private Type dummyMethodType() {
-            return new MethodType(List.<Type>nil(), syms.unknownType,
-                            List.<Type>nil(), syms.methodClass);
+            return dummyMethodType(null);
         }
 
         @Override
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java	Mon Jun 02 13:53:52 2014 -0700
@@ -282,7 +282,7 @@
      */
     public Type completionError(DiagnosticPosition pos, CompletionFailure ex) {
         log.error(JCDiagnostic.DiagnosticFlag.NON_DEFERRABLE, pos, "cant.access", ex.sym, ex.getDetailValue());
-        if (ex instanceof ClassReader.BadClassFile
+        if (ex instanceof ClassFinder.BadClassFile
                 && !suppressAbortOnBadClassFile) throw new Abort();
         else return syms.errType;
     }
@@ -621,10 +621,10 @@
          if (a.isUnbound()) {
              return true;
          } else if (!a.hasTag(WILDCARD)) {
-             a = types.upperBound(a);
+             a = types.cvarUpperBound(a);
              return types.isSubtype(a, bound);
          } else if (a.isExtendsBound()) {
-             return types.isCastable(bound, types.upperBound(a), types.noWarnings);
+             return types.isCastable(bound, types.wildUpperBound(a), types.noWarnings);
          } else if (a.isSuperBound()) {
              return !types.notSoftSubtype(types.wildLowerBound(a), bound);
          }
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1221,25 +1221,102 @@
             }
 
             //slow path
+            Symbol sym = quicklyResolveMethod(env, tree);
+
+            if (sym == null) {
+                result = ArgumentExpressionKind.POLY;
+                return;
+            }
+
+            result = analyzeCandidateMethods(sym, ArgumentExpressionKind.PRIMITIVE,
+                    argumentKindAnalyzer);
+        }
+        //where
+            private boolean isSimpleReceiver(JCTree rec) {
+                switch (rec.getTag()) {
+                    case IDENT:
+                        return true;
+                    case SELECT:
+                        return isSimpleReceiver(((JCFieldAccess)rec).selected);
+                    case TYPEAPPLY:
+                    case TYPEARRAY:
+                        return true;
+                    case ANNOTATED_TYPE:
+                        return isSimpleReceiver(((JCAnnotatedType)rec).underlyingType);
+                    case APPLY:
+                        return true;
+                    default:
+                        return false;
+                }
+            }
+            private ArgumentExpressionKind reduce(ArgumentExpressionKind kind) {
+                return argumentKindAnalyzer.reduce(result, kind);
+            }
+            MethodAnalyzer<ArgumentExpressionKind> argumentKindAnalyzer =
+                    new MethodAnalyzer<ArgumentExpressionKind>() {
+                @Override
+                public ArgumentExpressionKind process(MethodSymbol ms) {
+                    return ArgumentExpressionKind.methodKind(ms, types);
+                }
+                @Override
+                public ArgumentExpressionKind reduce(ArgumentExpressionKind kind1,
+                                                     ArgumentExpressionKind kind2) {
+                    switch (kind1) {
+                        case PRIMITIVE: return kind2;
+                        case NO_POLY: return kind2.isPoly() ? kind2 : kind1;
+                        case POLY: return kind1;
+                        default:
+                            Assert.error();
+                            return null;
+                    }
+                }
+                @Override
+                public boolean shouldStop(ArgumentExpressionKind result) {
+                    return result.isPoly();
+                }
+            };
+
+        @Override
+        public void visitLiteral(JCLiteral tree) {
+            Type litType = attr.litType(tree.typetag);
+            result = ArgumentExpressionKind.standaloneKind(litType, types);
+        }
+
+        @Override
+        void skip(JCTree tree) {
+            result = ArgumentExpressionKind.NO_POLY;
+        }
+
+        private Symbol quicklyResolveMethod(Env<AttrContext> env, final JCMethodInvocation tree) {
             final JCExpression rec = tree.meth.hasTag(SELECT) ?
                     ((JCFieldAccess)tree.meth).selected :
                     null;
 
             if (rec != null && !isSimpleReceiver(rec)) {
-                //give up if receiver is too complex (to cut down analysis time)
-                result = ArgumentExpressionKind.POLY;
-                return;
+                return null;
             }
 
-            Type site = rec != null ?
-                    attribSpeculative(rec, env, attr.unknownTypeExprInfo).type :
-                    env.enclClass.sym.type;
+            Type site;
 
-            while (site.hasTag(TYPEVAR)) {
-                site = site.getUpperBound();
+            if (rec != null) {
+                if (rec.hasTag(APPLY)) {
+                    Symbol recSym = quicklyResolveMethod(env, (JCMethodInvocation) rec);
+                    if (recSym == null)
+                        return null;
+                    Symbol resolvedReturnType =
+                            analyzeCandidateMethods(recSym, syms.errSymbol, returnSymbolAnalyzer);
+                    if (resolvedReturnType == null)
+                        return null;
+                    site = resolvedReturnType.type;
+                } else {
+                    site = attribSpeculative(rec, env, attr.unknownTypeExprInfo).type;
+                }
+            } else {
+                site = env.enclClass.sym.type;
             }
 
             List<Type> args = rs.dummyArgs(tree.args.length());
+            Name name = TreeInfo.name(tree.meth);
 
             Resolve.LookupHelper lh = rs.new LookupHelper(name, site, args, List.<Type>nil(), MethodResolutionPhase.VARARITY) {
                 @Override
@@ -1254,61 +1331,60 @@
                 }
             };
 
-            Symbol sym = rs.lookupMethod(env, tree, site.tsym, rs.arityMethodCheck, lh);
+            return rs.lookupMethod(env, tree, site.tsym, rs.arityMethodCheck, lh);
+        }
+        //where:
+            MethodAnalyzer<Symbol> returnSymbolAnalyzer = new MethodAnalyzer<Symbol>() {
+                @Override
+                public Symbol process(MethodSymbol ms) {
+                    ArgumentExpressionKind kind = ArgumentExpressionKind.methodKind(ms, types);
+                    return kind != ArgumentExpressionKind.POLY ? ms.getReturnType().tsym : null;
+                }
+                @Override
+                public Symbol reduce(Symbol s1, Symbol s2) {
+                    return s1 == syms.errSymbol ? s2 : s1 == s2 ? s1 : null;
+                }
+                @Override
+                public boolean shouldStop(Symbol result) {
+                    return result == null;
+                }
+            };
 
-            if (sym.kind == Kinds.AMBIGUOUS) {
-                Resolve.AmbiguityError err = (Resolve.AmbiguityError)sym.baseSymbol();
-                result = ArgumentExpressionKind.PRIMITIVE;
-                for (Symbol s : err.ambiguousSyms) {
-                    if (result.isPoly()) break;
-                    if (s.kind == Kinds.MTH) {
-                        result = reduce(ArgumentExpressionKind.methodKind(s, types));
+        /**
+         * Process the result of Resolve.lookupMethod. If sym is a method symbol, the result of
+         * MethodAnalyzer.process is returned. If sym is an ambiguous symbol, all the candidate
+         * methods are inspected one by one, using MethodAnalyzer.process. The outcomes are
+         * reduced using MethodAnalyzer.reduce (using defaultValue as the first value over which
+         * the reduction runs). MethodAnalyzer.shouldStop can be used to stop the inspection early.
+         */
+        <E> E analyzeCandidateMethods(Symbol sym, E defaultValue, MethodAnalyzer<E> analyzer) {
+            switch (sym.kind) {
+                case Kinds.MTH:
+                    return analyzer.process((MethodSymbol) sym);
+                case Kinds.AMBIGUOUS:
+                    Resolve.AmbiguityError err = (Resolve.AmbiguityError)sym.baseSymbol();
+                    E res = defaultValue;
+                    for (Symbol s : err.ambiguousSyms) {
+                        if (s.kind == Kinds.MTH) {
+                            res = analyzer.reduce(res, analyzer.process((MethodSymbol) s));
+                            if (analyzer.shouldStop(res))
+                                return res;
+                        }
                     }
-                }
-            } else {
-                result = (sym.kind == Kinds.MTH) ?
-                    ArgumentExpressionKind.methodKind(sym, types) :
-                    ArgumentExpressionKind.NO_POLY;
+                    return res;
+                default:
+                    return defaultValue;
             }
         }
-        //where
-            private boolean isSimpleReceiver(JCTree rec) {
-                switch (rec.getTag()) {
-                    case IDENT:
-                        return true;
-                    case SELECT:
-                        return isSimpleReceiver(((JCFieldAccess)rec).selected);
-                    case TYPEAPPLY:
-                    case TYPEARRAY:
-                        return true;
-                    case ANNOTATED_TYPE:
-                        return isSimpleReceiver(((JCAnnotatedType)rec).underlyingType);
-                    default:
-                        return false;
-                }
-            }
-            private ArgumentExpressionKind reduce(ArgumentExpressionKind kind) {
-                switch (result) {
-                    case PRIMITIVE: return kind;
-                    case NO_POLY: return kind.isPoly() ? kind : result;
-                    case POLY: return result;
-                    default:
-                        Assert.error();
-                        return null;
-                }
-            }
+    }
 
-        @Override
-        public void visitLiteral(JCLiteral tree) {
-            Type litType = attr.litType(tree.typetag);
-            result = ArgumentExpressionKind.standaloneKind(litType, types);
-        }
+    /** Analyzer for methods - used by analyzeCandidateMethods. */
+    interface MethodAnalyzer<E> {
+        E process(MethodSymbol ms);
+        E reduce(E e1, E e2);
+        boolean shouldStop(E result);
+    }
 
-        @Override
-        void skip(JCTree tree) {
-            result = ArgumentExpressionKind.NO_POLY;
-        }
-    }
     //where
     private EnumSet<JCTree.Tag> deferredCheckerTags =
             EnumSet.of(LAMBDA, REFERENCE, PARENS, TYPECAST,
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Enter.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Enter.java	Mon Jun 02 13:53:52 2014 -0700
@@ -96,7 +96,6 @@
     Symtab syms;
     Check chk;
     TreeMaker make;
-    ClassReader reader;
     Annotate annotate;
     MemberEnter memberEnter;
     Types types;
@@ -118,7 +117,6 @@
         context.put(enterKey, this);
 
         log = Log.instance(context);
-        reader = ClassReader.instance(context);
         make = TreeMaker.instance(context);
         syms = Symtab.instance(context);
         chk = Check.instance(context);
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java	Mon Jun 02 13:53:52 2014 -0700
@@ -231,7 +231,8 @@
         }
     }
 
-    public List<Type> analyzeLambdaThrownTypes(Env<AttrContext> env, JCLambda that, TreeMaker make) {
+    public List<Type> analyzeLambdaThrownTypes(final Env<AttrContext> env,
+            JCLambda that, TreeMaker make) {
         //we need to disable diagnostics temporarily; the problem is that if
         //a lambda expression contains e.g. an unreachable statement, an error
         //message will be reported and will cause compilation to skip the flow analyis
@@ -239,7 +240,13 @@
         //related errors, which will allow for more errors to be detected
         Log.DiagnosticHandler diagHandler = new Log.DiscardDiagnosticHandler(log);
         try {
-            new AssignAnalyzer(log, syms, lint, names, enforceThisDotInit).analyzeTree(env);
+            new AssignAnalyzer(log, syms, lint, names, enforceThisDotInit) {
+                @Override
+                protected boolean trackable(VarSymbol sym) {
+                    return !env.info.scope.includes(sym) &&
+                           sym.owner.kind == MTH;
+                }
+            }.analyzeTree(env);
             LambdaFlowAnalyzer flowAnalyzer = new LambdaFlowAnalyzer();
             flowAnalyzer.analyzeTree(env, that, make);
             return flowAnalyzer.inferredThrownTypes;
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java	Mon Jun 02 13:53:52 2014 -0700
@@ -67,25 +67,24 @@
         return instance;
     }
 
-    private Names names;
-    private Log log;
-    private Symtab syms;
-    private Resolve rs;
-    private Check chk;
-    private Attr attr;
+    private final Names names;
+    private final Log log;
+    private final Symtab syms;
+    private final Resolve rs;
+    private final Check chk;
+    private final Attr attr;
     private TreeMaker make;
     private DiagnosticPosition make_pos;
-    private ClassWriter writer;
-    private ClassReader reader;
-    private ConstFold cfolder;
-    private Target target;
-    private Source source;
-    private boolean allowEnums;
+    private final ClassWriter writer;
+    private final ConstFold cfolder;
+    private final Target target;
+    private final Source source;
+    private final boolean allowEnums;
     private final Name dollarAssertionsDisabled;
     private final Name classDollar;
-    private Types types;
-    private boolean debugLower;
-    private PkgInfo pkginfoOpt;
+    private final Types types;
+    private final boolean debugLower;
+    private final PkgInfo pkginfoOpt;
 
     protected Lower(Context context) {
         context.put(lowerKey, this);
@@ -97,7 +96,6 @@
         attr = Attr.instance(context);
         make = TreeMaker.instance(context);
         writer = ClassWriter.instance(context);
-        reader = ClassReader.instance(context);
         cfolder = ConstFold.instance(context);
         target = Target.instance(context);
         source = Source.instance(context);
@@ -3524,7 +3522,7 @@
         private void visitIterableForeachLoop(JCEnhancedForLoop tree) {
             make_at(tree.expr.pos());
             Type iteratorTarget = syms.objectType;
-            Type iterableType = types.asSuper(types.upperBound(tree.expr.type),
+            Type iterableType = types.asSuper(types.cvarUpperBound(tree.expr.type),
                                               syms.iterableType.tsym);
             if (iterableType.getTypeArguments().nonEmpty())
                 iteratorTarget = types.erasure(iterableType.getTypeArguments().head);
@@ -3558,7 +3556,7 @@
                                        List.<Type>nil());
             JCExpression vardefinit = make.App(make.Select(make.Ident(itvar), next));
             if (tree.var.type.isPrimitive())
-                vardefinit = make.TypeCast(types.upperBound(iteratorTarget), vardefinit);
+                vardefinit = make.TypeCast(types.cvarUpperBound(iteratorTarget), vardefinit);
             else
                 vardefinit = make.TypeCast(tree.var.type, vardefinit);
             JCVariableDecl indexDef = (JCVariableDecl)make.VarDef(tree.var.mods,
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java	Mon Jun 02 13:53:52 2014 -0700
@@ -25,10 +25,7 @@
 
 package com.sun.tools.javac.comp;
 
-import java.util.HashMap;
 import java.util.HashSet;
-import java.util.LinkedHashMap;
-import java.util.Map;
 import java.util.Set;
 
 import javax.tools.JavaFileObject;
@@ -49,6 +46,7 @@
 import static com.sun.tools.javac.code.TypeTag.ERROR;
 import static com.sun.tools.javac.code.TypeTag.TYPEVAR;
 import static com.sun.tools.javac.tree.JCTree.Tag.*;
+
 import com.sun.tools.javac.util.JCDiagnostic.DiagnosticFlag;
 import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
 
@@ -75,7 +73,6 @@
     private final Attr attr;
     private final Symtab syms;
     private final TreeMaker make;
-    private final ClassReader reader;
     private final Todo todo;
     private final Annotate annotate;
     private final TypeAnnotations typeAnnotations;
@@ -102,7 +99,6 @@
         attr = Attr.instance(context);
         syms = Symtab.instance(context);
         make = TreeMaker.instance(context);
-        reader = ClassReader.instance(context);
         todo = Todo.instance(context);
         annotate = Annotate.instance(context);
         typeAnnotations = TypeAnnotations.instance(context);
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java	Mon Jun 02 13:53:52 2014 -0700
@@ -87,7 +87,7 @@
     DeferredAttr deferredAttr;
     Check chk;
     Infer infer;
-    ClassReader reader;
+    ClassFinder finder;
     TreeInfo treeinfo;
     Types types;
     JCDiagnostic.Factory diags;
@@ -121,7 +121,7 @@
         deferredAttr = DeferredAttr.instance(context);
         chk = Check.instance(context);
         infer = Infer.instance(context);
-        reader = ClassReader.instance(context);
+        finder = ClassFinder.instance(context);
         treeinfo = TreeInfo.instance(context);
         types = Types.instance(context);
         diags = JCDiagnostic.Factory.instance(context);
@@ -347,7 +347,7 @@
 
     boolean isAccessible(Env<AttrContext> env, Type t, boolean checkInner) {
         return (t.hasTag(ARRAY))
-            ? isAccessible(env, types.upperBound(types.elemtype(t)))
+            ? isAccessible(env, types.cvarUpperBound(types.elemtype(t)))
             : isAccessible(env, t.tsym, checkInner);
     }
 
@@ -1014,7 +1014,7 @@
          */
         private Type U(Type found) {
             return found == pt ?
-                    found : types.upperBound(found);
+                    found : types.cvarUpperBound(found);
         }
 
         @Override
@@ -1886,9 +1886,9 @@
      */
     Symbol loadClass(Env<AttrContext> env, Name name) {
         try {
-            ClassSymbol c = reader.loadClass(name);
+            ClassSymbol c = finder.loadClass(name);
             return isAccessible(env, c) ? c : new AccessError(c);
-        } catch (ClassReader.BadClassFile err) {
+        } catch (ClassFinder.BadClassFile err) {
             throw err;
         } catch (CompletionFailure ex) {
             return typeNotFound;
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassFile.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassFile.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -108,11 +108,21 @@
         V50(50, 0),   // JDK 1.6: stackmaps
         V51(51, 0),   // JDK 1.7
         V52(52, 0);   // JDK 1.8: lambda, type annos, param names
+        // JDK9 still marked as V52 // V53(53, 0);   // JDK 1.9
+
         Version(int major, int minor) {
             this.major = major;
             this.minor = minor;
         }
         public final int major, minor;
+
+        private static final Version MIN = values()[0];
+        /** Return the least version supported, MIN */
+        public static Version MIN() { return MIN; }
+
+        private static final Version MAX = values()[values().length-1];
+        /** Return the largest version supported, MAX */
+        public static Version MAX() { return MAX; }
     }
 
 
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java	Mon Jun 02 13:53:52 2014 -0700
@@ -35,13 +35,8 @@
 import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
-import javax.lang.model.SourceVersion;
 import javax.tools.JavaFileObject;
 import javax.tools.JavaFileManager;
-import javax.tools.JavaFileManager.Location;
-import javax.tools.StandardJavaFileManager;
-
-import static javax.tools.StandardLocation.*;
 
 import com.sun.tools.javac.comp.Annotate;
 import com.sun.tools.javac.code.*;
@@ -120,23 +115,6 @@
     public boolean saveParameterNames;
 
     /**
-     * Switch: cache completion failures unless -XDdev is used
-     */
-    private boolean cacheCompletionFailure;
-
-    /**
-     * Switch: prefer source files instead of newer when both source
-     * and class are available
-     **/
-    public boolean preferSource;
-
-    /**
-     * Switch: Search classpath and sourcepath for classes before the
-     * bootclasspath
-     */
-    public boolean userPathsFirst;
-
-    /**
      * The currently selected profile.
      */
     public final Profile profile;
@@ -153,10 +131,6 @@
     /** The name table. */
     final Names names;
 
-    /** Force a completion failure on this name
-     */
-    final Name completionFailureName;
-
     /** Access to files
      */
     private final JavaFileManager fileManager;
@@ -165,12 +139,6 @@
      */
     JCDiagnostic.Factory diagFactory;
 
-    /** Can be reassigned from outside:
-     *  the completer to be used for ".java" files. If this remains unassigned
-     *  ".java" files will not be loaded.
-     */
-    public SourceCompleter sourceCompleter = null;
-
     /** The current scope where type variables are entered.
      */
     protected Scope typevars;
@@ -227,20 +195,6 @@
      */
     Set<Name> warnedAttrs = new HashSet<>();
 
-    /**
-     * Completer that delegates to the complete-method of this class.
-     */
-    private final Completer thisCompleter = new Completer() {
-        @Override
-        public void complete(Symbol sym) throws CompletionFailure {
-            ClassReader.this.complete(sym);
-        }
-    };
-
-    public Completer getCompleter() {
-        return thisCompleter;
-    }
-
     /** Get the ClassReader instance for this invocation. */
     public static ClassReader instance(Context context) {
         ClassReader instance = context.get(classReaderKey);
@@ -274,17 +228,9 @@
         allowSimplifiedVarargs = source.allowSimplifiedVarargs();
 
         saveParameterNames = options.isSet("save-parameter-names");
-        cacheCompletionFailure = options.isUnset("dev");
-        preferSource = "source".equals(options.get("-Xprefer"));
-        userPathsFirst = options.isSet(XXUSERPATHSFIRST);
 
         profile = Profile.instance(context);
 
-        completionFailureName =
-            options.isSet("failcomplete")
-            ? names.fromString(options.get("failcomplete"))
-            : null;
-
         typevars = new Scope(syms.noSymbol);
 
         lintClassfile = Lint.instance(context).isEnabled(LintCategory.CLASSFILE);
@@ -305,26 +251,12 @@
  * Error Diagnoses
  ***********************************************************************/
 
-
-    public class BadClassFile extends CompletionFailure {
-        private static final long serialVersionUID = 0;
-
-        public BadClassFile(TypeSymbol sym, JavaFileObject file, JCDiagnostic diag) {
-            super(sym, createBadClassFileDiagnostic(file, diag));
-        }
-    }
-    // where
-    private JCDiagnostic createBadClassFileDiagnostic(JavaFileObject file, JCDiagnostic diag) {
-        String key = (file.getKind() == JavaFileObject.Kind.SOURCE
-                    ? "bad.source.file.header" : "bad.class.file.header");
-        return diagFactory.fragment(key, file, diag);
-    }
-
-    public BadClassFile badClassFile(String key, Object... args) {
-        return new BadClassFile (
+    public ClassFinder.BadClassFile badClassFile(String key, Object... args) {
+        return new ClassFinder.BadClassFile (
             currentOwner.enclClass(),
             currentClassFile,
-            diagFactory.fragment(key, args));
+            diagFactory.fragment(key, args),
+            diagFactory);
     }
 
 /************************************************************************
@@ -1501,7 +1433,7 @@
         int tag = nextByte(); // TargetType tag is a byte
 
         if (!TargetType.isValidTargetTypeValue(tag))
-            throw this.badClassFile("bad.type.annotation.value", String.format("0x%02X", tag));
+            throw badClassFile("bad.type.annotation.value", String.format("0x%02X", tag));
 
         TargetType type = TargetType.fromTargetTypeValue(tag);
 
@@ -2080,8 +2012,8 @@
         Type type = readType(nextChar());
         if (currentOwner.isInterface() &&
                 (flags & ABSTRACT) == 0 && !name.equals(names.clinit)) {
-            if (majorVersion > Target.JDK1_8.majorVersion ||
-                    (majorVersion == Target.JDK1_8.majorVersion && minorVersion >= Target.JDK1_8.minorVersion)) {
+            if (majorVersion > Version.V52.major ||
+                    (majorVersion == Version.V52.major && minorVersion >= Version.V52.minor)) {
                 if ((flags & STATIC) == 0) {
                     currentOwner.flags_field |= DEFAULT;
                     flags |= DEFAULT | ABSTRACT;
@@ -2353,20 +2285,20 @@
         }
     }
 
-    /** Read a class file.
+    /** Read a class definition from the bytes in buf.
      */
-    private void readClassFile(ClassSymbol c) throws IOException {
+    private void readClassBuffer(ClassSymbol c) throws IOException {
         int magic = nextInt();
         if (magic != JAVA_MAGIC)
             throw badClassFile("illegal.start.of.class.file");
 
         minorVersion = nextChar();
         majorVersion = nextChar();
-        int maxMajor = Target.MAX().majorVersion;
-        int maxMinor = Target.MAX().minorVersion;
+        int maxMajor = Version.MAX().major;
+        int maxMinor = Version.MAX().minor;
         if (majorVersion > maxMajor ||
             majorVersion * 1000 + minorVersion <
-            Target.MIN().majorVersion * 1000 + Target.MIN().minorVersion)
+            Version.MIN().major * 1000 + Version.MIN().minor)
         {
             if (majorVersion == (maxMajor + 1))
                 log.warning("big.major.version",
@@ -2395,162 +2327,39 @@
         readClass(c);
     }
 
-/************************************************************************
- * Adjusting flags
- ***********************************************************************/
-
-    long adjustFieldFlags(long flags) {
-        return flags;
-    }
-    long adjustMethodFlags(long flags) {
-        if ((flags & ACC_BRIDGE) != 0) {
-            flags &= ~ACC_BRIDGE;
-            flags |= BRIDGE;
-            if (!allowGenerics)
-                flags &= ~SYNTHETIC;
-        }
-        if ((flags & ACC_VARARGS) != 0) {
-            flags &= ~ACC_VARARGS;
-            flags |= VARARGS;
-        }
-        return flags;
-    }
-    long adjustClassFlags(long flags) {
-        return flags & ~ACC_SUPER; // SUPER and SYNCHRONIZED bits overloaded
-    }
-
-/************************************************************************
- * Loading Classes
- ***********************************************************************/
-
-    /** Completion for classes to be loaded. Before a class is loaded
-     *  we make sure its enclosing class (if any) is loaded.
-     */
-    private void complete(Symbol sym) throws CompletionFailure {
-        if (sym.kind == TYP) {
-            ClassSymbol c = (ClassSymbol)sym;
-            c.members_field = new Scope.ErrorScope(c); // make sure it's always defined
-            annotate.enterStart();
-            try {
-                completeOwners(c.owner);
-                completeEnclosing(c);
-            } finally {
-                // The flush needs to happen only after annotations
-                // are filled in.
-                annotate.enterDoneWithoutFlush();
-            }
-            fillIn(c);
-        } else if (sym.kind == PCK) {
-            PackageSymbol p = (PackageSymbol)sym;
-            try {
-                fillIn(p);
-            } catch (IOException ex) {
-                throw new CompletionFailure(sym, ex.getLocalizedMessage()).initCause(ex);
+    public void readClassFile(ClassSymbol c) {
+        currentOwner = c;
+        currentClassFile = c.classfile;
+        warnedAttrs.clear();
+        filling = true;
+        try {
+            bp = 0;
+            buf = readInputStream(buf, c.classfile.openInputStream());
+            readClassBuffer(c);
+            if (!missingTypeVariables.isEmpty() && !foundTypeVariables.isEmpty()) {
+                List<Type> missing = missingTypeVariables;
+                List<Type> found = foundTypeVariables;
+                missingTypeVariables = List.nil();
+                foundTypeVariables = List.nil();
+                filling = false;
+                ClassType ct = (ClassType)currentOwner.type;
+                ct.supertype_field =
+                    types.subst(ct.supertype_field, missing, found);
+                ct.interfaces_field =
+                    types.subst(ct.interfaces_field, missing, found);
+            } else if (missingTypeVariables.isEmpty() !=
+                       foundTypeVariables.isEmpty()) {
+                Name name = missingTypeVariables.head.tsym.name;
+                throw badClassFile("undecl.type.var", name);
             }
-        }
-        if (!filling)
-            annotate.flush(); // finish attaching annotations
-    }
-
-    /** complete up through the enclosing package. */
-    private void completeOwners(Symbol o) {
-        if (o.kind != PCK) completeOwners(o.owner);
-        o.complete();
-    }
-
-    /**
-     * Tries to complete lexically enclosing classes if c looks like a
-     * nested class.  This is similar to completeOwners but handles
-     * the situation when a nested class is accessed directly as it is
-     * possible with the Tree API or javax.lang.model.*.
-     */
-    private void completeEnclosing(ClassSymbol c) {
-        if (c.owner.kind == PCK) {
-            Symbol owner = c.owner;
-            for (Name name : Convert.enclosingCandidates(Convert.shortName(c.name))) {
-                Symbol encl = owner.members().lookup(name).sym;
-                if (encl == null)
-                    encl = syms.classes.get(TypeSymbol.formFlatName(name, owner));
-                if (encl != null)
-                    encl.complete();
-            }
-        }
-    }
-
-    /** We can only read a single class file at a time; this
-     *  flag keeps track of when we are currently reading a class
-     *  file.
-     */
-    private boolean filling = false;
-
-    /** Fill in definition of class `c' from corresponding class or
-     *  source file.
-     */
-    private void fillIn(ClassSymbol c) {
-        if (completionFailureName == c.fullname) {
-            throw new CompletionFailure(c, "user-selected completion failure by class name");
-        }
-        currentOwner = c;
-        warnedAttrs.clear();
-        JavaFileObject classfile = c.classfile;
-        if (classfile != null) {
-            JavaFileObject previousClassFile = currentClassFile;
-            try {
-                if (filling) {
-                    Assert.error("Filling " + classfile.toUri() + " during " + previousClassFile);
-                }
-                currentClassFile = classfile;
-                if (verbose) {
-                    log.printVerbose("loading", currentClassFile.toString());
-                }
-                if (classfile.getKind() == JavaFileObject.Kind.CLASS) {
-                    filling = true;
-                    try {
-                        bp = 0;
-                        buf = readInputStream(buf, classfile.openInputStream());
-                        readClassFile(c);
-                        if (!missingTypeVariables.isEmpty() && !foundTypeVariables.isEmpty()) {
-                            List<Type> missing = missingTypeVariables;
-                            List<Type> found = foundTypeVariables;
-                            missingTypeVariables = List.nil();
-                            foundTypeVariables = List.nil();
-                            filling = false;
-                            ClassType ct = (ClassType)currentOwner.type;
-                            ct.supertype_field =
-                                types.subst(ct.supertype_field, missing, found);
-                            ct.interfaces_field =
-                                types.subst(ct.interfaces_field, missing, found);
-                        } else if (missingTypeVariables.isEmpty() !=
-                                   foundTypeVariables.isEmpty()) {
-                            Name name = missingTypeVariables.head.tsym.name;
-                            throw badClassFile("undecl.type.var", name);
-                        }
-                    } finally {
-                        missingTypeVariables = List.nil();
-                        foundTypeVariables = List.nil();
-                        filling = false;
-                    }
-                } else {
-                    if (sourceCompleter != null) {
-                        sourceCompleter.complete(c);
-                    } else {
-                        throw new IllegalStateException("Source completer required to read "
-                                                        + classfile.toUri());
-                    }
-                }
-                return;
-            } catch (IOException ex) {
-                throw badClassFile("unable.to.access.file", ex.getMessage());
-            } catch (ArrayIndexOutOfBoundsException ex) {
-                throw badClassFile("bad.class.file", c.flatname);
-            } finally {
-                currentClassFile = previousClassFile;
-            }
-        } else {
-            JCDiagnostic diag =
-                diagFactory.fragment("class.file.not.found", c.flatname);
-            throw
-                newCompletionFailure(c, diag);
+        } catch (IOException ex) {
+            throw badClassFile("unable.to.access.file", ex.getMessage());
+        } catch (ArrayIndexOutOfBoundsException ex) {
+            throw badClassFile("bad.class.file", c.flatname);
+        } finally {
+            missingTypeVariables = List.nil();
+            foundTypeVariables = List.nil();
+            filling = false;
         }
     }
     // where
@@ -2590,253 +2399,39 @@
             }
             return buf;
         }
-        /** Static factory for CompletionFailure objects.
-         *  In practice, only one can be used at a time, so we share one
-         *  to reduce the expense of allocating new exception objects.
-         */
-        private CompletionFailure newCompletionFailure(TypeSymbol c,
-                                                       JCDiagnostic diag) {
-            if (!cacheCompletionFailure) {
-                // log.warning("proc.messager",
-                //             Log.getLocalizedString("class.file.not.found", c.flatname));
-                // c.debug.printStackTrace();
-                return new CompletionFailure(c, diag);
-            } else {
-                CompletionFailure result = cachedCompletionFailure;
-                result.sym = c;
-                result.diag = diag;
-                return result;
-            }
-        }
-        private CompletionFailure cachedCompletionFailure =
-            new CompletionFailure(null, (JCDiagnostic) null);
-        {
-            cachedCompletionFailure.setStackTrace(new StackTraceElement[0]);
-        }
 
-
-    /** Load a toplevel class with given fully qualified name
-     *  The class is entered into `classes' only if load was successful.
+    /** We can only read a single class file at a time; this
+     *  flag keeps track of when we are currently reading a class
+     *  file.
      */
-    public ClassSymbol loadClass(Name flatname) throws CompletionFailure {
-        boolean absent = syms.classes.get(flatname) == null;
-        ClassSymbol c = syms.enterClass(flatname);
-        if (c.members_field == null && c.completer != null) {
-            try {
-                c.complete();
-            } catch (CompletionFailure ex) {
-                if (absent) syms.classes.remove(flatname);
-                throw ex;
-            }
-        }
-        return c;
-    }
+    public boolean filling = false;
 
 /************************************************************************
- * Loading Packages
+ * Adjusting flags
  ***********************************************************************/
 
-    /** Include class corresponding to given class file in package,
-     *  unless (1) we already have one the same kind (.class or .java), or
-     *         (2) we have one of the other kind, and the given class file
-     *             is older.
-     */
-    protected void includeClassFile(PackageSymbol p, JavaFileObject file) {
-        if ((p.flags_field & EXISTS) == 0)
-            for (Symbol q = p; q != null && q.kind == PCK; q = q.owner)
-                q.flags_field |= EXISTS;
-        JavaFileObject.Kind kind = file.getKind();
-        int seen;
-        if (kind == JavaFileObject.Kind.CLASS)
-            seen = CLASS_SEEN;
-        else
-            seen = SOURCE_SEEN;
-        String binaryName = fileManager.inferBinaryName(currentLoc, file);
-        int lastDot = binaryName.lastIndexOf(".");
-        Name classname = names.fromString(binaryName.substring(lastDot + 1));
-        boolean isPkgInfo = classname == names.package_info;
-        ClassSymbol c = isPkgInfo
-            ? p.package_info
-            : (ClassSymbol) p.members_field.lookup(classname).sym;
-        if (c == null) {
-            c = syms.enterClass(classname, p);
-            if (c.classfile == null) // only update the file if's it's newly created
-                c.classfile = file;
-            if (isPkgInfo) {
-                p.package_info = c;
-            } else {
-                if (c.owner == p)  // it might be an inner class
-                    p.members_field.enter(c);
-            }
-        } else if (!preferCurrent && c.classfile != null && (c.flags_field & seen) == 0) {
-            // if c.classfile == null, we are currently compiling this class
-            // and no further action is necessary.
-            // if (c.flags_field & seen) != 0, we have already encountered
-            // a file of the same kind; again no further action is necessary.
-            if ((c.flags_field & (CLASS_SEEN | SOURCE_SEEN)) != 0)
-                c.classfile = preferredFileObject(file, c.classfile);
-        }
-        c.flags_field |= seen;
-    }
-
-    /** Implement policy to choose to derive information from a source
-     *  file or a class file when both are present.  May be overridden
-     *  by subclasses.
-     */
-    protected JavaFileObject preferredFileObject(JavaFileObject a,
-                                           JavaFileObject b) {
-
-        if (preferSource)
-            return (a.getKind() == JavaFileObject.Kind.SOURCE) ? a : b;
-        else {
-            long adate = a.getLastModified();
-            long bdate = b.getLastModified();
-            // 6449326: policy for bad lastModifiedTime in ClassReader
-            //assert adate >= 0 && bdate >= 0;
-            return (adate > bdate) ? a : b;
-        }
-    }
-
-    /**
-     * specifies types of files to be read when filling in a package symbol
-     */
-    protected EnumSet<JavaFileObject.Kind> getPackageFileKinds() {
-        return EnumSet.of(JavaFileObject.Kind.CLASS, JavaFileObject.Kind.SOURCE);
-    }
-
-    /**
-     * this is used to support javadoc
-     */
-    protected void extraFileActions(PackageSymbol pack, JavaFileObject fe) {
+    long adjustFieldFlags(long flags) {
+        return flags;
     }
 
-    protected Location currentLoc; // FIXME
-
-    private boolean verbosePath = true;
-
-    // Set to true when the currently selected file should be kept
-    private boolean preferCurrent;
-
-    /** Load directory of package into members scope.
-     */
-    private void fillIn(PackageSymbol p) throws IOException {
-        if (p.members_field == null)
-            p.members_field = new Scope(p);
-
-        preferCurrent = false;
-        if (userPathsFirst) {
-            scanUserPaths(p);
-            preferCurrent = true;
-            scanPlatformPath(p);
-        } else {
-            scanPlatformPath(p);
-            scanUserPaths(p);
+    long adjustMethodFlags(long flags) {
+        if ((flags & ACC_BRIDGE) != 0) {
+            flags &= ~ACC_BRIDGE;
+            flags |= BRIDGE;
+            if (!allowGenerics)
+                flags &= ~SYNTHETIC;
         }
-        verbosePath = false;
+        if ((flags & ACC_VARARGS) != 0) {
+            flags &= ~ACC_VARARGS;
+            flags |= VARARGS;
+        }
+        return flags;
     }
 
-    /**
-     * Scans class path and source path for files in given package.
-     */
-    private void scanUserPaths(PackageSymbol p) throws IOException {
-        Set<JavaFileObject.Kind> kinds = getPackageFileKinds();
-
-        Set<JavaFileObject.Kind> classKinds = EnumSet.copyOf(kinds);
-        classKinds.remove(JavaFileObject.Kind.SOURCE);
-        boolean wantClassFiles = !classKinds.isEmpty();
-
-        Set<JavaFileObject.Kind> sourceKinds = EnumSet.copyOf(kinds);
-        sourceKinds.remove(JavaFileObject.Kind.CLASS);
-        boolean wantSourceFiles = !sourceKinds.isEmpty();
-
-        boolean haveSourcePath = fileManager.hasLocation(SOURCE_PATH);
-
-        if (verbose && verbosePath) {
-            if (fileManager instanceof StandardJavaFileManager) {
-                StandardJavaFileManager fm = (StandardJavaFileManager)fileManager;
-                if (haveSourcePath && wantSourceFiles) {
-                    List<File> path = List.nil();
-                    for (File file : fm.getLocation(SOURCE_PATH)) {
-                        path = path.prepend(file);
-                    }
-                    log.printVerbose("sourcepath", path.reverse().toString());
-                } else if (wantSourceFiles) {
-                    List<File> path = List.nil();
-                    for (File file : fm.getLocation(CLASS_PATH)) {
-                        path = path.prepend(file);
-                    }
-                    log.printVerbose("sourcepath", path.reverse().toString());
-                }
-                if (wantClassFiles) {
-                    List<File> path = List.nil();
-                    for (File file : fm.getLocation(PLATFORM_CLASS_PATH)) {
-                        path = path.prepend(file);
-                    }
-                    for (File file : fm.getLocation(CLASS_PATH)) {
-                        path = path.prepend(file);
-                    }
-                    log.printVerbose("classpath",  path.reverse().toString());
-                }
-            }
-        }
-
-        String packageName = p.fullname.toString();
-        if (wantSourceFiles && !haveSourcePath) {
-            fillIn(p, CLASS_PATH,
-                   fileManager.list(CLASS_PATH,
-                                    packageName,
-                                    kinds,
-                                    false));
-        } else {
-            if (wantClassFiles)
-                fillIn(p, CLASS_PATH,
-                       fileManager.list(CLASS_PATH,
-                                        packageName,
-                                        classKinds,
-                                        false));
-            if (wantSourceFiles)
-                fillIn(p, SOURCE_PATH,
-                       fileManager.list(SOURCE_PATH,
-                                        packageName,
-                                        sourceKinds,
-                                        false));
-        }
+    long adjustClassFlags(long flags) {
+        return flags & ~ACC_SUPER; // SUPER and SYNCHRONIZED bits overloaded
     }
 
-    /**
-     * Scans platform class path for files in given package.
-     */
-    private void scanPlatformPath(PackageSymbol p) throws IOException {
-        fillIn(p, PLATFORM_CLASS_PATH,
-               fileManager.list(PLATFORM_CLASS_PATH,
-                                p.fullname.toString(),
-                                EnumSet.of(JavaFileObject.Kind.CLASS),
-                                false));
-    }
-    // where
-        private void fillIn(PackageSymbol p,
-                            Location location,
-                            Iterable<JavaFileObject> files)
-        {
-            currentLoc = location;
-            for (JavaFileObject fo : files) {
-                switch (fo.getKind()) {
-                case CLASS:
-                case SOURCE: {
-                    // TODO pass binaryName to includeClassFile
-                    String binaryName = fileManager.inferBinaryName(currentLoc, fo);
-                    String simpleName = binaryName.substring(binaryName.lastIndexOf(".") + 1);
-                    if (SourceVersion.isIdentifier(simpleName) ||
-                        simpleName.equals("package-info"))
-                        includeClassFile(p, fo);
-                    break;
-                }
-                default:
-                    extraFileActions(p, fo);
-                }
-            }
-        }
-
     /** Output for "-checkclassfile" option.
      *  @param key The key to look up the correct internationalized string.
      *  @param arg An argument for substitution into the output string.
@@ -2845,12 +2440,6 @@
         log.printLines(key, arg);
     }
 
-
-    public interface SourceCompleter {
-        void complete(ClassSymbol sym)
-            throws CompletionFailure;
-    }
-
     /**
      * A subclass of JavaFileObject for the sourcefile attribute found in a classfile.
      * The attribute is only the last component of the original filename, so is unlikely
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java	Mon Jun 02 13:53:52 2014 -0700
@@ -459,11 +459,11 @@
                 poolbuf.appendChar(pool.put(names.fromString((String)value)));
             } else if (value instanceof UniqueType) {
                 Type type = ((UniqueType)value).type;
-                if (type instanceof MethodType) {
+                if (type.hasTag(METHOD)) {
                     poolbuf.appendByte(CONSTANT_MethodType);
                     poolbuf.appendChar(pool.put(typeSig((MethodType)type)));
                 } else {
-                    if (type.hasTag(CLASS)) enterInner((ClassSymbol)type.tsym);
+                    Assert.check(type.hasTag(ARRAY));
                     poolbuf.appendByte(CONSTANT_Class);
                     poolbuf.appendChar(pool.put(xClassName(type)));
                 }
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Code.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Code.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1925,6 +1925,13 @@
             return aliveRanges.isEmpty() ? null : aliveRanges.get(aliveRanges.size() - 1);
         }
 
+        void removeLastRange() {
+            Range lastRange = lastRange();
+            if (lastRange != null) {
+                aliveRanges.remove(lastRange);
+            }
+        }
+
         @Override
         public String toString() {
             if (aliveRanges == null) {
@@ -1955,9 +1962,7 @@
                     }
                 }
             } else {
-                if (!aliveRanges.isEmpty()) {
-                    aliveRanges.remove(aliveRanges.size() - 1);
-                }
+                removeLastRange();
             }
         }
 
@@ -1965,16 +1970,14 @@
             if (aliveRanges.isEmpty()) {
                 return false;
             }
-            Range range = lastRange();
-            return range.length == Character.MAX_VALUE;
+            return lastRange().length == Character.MAX_VALUE;
         }
 
         public boolean isLastRangeInitialized() {
             if (aliveRanges.isEmpty()) {
                 return false;
             }
-            Range range = lastRange();
-            return range.start_pc != Character.MAX_VALUE;
+            return lastRange().start_pc != Character.MAX_VALUE;
         }
 
         public Range getWidestRange() {
@@ -2095,7 +2098,7 @@
                 v.closeRange(length);
                 putVar(v);
             } else {
-                v.lastRange().start_pc = Character.MAX_VALUE;
+                v.removeLastRange();
             }
         }
     }
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1800,8 +1800,7 @@
             genStat(tree.thenpart, env, CRT_STATEMENT | CRT_FLOW_TARGET);
             thenExit = code.branch(goto_);
             if (varDebugInfo && lvtRanges.containsKey(code.meth, tree.thenpart)) {
-                code.closeAliveRanges(tree.thenpart,
-                        thenExit != null && tree.elsepart == null ? thenExit.pc : code.cp);
+                code.closeAliveRanges(tree.thenpart, code.cp);
             }
         }
         if (elseChain != null) {
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Pool.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Pool.java	Mon Jun 02 13:53:52 2014 -0700
@@ -28,6 +28,7 @@
 import com.sun.tools.javac.code.Kinds;
 import com.sun.tools.javac.code.Symbol;
 import com.sun.tools.javac.code.Symbol.*;
+import com.sun.tools.javac.code.TypeTag;
 import com.sun.tools.javac.code.Type;
 import com.sun.tools.javac.code.Types;
 import com.sun.tools.javac.code.Types.UniqueType;
@@ -127,7 +128,14 @@
         } else if (o instanceof VarSymbol) {
             return new Variable((VarSymbol)o, types);
         } else if (o instanceof Type) {
-            return new UniqueType((Type)o, types);
+            Type t = (Type)o;
+            // ClassRefs can come from ClassSymbols or from Types.
+            // Return the symbol for these types to avoid duplicates
+            // in the constant pool
+            if (t.hasTag(TypeTag.CLASS))
+                return t.tsym;
+            else
+                return new UniqueType(t, types);
         } else {
             return o;
         }
--- a/langtools/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/langtools/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java	Mon Jun 02 13:53:52 2014 -0700
@@ -219,6 +219,10 @@
      */
     protected TreeMaker make;
 
+    /** The class finder.
+     */
+    protected ClassFinder finder;
+
     /** The class reader.
      */
     protected ClassReader reader;
@@ -296,13 +300,13 @@
     protected MultiTaskListener taskListener;
 
     /**
-     * SourceCompleter that delegates to the complete-method of this class.
+     * SourceCompleter that delegates to the readSourceFile method of this class.
      */
-    protected final ClassReader.SourceCompleter thisCompleter =
-            new ClassReader.SourceCompleter() {
+    protected final Symbol.Completer sourceCompleter =
+            new Symbol.Completer() {
                 @Override
-                public void complete(ClassSymbol sym) throws CompletionFailure {
-                    JavaCompiler.this.complete(sym);
+                public void complete(Symbol sym) throws CompletionFailure {
+                    readSourceFile((ClassSymbol) sym);
                 }
             };
 
@@ -338,6 +342,7 @@
         names = Names.instance(context);
         log = Log.instance(context);
         diagFactory = JCDiagnostic.Factory.instance(context);
+        finder = ClassFinder.instance(context);
         reader = ClassReader.instance(context);
         make = TreeMaker.instance(context);
         writer = ClassWriter.instance(context);
@@ -355,7 +360,7 @@
         } catch (CompletionFailure ex) {
             // inlined Check.completionError as it is not initialized yet
             log.error("cant.access", ex.sym, ex.getDetailValue());
-            if (ex instanceof ClassReader.BadClassFile)
+            if (ex instanceof ClassFinder.BadClassFile)
                 throw new Abort();
         }
         source = Source.instance(context);
@@ -370,7 +375,7 @@
         types = Types.instance(context);
         taskListener = MultiTaskListener.instance(context);
 
-        reader.sourceCompleter = thisCompleter;
+        finder.sourceCompleter = sourceCompleter;
 
         options = Options.instance(context);
 
@@ -663,7 +668,7 @@
     public Symbol resolveBinaryNameOrIdent(String name) {
         try {
             Name flatname = names.fromString(name.replace("/", "."));
-            return reader.loadClass(flatname);
+            return finder.loadClass(flatname);
         } catch (CompletionFailure ignore) {
             return resolveIdent(name);
         }
@@ -737,22 +742,20 @@
         return null;
     }
 
-    /** Complete compiling a source file that has been accessed
-     *  by the class file reader.
+    /** Compile a source file that has been accessed by the class finder.
      *  @param c          The class the source file of which needs to be compiled.
      */
-    public void complete(ClassSymbol c) throws CompletionFailure {
-        complete(null, c);
+    private void readSourceFile(ClassSymbol c) throws CompletionFailure {
+        readSourceFile(null, c);
     }
 
-    /** Complete a ClassSymbol from source, optionally using the given compilation unit as
+    /** Compile a ClassSymbol from source, optionally using the given compilation unit as
      *  the source tree.
-     *  @param tree the compilation unit int which the given ClassSymbol resides,
+     *  @param tree the compilation unit in which the given ClassSymbol resides,
      *              or null if should be parsed from source
      *  @param c    the ClassSymbol to complete
      */
-    public void complete(JCCompilationUnit tree, ClassSymbol c) throws CompletionFailure {
-//      System.err.println("completing " + c);//DEBUG
+    public void readSourceFile(JCCompilationUnit tree, ClassSymbol c) throws CompletionFailure {
         if (completionFailureName == c.fullname) {
             throw new CompletionFailure(c, "user-selected completion failure by class name");
         }
@@ -791,13 +794,13 @@
                     JCDiagnostic diag =
                         diagFactory.fragment("file.does.not.contain.package",
                                                  c.location());
-                    throw reader.new BadClassFile(c, filename, diag);
+                    throw new ClassFinder.BadClassFile(c, filename, diag, diagFactory);
                 }
             } else {
                 JCDiagnostic diag =
                         diagFactory.fragment("file.doesnt.contain.class",
                                             c.getQualifiedName());
-                throw reader.new BadClassFile(c, filename, diag);
+                throw new ClassFinder.BadClassFile(c, filename, diag, diagFactory);
             }
         }
 
@@ -1663,6 +1666,7 @@
      */
     public void close() {
         rootClasses = null;
+        finder = null;
         reader = null;
         make = null;
         writer = null;
--- a/langtools/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/langtools/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java	Mon Jun 02 13:53:52 2014 -0700
@@ -54,8 +54,6 @@
 import com.sun.tools.javac.comp.Enter;
 import com.sun.tools.javac.comp.Env;
 import com.sun.tools.javac.file.JavacFileManager;
-import com.sun.tools.javac.jvm.*;
-import com.sun.tools.javac.jvm.ClassReader.BadClassFile;
 import com.sun.tools.javac.main.JavaCompiler;
 import com.sun.tools.javac.model.JavacElements;
 import com.sun.tools.javac.model.JavacTypes;
@@ -203,7 +201,7 @@
         symtab = Symtab.instance(context);
         names = Names.instance(context);
         enter = Enter.instance(context);
-        initialCompleter = ClassReader.instance(context).getCompleter();
+        initialCompleter = ClassFinder.instance(context).getCompleter();
         chk = Check.instance(context);
         initProcessorClassLoader();
     }
@@ -799,7 +797,7 @@
                                          RoundEnvironment renv) {
         try {
             return proc.process(tes, renv);
-        } catch (BadClassFile ex) {
+        } catch (ClassFinder.BadClassFile ex) {
             log.error("proc.cant.access.1", ex.sym, ex.getDetailValue());
             return false;
         } catch (CompletionFailure ex) {
@@ -1308,7 +1306,7 @@
         }
 
         @Override public void complete(Symbol sym) throws CompletionFailure {
-            compiler.complete(topLevel, (ClassSymbol) sym);
+            compiler.readSourceFile(topLevel, (ClassSymbol) sym);
         }
     }
 
--- a/langtools/src/share/classes/com/sun/tools/javac/util/Names.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/Names.java	Mon Jun 02 13:53:52 2014 -0700
@@ -317,9 +317,9 @@
     protected Name.Table createTable(Options options) {
         boolean useUnsharedTable = options.isSet("useUnsharedTable");
         if (useUnsharedTable)
-            return new UnsharedNameTable(this);
+            return UnsharedNameTable.create(this);
         else
-            return new SharedNameTable(this);
+            return SharedNameTable.create(this);
     }
 
     public void dispose() {
--- a/langtools/src/share/classes/com/sun/tools/javac/util/StringUtils.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/StringUtils.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
 package com.sun.tools.javac.util;
 
 import java.util.Locale;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 /** A collection of utilities for String manipulation.
  *
@@ -50,4 +52,19 @@
         return source.toUpperCase(Locale.US);
     }
 
+    /**Case insensitive version of {@link String#indexOf(java.lang.String)}. Equivalent to
+     * {@code text.indexOf(str)}, except the matching is case insensitive.
+     */
+    public static int indexOfIgnoreCase(String text, String str) {
+        return indexOfIgnoreCase(text, str, 0);
+    }
+
+    /**Case insensitive version of {@link String#indexOf(java.lang.String, int)}. Equivalent to
+     * {@code text.indexOf(str, startIndex)}, except the matching is case insensitive.
+     */
+    public static int indexOfIgnoreCase(String text, String str, int startIndex) {
+        Matcher m = Pattern.compile(Pattern.quote(str), Pattern.CASE_INSENSITIVE).matcher(text);
+        return m.find(startIndex) ? m.start() : -1;
+    }
+
 }
--- a/langtools/src/share/classes/com/sun/tools/javadoc/DocEnv.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/DocEnv.java	Mon Jun 02 13:53:52 2014 -0700
@@ -37,11 +37,19 @@
 import com.sun.tools.javac.api.BasicJavacTask;
 import com.sun.tools.javac.code.*;
 import com.sun.tools.javac.code.Symbol.*;
+import com.sun.tools.javac.code.Symbol.ClassSymbol;
+import com.sun.tools.javac.code.Symbol.CompletionFailure;
+import com.sun.tools.javac.code.Symbol.MethodSymbol;
+import com.sun.tools.javac.code.Symbol.PackageSymbol;
+import com.sun.tools.javac.code.Symbol.VarSymbol;
 import com.sun.tools.javac.code.Type.ClassType;
 import com.sun.tools.javac.comp.Check;
+import com.sun.tools.javac.comp.Enter;
 import com.sun.tools.javac.file.JavacFileManager;
 import com.sun.tools.javac.tree.JCTree;
-import com.sun.tools.javac.tree.JCTree.*;
+import com.sun.tools.javac.tree.JCTree.JCClassDecl;
+import com.sun.tools.javac.tree.JCTree.JCCompilationUnit;
+import com.sun.tools.javac.tree.JCTree.JCPackageDecl;
 import com.sun.tools.javac.util.Context;
 import com.sun.tools.javac.util.Names;
 
@@ -71,21 +79,21 @@
         return instance;
     }
 
-    private Messager messager;
-
     DocLocale doclocale;
 
+    private final Messager messager;
+
     /** Predefined symbols known to the compiler. */
-    Symtab syms;
+    final Symtab syms;
 
     /** Referenced directly in RootDocImpl. */
-    JavadocClassReader reader;
+    private final ClassFinder finder;
 
     /** Javadoc's own version of the compiler's enter phase. */
-    JavadocEnter enter;
+    final Enter enter;
 
     /** The name table. */
-    Names names;
+    private Names names;
 
     /** The encoding name. */
     private String encoding;
@@ -139,8 +147,8 @@
 
         messager = Messager.instance0(context);
         syms = Symtab.instance(context);
-        reader = JavadocClassReader.instance0(context);
-        enter = JavadocEnter.instance0(context);
+        finder = JavadocClassFinder.instance(context);
+        enter = JavadocEnter.instance(context);
         names = Names.instance(context);
         externalizableSym = syms.enterClass(names.fromString("java.io.Externalizable"));
         chk = Check.instance(context);
@@ -176,7 +184,7 @@
      */
     public ClassDocImpl loadClass(String name) {
         try {
-            ClassSymbol c = reader.loadClass(names.fromString(name));
+            ClassSymbol c = finder.loadClass(names.fromString(name));
             return getClassDoc(c);
         } catch (CompletionFailure ex) {
             chk.completionError(null, ex);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/JavadocClassFinder.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.tools.javadoc;
+
+import java.util.EnumSet;
+import javax.tools.JavaFileObject;
+
+import com.sun.tools.javac.code.Symbol.PackageSymbol;
+import com.sun.tools.javac.code.ClassFinder;
+import com.sun.tools.javac.util.Context;
+
+/** Javadoc uses an extended class finder that records package.html entries
+ *
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
+ *  This code and its internal interfaces are subject to change or
+ *  deletion without notice.</b>
+ *
+ *  @author Neal Gafter
+ */
+public class JavadocClassFinder extends ClassFinder {
+
+    public static JavadocClassFinder instance(Context context) {
+        ClassFinder instance = context.get(classFinderKey);
+        if (instance == null)
+            instance = new JavadocClassFinder(context);
+        return (JavadocClassFinder)instance;
+    }
+
+    public static void preRegister(Context context) {
+        context.put(classFinderKey, new Context.Factory<ClassFinder>() {
+            public ClassFinder make(Context c) {
+                return new JavadocClassFinder(c);
+            }
+        });
+    }
+
+    private DocEnv docenv;
+    private EnumSet<JavaFileObject.Kind> all = EnumSet.of(JavaFileObject.Kind.CLASS,
+                                                          JavaFileObject.Kind.SOURCE,
+                                                          JavaFileObject.Kind.HTML);
+    private EnumSet<JavaFileObject.Kind> noSource = EnumSet.of(JavaFileObject.Kind.CLASS,
+                                                               JavaFileObject.Kind.HTML);
+
+    public JavadocClassFinder(Context context) {
+        super(context);
+        docenv = DocEnv.instance(context);
+        preferSource = true;
+    }
+
+    /**
+     * Override getPackageFileKinds to include search for package.html
+     */
+    @Override
+    protected EnumSet<JavaFileObject.Kind> getPackageFileKinds() {
+        return docenv.docClasses ? noSource : all;
+    }
+
+    /**
+     * Override extraFileActions to check for package documentation
+     */
+    @Override
+    protected void extraFileActions(PackageSymbol pack, JavaFileObject fo) {
+        if (fo.isNameCompatible("package", JavaFileObject.Kind.HTML))
+            docenv.getPackageDoc(pack).setDocPath(fo);
+    }
+}
--- a/langtools/src/share/classes/com/sun/tools/javadoc/JavadocClassReader.java	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.tools.javadoc;
-
-import java.util.EnumSet;
-import javax.tools.JavaFileObject;
-
-import com.sun.tools.javac.code.Symbol.PackageSymbol;
-import com.sun.tools.javac.jvm.ClassReader;
-import com.sun.tools.javac.util.Context;
-
-/** Javadoc uses an extended class reader that records package.html entries
- *
- *  <p><b>This is NOT part of any supported API.
- *  If you write code that depends on this, you do so at your own risk.
- *  This code and its internal interfaces are subject to change or
- *  deletion without notice.</b>
- *
- *  @author Neal Gafter
- */
-public class JavadocClassReader extends ClassReader {
-
-    public static JavadocClassReader instance0(Context context) {
-        ClassReader instance = context.get(classReaderKey);
-        if (instance == null)
-            instance = new JavadocClassReader(context);
-        return (JavadocClassReader)instance;
-    }
-
-    public static void preRegister(Context context) {
-        context.put(classReaderKey, new Context.Factory<ClassReader>() {
-            public ClassReader make(Context c) {
-                return new JavadocClassReader(c);
-            }
-        });
-    }
-
-    private DocEnv docenv;
-    private EnumSet<JavaFileObject.Kind> all = EnumSet.of(JavaFileObject.Kind.CLASS,
-                                                          JavaFileObject.Kind.SOURCE,
-                                                          JavaFileObject.Kind.HTML);
-    private EnumSet<JavaFileObject.Kind> noSource = EnumSet.of(JavaFileObject.Kind.CLASS,
-                                                               JavaFileObject.Kind.HTML);
-
-    public JavadocClassReader(Context context) {
-        super(context);
-        docenv = DocEnv.instance(context);
-        preferSource = true;
-    }
-
-    /**
-     * Override getPackageFileKinds to include search for package.html
-     */
-    @Override
-    protected EnumSet<JavaFileObject.Kind> getPackageFileKinds() {
-        return docenv.docClasses ? noSource : all;
-    }
-
-    /**
-     * Override extraFileActions to check for package documentation
-     */
-    @Override
-    protected void extraFileActions(PackageSymbol pack, JavaFileObject fo) {
-        if (fo.isNameCompatible("package", JavaFileObject.Kind.HTML))
-            docenv.getPackageDoc(pack).setDocPath(fo);
-    }
-}
--- a/langtools/src/share/classes/com/sun/tools/javadoc/JavadocEnter.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/JavadocEnter.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -48,7 +48,7 @@
  *  @author Neal Gafter
  */
 public class JavadocEnter extends Enter {
-    public static JavadocEnter instance0(Context context) {
+    public static JavadocEnter instance(Context context) {
         Enter instance = context.get(enterKey);
         if (instance == null)
             instance = new JavadocEnter(context);
--- a/langtools/src/share/classes/com/sun/tools/javadoc/JavadocTool.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/JavadocTool.java	Mon Jun 02 13:53:52 2014 -0700
@@ -33,12 +33,15 @@
 import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
+
 import javax.tools.JavaFileManager.Location;
 import javax.tools.JavaFileObject;
 import javax.tools.StandardJavaFileManager;
 import javax.tools.StandardLocation;
 
+import com.sun.tools.javac.code.ClassFinder;
 import com.sun.tools.javac.code.Symbol.CompletionFailure;
+import com.sun.tools.javac.comp.Enter;
 import com.sun.tools.javac.tree.JCTree;
 import com.sun.tools.javac.tree.JCTree.JCClassDecl;
 import com.sun.tools.javac.tree.JCTree.JCCompilationUnit;
@@ -66,8 +69,8 @@
     DocEnv docenv;
 
     final Messager messager;
-    final JavadocClassReader javadocReader;
-    final JavadocEnter javadocEnter;
+    final ClassFinder javadocFinder;
+    final Enter javadocEnter;
     final Set<JavaFileObject> uniquefiles;
 
     /**
@@ -77,8 +80,8 @@
     protected JavadocTool(Context context) {
         super(context);
         messager = Messager.instance0(context);
-        javadocReader = JavadocClassReader.instance0(context);
-        javadocEnter = JavadocEnter.instance0(context);
+        javadocFinder = JavadocClassFinder.instance(context);
+        javadocEnter = JavadocEnter.instance(context);
         uniquefiles = new HashSet<>();
     }
 
@@ -95,8 +98,8 @@
     public static JavadocTool make0(Context context) {
         Messager messager = null;
         try {
-            // force the use of Javadoc's class reader
-            JavadocClassReader.preRegister(context);
+            // force the use of Javadoc's class finder
+            JavadocClassFinder.preRegister(context);
 
             // force the use of Javadoc's own enter phase
             JavadocEnter.preRegister(context);
@@ -137,7 +140,8 @@
         docenv.setEncoding(encoding);
         docenv.docClasses = docClasses;
         docenv.legacyDoclet = legacyDoclet;
-        javadocReader.sourceCompleter = docClasses ? null : thisCompleter;
+
+        javadocFinder.sourceCompleter = docClasses ? null : sourceCompleter;
 
         ListBuffer<String> names = new ListBuffer<>();
         ListBuffer<JCCompilationUnit> classTrees = new ListBuffer<>();
--- a/langtools/test/com/sun/javadoc/testRelativeLinks/TestRelativeLinks.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/langtools/test/com/sun/javadoc/testRelativeLinks/TestRelativeLinks.java	Mon Jun 02 13:53:52 2014 -0700
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug      4460354 8014636
+ * @bug      4460354 8014636 8043186
  * @summary  Test to make sure that relative paths are redirected in the
  *           output so that they are not broken.
  * @author   jamieh
--- a/langtools/test/com/sun/javadoc/testRelativeLinks/pkg/C.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/langtools/test/com/sun/javadoc/testRelativeLinks/pkg/C.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,7 @@
 public class C {
 
     /**
-     * Here is a relative link in a field:
+     * Here is a relative link in a field:\u0130
      * <a href="relative-field-link.html">relative field link</a>.
      */
     public C field = null;
--- a/langtools/test/com/sun/javadoc/testTopOption/TestTopOption.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/langtools/test/com/sun/javadoc/testTopOption/TestTopOption.java	Mon Jun 02 13:53:52 2014 -0700
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug      6227616
+ * @bug      6227616 8043186
  * @summary  Test the new -top option.
  * @author   jamieh
  * @library  ../lib
@@ -43,7 +43,30 @@
         javadoc("-overview", testSrc("overview.html"),
                 "-use",
                 "-top", "TOP TEXT",
-                "-d", "out",
+                "-d", "out-1",
+                "-sourcepath", testSrc,
+                "pkg");
+        checkExit(Exit.OK);
+
+        checkTopText(
+                "pkg/AnnotationType.html",
+                "pkg/class-use/AnnotationType.html",
+                "pkg/Cl.html",
+                "pkg/class-use/Cl.html",
+                "pkg/package-summary.html",
+                "pkg/package-use.html",
+                "overview-summary.html",
+                "overview-tree.html",
+                "constant-values.html",
+                "help-doc.html");
+    }
+
+    @Test
+    void testDocRootRewrite() {
+        javadoc("-overview", testSrc("overview.html"),
+                "-use",
+                "-top", "\u0130{@docroot}TOP TEXT",
+                "-d", "out-2",
                 "-sourcepath", testSrc,
                 "pkg");
         checkExit(Exit.OK);
--- a/langtools/test/tools/javac/6330997/T6330997.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/langtools/test/tools/javac/6330997/T6330997.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,7 +36,7 @@
 import java.io.*;
 import java.nio.channels.*;
 import com.sun.tools.javac.api.JavacTaskImpl;
-import com.sun.tools.javac.jvm.ClassReader.BadClassFile;
+import com.sun.tools.javac.code.ClassFinder.BadClassFile;
 import com.sun.tools.javac.main.JavaCompiler;
 import javax.tools.ToolProvider;
 
--- a/langtools/test/tools/javac/MethodParametersTest.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/langtools/test/tools/javac/MethodParametersTest.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -129,14 +129,14 @@
         if (out.length() > 0)
             System.err.println(out);
 
-        // Now get the class reader, construct a name for Baz, and load it.
-        com.sun.tools.javac.jvm.ClassReader cr =
-            com.sun.tools.javac.jvm.ClassReader.instance(context);
+        // Now get the class finder, construct a name for Baz, and load it.
+        com.sun.tools.javac.code.ClassFinder cf =
+            com.sun.tools.javac.code.ClassFinder.instance(context);
         Name name = Names.instance(context).fromString(Baz_name);
 
         // Now walk down the language model and check the name of the
         // parameter.
-        final Element baz = cr.loadClass(name);
+        final Element baz = cf.loadClass(name);
         for (Element e : baz.getEnclosedElements()) {
             if (e instanceof ExecutableElement) {
                 final ExecutableElement ee = (ExecutableElement) e;
--- a/langtools/test/tools/javac/T6435291/T6435291.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/langtools/test/tools/javac/T6435291/T6435291.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,7 @@
  */
 
 import com.sun.tools.javac.api.JavacTaskImpl;
-import com.sun.tools.javac.jvm.ClassReader.BadClassFile;
+import com.sun.tools.javac.code.ClassFinder.BadClassFile;
 import com.sun.tools.javac.main.JavaCompiler;
 import javax.tools.ToolProvider;
 
--- a/langtools/test/tools/javac/T8030816/CrashLambdaExpressionWithNonAccessibleIdTest.out	Mon Jun 02 15:49:53 2014 -0400
+++ b/langtools/test/tools/javac/T8030816/CrashLambdaExpressionWithNonAccessibleIdTest.out	Mon Jun 02 13:53:52 2014 -0700
@@ -1,3 +1,2 @@
-CrashLambdaExpressionWithNonAccessibleIdTest.java:15:35: compiler.err.missing.ret.stmt
 CrashLambdaExpressionWithNonAccessibleIdTest.java:14:17: compiler.err.cant.resolve.location: kindname.class, A, , , (compiler.misc.location: kindname.class, CrashLambdaExpressionWithNonAccessibleIdTest, null)
-2 errors
+1 error
--- a/langtools/test/tools/javac/classfiles/attributes/SourceFile/NoSourceFileAttribute.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/langtools/test/tools/javac/classfiles/attributes/SourceFile/NoSourceFileAttribute.java	Mon Jun 02 13:53:52 2014 -0700
@@ -24,10 +24,11 @@
 /*
  * @test
  * @summary sourcefile attribute test for file compiled without debug information.
+ * @bug 8040129
  * @library /tools/javac/lib ../lib
  * @build SourceFileTestBase TestBase InMemoryFileManager ToolBox
  * @compile -g:none NoSourceFileAttribute.java
- * @run main  NoSourceFileAttribute
+ * @run main NoSourceFileAttribute
  */
 
 import com.sun.tools.classfile.Attribute;
--- a/langtools/test/tools/javac/defaultMethods/BadClassfile.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/langtools/test/tools/javac/defaultMethods/BadClassfile.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,8 +32,8 @@
 
 import com.sun.tools.classfile.*;
 import com.sun.tools.javac.api.JavacTaskImpl;
+import com.sun.tools.javac.code.ClassFinder.BadClassFile;
 import com.sun.tools.javac.code.Symbol;
-import com.sun.tools.javac.jvm.ClassReader.BadClassFile;
 import com.sun.tools.javac.jvm.Target;
 import com.sun.tools.javac.util.Assert;
 import com.sun.tools.javac.util.JCDiagnostic;
--- a/langtools/test/tools/javac/flow/LVTHarness.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/langtools/test/tools/javac/flow/LVTHarness.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,8 +23,8 @@
 
 /*
  * @test
- * @bug 7047734 8027660
- * @summary The LVT is not generated correctly during some try/catch scenarios;
+ * @bug 7047734 8027660 8037937
+ * @summary The LVT is not generated correctly during some try/catch scenarios
  *          javac crash while creating LVT entry for a local variable defined in
  *          an inner block
  * @library /tools/javac/lib
@@ -120,7 +120,7 @@
         for (Map.Entry<ElementKey, AliveRanges> entry : aliveRangeMap.entrySet()) {
             if (!seenAliveRanges.contains(entry.getKey())) {
                 error("Redundant @AliveRanges annotation on method " +
-                        entry.getKey().elem);
+                        entry.getKey().elem + " with key " + entry.getKey());
             }
         }
     }
@@ -134,7 +134,7 @@
         for (Method method : classFile.methods) {
             for (ElementKey elementKey: aliveRangeMap.keySet()) {
                 String methodDesc = method.getName(constantPool) +
-                        method.descriptor.getParameterTypes(constantPool);
+                        method.descriptor.getParameterTypes(constantPool).replace(" ", "");
                 if (methodDesc.equals(elementKey.elem.toString())) {
                     checkMethod(constantPool, method, aliveRangeMap.get(elementKey));
                     seenAliveRanges.add(elementKey);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/flow/T8042741/A.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+// str must be at absolute position greater than that of lambda
+// expression in PositionTest.java
+// padding..........................................................padding
+// padding..........................................................padding
+// padding..........................................................padding
+// padding..........................................................padding
+// padding..........................................................padding
+
+public class A {
+    public final String str;
+    {
+        str = "";
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/flow/T8042741/PositionTest.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* @test
+ * @bug 8042741
+ * @summary Java 8 compiler throws NullPointerException depending location in source file
+ * @compile A.java PositionTest.java
+ */
+
+public class PositionTest extends A {
+    <E extends Exception> void test(SAM<E> r) throws E {
+        test(() -> { System.err.println(str); });
+    }
+    interface SAM<E extends Exception> {
+        public void run() throws E;
+    }
+    void f() {
+        try {
+            test(() -> {
+                    test(() -> {
+                            try {
+                                test(() -> { System.err.println(str); });
+                                System.err.println(str);
+                            } catch (Exception e) {}
+                            System.err.println(str);
+                        });
+                    System.err.println(str);
+                });
+        } catch (Exception e) { }
+    }
+    void g() throws Exception {
+        test(() -> {
+                try {
+                    try {
+                        test(() -> { System.err.println(str); });
+                    } catch (Exception e) {}
+                    System.err.println(str);
+                } catch (Exception e) {}
+                System.err.println(str);
+            });
+    }
+}
--- a/langtools/test/tools/javac/flow/tests/TestCaseIfElse.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/langtools/test/tools/javac/flow/tests/TestCaseIfElse.java	Mon Jun 02 13:53:52 2014 -0700
@@ -33,7 +33,7 @@
 
     @AliveRange(varName="o", bytecodeStart=10, bytecodeLength=8)
     @AliveRange(varName="o", bytecodeStart=21, bytecodeLength=9)
-    void m2(String[] args) {
+    void m2() {
         Object o;
         int i = 5;
         if (i != 5) {
@@ -45,4 +45,19 @@
         }
         o = "finish";
     }
+
+    @AliveRange(varName="o", bytecodeStart=11, bytecodeLength=3)
+    @AliveRange(varName="o", bytecodeStart=17, bytecodeLength=2)
+    Object m3(boolean cond1, boolean cond2) {
+        Object o;
+        if (cond1) {
+            if (cond2) {
+                o = "then";
+            } else {
+                o = "else";
+                return null;
+            }
+        }
+        return null;
+    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/inference/EagerReturnTypeResolution/EagerReturnTypeResolutionTesta.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8030741
+ * @summary Inference: implement eager resolution of return types, consistent with JDK-8028800
+ * @compile EagerReturnTypeResolutionTesta.java
+ */
+
+public class EagerReturnTypeResolutionTesta {
+
+    abstract class Test1<T>{
+        abstract <S> S foo(S x, S y);
+        <S extends Number & Comparable<? extends Number>> void baz(Test1<S> a){}
+
+        void bar(Test1<Long> x, Test1<Integer> y){
+            baz(foo(x, y));
+        }
+    }
+
+    abstract class Test2<T>{
+        abstract <S> S foo(S x, S y);
+        abstract <S1> void baz(Test2<S1> a);
+
+        void bar(Test2<Integer> y, Test2<Long> x){
+             baz(foo(x, y));
+        }
+    }
+
+    abstract class Test3<T>{
+        abstract <S> S foo(S x, S y);
+        <T extends Number & Comparable<?>,
+                S extends Number & Comparable<? extends T>> void baz(Test3<S> a){}
+
+        void bar(Test3<Long> x, Test3<Integer> y){
+            baz(foo(x, y));
+        }
+    }
+
+    abstract class Test4 {
+        abstract class A0<T> {}
+
+        abstract class A1<T> extends A0<T> {}
+
+        abstract class A2<T> extends A0<T> {}
+
+        abstract <S> S foo(S x, S y);
+        abstract <S1> void baz(A0<S1> a);
+
+        void bar(A2<Integer> y, A1<Long> x){
+             baz(foo(x, y));
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/inference/EagerReturnTypeResolution/EagerReturnTypeResolutionTestb.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,182 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8030741
+ * @summary Inference: implement eager resolution of return types, consistent with JDK-8028800
+ * @compile/fail/ref=EagerReturnTypeResolutionTestb.out -XDrawDiagnostics EagerReturnTypeResolutionTestb.java
+ * @author Dan Smith
+ */
+
+import java.util.List;
+
+public class EagerReturnTypeResolutionTestb {
+    interface I<S> {}
+    interface J<S> extends I<S> {}
+    interface K extends I<String> {}
+    interface L<S> extends I {}
+
+    <T> T lower(List<? extends T> l) { return null; }
+    <T> T lower2(List<? extends T> l1, List<? extends T> l2) { return null; }
+
+    <T> T upper(List<? super T> l) { return null; }
+    <T> T upper2(List<? super T> l1, List<? super T> l2) { return null; }
+
+    <T> T eq(List<T> l) { return null; }
+    <T> T eq2(List<T> l1, List<T> l2) { return null; }
+
+    <X> void takeI(I<X> i) {}
+    void takeIString(I<String> i) {}
+    I<String> iStringField;
+
+    void takeLong(long arg) {}
+    long longField;
+
+    void testSimpleCaptureOK(List<I<?>> i1) {
+        takeI(lower(i1)); // ok*
+        takeI(eq(i1)); // ok*
+        takeI(upper(i1)); // ok, no capture
+        takeIString(upper(i1)); // ok
+        iStringField = upper(i1); // ok
+    }
+
+    void testSimpleCaptureKO(List<I<?>> i1) {
+        takeIString(lower(i1)); // ERROR
+        takeIString(eq(i1)); // ERROR
+        iStringField = lower(i1); // ERROR
+        iStringField = eq(i1); // ERROR
+    }
+
+    void testMultiCaptureOK(List<I<String>> i1, List<I<Integer>> i2, List<I<?>> i3,
+                          List<J<String>> j1, List<J<Integer>> j2, List<K> k1) {
+        /* Lines marked with JDK-8029002 should be uncommented once this bug is
+         * fixed
+         */
+        takeI(lower2(i1, i2)); // ok*
+        takeI(lower2(i1, i3)); // ok*
+        takeI(upper2(i1, i3)); // ok, no capture*  JDK-8029002
+
+        takeIString(upper2(i1, i3)); // ok, no capture
+        iStringField = upper2(i1, i3); // ok, no capture
+
+        takeI(lower2(j1, j2)); // ok*
+        takeI(lower2(j1, k1)); // ok, no capture
+        takeI(upper2(j1, k1)); // ok, no capture*  JDK-8029002
+
+        takeIString(lower2(j1, k1)); // ok, no capture
+        takeIString(upper2(j1, k1)); // ok, no capture
+
+        iStringField = lower2(j1, k1); // ok, no capture
+        iStringField = upper2(j1, k1); // ok, no capture
+        takeI(lower2(j2, k1)); // ok*
+    }
+
+    void testMultiCaptureKO(List<I<String>> i1, List<I<Integer>> i2, List<I<?>> i3,
+                          List<J<String>> j1, List<J<Integer>> j2, List<K> k1) {
+        takeI(eq2(i1, i2)); // ERROR, bad bounds
+        takeI(upper2(i1, i2)); // ERROR, bad bounds
+
+        takeIString(lower2(i1, i2)); // ERROR
+        takeIString(eq2(i1, i2)); // ERROR, bad bounds
+        takeIString(upper2(i1, i2)); // ERROR, bad bounds
+
+        iStringField = lower2(i1, i2); // ERROR
+        iStringField = eq2(i1, i2); // ERROR, bad bounds
+        iStringField = upper2(i1, i2); // ERROR, bad bounds
+
+        takeI(eq2(i1, i3)); // ERROR, bad bounds
+        takeIString(lower2(i1, i3)); // ERROR
+        takeIString(eq2(i1, i3)); // ERROR, bad bounds
+
+        iStringField = lower2(i1, i3); // ERROR
+        iStringField = eq2(i1, i3); // ERROR, bad bounds
+        takeI(eq2(j1, j2)); // ERROR, bad bounds
+        takeI(upper2(j1, j2)); // ERROR, bad bounds
+
+        takeIString(lower2(j1, j2)); // ERROR
+        takeIString(eq2(j1, j2)); // ERROR, bad bounds
+        takeIString(upper2(j1, j2)); // ERROR, bad bounds
+
+        iStringField = lower2(j1, j2); // ERROR
+        iStringField = eq2(j1, j2); // ERROR, bad bounds
+        iStringField = upper2(j1, j2); // ERROR, bad bounds
+
+        takeI(eq2(j1, k1)); // ERROR, bad bounds
+        takeIString(eq2(j1, k1)); // ERROR, bad bounds
+        iStringField = eq2(j1, k1); // ERROR, bad bounds
+        takeI(eq2(j2, k1)); // ERROR, bad bounds
+        takeI(upper2(j2, k1)); // ERROR, bad bounds; actual: no error, see JDK-8037474
+
+        takeIString(lower2(j2, k1)); // ERROR
+        takeIString(eq2(j2, k1)); // ERROR, bad bounds
+        takeIString(upper2(j2, k1)); // ERROR, bad bounds
+
+        iStringField = lower2(j2, k1); // ERROR
+        iStringField = eq2(j2, k1); // ERROR, bad bounds
+        iStringField = upper2(j2, k1); // ERROR, bad bounds
+    }
+
+    void testRawOK(List<I> i1, List<J> j1, List<L<String>> l1) {
+        takeI(lower(i1)); // ok, unchecked
+        takeI(eq(i1)); // ok, unchecked
+        takeI(upper(i1)); // ok, no capture, not unchecked
+
+        takeIString(lower(i1)); // ok, unchecked
+        takeIString(eq(i1)); // ok, unchecked
+        takeIString(upper(i1)); // ok, no capture, not unchecked
+
+        iStringField = lower(i1); // ok, unchecked
+        iStringField = eq(i1); // ok, unchecked
+        iStringField = upper(i1); // ok, no capture, not unchecked
+
+        takeI(lower(j1)); // ok, unchecked
+        takeI(eq(j1)); // ok, unchecked
+        takeI(upper(j1)); // bad bounds? -- spec is unclear
+
+        takeIString(lower(j1)); // ok, unchecked
+        takeIString(eq(j1)); // ok, unchecked
+        takeIString(upper(j1)); // bad bounds? -- spec is unclear
+
+        iStringField = lower(j1); // ok, unchecked
+        iStringField = eq(j1); // ok, unchecked
+        iStringField = upper(j1); // bad bounds? -- spec is unclear
+
+        takeI(lower(l1)); // ok, unchecked
+        takeI(eq(l1)); // ok, unchecked
+        takeI(upper(l1)); // bad bounds? -- spec is unclear
+
+        takeIString(lower(l1)); // ok, unchecked
+        takeIString(eq(l1)); // ok, unchecked
+        takeIString(upper(l1)); // bad bounds? -- spec is unclear
+
+        iStringField = lower(l1); // ok, unchecked
+        iStringField = eq(l1); // ok, unchecked
+        iStringField = upper(l1); // bad bounds? -- spec is unclear
+    }
+
+    void testPrimOK(List<Integer> i1, List<Long> l1, List<Double> d1) {
+        takeLong(lower(i1)); // ok
+        takeLong(eq(i1)); // ok
+        takeLong(upper(i1)); // ok*
+
+        longField = lower(i1); // ok
+        longField = eq(i1); // ok
+        longField = upper(i1); // ok*
+
+        takeLong(lower(l1)); // ok
+        takeLong(eq(l1)); // ok
+        takeLong(upper(l1)); // ok
+
+        longField = lower(l1); // ok
+        longField = eq(l1); // ok
+        longField = upper(l1); // ok
+    }
+
+    void testPrimKO(List<Integer> i1, List<Long> l1, List<Double> d1) {
+        takeLong(lower(d1)); // ERROR
+        takeLong(eq(d1)); // ERROR
+        takeLong(upper(d1)); // ERROR
+
+        longField = lower(d1); // ERROR
+        longField = eq(d1); // ERROR
+        longField = upper(d1); // ERROR
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/inference/EagerReturnTypeResolution/EagerReturnTypeResolutionTestb.out	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,45 @@
+EagerReturnTypeResolutionTestb.java:42:9: compiler.err.cant.apply.symbol: kindname.method, takeIString, EagerReturnTypeResolutionTestb.I<java.lang.String>, EagerReturnTypeResolutionTestb.I<compiler.misc.type.captureof: 1, ?>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inferred.do.not.conform.to.upper.bounds: EagerReturnTypeResolutionTestb.I<?>, EagerReturnTypeResolutionTestb.I<java.lang.String>,java.lang.Object))
+EagerReturnTypeResolutionTestb.java:43:9: compiler.err.cant.apply.symbol: kindname.method, takeIString, EagerReturnTypeResolutionTestb.I<java.lang.String>, EagerReturnTypeResolutionTestb.I<compiler.misc.type.captureof: 1, ?>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inferred.do.not.conform.to.upper.bounds: EagerReturnTypeResolutionTestb.I<?>, EagerReturnTypeResolutionTestb.I<java.lang.String>,java.lang.Object))
+EagerReturnTypeResolutionTestb.java:44:29: compiler.err.prob.found.req: (compiler.misc.inferred.do.not.conform.to.upper.bounds: EagerReturnTypeResolutionTestb.I<?>, EagerReturnTypeResolutionTestb.I<java.lang.String>,java.lang.Object)
+EagerReturnTypeResolutionTestb.java:45:26: compiler.err.prob.found.req: (compiler.misc.inferred.do.not.conform.to.upper.bounds: EagerReturnTypeResolutionTestb.I<?>, EagerReturnTypeResolutionTestb.I<java.lang.String>,java.lang.Object)
+EagerReturnTypeResolutionTestb.java:74:15: compiler.err.cant.apply.symbol: kindname.method, eq2, java.util.List<T>,java.util.List<T>, java.util.List<EagerReturnTypeResolutionTestb.I<java.lang.String>>,java.util.List<EagerReturnTypeResolutionTestb.I<java.lang.Integer>>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.inferred.do.not.conform.to.eq.bounds: EagerReturnTypeResolutionTestb.I<java.lang.Integer>, EagerReturnTypeResolutionTestb.I<java.lang.Integer>,EagerReturnTypeResolutionTestb.I<java.lang.String>)
+EagerReturnTypeResolutionTestb.java:75:15: compiler.err.cant.apply.symbol: kindname.method, upper2, java.util.List<? super T>,java.util.List<? super T>, java.util.List<EagerReturnTypeResolutionTestb.I<java.lang.String>>,java.util.List<EagerReturnTypeResolutionTestb.I<java.lang.Integer>>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.inferred.do.not.conform.to.upper.bounds: EagerReturnTypeResolutionTestb.I<java.lang.Integer>, EagerReturnTypeResolutionTestb.I<java.lang.Integer>,EagerReturnTypeResolutionTestb.I<java.lang.String>,java.lang.Object)
+EagerReturnTypeResolutionTestb.java:77:9: compiler.err.cant.apply.symbol: kindname.method, takeIString, EagerReturnTypeResolutionTestb.I<java.lang.String>, EagerReturnTypeResolutionTestb.I<compiler.misc.type.captureof: 1, ? extends java.lang.Object&java.io.Serializable&java.lang.Comparable<? extends java.lang.Object&java.io.Serializable&java.lang.Comparable<?>>>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inferred.do.not.conform.to.upper.bounds: EagerReturnTypeResolutionTestb.I<? extends java.lang.Object&java.io.Serializable&java.lang.Comparable<? extends java.lang.Object&java.io.Serializable&java.lang.Comparable<?>>>, EagerReturnTypeResolutionTestb.I<java.lang.String>,java.lang.Object))
+EagerReturnTypeResolutionTestb.java:78:21: compiler.err.cant.apply.symbol: kindname.method, eq2, java.util.List<T>,java.util.List<T>, java.util.List<EagerReturnTypeResolutionTestb.I<java.lang.String>>,java.util.List<EagerReturnTypeResolutionTestb.I<java.lang.Integer>>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.inferred.do.not.conform.to.eq.bounds: EagerReturnTypeResolutionTestb.I<java.lang.Integer>, EagerReturnTypeResolutionTestb.I<java.lang.Integer>,EagerReturnTypeResolutionTestb.I<java.lang.String>)
+EagerReturnTypeResolutionTestb.java:79:21: compiler.err.cant.apply.symbol: kindname.method, upper2, java.util.List<? super T>,java.util.List<? super T>, java.util.List<EagerReturnTypeResolutionTestb.I<java.lang.String>>,java.util.List<EagerReturnTypeResolutionTestb.I<java.lang.Integer>>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.inferred.do.not.conform.to.upper.bounds: EagerReturnTypeResolutionTestb.I<java.lang.Integer>, EagerReturnTypeResolutionTestb.I<java.lang.Integer>,EagerReturnTypeResolutionTestb.I<java.lang.String>,java.lang.Object)
+EagerReturnTypeResolutionTestb.java:81:30: compiler.err.prob.found.req: (compiler.misc.inferred.do.not.conform.to.upper.bounds: EagerReturnTypeResolutionTestb.I<? extends java.lang.Object&java.io.Serializable&java.lang.Comparable<? extends java.lang.Object&java.io.Serializable&java.lang.Comparable<?>>>, EagerReturnTypeResolutionTestb.I<java.lang.String>,java.lang.Object)
+EagerReturnTypeResolutionTestb.java:82:24: compiler.err.cant.apply.symbol: kindname.method, eq2, java.util.List<T>,java.util.List<T>, java.util.List<EagerReturnTypeResolutionTestb.I<java.lang.String>>,java.util.List<EagerReturnTypeResolutionTestb.I<java.lang.Integer>>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.inferred.do.not.conform.to.eq.bounds: EagerReturnTypeResolutionTestb.I<java.lang.Integer>, EagerReturnTypeResolutionTestb.I<java.lang.Integer>,EagerReturnTypeResolutionTestb.I<java.lang.String>)
+EagerReturnTypeResolutionTestb.java:83:24: compiler.err.cant.apply.symbol: kindname.method, upper2, java.util.List<? super T>,java.util.List<? super T>, java.util.List<EagerReturnTypeResolutionTestb.I<java.lang.String>>,java.util.List<EagerReturnTypeResolutionTestb.I<java.lang.Integer>>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.inferred.do.not.conform.to.upper.bounds: EagerReturnTypeResolutionTestb.I<java.lang.Integer>, EagerReturnTypeResolutionTestb.I<java.lang.Integer>,EagerReturnTypeResolutionTestb.I<java.lang.String>,java.lang.Object)
+EagerReturnTypeResolutionTestb.java:85:15: compiler.err.cant.apply.symbol: kindname.method, eq2, java.util.List<T>,java.util.List<T>, java.util.List<EagerReturnTypeResolutionTestb.I<java.lang.String>>,java.util.List<EagerReturnTypeResolutionTestb.I<?>>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.inferred.do.not.conform.to.eq.bounds: EagerReturnTypeResolutionTestb.I<?>, EagerReturnTypeResolutionTestb.I<?>,EagerReturnTypeResolutionTestb.I<java.lang.String>)
+EagerReturnTypeResolutionTestb.java:86:9: compiler.err.cant.apply.symbol: kindname.method, takeIString, EagerReturnTypeResolutionTestb.I<java.lang.String>, EagerReturnTypeResolutionTestb.I<compiler.misc.type.captureof: 1, ?>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inferred.do.not.conform.to.upper.bounds: EagerReturnTypeResolutionTestb.I<?>, EagerReturnTypeResolutionTestb.I<java.lang.String>,java.lang.Object))
+EagerReturnTypeResolutionTestb.java:87:21: compiler.err.cant.apply.symbol: kindname.method, eq2, java.util.List<T>,java.util.List<T>, java.util.List<EagerReturnTypeResolutionTestb.I<java.lang.String>>,java.util.List<EagerReturnTypeResolutionTestb.I<?>>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.inferred.do.not.conform.to.eq.bounds: EagerReturnTypeResolutionTestb.I<?>, EagerReturnTypeResolutionTestb.I<?>,EagerReturnTypeResolutionTestb.I<java.lang.String>)
+EagerReturnTypeResolutionTestb.java:89:30: compiler.err.prob.found.req: (compiler.misc.inferred.do.not.conform.to.upper.bounds: EagerReturnTypeResolutionTestb.I<?>, EagerReturnTypeResolutionTestb.I<java.lang.String>,java.lang.Object)
+EagerReturnTypeResolutionTestb.java:90:24: compiler.err.cant.apply.symbol: kindname.method, eq2, java.util.List<T>,java.util.List<T>, java.util.List<EagerReturnTypeResolutionTestb.I<java.lang.String>>,java.util.List<EagerReturnTypeResolutionTestb.I<?>>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.inferred.do.not.conform.to.eq.bounds: EagerReturnTypeResolutionTestb.I<?>, EagerReturnTypeResolutionTestb.I<?>,EagerReturnTypeResolutionTestb.I<java.lang.String>)
+EagerReturnTypeResolutionTestb.java:91:15: compiler.err.cant.apply.symbol: kindname.method, eq2, java.util.List<T>,java.util.List<T>, java.util.List<EagerReturnTypeResolutionTestb.J<java.lang.String>>,java.util.List<EagerReturnTypeResolutionTestb.J<java.lang.Integer>>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.inferred.do.not.conform.to.eq.bounds: EagerReturnTypeResolutionTestb.J<java.lang.Integer>, EagerReturnTypeResolutionTestb.J<java.lang.Integer>,EagerReturnTypeResolutionTestb.J<java.lang.String>)
+EagerReturnTypeResolutionTestb.java:92:15: compiler.err.cant.apply.symbol: kindname.method, upper2, java.util.List<? super T>,java.util.List<? super T>, java.util.List<EagerReturnTypeResolutionTestb.J<java.lang.String>>,java.util.List<EagerReturnTypeResolutionTestb.J<java.lang.Integer>>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.inferred.do.not.conform.to.upper.bounds: EagerReturnTypeResolutionTestb.J<java.lang.Integer>, EagerReturnTypeResolutionTestb.J<java.lang.Integer>,EagerReturnTypeResolutionTestb.J<java.lang.String>,java.lang.Object)
+EagerReturnTypeResolutionTestb.java:94:9: compiler.err.cant.apply.symbol: kindname.method, takeIString, EagerReturnTypeResolutionTestb.I<java.lang.String>, EagerReturnTypeResolutionTestb.J<compiler.misc.type.captureof: 1, ? extends java.lang.Object&java.io.Serializable&java.lang.Comparable<? extends java.lang.Object&java.io.Serializable&java.lang.Comparable<?>>>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inferred.do.not.conform.to.upper.bounds: EagerReturnTypeResolutionTestb.J<? extends java.lang.Object&java.io.Serializable&java.lang.Comparable<? extends java.lang.Object&java.io.Serializable&java.lang.Comparable<?>>>, EagerReturnTypeResolutionTestb.I<java.lang.String>,java.lang.Object))
+EagerReturnTypeResolutionTestb.java:95:21: compiler.err.cant.apply.symbol: kindname.method, eq2, java.util.List<T>,java.util.List<T>, java.util.List<EagerReturnTypeResolutionTestb.J<java.lang.String>>,java.util.List<EagerReturnTypeResolutionTestb.J<java.lang.Integer>>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.inferred.do.not.conform.to.eq.bounds: EagerReturnTypeResolutionTestb.J<java.lang.Integer>, EagerReturnTypeResolutionTestb.J<java.lang.Integer>,EagerReturnTypeResolutionTestb.J<java.lang.String>)
+EagerReturnTypeResolutionTestb.java:96:21: compiler.err.cant.apply.symbol: kindname.method, upper2, java.util.List<? super T>,java.util.List<? super T>, java.util.List<EagerReturnTypeResolutionTestb.J<java.lang.String>>,java.util.List<EagerReturnTypeResolutionTestb.J<java.lang.Integer>>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.inferred.do.not.conform.to.upper.bounds: EagerReturnTypeResolutionTestb.J<java.lang.Integer>, EagerReturnTypeResolutionTestb.J<java.lang.Integer>,EagerReturnTypeResolutionTestb.J<java.lang.String>,java.lang.Object)
+EagerReturnTypeResolutionTestb.java:98:30: compiler.err.prob.found.req: (compiler.misc.inferred.do.not.conform.to.upper.bounds: EagerReturnTypeResolutionTestb.J<? extends java.lang.Object&java.io.Serializable&java.lang.Comparable<? extends java.lang.Object&java.io.Serializable&java.lang.Comparable<?>>>, EagerReturnTypeResolutionTestb.I<java.lang.String>,java.lang.Object)
+EagerReturnTypeResolutionTestb.java:99:24: compiler.err.cant.apply.symbol: kindname.method, eq2, java.util.List<T>,java.util.List<T>, java.util.List<EagerReturnTypeResolutionTestb.J<java.lang.String>>,java.util.List<EagerReturnTypeResolutionTestb.J<java.lang.Integer>>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.inferred.do.not.conform.to.eq.bounds: EagerReturnTypeResolutionTestb.J<java.lang.Integer>, EagerReturnTypeResolutionTestb.J<java.lang.Integer>,EagerReturnTypeResolutionTestb.J<java.lang.String>)
+EagerReturnTypeResolutionTestb.java:100:24: compiler.err.cant.apply.symbol: kindname.method, upper2, java.util.List<? super T>,java.util.List<? super T>, java.util.List<EagerReturnTypeResolutionTestb.J<java.lang.String>>,java.util.List<EagerReturnTypeResolutionTestb.J<java.lang.Integer>>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.inferred.do.not.conform.to.upper.bounds: EagerReturnTypeResolutionTestb.J<java.lang.Integer>, EagerReturnTypeResolutionTestb.J<java.lang.Integer>,EagerReturnTypeResolutionTestb.J<java.lang.String>,java.lang.Object)
+EagerReturnTypeResolutionTestb.java:102:15: compiler.err.cant.apply.symbol: kindname.method, eq2, java.util.List<T>,java.util.List<T>, java.util.List<EagerReturnTypeResolutionTestb.J<java.lang.String>>,java.util.List<EagerReturnTypeResolutionTestb.K>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.inferred.do.not.conform.to.eq.bounds: EagerReturnTypeResolutionTestb.K, EagerReturnTypeResolutionTestb.K,EagerReturnTypeResolutionTestb.J<java.lang.String>)
+EagerReturnTypeResolutionTestb.java:103:21: compiler.err.cant.apply.symbol: kindname.method, eq2, java.util.List<T>,java.util.List<T>, java.util.List<EagerReturnTypeResolutionTestb.J<java.lang.String>>,java.util.List<EagerReturnTypeResolutionTestb.K>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.inferred.do.not.conform.to.eq.bounds: EagerReturnTypeResolutionTestb.K, EagerReturnTypeResolutionTestb.K,EagerReturnTypeResolutionTestb.J<java.lang.String>)
+EagerReturnTypeResolutionTestb.java:104:24: compiler.err.cant.apply.symbol: kindname.method, eq2, java.util.List<T>,java.util.List<T>, java.util.List<EagerReturnTypeResolutionTestb.J<java.lang.String>>,java.util.List<EagerReturnTypeResolutionTestb.K>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.inferred.do.not.conform.to.eq.bounds: EagerReturnTypeResolutionTestb.K, EagerReturnTypeResolutionTestb.K,EagerReturnTypeResolutionTestb.J<java.lang.String>)
+EagerReturnTypeResolutionTestb.java:105:15: compiler.err.cant.apply.symbol: kindname.method, eq2, java.util.List<T>,java.util.List<T>, java.util.List<EagerReturnTypeResolutionTestb.J<java.lang.Integer>>,java.util.List<EagerReturnTypeResolutionTestb.K>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.inferred.do.not.conform.to.eq.bounds: EagerReturnTypeResolutionTestb.K, EagerReturnTypeResolutionTestb.K,EagerReturnTypeResolutionTestb.J<java.lang.Integer>)
+EagerReturnTypeResolutionTestb.java:106:9: compiler.err.cant.apply.symbol: kindname.method, takeI, EagerReturnTypeResolutionTestb.I<X>, java.lang.Object&EagerReturnTypeResolutionTestb.J<java.lang.Integer>&EagerReturnTypeResolutionTestb.K, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.inferred.do.not.conform.to.eq.bounds: java.lang.Integer, java.lang.Integer,java.lang.String)
+EagerReturnTypeResolutionTestb.java:108:9: compiler.err.cant.apply.symbol: kindname.method, takeIString, EagerReturnTypeResolutionTestb.I<java.lang.String>, EagerReturnTypeResolutionTestb.I<compiler.misc.type.captureof: 1, ? extends java.lang.Object&java.io.Serializable&java.lang.Comparable<? extends java.lang.Object&java.io.Serializable&java.lang.Comparable<?>>>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inferred.do.not.conform.to.upper.bounds: EagerReturnTypeResolutionTestb.I<? extends java.lang.Object&java.io.Serializable&java.lang.Comparable<? extends java.lang.Object&java.io.Serializable&java.lang.Comparable<?>>>, EagerReturnTypeResolutionTestb.I<java.lang.String>,java.lang.Object))
+EagerReturnTypeResolutionTestb.java:109:21: compiler.err.cant.apply.symbol: kindname.method, eq2, java.util.List<T>,java.util.List<T>, java.util.List<EagerReturnTypeResolutionTestb.J<java.lang.Integer>>,java.util.List<EagerReturnTypeResolutionTestb.K>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.inferred.do.not.conform.to.eq.bounds: EagerReturnTypeResolutionTestb.K, EagerReturnTypeResolutionTestb.K,EagerReturnTypeResolutionTestb.J<java.lang.Integer>)
+EagerReturnTypeResolutionTestb.java:110:9: compiler.err.cant.apply.symbol: kindname.method, takeIString, EagerReturnTypeResolutionTestb.I<java.lang.String>, java.lang.Object&EagerReturnTypeResolutionTestb.J<java.lang.Integer>&EagerReturnTypeResolutionTestb.K, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inferred.do.not.conform.to.upper.bounds: java.lang.Object&EagerReturnTypeResolutionTestb.J<java.lang.Integer>&EagerReturnTypeResolutionTestb.K, EagerReturnTypeResolutionTestb.I<java.lang.String>,EagerReturnTypeResolutionTestb.K,EagerReturnTypeResolutionTestb.J<java.lang.Integer>,java.lang.Object))
+EagerReturnTypeResolutionTestb.java:112:30: compiler.err.prob.found.req: (compiler.misc.inferred.do.not.conform.to.upper.bounds: EagerReturnTypeResolutionTestb.I<? extends java.lang.Object&java.io.Serializable&java.lang.Comparable<? extends java.lang.Object&java.io.Serializable&java.lang.Comparable<?>>>, EagerReturnTypeResolutionTestb.I<java.lang.String>,java.lang.Object)
+EagerReturnTypeResolutionTestb.java:113:24: compiler.err.cant.apply.symbol: kindname.method, eq2, java.util.List<T>,java.util.List<T>, java.util.List<EagerReturnTypeResolutionTestb.J<java.lang.Integer>>,java.util.List<EagerReturnTypeResolutionTestb.K>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.inferred.do.not.conform.to.eq.bounds: EagerReturnTypeResolutionTestb.K, EagerReturnTypeResolutionTestb.K,EagerReturnTypeResolutionTestb.J<java.lang.Integer>)
+EagerReturnTypeResolutionTestb.java:114:30: compiler.err.prob.found.req: (compiler.misc.inferred.do.not.conform.to.upper.bounds: java.lang.Object&EagerReturnTypeResolutionTestb.J<java.lang.Integer>&EagerReturnTypeResolutionTestb.K, EagerReturnTypeResolutionTestb.I<java.lang.String>,EagerReturnTypeResolutionTestb.K,EagerReturnTypeResolutionTestb.J<java.lang.Integer>,java.lang.Object)
+EagerReturnTypeResolutionTestb.java:174:9: compiler.err.cant.apply.symbol: kindname.method, takeLong, long, java.lang.Double, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.infer.no.conforming.instance.exists: , T, long))
+EagerReturnTypeResolutionTestb.java:175:9: compiler.err.cant.apply.symbol: kindname.method, takeLong, long, java.lang.Double, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.infer.no.conforming.instance.exists: , T, long))
+EagerReturnTypeResolutionTestb.java:176:9: compiler.err.cant.apply.symbol: kindname.method, takeLong, long, java.lang.Double, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.infer.no.conforming.instance.exists: , T, long))
+EagerReturnTypeResolutionTestb.java:178:26: compiler.err.prob.found.req: (compiler.misc.infer.no.conforming.instance.exists: , T, long)
+EagerReturnTypeResolutionTestb.java:179:23: compiler.err.prob.found.req: (compiler.misc.infer.no.conforming.instance.exists: , T, long)
+EagerReturnTypeResolutionTestb.java:180:26: compiler.err.prob.found.req: (compiler.misc.infer.no.conforming.instance.exists: , T, long)
+- compiler.note.unchecked.filename: EagerReturnTypeResolutionTestb.java
+- compiler.note.unchecked.recompile
+42 errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/inference/EagerReturnTypeResolution/PrimitiveTypeBoxingTest.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,25 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8030741
+ * @summary Inference: implement eager resolution of return types, consistent with JDK-8028800
+ * @compile/fail/ref=PrimitiveTypeBoxingTest.out -XDrawDiagnostics PrimitiveTypeBoxingTest.java
+ */
+
+public class PrimitiveTypeBoxingTest {
+
+    static void foo(long arg) {}
+    static void bar(int arg) {}
+
+    interface F<X> { void get(X arg); }
+
+    <Z> void m1(F<Z> f, Z arg) {}
+    <Z> void m2(Z arg, F<Z> f) {}
+
+    void test() {
+        m1(PrimitiveTypeBoxingTest::foo, 23); // expected: error
+        m2(23, PrimitiveTypeBoxingTest::foo); // expected: error
+
+        m1(PrimitiveTypeBoxingTest::bar, 23); // expected: success
+        m2(23, PrimitiveTypeBoxingTest::bar); // expected: success
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/inference/EagerReturnTypeResolution/PrimitiveTypeBoxingTest.out	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,3 @@
+PrimitiveTypeBoxingTest.java:19:9: compiler.err.cant.apply.symbol: kindname.method, m1, PrimitiveTypeBoxingTest.F<Z>,Z, @490,int, kindname.class, PrimitiveTypeBoxingTest, (compiler.misc.inferred.do.not.conform.to.upper.bounds: java.lang.Integer, java.lang.Long,java.lang.Object)
+PrimitiveTypeBoxingTest.java:20:9: compiler.err.cant.apply.symbol: kindname.method, m2, Z,PrimitiveTypeBoxingTest.F<Z>, int,@559, kindname.class, PrimitiveTypeBoxingTest, (compiler.misc.inferred.do.not.conform.to.upper.bounds: java.lang.Integer, java.lang.Long,java.lang.Object)
+2 errors
--- a/langtools/test/tools/javac/inference/EagerReturnTypeResolution/EagerReturnTypeResolutionTesta.java	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @bug 8030741
- * @summary Inference: implement eager resolution of return types, consistent with JDK-8028800
- * @compile EagerReturnTypeResolutionTesta.java
- */
-
-public class EagerReturnTypeResolutionTesta {
-
-    abstract class Test1<T>{
-        abstract <S> S foo(S x, S y);
-        <S extends Number & Comparable<? extends Number>> void baz(Test1<S> a){}
-
-        void bar(Test1<Long> x, Test1<Integer> y){
-            baz(foo(x, y));
-        }
-    }
-
-    abstract class Test2<T>{
-        abstract <S> S foo(S x, S y);
-        abstract <S1> void baz(Test2<S1> a);
-
-        void bar(Test2<Integer> y, Test2<Long> x){
-             baz(foo(x, y));
-        }
-    }
-
-    abstract class Test3<T>{
-        abstract <S> S foo(S x, S y);
-        <T extends Number & Comparable<?>,
-                S extends Number & Comparable<? extends T>> void baz(Test3<S> a){}
-
-        void bar(Test3<Long> x, Test3<Integer> y){
-            baz(foo(x, y));
-        }
-    }
-
-    abstract class Test4 {
-        abstract class A0<T> {}
-
-        abstract class A1<T> extends A0<T> {}
-
-        abstract class A2<T> extends A0<T> {}
-
-        abstract <S> S foo(S x, S y);
-        abstract <S1> void baz(A0<S1> a);
-
-        void bar(A2<Integer> y, A1<Long> x){
-             baz(foo(x, y));
-        }
-    }
-
-}
--- a/langtools/test/tools/javac/inference/EagerReturnTypeResolution/EagerReturnTypeResolutionTestb.java	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,182 +0,0 @@
-/*
- * @test /nodynamiccopyright/
- * @bug 8030741
- * @summary Inference: implement eager resolution of return types, consistent with JDK-8028800
- * @compile/fail/ref=EagerReturnTypeResolutionTestb.out -XDrawDiagnostics EagerReturnTypeResolutionTestb.java
- * @author Dan Smith
- */
-
-import java.util.List;
-
-public class EagerReturnTypeResolutionTestb {
-    interface I<S> {}
-    interface J<S> extends I<S> {}
-    interface K extends I<String> {}
-    interface L<S> extends I {}
-
-    <T> T lower(List<? extends T> l) { return null; }
-    <T> T lower2(List<? extends T> l1, List<? extends T> l2) { return null; }
-
-    <T> T upper(List<? super T> l) { return null; }
-    <T> T upper2(List<? super T> l1, List<? super T> l2) { return null; }
-
-    <T> T eq(List<T> l) { return null; }
-    <T> T eq2(List<T> l1, List<T> l2) { return null; }
-
-    <X> void takeI(I<X> i) {}
-    void takeIString(I<String> i) {}
-    I<String> iStringField;
-
-    void takeLong(long arg) {}
-    long longField;
-
-    void testSimpleCaptureOK(List<I<?>> i1) {
-        takeI(lower(i1)); // ok*
-        takeI(eq(i1)); // ok*
-        takeI(upper(i1)); // ok, no capture
-        takeIString(upper(i1)); // ok
-        iStringField = upper(i1); // ok
-    }
-
-    void testSimpleCaptureKO(List<I<?>> i1) {
-        takeIString(lower(i1)); // ERROR
-        takeIString(eq(i1)); // ERROR
-        iStringField = lower(i1); // ERROR
-        iStringField = eq(i1); // ERROR
-    }
-
-    void testMultiCaptureOK(List<I<String>> i1, List<I<Integer>> i2, List<I<?>> i3,
-                          List<J<String>> j1, List<J<Integer>> j2, List<K> k1) {
-        /* Lines marked with JDK-8029002 should be uncommented once this bug is
-         * fixed
-         */
-        takeI(lower2(i1, i2)); // ok*
-        takeI(lower2(i1, i3)); // ok*
-        takeI(upper2(i1, i3)); // ok, no capture*  JDK-8029002
-
-        takeIString(upper2(i1, i3)); // ok, no capture
-        iStringField = upper2(i1, i3); // ok, no capture
-
-        takeI(lower2(j1, j2)); // ok*
-        takeI(lower2(j1, k1)); // ok, no capture
-        takeI(upper2(j1, k1)); // ok, no capture*  JDK-8029002
-
-        takeIString(lower2(j1, k1)); // ok, no capture
-        takeIString(upper2(j1, k1)); // ok, no capture
-
-        iStringField = lower2(j1, k1); // ok, no capture
-        iStringField = upper2(j1, k1); // ok, no capture
-        takeI(lower2(j2, k1)); // ok*
-    }
-
-    void testMultiCaptureKO(List<I<String>> i1, List<I<Integer>> i2, List<I<?>> i3,
-                          List<J<String>> j1, List<J<Integer>> j2, List<K> k1) {
-        takeI(eq2(i1, i2)); // ERROR, bad bounds
-        takeI(upper2(i1, i2)); // ERROR, bad bounds
-
-        takeIString(lower2(i1, i2)); // ERROR
-        takeIString(eq2(i1, i2)); // ERROR, bad bounds
-        takeIString(upper2(i1, i2)); // ERROR, bad bounds
-
-        iStringField = lower2(i1, i2); // ERROR
-        iStringField = eq2(i1, i2); // ERROR, bad bounds
-        iStringField = upper2(i1, i2); // ERROR, bad bounds
-
-        takeI(eq2(i1, i3)); // ERROR, bad bounds
-        takeIString(lower2(i1, i3)); // ERROR
-        takeIString(eq2(i1, i3)); // ERROR, bad bounds
-
-        iStringField = lower2(i1, i3); // ERROR
-        iStringField = eq2(i1, i3); // ERROR, bad bounds
-        takeI(eq2(j1, j2)); // ERROR, bad bounds
-        takeI(upper2(j1, j2)); // ERROR, bad bounds
-
-        takeIString(lower2(j1, j2)); // ERROR
-        takeIString(eq2(j1, j2)); // ERROR, bad bounds
-        takeIString(upper2(j1, j2)); // ERROR, bad bounds
-
-        iStringField = lower2(j1, j2); // ERROR
-        iStringField = eq2(j1, j2); // ERROR, bad bounds
-        iStringField = upper2(j1, j2); // ERROR, bad bounds
-
-        takeI(eq2(j1, k1)); // ERROR, bad bounds
-        takeIString(eq2(j1, k1)); // ERROR, bad bounds
-        iStringField = eq2(j1, k1); // ERROR, bad bounds
-        takeI(eq2(j2, k1)); // ERROR, bad bounds
-        takeI(upper2(j2, k1)); // ERROR, bad bounds; actual: no error, see JDK-8037474
-
-        takeIString(lower2(j2, k1)); // ERROR
-        takeIString(eq2(j2, k1)); // ERROR, bad bounds
-        takeIString(upper2(j2, k1)); // ERROR, bad bounds
-
-        iStringField = lower2(j2, k1); // ERROR
-        iStringField = eq2(j2, k1); // ERROR, bad bounds
-        iStringField = upper2(j2, k1); // ERROR, bad bounds
-    }
-
-    void testRawOK(List<I> i1, List<J> j1, List<L<String>> l1) {
-        takeI(lower(i1)); // ok, unchecked
-        takeI(eq(i1)); // ok, unchecked
-        takeI(upper(i1)); // ok, no capture, not unchecked
-
-        takeIString(lower(i1)); // ok, unchecked
-        takeIString(eq(i1)); // ok, unchecked
-        takeIString(upper(i1)); // ok, no capture, not unchecked
-
-        iStringField = lower(i1); // ok, unchecked
-        iStringField = eq(i1); // ok, unchecked
-        iStringField = upper(i1); // ok, no capture, not unchecked
-
-        takeI(lower(j1)); // ok, unchecked
-        takeI(eq(j1)); // ok, unchecked
-        takeI(upper(j1)); // bad bounds? -- spec is unclear
-
-        takeIString(lower(j1)); // ok, unchecked
-        takeIString(eq(j1)); // ok, unchecked
-        takeIString(upper(j1)); // bad bounds? -- spec is unclear
-
-        iStringField = lower(j1); // ok, unchecked
-        iStringField = eq(j1); // ok, unchecked
-        iStringField = upper(j1); // bad bounds? -- spec is unclear
-
-        takeI(lower(l1)); // ok, unchecked
-        takeI(eq(l1)); // ok, unchecked
-        takeI(upper(l1)); // bad bounds? -- spec is unclear
-
-        takeIString(lower(l1)); // ok, unchecked
-        takeIString(eq(l1)); // ok, unchecked
-        takeIString(upper(l1)); // bad bounds? -- spec is unclear
-
-        iStringField = lower(l1); // ok, unchecked
-        iStringField = eq(l1); // ok, unchecked
-        iStringField = upper(l1); // bad bounds? -- spec is unclear
-    }
-
-    void testPrimOK(List<Integer> i1, List<Long> l1, List<Double> d1) {
-        takeLong(lower(i1)); // ok
-        takeLong(eq(i1)); // ok
-        takeLong(upper(i1)); // ok*
-
-        longField = lower(i1); // ok
-        longField = eq(i1); // ok
-        longField = upper(i1); // ok*
-
-        takeLong(lower(l1)); // ok
-        takeLong(eq(l1)); // ok
-        takeLong(upper(l1)); // ok
-
-        longField = lower(l1); // ok
-        longField = eq(l1); // ok
-        longField = upper(l1); // ok
-    }
-
-    void testPrimKO(List<Integer> i1, List<Long> l1, List<Double> d1) {
-        takeLong(lower(d1)); // ERROR
-        takeLong(eq(d1)); // ERROR
-        takeLong(upper(d1)); // ERROR
-
-        longField = lower(d1); // ERROR
-        longField = eq(d1); // ERROR
-        longField = upper(d1); // ERROR
-    }
-}
--- a/langtools/test/tools/javac/inference/EagerReturnTypeResolution/EagerReturnTypeResolutionTestb.out	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-EagerReturnTypeResolutionTestb.java:42:9: compiler.err.cant.apply.symbol: kindname.method, takeIString, EagerReturnTypeResolutionTestb.I<java.lang.String>, EagerReturnTypeResolutionTestb.I<compiler.misc.type.captureof: 1, ?>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inferred.do.not.conform.to.upper.bounds: EagerReturnTypeResolutionTestb.I<?>, EagerReturnTypeResolutionTestb.I<java.lang.String>,java.lang.Object))
-EagerReturnTypeResolutionTestb.java:43:9: compiler.err.cant.apply.symbol: kindname.method, takeIString, EagerReturnTypeResolutionTestb.I<java.lang.String>, EagerReturnTypeResolutionTestb.I<compiler.misc.type.captureof: 1, ?>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inferred.do.not.conform.to.upper.bounds: EagerReturnTypeResolutionTestb.I<?>, EagerReturnTypeResolutionTestb.I<java.lang.String>,java.lang.Object))
-EagerReturnTypeResolutionTestb.java:44:29: compiler.err.prob.found.req: (compiler.misc.inferred.do.not.conform.to.upper.bounds: EagerReturnTypeResolutionTestb.I<?>, EagerReturnTypeResolutionTestb.I<java.lang.String>,java.lang.Object)
-EagerReturnTypeResolutionTestb.java:45:26: compiler.err.prob.found.req: (compiler.misc.inferred.do.not.conform.to.upper.bounds: EagerReturnTypeResolutionTestb.I<?>, EagerReturnTypeResolutionTestb.I<java.lang.String>,java.lang.Object)
-EagerReturnTypeResolutionTestb.java:74:15: compiler.err.cant.apply.symbol: kindname.method, eq2, java.util.List<T>,java.util.List<T>, java.util.List<EagerReturnTypeResolutionTestb.I<java.lang.String>>,java.util.List<EagerReturnTypeResolutionTestb.I<java.lang.Integer>>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.inferred.do.not.conform.to.eq.bounds: EagerReturnTypeResolutionTestb.I<java.lang.Integer>, EagerReturnTypeResolutionTestb.I<java.lang.Integer>,EagerReturnTypeResolutionTestb.I<java.lang.String>)
-EagerReturnTypeResolutionTestb.java:75:15: compiler.err.cant.apply.symbol: kindname.method, upper2, java.util.List<? super T>,java.util.List<? super T>, java.util.List<EagerReturnTypeResolutionTestb.I<java.lang.String>>,java.util.List<EagerReturnTypeResolutionTestb.I<java.lang.Integer>>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.inferred.do.not.conform.to.upper.bounds: EagerReturnTypeResolutionTestb.I<java.lang.Integer>, EagerReturnTypeResolutionTestb.I<java.lang.Integer>,EagerReturnTypeResolutionTestb.I<java.lang.String>,java.lang.Object)
-EagerReturnTypeResolutionTestb.java:77:9: compiler.err.cant.apply.symbol: kindname.method, takeIString, EagerReturnTypeResolutionTestb.I<java.lang.String>, EagerReturnTypeResolutionTestb.I<compiler.misc.type.captureof: 1, ? extends java.lang.Object&java.io.Serializable&java.lang.Comparable<? extends java.lang.Object&java.io.Serializable&java.lang.Comparable<?>>>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inferred.do.not.conform.to.upper.bounds: EagerReturnTypeResolutionTestb.I<? extends java.lang.Object&java.io.Serializable&java.lang.Comparable<? extends java.lang.Object&java.io.Serializable&java.lang.Comparable<?>>>, EagerReturnTypeResolutionTestb.I<java.lang.String>,java.lang.Object))
-EagerReturnTypeResolutionTestb.java:78:21: compiler.err.cant.apply.symbol: kindname.method, eq2, java.util.List<T>,java.util.List<T>, java.util.List<EagerReturnTypeResolutionTestb.I<java.lang.String>>,java.util.List<EagerReturnTypeResolutionTestb.I<java.lang.Integer>>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.inferred.do.not.conform.to.eq.bounds: EagerReturnTypeResolutionTestb.I<java.lang.Integer>, EagerReturnTypeResolutionTestb.I<java.lang.Integer>,EagerReturnTypeResolutionTestb.I<java.lang.String>)
-EagerReturnTypeResolutionTestb.java:79:21: compiler.err.cant.apply.symbol: kindname.method, upper2, java.util.List<? super T>,java.util.List<? super T>, java.util.List<EagerReturnTypeResolutionTestb.I<java.lang.String>>,java.util.List<EagerReturnTypeResolutionTestb.I<java.lang.Integer>>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.inferred.do.not.conform.to.upper.bounds: EagerReturnTypeResolutionTestb.I<java.lang.Integer>, EagerReturnTypeResolutionTestb.I<java.lang.Integer>,EagerReturnTypeResolutionTestb.I<java.lang.String>,java.lang.Object)
-EagerReturnTypeResolutionTestb.java:81:30: compiler.err.prob.found.req: (compiler.misc.inferred.do.not.conform.to.upper.bounds: EagerReturnTypeResolutionTestb.I<? extends java.lang.Object&java.io.Serializable&java.lang.Comparable<? extends java.lang.Object&java.io.Serializable&java.lang.Comparable<?>>>, EagerReturnTypeResolutionTestb.I<java.lang.String>,java.lang.Object)
-EagerReturnTypeResolutionTestb.java:82:24: compiler.err.cant.apply.symbol: kindname.method, eq2, java.util.List<T>,java.util.List<T>, java.util.List<EagerReturnTypeResolutionTestb.I<java.lang.String>>,java.util.List<EagerReturnTypeResolutionTestb.I<java.lang.Integer>>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.inferred.do.not.conform.to.eq.bounds: EagerReturnTypeResolutionTestb.I<java.lang.Integer>, EagerReturnTypeResolutionTestb.I<java.lang.Integer>,EagerReturnTypeResolutionTestb.I<java.lang.String>)
-EagerReturnTypeResolutionTestb.java:83:24: compiler.err.cant.apply.symbol: kindname.method, upper2, java.util.List<? super T>,java.util.List<? super T>, java.util.List<EagerReturnTypeResolutionTestb.I<java.lang.String>>,java.util.List<EagerReturnTypeResolutionTestb.I<java.lang.Integer>>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.inferred.do.not.conform.to.upper.bounds: EagerReturnTypeResolutionTestb.I<java.lang.Integer>, EagerReturnTypeResolutionTestb.I<java.lang.Integer>,EagerReturnTypeResolutionTestb.I<java.lang.String>,java.lang.Object)
-EagerReturnTypeResolutionTestb.java:85:15: compiler.err.cant.apply.symbol: kindname.method, eq2, java.util.List<T>,java.util.List<T>, java.util.List<EagerReturnTypeResolutionTestb.I<java.lang.String>>,java.util.List<EagerReturnTypeResolutionTestb.I<?>>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.inferred.do.not.conform.to.eq.bounds: EagerReturnTypeResolutionTestb.I<?>, EagerReturnTypeResolutionTestb.I<?>,EagerReturnTypeResolutionTestb.I<java.lang.String>)
-EagerReturnTypeResolutionTestb.java:86:9: compiler.err.cant.apply.symbol: kindname.method, takeIString, EagerReturnTypeResolutionTestb.I<java.lang.String>, EagerReturnTypeResolutionTestb.I<compiler.misc.type.captureof: 1, ?>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inferred.do.not.conform.to.upper.bounds: EagerReturnTypeResolutionTestb.I<?>, EagerReturnTypeResolutionTestb.I<java.lang.String>,java.lang.Object))
-EagerReturnTypeResolutionTestb.java:87:21: compiler.err.cant.apply.symbol: kindname.method, eq2, java.util.List<T>,java.util.List<T>, java.util.List<EagerReturnTypeResolutionTestb.I<java.lang.String>>,java.util.List<EagerReturnTypeResolutionTestb.I<?>>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.inferred.do.not.conform.to.eq.bounds: EagerReturnTypeResolutionTestb.I<?>, EagerReturnTypeResolutionTestb.I<?>,EagerReturnTypeResolutionTestb.I<java.lang.String>)
-EagerReturnTypeResolutionTestb.java:89:30: compiler.err.prob.found.req: (compiler.misc.inferred.do.not.conform.to.upper.bounds: EagerReturnTypeResolutionTestb.I<?>, EagerReturnTypeResolutionTestb.I<java.lang.String>,java.lang.Object)
-EagerReturnTypeResolutionTestb.java:90:24: compiler.err.cant.apply.symbol: kindname.method, eq2, java.util.List<T>,java.util.List<T>, java.util.List<EagerReturnTypeResolutionTestb.I<java.lang.String>>,java.util.List<EagerReturnTypeResolutionTestb.I<?>>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.inferred.do.not.conform.to.eq.bounds: EagerReturnTypeResolutionTestb.I<?>, EagerReturnTypeResolutionTestb.I<?>,EagerReturnTypeResolutionTestb.I<java.lang.String>)
-EagerReturnTypeResolutionTestb.java:91:15: compiler.err.cant.apply.symbol: kindname.method, eq2, java.util.List<T>,java.util.List<T>, java.util.List<EagerReturnTypeResolutionTestb.J<java.lang.String>>,java.util.List<EagerReturnTypeResolutionTestb.J<java.lang.Integer>>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.inferred.do.not.conform.to.eq.bounds: EagerReturnTypeResolutionTestb.J<java.lang.Integer>, EagerReturnTypeResolutionTestb.J<java.lang.Integer>,EagerReturnTypeResolutionTestb.J<java.lang.String>)
-EagerReturnTypeResolutionTestb.java:92:15: compiler.err.cant.apply.symbol: kindname.method, upper2, java.util.List<? super T>,java.util.List<? super T>, java.util.List<EagerReturnTypeResolutionTestb.J<java.lang.String>>,java.util.List<EagerReturnTypeResolutionTestb.J<java.lang.Integer>>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.inferred.do.not.conform.to.upper.bounds: EagerReturnTypeResolutionTestb.J<java.lang.Integer>, EagerReturnTypeResolutionTestb.J<java.lang.Integer>,EagerReturnTypeResolutionTestb.J<java.lang.String>,java.lang.Object)
-EagerReturnTypeResolutionTestb.java:94:9: compiler.err.cant.apply.symbol: kindname.method, takeIString, EagerReturnTypeResolutionTestb.I<java.lang.String>, EagerReturnTypeResolutionTestb.J<compiler.misc.type.captureof: 1, ? extends java.lang.Object&java.io.Serializable&java.lang.Comparable<? extends java.lang.Object&java.io.Serializable&java.lang.Comparable<?>>>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inferred.do.not.conform.to.upper.bounds: EagerReturnTypeResolutionTestb.J<? extends java.lang.Object&java.io.Serializable&java.lang.Comparable<? extends java.lang.Object&java.io.Serializable&java.lang.Comparable<?>>>, EagerReturnTypeResolutionTestb.I<java.lang.String>,java.lang.Object))
-EagerReturnTypeResolutionTestb.java:95:21: compiler.err.cant.apply.symbol: kindname.method, eq2, java.util.List<T>,java.util.List<T>, java.util.List<EagerReturnTypeResolutionTestb.J<java.lang.String>>,java.util.List<EagerReturnTypeResolutionTestb.J<java.lang.Integer>>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.inferred.do.not.conform.to.eq.bounds: EagerReturnTypeResolutionTestb.J<java.lang.Integer>, EagerReturnTypeResolutionTestb.J<java.lang.Integer>,EagerReturnTypeResolutionTestb.J<java.lang.String>)
-EagerReturnTypeResolutionTestb.java:96:21: compiler.err.cant.apply.symbol: kindname.method, upper2, java.util.List<? super T>,java.util.List<? super T>, java.util.List<EagerReturnTypeResolutionTestb.J<java.lang.String>>,java.util.List<EagerReturnTypeResolutionTestb.J<java.lang.Integer>>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.inferred.do.not.conform.to.upper.bounds: EagerReturnTypeResolutionTestb.J<java.lang.Integer>, EagerReturnTypeResolutionTestb.J<java.lang.Integer>,EagerReturnTypeResolutionTestb.J<java.lang.String>,java.lang.Object)
-EagerReturnTypeResolutionTestb.java:98:30: compiler.err.prob.found.req: (compiler.misc.inferred.do.not.conform.to.upper.bounds: EagerReturnTypeResolutionTestb.J<? extends java.lang.Object&java.io.Serializable&java.lang.Comparable<? extends java.lang.Object&java.io.Serializable&java.lang.Comparable<?>>>, EagerReturnTypeResolutionTestb.I<java.lang.String>,java.lang.Object)
-EagerReturnTypeResolutionTestb.java:99:24: compiler.err.cant.apply.symbol: kindname.method, eq2, java.util.List<T>,java.util.List<T>, java.util.List<EagerReturnTypeResolutionTestb.J<java.lang.String>>,java.util.List<EagerReturnTypeResolutionTestb.J<java.lang.Integer>>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.inferred.do.not.conform.to.eq.bounds: EagerReturnTypeResolutionTestb.J<java.lang.Integer>, EagerReturnTypeResolutionTestb.J<java.lang.Integer>,EagerReturnTypeResolutionTestb.J<java.lang.String>)
-EagerReturnTypeResolutionTestb.java:100:24: compiler.err.cant.apply.symbol: kindname.method, upper2, java.util.List<? super T>,java.util.List<? super T>, java.util.List<EagerReturnTypeResolutionTestb.J<java.lang.String>>,java.util.List<EagerReturnTypeResolutionTestb.J<java.lang.Integer>>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.inferred.do.not.conform.to.upper.bounds: EagerReturnTypeResolutionTestb.J<java.lang.Integer>, EagerReturnTypeResolutionTestb.J<java.lang.Integer>,EagerReturnTypeResolutionTestb.J<java.lang.String>,java.lang.Object)
-EagerReturnTypeResolutionTestb.java:102:15: compiler.err.cant.apply.symbol: kindname.method, eq2, java.util.List<T>,java.util.List<T>, java.util.List<EagerReturnTypeResolutionTestb.J<java.lang.String>>,java.util.List<EagerReturnTypeResolutionTestb.K>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.inferred.do.not.conform.to.eq.bounds: EagerReturnTypeResolutionTestb.K, EagerReturnTypeResolutionTestb.K,EagerReturnTypeResolutionTestb.J<java.lang.String>)
-EagerReturnTypeResolutionTestb.java:103:21: compiler.err.cant.apply.symbol: kindname.method, eq2, java.util.List<T>,java.util.List<T>, java.util.List<EagerReturnTypeResolutionTestb.J<java.lang.String>>,java.util.List<EagerReturnTypeResolutionTestb.K>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.inferred.do.not.conform.to.eq.bounds: EagerReturnTypeResolutionTestb.K, EagerReturnTypeResolutionTestb.K,EagerReturnTypeResolutionTestb.J<java.lang.String>)
-EagerReturnTypeResolutionTestb.java:104:24: compiler.err.cant.apply.symbol: kindname.method, eq2, java.util.List<T>,java.util.List<T>, java.util.List<EagerReturnTypeResolutionTestb.J<java.lang.String>>,java.util.List<EagerReturnTypeResolutionTestb.K>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.inferred.do.not.conform.to.eq.bounds: EagerReturnTypeResolutionTestb.K, EagerReturnTypeResolutionTestb.K,EagerReturnTypeResolutionTestb.J<java.lang.String>)
-EagerReturnTypeResolutionTestb.java:105:15: compiler.err.cant.apply.symbol: kindname.method, eq2, java.util.List<T>,java.util.List<T>, java.util.List<EagerReturnTypeResolutionTestb.J<java.lang.Integer>>,java.util.List<EagerReturnTypeResolutionTestb.K>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.inferred.do.not.conform.to.eq.bounds: EagerReturnTypeResolutionTestb.K, EagerReturnTypeResolutionTestb.K,EagerReturnTypeResolutionTestb.J<java.lang.Integer>)
-EagerReturnTypeResolutionTestb.java:106:9: compiler.err.cant.apply.symbol: kindname.method, takeI, EagerReturnTypeResolutionTestb.I<X>, java.lang.Object&EagerReturnTypeResolutionTestb.J<java.lang.Integer>&EagerReturnTypeResolutionTestb.K, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.inferred.do.not.conform.to.eq.bounds: java.lang.Integer, java.lang.Integer,java.lang.String)
-EagerReturnTypeResolutionTestb.java:108:9: compiler.err.cant.apply.symbol: kindname.method, takeIString, EagerReturnTypeResolutionTestb.I<java.lang.String>, EagerReturnTypeResolutionTestb.I<compiler.misc.type.captureof: 1, ? extends java.lang.Object&java.io.Serializable&java.lang.Comparable<? extends java.lang.Object&java.io.Serializable&java.lang.Comparable<?>>>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inferred.do.not.conform.to.upper.bounds: EagerReturnTypeResolutionTestb.I<? extends java.lang.Object&java.io.Serializable&java.lang.Comparable<? extends java.lang.Object&java.io.Serializable&java.lang.Comparable<?>>>, EagerReturnTypeResolutionTestb.I<java.lang.String>,java.lang.Object))
-EagerReturnTypeResolutionTestb.java:109:21: compiler.err.cant.apply.symbol: kindname.method, eq2, java.util.List<T>,java.util.List<T>, java.util.List<EagerReturnTypeResolutionTestb.J<java.lang.Integer>>,java.util.List<EagerReturnTypeResolutionTestb.K>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.inferred.do.not.conform.to.eq.bounds: EagerReturnTypeResolutionTestb.K, EagerReturnTypeResolutionTestb.K,EagerReturnTypeResolutionTestb.J<java.lang.Integer>)
-EagerReturnTypeResolutionTestb.java:110:9: compiler.err.cant.apply.symbol: kindname.method, takeIString, EagerReturnTypeResolutionTestb.I<java.lang.String>, java.lang.Object&EagerReturnTypeResolutionTestb.J<java.lang.Integer>&EagerReturnTypeResolutionTestb.K, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inferred.do.not.conform.to.upper.bounds: java.lang.Object&EagerReturnTypeResolutionTestb.J<java.lang.Integer>&EagerReturnTypeResolutionTestb.K, EagerReturnTypeResolutionTestb.I<java.lang.String>,EagerReturnTypeResolutionTestb.K,EagerReturnTypeResolutionTestb.J<java.lang.Integer>,java.lang.Object))
-EagerReturnTypeResolutionTestb.java:112:30: compiler.err.prob.found.req: (compiler.misc.inferred.do.not.conform.to.upper.bounds: EagerReturnTypeResolutionTestb.I<? extends java.lang.Object&java.io.Serializable&java.lang.Comparable<? extends java.lang.Object&java.io.Serializable&java.lang.Comparable<?>>>, EagerReturnTypeResolutionTestb.I<java.lang.String>,java.lang.Object)
-EagerReturnTypeResolutionTestb.java:113:24: compiler.err.cant.apply.symbol: kindname.method, eq2, java.util.List<T>,java.util.List<T>, java.util.List<EagerReturnTypeResolutionTestb.J<java.lang.Integer>>,java.util.List<EagerReturnTypeResolutionTestb.K>, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.inferred.do.not.conform.to.eq.bounds: EagerReturnTypeResolutionTestb.K, EagerReturnTypeResolutionTestb.K,EagerReturnTypeResolutionTestb.J<java.lang.Integer>)
-EagerReturnTypeResolutionTestb.java:114:30: compiler.err.prob.found.req: (compiler.misc.inferred.do.not.conform.to.upper.bounds: java.lang.Object&EagerReturnTypeResolutionTestb.J<java.lang.Integer>&EagerReturnTypeResolutionTestb.K, EagerReturnTypeResolutionTestb.I<java.lang.String>,EagerReturnTypeResolutionTestb.K,EagerReturnTypeResolutionTestb.J<java.lang.Integer>,java.lang.Object)
-EagerReturnTypeResolutionTestb.java:174:9: compiler.err.cant.apply.symbol: kindname.method, takeLong, long, java.lang.Double, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.infer.no.conforming.instance.exists: , T, long))
-EagerReturnTypeResolutionTestb.java:175:9: compiler.err.cant.apply.symbol: kindname.method, takeLong, long, java.lang.Double, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.infer.no.conforming.instance.exists: , T, long))
-EagerReturnTypeResolutionTestb.java:176:9: compiler.err.cant.apply.symbol: kindname.method, takeLong, long, java.lang.Double, kindname.class, EagerReturnTypeResolutionTestb, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.infer.no.conforming.instance.exists: , T, long))
-EagerReturnTypeResolutionTestb.java:178:26: compiler.err.prob.found.req: (compiler.misc.infer.no.conforming.instance.exists: , T, long)
-EagerReturnTypeResolutionTestb.java:179:23: compiler.err.prob.found.req: (compiler.misc.infer.no.conforming.instance.exists: , T, long)
-EagerReturnTypeResolutionTestb.java:180:26: compiler.err.prob.found.req: (compiler.misc.infer.no.conforming.instance.exists: , T, long)
-- compiler.note.unchecked.filename: EagerReturnTypeResolutionTestb.java
-- compiler.note.unchecked.recompile
-42 errors
--- a/langtools/test/tools/javac/inference/EagerReturnTypeResolution/PrimitiveTypeBoxingTest.java	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-/*
- * @test /nodynamiccopyright/
- * @bug 8030741
- * @summary Inference: implement eager resolution of return types, consistent with JDK-8028800
- * @compile/fail/ref=PrimitiveTypeBoxingTest.out -XDrawDiagnostics PrimitiveTypeBoxingTest.java
- */
-
-public class PrimitiveTypeBoxingTest {
-
-    static void foo(long arg) {}
-    static void bar(int arg) {}
-
-    interface F<X> { void get(X arg); }
-
-    <Z> void m1(F<Z> f, Z arg) {}
-    <Z> void m2(Z arg, F<Z> f) {}
-
-    void test() {
-        m1(PrimitiveTypeBoxingTest::foo, 23); // expected: error
-        m2(23, PrimitiveTypeBoxingTest::foo); // expected: error
-
-        m1(PrimitiveTypeBoxingTest::bar, 23); // expected: success
-        m2(23, PrimitiveTypeBoxingTest::bar); // expected: success
-    }
-}
--- a/langtools/test/tools/javac/inference/EagerReturnTypeResolution/PrimitiveTypeBoxingTest.out	Mon Jun 02 15:49:53 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-PrimitiveTypeBoxingTest.java:19:9: compiler.err.cant.apply.symbol: kindname.method, m1, PrimitiveTypeBoxingTest.F<Z>,Z, @490,int, kindname.class, PrimitiveTypeBoxingTest, (compiler.misc.inferred.do.not.conform.to.upper.bounds: java.lang.Integer, java.lang.Long,java.lang.Object)
-PrimitiveTypeBoxingTest.java:20:9: compiler.err.cant.apply.symbol: kindname.method, m2, Z,PrimitiveTypeBoxingTest.F<Z>, int,@559, kindname.class, PrimitiveTypeBoxingTest, (compiler.misc.inferred.do.not.conform.to.upper.bounds: java.lang.Integer, java.lang.Long,java.lang.Object)
-2 errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/jvm/ClassRefDupInConstantPoolTest.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8015927
+ * @summary Class reference duplicates in constant pool
+ * @clean ClassRefDupInConstantPoolTest$Duplicates.class
+ * @run main ClassRefDupInConstantPoolTest
+ */
+
+import java.util.TreeSet;
+
+import com.sun.tools.classfile.*;
+import com.sun.tools.classfile.ConstantPool.*;
+
+public class ClassRefDupInConstantPoolTest {
+    public static void main(String[] args) throws Exception {
+        ClassFile cls = ClassFile.read(ClassRefDupInConstantPoolTest.class.
+                                       getResourceAsStream("ClassRefDupInConstantPoolTest$Duplicates.class"));
+        ConstantPool pool = cls.constant_pool;
+
+        int duplicates = 0;
+        TreeSet<Integer> set = new TreeSet<>();
+        for (CPInfo i : pool.entries()) {
+            if (i.getTag() == ConstantPool.CONSTANT_Class) {
+                CONSTANT_Class_info ci = (CONSTANT_Class_info)i;
+                if (!set.add(ci.name_index)) {
+                    duplicates++;
+                    System.out.println("DUPLICATE CLASS REF " + ci.getName());
+                }
+            }
+        }
+        if (duplicates > 0)
+            throw new Exception("Test Failed");
+    }
+
+    class Duplicates {
+        String concat(String s1, String s2) {
+            return s1 + (s2 == s1 ? " " : s2);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/T8031967.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,137 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8031967
+ * @summary Ensure javac can handle very deeply nested chain of method invocations occurring as
+ *          a parameter to other method invocations.
+ * @run main T8031967
+ */
+
+import java.io.IOException;
+import java.net.URI;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.tools.DiagnosticListener;
+import javax.tools.JavaCompiler;
+import javax.tools.JavaFileObject;
+import javax.tools.SimpleJavaFileObject;
+import javax.tools.ToolProvider;
+
+import com.sun.source.util.JavacTask;
+
+public class T8031967 {
+
+    public static void main(String... args) throws IOException {
+        new T8031967().run();
+    }
+
+    final int depth = 50;
+
+    private void run() throws IOException {
+        runTestCase(true);
+        runTestCase(false);
+    }
+
+    private void runTestCase(boolean withErrors) throws IOException {
+        StringBuilder code = new StringBuilder();
+
+        code.append("public class Test {\n" +
+                    "    private void test() {\n" +
+                    "        GroupLayout l = new GroupLayout();\n" +
+                    "        l.setHorizontalGroup(\n");
+
+        gen(code, depth);
+        code.append("        );\n" +
+                    "    }\n");
+        if (!withErrors) {
+            code.append("    class GroupLayout {\n" +
+                        "        ParallelGroup createParallelGroup() {return null;}\n" +
+                        "        ParallelGroup createParallelGroup(int i) {return null;}\n" +
+                        "        ParallelGroup createParallelGroup(int i, int j) {return null;}\n" +
+                        "        void setHorizontalGroup(Group g) { }\n" +
+                        "    }\n" +
+                        "    \n" +
+                        "    class Group {\n" +
+                        "        Group addGroup(Group g) { return this; }\n" +
+                        "        Group addGroup(int i, Group g) { return this; }\n" +
+                        "        Group addGap(int i) { return this; }\n" +
+                        "        Group addGap(long l) { return this; }\n" +
+                        "        Group addGap(int i, int j) { return this; }\n" +
+                        "        Group addComponent(Object c) { return this; }\n" +
+                        "        Group addComponent(int i, Object c) { return this; }\n" +
+                        "    }\n" +
+                        "    class ParallelGroup extends Group {\n" +
+                        "        Group addGroup(Group g) { return this; }\n" +
+                        "        Group addGroup(int i, Group g) { return this; }\n" +
+                        "        Group addGap(int i) { return this; }\n" +
+                        "        Group addGap(int i, int j) { return this; }\n" +
+                        "        Group addComponent(Object c) { return this; }\n" +
+                        "        Group addComponent(int i, Object c) { return this; }\n" +
+                        "    }\n");
+        }
+
+        code.append("}\n");
+
+        JavaSource source = new JavaSource(code.toString());
+        List<JavaSource> sourceList = Arrays.asList(source);
+        JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
+        DiagnosticListener<JavaFileObject> noErrors = (diagnostic) -> {
+            throw new IllegalStateException("Should not produce errors: " + diagnostic);
+        };
+        JavacTask task = (JavacTask) compiler.getTask(null, null, withErrors ? null : noErrors,
+                null, null, sourceList);
+
+        task.analyze();
+    }
+
+    private void gen(StringBuilder code, int depth) {
+        code.append("l.createParallelGroup()\n");
+        if (depth > 0) {
+            code.append(".addGroup(\n");
+            gen(code, depth - 1);
+            code.append(")");
+        }
+
+        code.append(".addGap(1)\n" +
+                    ".addComponent(new Object())\n" +
+                    ".addGap(1)\n" +
+                    ".addComponent(new Object())");
+    }
+
+    class JavaSource extends SimpleJavaFileObject {
+
+        final String code;
+        public JavaSource(String code) {
+            super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE);
+            this.code = code;
+        }
+
+        @Override
+        public CharSequence getCharContent(boolean ignoreEncodingErrors) {
+            return code;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/T8041704/ErrorMessageTest.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,12 @@
+/**
+ * @test /nodynamiccopyright/
+ * @bug 8041704
+ * @summary wrong error message when mixing lambda expression and inner class
+ * @compile/fail/ref=ErrorMessageTest.out -XDrawDiagnostics ErrorMessageTest.java
+ */
+
+public class ErrorMessageTest {
+    void f(Runnable r) {
+        f(() -> { f(new MISSING() { public void run() {} }); });
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/T8041704/ErrorMessageTest.out	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,2 @@
+ErrorMessageTest.java:10:25: compiler.err.cant.resolve.location: kindname.class, MISSING, , , (compiler.misc.location: kindname.class, ErrorMessageTest, null)
+1 error
--- a/langtools/test/tools/javac/lambda/TargetType23.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/langtools/test/tools/javac/lambda/TargetType23.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,6 +1,6 @@
 /*
  * @test /nodynamiccopyright/
- * @bug 8003280
+ * @bug 8003280 8034223
  * @summary Add lambda tests
  *  check case of ambiguous method call with lambda whose body cannot
             complete normally
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/types/BadSigTest.java	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8037934
+ * @summary Javac generates invalid signatures for local types
+ * @run main BadSigTest
+ */
+
+public class BadSigTest<Outer> {
+    void m(){
+        class Local1{}
+        class Local2 extends Local1{}
+        Local2.class.getTypeParameters();
+    }
+    public static void main(String[] args) {
+        new BadSigTest().m();
+    }
+}
--- a/langtools/test/tools/javac/util/StringUtilsTest.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/langtools/test/tools/javac/util/StringUtilsTest.java	Mon Jun 02 13:53:52 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /**
  * @test
- * @bug 8029800
+ * @bug 8029800 8043186
  * @summary Unit test StringUtils
  * @run main StringUtilsTest
  */
@@ -44,12 +44,14 @@
         assertEquals("\u0131", "I".toLowerCase());
         assertEquals("\u0130", "i".toUpperCase());
 
-        //verify the StringUtils does what it should
+        //verify the StringUtils.toLowerCase/toUpperCase do what they should:
         assertEquals("i", StringUtils.toLowerCase("I"));
         assertEquals("I", StringUtils.toUpperCase("i"));
 
-        //verify we can use index from indexOf of toLowerCase String in the original:
-        assertEquals(2, StringUtils.toLowerCase("\u0130\u0130lookFor").indexOf("lookfor"));
+        //verify StringUtils.caseInsensitiveIndexOf works:
+        assertEquals(2, StringUtils.indexOfIgnoreCase("  lookFor", "lookfor"));
+        assertEquals(11, StringUtils.indexOfIgnoreCase("  lookFor  LOOKfor", "lookfor", 11));
+        assertEquals(2, StringUtils.indexOfIgnoreCase("\u0130\u0130lookFor", "lookfor"));
     }
 
     void assertEquals(String expected, String actual) {
--- a/make/Jprt.gmk	Mon Jun 02 15:49:53 2014 -0400
+++ b/make/Jprt.gmk	Mon Jun 02 13:53:52 2014 -0700
@@ -23,8 +23,22 @@
 # questions.
 #
 
-# This file is contains targets utilities needed by JPRT.
+# This file contains targets and utilities needed by JPRT.
 
+# Cygpath is only defined when running on Cygwin
+ifneq ($(CYGPATH), )
+  # If we get JPRT_ARCHIVE_*BUNDLE externally, make sure they have /cygdrive
+  # style paths
+  ifdef JPRT_ARCHIVE_BUNDLE
+    override JPRT_ARCHIVE_BUNDLE := $(shell $(CYGPATH) -u $(JPRT_ARCHIVE_BUNDLE))
+  endif
+  ifdef JPRT_ARCHIVE_INSTALL_BUNDLE
+    override JPRT_ARCHIVE_INSTALL_BUNDLE := $(shell $(CYGPATH) -u $(JPRT_ARCHIVE_INSTALL_BUNDLE))
+  endif
+endif
+
+# When running in JPRT these will be provided. Need defaults so that this makefile
+# is valid anyway.
 ifndef JPRT_ARCHIVE_BUNDLE
   JPRT_ARCHIVE_BUNDLE=/tmp/jprt_bundles/j2sdk-image.zip
 endif
--- a/nashorn/.hgtags	Mon Jun 02 15:49:53 2014 -0400
+++ b/nashorn/.hgtags	Mon Jun 02 13:53:52 2014 -0700
@@ -247,3 +247,5 @@
 4d60c3292e14aac90dc3b8232496ba4af4254cc3 jdk9-b11
 282e9a675e079cc84dbfaa4c10050f08397faab0 jdk9-b12
 be4580ae56e2ef0ce521d3f840753eaa83cacf33 jdk9-b13
+806df06b6ac58d3e9c9c6a680dbdd7a6c94ca700 jdk9-b14
+32b66f4661eac52f8b04fb3d7703feb2c96febb7 jdk9-b15
--- a/nashorn/make/build.xml	Mon Jun 02 15:49:53 2014 -0400
+++ b/nashorn/make/build.xml	Mon Jun 02 13:53:52 2014 -0700
@@ -196,14 +196,16 @@
     </jar>
   </target>
 
-  <target name="javadoc" depends="prepare">
-    <javadoc destdir="${dist.javadoc.dir}" use="yes" overview="src/overview.html" windowtitle="${nashorn.product.name} ${nashorn.version}" additionalparam="-quiet" failonerror="true">
+  <target name="javadoc" depends="jar">
+    <javadoc destdir="${dist.javadoc.dir}" use="yes" overview="src/overview.html" 
+        extdirs="${nashorn.ext.path}" windowtitle="${nashorn.product.name} ${nashorn.version}"
+        additionalparam="-quiet" failonerror="true">
       <classpath>
         <pathelement location="${build.classes.dir}"/>
       </classpath>
       <fileset dir="${src.dir}" includes="**/*.java"/>
       <fileset dir="${jdk.asm.src.dir}" includes="**/*.java"/>
-      <link href="http://docs.oracle.com/javase/7/docs/api/"/>
+      <link href="http://docs.oracle.com/javase/8/docs/api/"/>
       <!-- The following tags are used only in ASM sources - just ignore these -->
       <tag name="label" description="label tag in ASM sources" enabled="false"/>
       <tag name="linked" description="linked tag in ASM sources" enabled="false"/>
@@ -211,6 +213,19 @@
     </javadoc>
   </target>
 
+  <!-- generate javadoc only for nashorn extension api classes -->
+  <target name="javadocapi" depends="jar">
+    <javadoc destdir="${dist.javadoc.dir}" use="yes" extdirs="${nashorn.ext.path}" 
+        windowtitle="${nashorn.product.name}" additionalparam="-quiet" failonerror="true">
+      <classpath>
+        <pathelement location="${build.classes.dir}"/>
+      </classpath>
+      <fileset dir="${src.dir}" includes="jdk/nashorn/api/**/*.java"/>
+      <link href="http://docs.oracle.com/javase/8/docs/api/"/>
+    </javadoc>
+  </target>
+
+
   <!-- generate shell.html for shell tool documentation -->
   <target name="shelldoc" depends="jar">
     <java classname="${nashorn.shell.tool}" dir="${basedir}" output="${dist.dir}/shell.html" failonerror="true" fork="true">
@@ -360,6 +375,10 @@
       <include name="**/framework/*Test.class"/>
     </fileset>
 
+    <fileset id="test.nosecurity.classes" dir="${build.test.classes.dir}">
+      <include name="**/framework/ScriptTest.class"/>
+    </fileset>
+
     <testng outputdir="${build.test.results.dir}" classfilesetref="test.classes"
        verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
       <jvmarg line="${ext.class.path}"/>
@@ -376,6 +395,21 @@
           <pathelement path="${run.test.classpath}"/>
       </classpath>
     </testng>
+    <testng outputdir="${build.nosecurity.test.results.dir}" classfilesetref="test.nosecurity.classes"
+       verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
+      <jvmarg line="${ext.class.path}"/>
+      <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx}"/>
+      <propertyset>
+        <propertyref prefix="nashorn."/>
+      </propertyset>
+      <propertyset>
+        <propertyref prefix="test-sys-prop-no-security."/>
+        <mapper from="test-sys-prop-no-security.*" to="*" type="glob"/>
+      </propertyset>
+      <classpath>
+          <pathelement path="${run.test.classpath}"/>
+      </classpath>
+    </testng>
   </target>
 
   <target name="test-basicparallel" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file">
--- a/nashorn/make/project.properties	Mon Jun 02 15:49:53 2014 -0400
+++ b/nashorn/make/project.properties	Mon Jun 02 13:53:52 2014 -0700
@@ -59,6 +59,7 @@
 
 # test results directory
 build.test.results.dir=${build.dir}/test/reports
+build.nosecurity.test.results.dir=${build.dir}/test/nosecurity/reports
 
 # This directory is removed when the project is cleaned:
 dist.dir=dist
@@ -113,6 +114,7 @@
 
 # test scripts to run
 test.dir=test
+test.nosecurity.dir=test/script/nosecurity
 test.script.dir=test/script
 test.basic.dir=test/script/basic
 test.maptests.dir=test/script/maptests
@@ -131,8 +133,12 @@
 test-sys-prop.es5conform.testcases.dir=${test.external.dir}/ES5Conform/TestCases
 test-sys-prop.test.basic.dir=${test.basic.dir}
 
+test-sys-prop-no-security.test.dir=${test.dir}
+test-sys-prop-no-security.test.js.roots=${test.nosecurity.dir}
+
 # framework root for our script tests
 test-sys-prop.test.js.framework=${test.script.dir}/assert.js
+test-sys-prop-no-security.test.js.framework=${test.script.dir}/assert.js
 
 # Control the verbosity of ParserTest
 test-sys-prop.parsertest.verbose=false
@@ -259,7 +265,7 @@
 test.src.dir=test/src
 
 # -Xmx is used for all tests, -Xms only for octane benchmark
-run.test.xmx=3G
+run.test.xmx=2G
 run.test.xms=2G
 
 run.test.user.language=tr
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/samples/filebrowser.js	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,100 @@
+#// Usage: jjs -fx filebrowser.js -- <start_dir>
+
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   - Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 
+ *   - Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 
+ *   - Neither the name of Oracle nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// Uses -fx and javafx TreeView to visualize directories
+if (!$OPTIONS._fx) {
+    print("Usage: jjs -fx filebrowser.js -- <start_dir>");
+    exit(1);
+}
+
+// Java classes used
+var File = Java.type("java.io.File");
+var Files = Java.type("java.nio.file.Files");
+
+// check directory argument, if passed
+var dir = arguments.length > 0? new File(arguments[0]) : new File(".");
+if (! dir.isDirectory()) {
+    print(dir + " is not a directory!");
+    exit(2);
+}
+
+// JavaFX classes used
+var FXCollections = Java.type("javafx.collections.FXCollections");
+var Scene     = Java.type("javafx.scene.Scene");
+var TreeItem  = Java.type("javafx.scene.control.TreeItem");
+var TreeView  = Java.type("javafx.scene.control.TreeView");
+
+// create a subclass of JavaFX TreeItem class
+var LazyTreeItem = Java.extend(TreeItem);
+
+// lazily filling children of a directory LazyTreeItem
+function buildChildren(dir) {
+    var children = FXCollections.observableArrayList();
+    var stream = Files.list(dir.toPath());
+    stream.forEach(function(path) {
+        var file = path.toFile();
+        var item = file.isDirectory()?
+            makeLazyTreeItem(file) : new TreeItem(file.name);
+        children.add(item);
+    });
+    stream.close();
+    return children;
+}
+
+// create an instance LazyTreeItem with override methods
+function makeLazyTreeItem(dir) {
+    var item = new LazyTreeItem(dir.name) {
+        expanded: false,
+        isLeaf: function() false,
+        getChildren: function() {
+            if (! this.expanded) {
+                // call super class (TreeItem) method
+                Java.super(item).getChildren().setAll(buildChildren(dir));
+                this.expanded = true;
+            }
+            // call super class (TreeItem) method
+            return Java.super(item).getChildren();
+        }
+    }
+    return item;
+}
+
+// JavaFX start method
+function start(stage) {
+    stage.title = dir.absolutePath;
+    var rootItem = makeLazyTreeItem(dir);
+    rootItem.expanded = true;
+    var tree = new TreeView(rootItem);
+    stage.scene = new Scene(tree, 300, 450);
+    stage.show();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/samples/word_histogram.js	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,53 @@
+#nashorn word histogram of a file
+
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   - Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 
+ *   - Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 
+ *   - Neither the name of Oracle nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This example demonstrates how to print word histogram
+ * of a given text file using regex, array and JSON
+ * functions.
+ */
+
+if (arguments.length < 1) {
+    print("Usage: jjs -scripting word_histogram.js -- <file>");
+    exit(1);
+}
+
+var obj = {};
+
+readFully(arguments[0]).
+    split(/[^\w+]/).
+    forEach(function(x)
+      (x in obj? obj[x]++ : obj[x] = 1));
+
+print(JSON.stringify(obj));
+
--- a/nashorn/src/jdk/nashorn/api/scripting/ScriptObjectMirror.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/nashorn/src/jdk/nashorn/api/scripting/ScriptObjectMirror.java	Mon Jun 02 13:53:52 2014 -0700
@@ -621,6 +621,7 @@
     /**
      * Utilitity to convert this script object to the given type.
      *
+     * @param <T> destination type to convert to
      * @param type destination type to convert to
      * @return converted object
      */
--- a/nashorn/src/jdk/nashorn/api/scripting/package-info.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/nashorn/src/jdk/nashorn/api/scripting/package-info.java	Mon Jun 02 13:53:52 2014 -0700
@@ -32,7 +32,8 @@
  * ScriptEngine nashornEngine = new ScriptEngineManager().getEngineByName("Nashorn");
  * </pre>
  * <p>Nashorn script engines implement the optional {@link javax.script.Invocable} and {@link javax.script.Compilable}
- * interfaces, allowing for efficient pre-compilation and repeated execution of scripts. See
+ * interfaces, allowing for efficient pre-compilation and repeated execution of scripts. In addition,
+ * this package provides nashorn specific extension classes, interfaces and methods. See
  * {@link jdk.nashorn.api.scripting.NashornScriptEngineFactory} for further details.
  */
 package jdk.nashorn.api.scripting;
--- a/nashorn/src/jdk/nashorn/internal/ir/annotations/Reference.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/nashorn/src/jdk/nashorn/internal/ir/annotations/Reference.java	Mon Jun 02 13:53:52 2014 -0700
@@ -32,9 +32,7 @@
  * Reference node in AST, i.e. anything not a copy. Important for
  * AST traversal and cloning. Cloning currently as a rule uses
  * existingOrSame for references and otherwise existingOrCopy
- * <p>
  */
-
 @Retention(value=RetentionPolicy.RUNTIME)
 public @interface Reference {
     // EMPTY
--- a/nashorn/src/jdk/nashorn/internal/runtime/linker/Bootstrap.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/nashorn/src/jdk/nashorn/internal/runtime/linker/Bootstrap.java	Mon Jun 02 13:53:52 2014 -0700
@@ -61,9 +61,17 @@
     private static final DynamicLinker dynamicLinker;
     static {
         final DynamicLinkerFactory factory = new DynamicLinkerFactory();
-        factory.setPrioritizedLinkers(new NashornLinker(), new NashornPrimitiveLinker(), new NashornStaticClassLinker(),
-                new BoundDynamicMethodLinker(), new JavaSuperAdapterLinker(), new JSObjectLinker(), new ReflectionCheckLinker());
-        factory.setFallbackLinkers(new NashornBeansLinker(), new NashornBottomLinker());
+        final NashornBeansLinker nashornBeansLinker = new NashornBeansLinker();
+        final JSObjectLinker jsObjectLinker = new JSObjectLinker(nashornBeansLinker);
+        factory.setPrioritizedLinkers(
+            new NashornLinker(),
+            new NashornPrimitiveLinker(),
+            new NashornStaticClassLinker(),
+            new BoundDynamicMethodLinker(),
+            new JavaSuperAdapterLinker(),
+            jsObjectLinker,
+            new ReflectionCheckLinker());
+        factory.setFallbackLinkers(nashornBeansLinker, new NashornBottomLinker());
         factory.setSyncOnRelink(true);
         final int relinkThreshold = Options.getIntProperty("nashorn.unstable.relink.threshold", -1);
         if (relinkThreshold > -1) {
--- a/nashorn/src/jdk/nashorn/internal/runtime/linker/JSObjectLinker.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/nashorn/src/jdk/nashorn/internal/runtime/linker/JSObjectLinker.java	Mon Jun 02 13:53:52 2014 -0700
@@ -30,6 +30,7 @@
 import java.lang.invoke.MethodType;
 import java.util.HashMap;
 import java.util.Map;
+import javax.script.Bindings;
 import jdk.internal.dynalink.CallSiteDescriptor;
 import jdk.internal.dynalink.linker.GuardedInvocation;
 import jdk.internal.dynalink.linker.GuardedTypeConversion;
@@ -48,14 +49,23 @@
  * as ScriptObjects from other Nashorn contexts.
  */
 final class JSObjectLinker implements TypeBasedGuardingDynamicLinker, GuardingTypeConverterFactory {
+    private final NashornBeansLinker nashornBeansLinker;
+
+    JSObjectLinker(final NashornBeansLinker nashornBeansLinker) {
+        this.nashornBeansLinker = nashornBeansLinker;
+    }
+
     @Override
     public boolean canLinkType(final Class<?> type) {
         return canLinkTypeStatic(type);
     }
 
     static boolean canLinkTypeStatic(final Class<?> type) {
-        // can link JSObject
-        return JSObject.class.isAssignableFrom(type);
+        // can link JSObject also handles Map, Bindings to make
+        // sure those are not JSObjects.
+        return Map.class.isAssignableFrom(type) ||
+               Bindings.class.isAssignableFrom(type) ||
+               JSObject.class.isAssignableFrom(type);
     }
 
     @Override
@@ -72,6 +82,11 @@
         final GuardedInvocation inv;
         if (self instanceof JSObject) {
             inv = lookup(desc);
+        } else if (self instanceof Map || self instanceof Bindings) {
+            // guard to make sure the Map or Bindings does not turn into JSObject later!
+            final GuardedInvocation beanInv = nashornBeansLinker.getGuardedInvocation(request, linkerServices);
+            inv = new GuardedInvocation(beanInv.getInvocation(),
+                NashornGuards.combineGuards(beanInv.getGuard(), NashornGuards.getNotJSObjectGuard()));
         } else {
             throw new AssertionError(); // Should never reach here.
         }
--- a/nashorn/src/jdk/nashorn/internal/runtime/linker/NashornGuards.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/nashorn/src/jdk/nashorn/internal/runtime/linker/NashornGuards.java	Mon Jun 02 13:53:52 2014 -0700
@@ -31,6 +31,7 @@
 import java.lang.invoke.MethodHandles;
 import java.lang.ref.WeakReference;
 import jdk.internal.dynalink.CallSiteDescriptor;
+import jdk.nashorn.api.scripting.JSObject;
 import jdk.nashorn.internal.codegen.ObjectClassGenerator;
 import jdk.nashorn.internal.objects.Global;
 import jdk.nashorn.internal.runtime.Property;
@@ -43,6 +44,7 @@
  */
 public final class NashornGuards {
     private static final MethodHandle IS_SCRIPTOBJECT   = findOwnMH("isScriptObject", boolean.class, Object.class);
+    private static final MethodHandle IS_NOT_JSOBJECT   = findOwnMH("isNotJSObject", boolean.class, Object.class);
     private static final MethodHandle IS_SCRIPTFUNCTION = findOwnMH("isScriptFunction", boolean.class, Object.class);
     private static final MethodHandle IS_MAP            = findOwnMH("isMap", boolean.class, Object.class, PropertyMap.class);
     private static final MethodHandle SAME_OBJECT       = findOwnMH("sameObject", boolean.class, Object.class, WeakReference.class);
@@ -61,6 +63,14 @@
     }
 
     /**
+     * Get the guard that checks if an item is not a {@code JSObject}
+     * @return method handle for guard
+     */
+    public static MethodHandle getNotJSObjectGuard() {
+        return IS_NOT_JSOBJECT;
+    }
+
+    /**
      * Get the guard that checks if an item is a {@code ScriptFunction}
      * @return method handle for guard
      */
@@ -157,6 +167,11 @@
     }
 
     @SuppressWarnings("unused")
+    private static boolean isNotJSObject(final Object self) {
+        return !(self instanceof JSObject);
+    }
+
+    @SuppressWarnings("unused")
     private static boolean isScriptFunction(final Object self) {
         return self instanceof ScriptFunction;
     }
--- a/nashorn/src/jdk/nashorn/internal/runtime/linker/NashornStaticClassLinker.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/nashorn/src/jdk/nashorn/internal/runtime/linker/NashornStaticClassLinker.java	Mon Jun 02 13:53:52 2014 -0700
@@ -25,6 +25,7 @@
 
 package jdk.nashorn.internal.runtime.linker;
 
+import java.lang.reflect.Modifier;
 import jdk.internal.dynalink.CallSiteDescriptor;
 import jdk.internal.dynalink.beans.BeansLinker;
 import jdk.internal.dynalink.beans.StaticClass;
@@ -65,10 +66,15 @@
             return null;
         }
         final Class<?> receiverClass = ((StaticClass) self).getRepresentedClass();
+
         Bootstrap.checkReflectionAccess(receiverClass, true);
         final CallSiteDescriptor desc = request.getCallSiteDescriptor();
         // We intercept "new" on StaticClass instances to provide additional capabilities
         if ("new".equals(desc.getNameToken(CallSiteDescriptor.OPERATOR))) {
+            if (! Modifier.isPublic(receiverClass.getModifiers())) {
+                throw ECMAErrors.typeError("new.on.nonpublic.javatype", receiverClass.getName());
+            }
+
             // make sure new is on accessible Class
             Context.checkPackageAccess(receiverClass);
 
--- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/Analyser.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/Analyser.java	Mon Jun 02 13:53:52 2014 -0700
@@ -771,7 +771,7 @@
 
         while (value < end) {
             int ovalue = value;
-            buf = Character.toLowerCase(chars[value++]);
+            buf = EncodingHelper.toLowerCase(chars[value++]);
 
             if (chars[ovalue] != buf) {
 
@@ -779,7 +779,7 @@
                 System.arraycopy(chars, sn.p, sbuf, 0, ovalue - sn.p);
                 value = ovalue;
                 while (value < end) {
-                    buf = Character.toLowerCase(chars[value++]);
+                    buf = EncodingHelper.toLowerCase(chars[value++]);
                     if (sp >= sbuf.length) {
                         char[]tmp = new char[sbuf.length << 1];
                         System.arraycopy(sbuf, 0, tmp, 0, sbuf.length);
--- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ApplyCaseFold.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ApplyCaseFold.java	Mon Jun 02 13:53:52 2014 -0700
@@ -20,70 +20,42 @@
 package jdk.nashorn.internal.runtime.regexp.joni;
 
 import jdk.nashorn.internal.runtime.regexp.joni.ast.CClassNode;
-import jdk.nashorn.internal.runtime.regexp.joni.ast.ConsAltNode;
-import jdk.nashorn.internal.runtime.regexp.joni.ast.StringNode;
 
 final class ApplyCaseFold {
 
     // i_apply_case_fold
-    public void apply(int from, int[]to, int length, Object o) {
+    public void apply(int from, int to, Object o) {
         ApplyCaseFoldArg arg = (ApplyCaseFoldArg)o;
 
         ScanEnvironment env = arg.env;
         CClassNode cc = arg.cc;
         BitSet bs = cc.bs;
 
-        if (length == 1) {
-            boolean inCC = cc.isCodeInCC(from);
+        boolean inCC = cc.isCodeInCC(from);
 
-            if (Config.CASE_FOLD_IS_APPLIED_INSIDE_NEGATIVE_CCLASS) {
-                if ((inCC && !cc.isNot()) || (!inCC && cc.isNot())) {
-                    if (to[0] >= BitSet.SINGLE_BYTE_SIZE) {
-                        cc.addCodeRange(env, to[0], to[0]);
-                    } else {
-                        /* /(?i:[^A-C])/.match("a") ==> fail. */
-                        bs.set(to[0]);
-                    }
+        if (Config.CASE_FOLD_IS_APPLIED_INSIDE_NEGATIVE_CCLASS) {
+            if ((inCC && !cc.isNot()) || (!inCC && cc.isNot())) {
+                if (to >= BitSet.SINGLE_BYTE_SIZE) {
+                    cc.addCodeRange(env, to, to);
+                } else {
+                    /* /(?i:[^A-C])/.match("a") ==> fail. */
+                    bs.set(to);
                 }
-            } else {
-                if (inCC) {
-                    if (to[0] >= BitSet.SINGLE_BYTE_SIZE) {
-                        if (cc.isNot()) cc.clearNotFlag();
-                        cc.addCodeRange(env, to[0], to[0]);
+            }
+        } else {
+            if (inCC) {
+                if (to >= BitSet.SINGLE_BYTE_SIZE) {
+                    if (cc.isNot()) cc.clearNotFlag();
+                    cc.addCodeRange(env, to, to);
+                } else {
+                    if (cc.isNot()) {
+                        bs.clear(to);
                     } else {
-                        if (cc.isNot()) {
-                            bs.clear(to[0]);
-                        } else {
-                            bs.set(to[0]);
-                        }
+                        bs.set(to);
                     }
                 }
-            } // CASE_FOLD_IS_APPLIED_INSIDE_NEGATIVE_CCLASS
-
-        } else {
-            if (cc.isCodeInCC(from) && (!Config.CASE_FOLD_IS_APPLIED_INSIDE_NEGATIVE_CCLASS || !cc.isNot())) {
-                StringNode node = null;
-                for (int i=0; i<length; i++) {
-                    if (i == 0) {
-                        node = new StringNode();
-                        /* char-class expanded multi-char only
-                        compare with string folded at match time. */
-                        node.setAmbig();
-                    }
-                    node.catCode(to[i]);
-                }
-
-                ConsAltNode alt = ConsAltNode.newAltNode(node, null);
-
-                if (arg.tail == null) {
-                    arg.altRoot = alt;
-                } else {
-                    arg.tail.setCdr(alt);
-                }
-                arg.tail = alt;
             }
-
-        }
+        } // CASE_FOLD_IS_APPLIED_INSIDE_NEGATIVE_CCLASS
 
     }
 
--- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ByteCodeMachine.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ByteCodeMachine.java	Mon Jun 02 13:53:52 2014 -0700
@@ -58,8 +58,8 @@
         int end1 = s1 + mbLen;
 
         while (s1 < end1) {
-            char c1 = Character.toLowerCase(chars[s1++]);
-            char c2 = Character.toLowerCase(chars[s2++]);
+            char c1 = EncodingHelper.toLowerCase(chars[s1++]);
+            char c2 = EncodingHelper.toLowerCase(chars[s2++]);
 
             if (c1 != c2) {
                 return false;
@@ -367,7 +367,7 @@
     }
 
     private void opExact1IC() {
-        if (s >= range || code[ip] != Character.toLowerCase(chars[s++])) {opFail(); return;}
+        if (s >= range || code[ip] != EncodingHelper.toLowerCase(chars[s++])) {opFail(); return;}
         ip++;
         sprev = sbegin; // break;
     }
@@ -380,10 +380,10 @@
             char[] bs = regex.templates[code[ip++]];
             int ps = code[ip++];
 
-            while (tlen-- > 0) if (bs[ps++] != Character.toLowerCase(chars[s++])) {opFail(); return;}
+            while (tlen-- > 0) if (bs[ps++] != EncodingHelper.toLowerCase(chars[s++])) {opFail(); return;}
         } else {
 
-            while (tlen-- > 0) if (code[ip++] != Character.toLowerCase(chars[s++])) {opFail(); return;}
+            while (tlen-- > 0) if (code[ip++] != EncodingHelper.toLowerCase(chars[s++])) {opFail(); return;}
         }
         sprev = s - 1;
     }
--- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/EncodingHelper.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/EncodingHelper.java	Mon Jun 02 13:53:52 2014 -0700
@@ -93,43 +93,80 @@
        return s;
     }
 
-    public static int mbcToCode(byte[] bytes, int p, int end) {
-        int code = 0;
-        for (int i = p; i < end; i++) {
-            code = (code << 8) | (bytes[i] & 0xff);
-        }
-        return code;
-    }
-
     public static int mbcodeStartPosition() {
         return 0x80;
     }
 
     public static char[] caseFoldCodesByString(int flag, char c) {
-        if (Character.isUpperCase(c)) {
-            return new char[] {Character.toLowerCase(c)};
-        } else if (Character.isLowerCase(c)) {
-            return new char[] {Character.toUpperCase(c)};
-        } else {
-            return EMPTYCHARS;
+        char[] codes = EMPTYCHARS;
+        final char upper = toUpperCase(c);
+
+        if (upper != toLowerCase(upper)) {
+            int count = 0;
+            char ch = 0;
+
+            do {
+                final char u = toUpperCase(ch);
+                if (u == upper && ch != c) {
+                    // Almost all characters will return array of length 1, very few 2 or 3, so growing by one is fine.
+                    codes = count == 0 ? new char[1] : Arrays.copyOf(codes, count + 1);
+                    codes[count++] = ch;
+                }
+            } while (ch++ < 0xffff);
         }
+        return codes;
     }
 
     public static void applyAllCaseFold(int flag, ApplyCaseFold fun, Object arg) {
-        int[] code = new int[1];
-
         for (int c = 0; c < 0xffff; c++) {
-            if (Character.getType(c) == Character.LOWERCASE_LETTER) {
+            if (Character.isLowerCase(c)) {
+                final int upper = toUpperCase(c);
 
-                int upper = code[0] = Character.toUpperCase(c);
-                fun.apply(c, code, 1, arg);
+                if (upper != c) {
+                    fun.apply(c, upper, arg);
+                }
+            }
+        }
 
-                code[0] = c;
-                fun.apply(upper, code, 1, arg);
+        // Some characters have multiple lower case variants, hence we need to do a second run
+        for (int c = 0; c < 0xffff; c++) {
+            if (Character.isLowerCase(c)) {
+                final int upper = toUpperCase(c);
+
+                if (upper != c) {
+                    fun.apply(upper, c, arg);
+                }
             }
         }
     }
 
+    public static char toLowerCase(char c) {
+        return (char)toLowerCase((int)c);
+    }
+
+    public static int toLowerCase(int c) {
+        if (c < 128) {
+            return ('A' <= c && c <= 'Z') ? (c + ('a' - 'A')) : c;
+        }
+        // Do not convert non-ASCII upper case character to ASCII lower case.
+        int lower = Character.toLowerCase(c);
+        return (lower < 128) ? c : lower;
+
+    }
+
+    public static char toUpperCase(char c) {
+        return (char)toUpperCase((int)c);
+    }
+
+    public static int toUpperCase(int c) {
+        if (c < 128) {
+            return ('a' <= c && c <= 'z') ? c + ('A' - 'a') : c;
+        }
+        // Do not convert non-ASCII lower case character to ASCII upper case.
+        int upper = Character.toUpperCase(c);
+        return (upper < 128) ? c : upper;
+    }
+
     public static int[] ctypeCodeRange(int ctype, IntHolder sbOut) {
         sbOut.value = 0x100; // use bitset for codes smaller than 256
         int[] range = null;
--- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/SearchAlgorithm.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/SearchAlgorithm.java	Mon Jun 02 13:53:52 2014 -0700
@@ -168,7 +168,7 @@
                                        char[] chars, int p, int end) {
 
             while (tP < tEnd) {
-                if (t[tP++] != Character.toLowerCase(chars[p++])) return false;
+                if (t[tP++] != EncodingHelper.toLowerCase(chars[p++])) return false;
             }
             return true;
         }
--- a/nashorn/src/jdk/nashorn/internal/runtime/resources/Messages.properties	Mon Jun 02 15:49:53 2014 -0400
+++ b/nashorn/src/jdk/nashorn/internal/runtime/resources/Messages.properties	Mon Jun 02 13:53:52 2014 -0700
@@ -138,6 +138,7 @@
 type.error.method.not.constructor=Java method {0} can't be used as a constructor.
 type.error.env.not.object=$ENV must be an Object.
 type.error.unsupported.java.to.type=Unsupported Java.to target type {0}.
+type.error.new.on.nonpublic.javatype=new cannot be used with non-public java type {0}.
 
 range.error.dataview.constructor.offset=Wrong offset or length in DataView constructor
 range.error.dataview.offset=Offset is outside the bounds of the DataView
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8030202.js	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8030202: Nashorn: Multiple RegExp#ignoreCase issues
+ *
+ * @test
+ * @run
+ */
+
+print(/\u2160/i.test("\u2170"));
+print(/[\u2160]/i.test("\u2170"));
+print(/\u2170/i.test("\u2160"));
+print(/[\u2170]/i.test("\u2160"));
+
+print(/\u0130/i.test("\u0069"));
+print(/[\u0130]/i.test("\u0069"));
+print(/\u0069/i.test("\u0130"));
+print(/[\u0069]/i.test("\u0130"));
+
+print(/\u1e9e/i.test("\u00df"));
+print(/[\u1e9e]/i.test("\u00df"));
+print(/\u00df/i.test("\u1e9e"));
+print(/[\u00df]/i.test("\u1e9e"));
+
+print(/[^\u1e9e]/i.test("\u00df"));
+print(/[^\u00df]/i.test("\u1e9e"));
+
+print(/\u0345{4}/i.test("\u0345\u0399\u03b9\u1fbe"));
+print(/\u0399{4}/i.test("\u0345\u0399\u03b9\u1fbe"));
+print(/\u03b9{4}/i.test("\u0345\u0399\u03b9\u1fbe"));
+print(/\u1fbe{4}/i.test("\u0345\u0399\u03b9\u1fbe"));
+
+print(/[\u0345]{4}/i.test("\u0345\u0399\u03b9\u1fbe"));
+print(/[\u0399]{4}/i.test("\u0345\u0399\u03b9\u1fbe"));
+print(/[\u03b9]{4}/i.test("\u0345\u0399\u03b9\u1fbe"));
+print(/[\u1fbe]{4}/i.test("\u0345\u0399\u03b9\u1fbe"));
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8030202.js.EXPECTED	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,22 @@
+true
+true
+true
+true
+false
+false
+false
+false
+false
+false
+false
+false
+true
+true
+true
+true
+true
+true
+true
+true
+true
+true
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8043930.js	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8043930: TypeError when attemping to create an instance of non-public class could be better 
+ *
+ * @test
+ * @run
+ */
+
+var NonPublicClass = Java.type("jdk.nashorn.test.models.NonPublicClass");
+try {
+    var obj = new NonPublicClass();
+    fail("Expected TypeError to be thrown!");
+} catch (e) {
+    print(e);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8043930.js.EXPECTED	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,1 @@
+TypeError: new cannot be used with non-public java type jdk.nashorn.test.models.NonPublicClass.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/nosecurity.js	Mon Jun 02 13:53:52 2014 -0700
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * 8043443: Test framework changes to run script tests without security manager 
+ * @test
+ * @run
+ */
+
+var System = Java.type("java.lang.System");
+
+if (System.securityManager != null) {
+    fail("SecurityManager is set!");
+}
--- a/nashorn/test/src/jdk/nashorn/api/scripting/ScriptObjectMirrorTest.java	Mon Jun 02 15:49:53 2014 -0400
+++ b/nashorn/test/src/jdk/nashorn/api/scripting/ScriptObjectMirrorTest.java	Mon Jun 02 13:53:52 2014 -0700
@@ -29,6 +29,8 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import javax.script.Bindings;
+import javax.script.ScriptContext;
 import javax.script.ScriptEngine;
 import javax.script.ScriptEngineManager;
 import javax.script.ScriptException;
@@ -276,4 +278,31 @@
             "({ toString: function() { return 'foo' } })");
         assertEquals("foo", obj.to(String.class));
     }
+
+    // @bug 8044000: Access to undefined property yields "null" instead of "undefined"
+    @Test
+    public void mapScriptObjectMirrorCallsiteTest() throws ScriptException {
+        final ScriptEngineManager m = new ScriptEngineManager();
+        final ScriptEngine engine = m.getEngineByName("nashorn");
+        final String TEST_SCRIPT = "typeof obj.foo";
+
+        final Bindings global = engine.getContext().getBindings(ScriptContext.ENGINE_SCOPE);
+        engine.eval("var obj = java.util.Collections.emptyMap()");
+        // this will drive callsite "obj.foo" of TEST_SCRIPT
+        // to use "obj instanceof Map" as it's guard
+        engine.eval(TEST_SCRIPT, global);
+        // redefine 'obj' to be a script object
+        engine.eval("obj = {}");
+
+        final Bindings newGlobal = engine.createBindings();
+        // transfer 'obj' from default global to new global
+        // new global will get a ScriptObjectMirror wrapping 'obj'
+        newGlobal.put("obj", global.get("obj"));
+
+        // Every ScriptObjectMirror is a Map! If callsite "obj.foo"
+        // does not see the new 'obj' is a ScriptObjectMirror, it'll
+        // continue to use Map's get("obj.foo") instead of ScriptObjectMirror's
+        // getMember("obj.foo") - thereby getting null instead of undefined
+        assertEquals("undefined", engine.eval(TEST_SCRIPT, newGlobal));
+    }
 }
--- a/test/Makefile	Mon Jun 02 15:49:53 2014 -0400
+++ b/test/Makefile	Mon Jun 02 13:53:52 2014 -0700
@@ -33,6 +33,7 @@
 # This makefile depends on the availability of sibling directories.
 LANGTOOLS_DIR=$(TOPDIR)/langtools
 JDK_DIR=$(TOPDIR)/jdk
+HOTSPOT_DIR=$(TOPDIR)/hotspot
 
 # Macro to run a test target in a subdir
 define SUBDIR_TEST # subdirectory target
@@ -62,6 +63,9 @@
 jdk_% core_%s svc_%:
 	@$(NO_STOPPING)$(call SUBDIR_TEST, $(JDK_DIR), TEST="$@" $@)
 
+hotspot_%:
+	@$(NO_STOPPING)$(call SUBDIR_TEST, $(HOTSPOT_DIR), TEST="$@" $@)
+
 ################################################################
 
 # Phony targets (e.g. these are not filenames)