changeset 11964:ed94f3e7ba6b jdk9-b65

Merge
author lana
date Thu, 14 May 2015 20:15:26 -0700
parents 9d67cbc39333 c5d10830cfb9
children b4e21fd93f44 6837759aa403
files src/java.base/share/classes/sun/security/provider/certpath/CertStoreHelper.java src/java.base/share/classes/sun/security/provider/certpath/ssl/SSLServerCertStoreHelper.java src/java.desktop/unix/classes/sun/awt/motif/MFontConfiguration.java src/java.desktop/unix/classes/sun/awt/motif/X11CNS11643.java src/java.desktop/unix/classes/sun/awt/motif/X11CNS11643P1.java src/java.desktop/unix/classes/sun/awt/motif/X11CNS11643P2.java src/java.desktop/unix/classes/sun/awt/motif/X11CNS11643P3.java src/java.desktop/unix/classes/sun/awt/motif/X11Dingbats.java src/java.desktop/unix/classes/sun/awt/motif/X11GB18030_0.java src/java.desktop/unix/classes/sun/awt/motif/X11GB18030_1.java src/java.desktop/unix/classes/sun/awt/motif/X11GB2312.java src/java.desktop/unix/classes/sun/awt/motif/X11GBK.java src/java.desktop/unix/classes/sun/awt/motif/X11JIS0201.java src/java.desktop/unix/classes/sun/awt/motif/X11JIS0208.java src/java.desktop/unix/classes/sun/awt/motif/X11JIS0212.java src/java.desktop/unix/classes/sun/awt/motif/X11Johab.java src/java.desktop/unix/classes/sun/awt/motif/X11KSC5601.java src/java.desktop/unix/classes/sun/awt/motif/X11SunUnicode_0.java src/java.naming/share/classes/sun/security/provider/certpath/ldap/LDAPCertStoreHelper.java src/jdk.charsets/share/classes/sun/nio/cs/ext/DoubleByteEncoder.java src/jdk.charsets/unix/classes/sun/nio/cs/ext/COMPOUND_TEXT.java src/jdk.charsets/unix/classes/sun/nio/cs/ext/COMPOUND_TEXT_Decoder.java src/jdk.charsets/unix/classes/sun/nio/cs/ext/COMPOUND_TEXT_Encoder.java src/jdk.charsets/unix/classes/sun/nio/cs/ext/CompoundTextSupport.java test/java/awt/Component/isLightweightCrash/StubPeerCrash.java test/sun/nio/cs/OLD/X11GB2312_OLD.java test/sun/nio/cs/OLD/X11GBK_OLD.java test/sun/nio/cs/OLD/X11KSC5601_OLD.java test/sun/nio/cs/TestCompoundTest.java test/sun/nio/cs/TestX11CNS.java test/sun/nio/cs/TestX11JIS0201.java test/sun/nio/cs/X11CNS11643.java test/sun/nio/cs/X11CNS11643P1.java test/sun/nio/cs/X11CNS11643P2.java test/sun/nio/cs/X11CNS11643P3.java
diffstat 463 files changed, 27462 insertions(+), 23878 deletions(-) [+]
line wrap: on
line diff
--- a/make/CompileDemos.gmk	Thu May 14 12:38:11 2015 -0700
+++ b/make/CompileDemos.gmk	Thu May 14 20:15:26 2015 -0700
@@ -396,7 +396,7 @@
   $(eval $(call SetupNativeCompilation,BUILD_LIBPOLLER, \
       SRC := $(DEMO_SOLARIS_SRC)/jni/Poller, \
       OPTIMIZATION := LOW, \
-      CFLAGS := $(CFLAGS_JDKLIB) $(SHARED_LIBRARY_FLAGS) \
+      CFLAGS := $(CFLAGS_JDKLIB) \
           -I$(SUPPORT_OUTPUTDIR)/demo/classes/jni/Poller, \
       LDFLAGS := $(LDFLAGS_JDKLIB), \
       LDFLAGS_SUFFIX_solaris := -lc, \
--- a/make/data/charsetmapping/charsets	Thu May 14 12:38:11 2015 -0700
+++ b/make/data/charsetmapping/charsets	Thu May 14 20:15:26 2015 -0700
@@ -1833,10 +1833,3 @@
 ##
 ########################################################
  
-charset x-COMPOUND_TEXT COMPOUND_TEXT
-    package sun.nio.cs.ext
-    type    source
-    os      unix
-    alias   COMPOUND_TEXT       # JDK historical
-    alias   x11-compound_text
-    alias   x-compound-text
--- a/make/launcher/Launcher-jdk.accessibility.gmk	Thu May 14 12:38:11 2015 -0700
+++ b/make/launcher/Launcher-jdk.accessibility.gmk	Thu May 14 20:15:26 2015 -0700
@@ -39,7 +39,7 @@
       CFLAGS := $(filter-out -Zc:wchar_t-, $(CFLAGS_JDKEXE)) -Zc:wchar_t \
           -analyze- -Od -Gd -D_WINDOWS \
           -D_UNICODE -DUNICODE -RTC1 -EHsc, \
-      DISABLED_WARNINGS_microsoft := 4267, \
+      DISABLED_WARNINGS_microsoft := 4267 4996, \
       LDFLAGS := $(LDFLAGS_JDKEXE) \
           Advapi32.lib Version.lib User32.lib, \
       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/jdk.accessibility/jabswitch, \
--- a/make/launcher/Launcher-jdk.pack200.gmk	Thu May 14 12:38:11 2015 -0700
+++ b/make/launcher/Launcher-jdk.pack200.gmk	Thu May 14 20:15:26 2015 -0700
@@ -84,6 +84,7 @@
     CFLAGS_linux := -fPIC, \
     CFLAGS_solaris := -KPIC, \
     CFLAGS_macosx := -fPIC, \
+    DISABLED_WARNINGS_gcc := unused-result, \
     MAPFILE := $(UNPACK_MAPFILE),\
     LDFLAGS := $(UNPACKEXE_ZIPOBJS) \
         $(LDFLAGS_JDKEXE) $(LDFLAGS_CXX_JDK) \
--- a/make/lib/Awt2dLibraries.gmk	Thu May 14 12:38:11 2015 -0700
+++ b/make/lib/Awt2dLibraries.gmk	Thu May 14 20:15:26 2015 -0700
@@ -246,9 +246,10 @@
     CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_CFLAGS), \
     DISABLED_WARNINGS_gcc := sign-compare unused-result maybe-uninitialized \
         format-nonliteral parentheses, \
-    DISABLED_WARNINGS_clang := logical-op-parentheses, \
+    DISABLED_WARNINGS_clang := logical-op-parentheses extern-initializer, \
     DISABLED_WARNINGS_solstudio := E_DECLARATION_IN_CODE, \
-    DISABLED_WARNINGS_microsoft := 4297 4244 4267, \
+    DISABLED_WARNINGS_microsoft := 4297 4244 4267 4996, \
+    WARNINGS_AS_ERRORS_gcc := false, \
     ASFLAGS := $(LIBAWT_ASFLAGS), \
     MAPFILE := $(LIBAWT_MAPFILE), \
     LDFLAGS := $(LDFLAGS_JDKLIB) $(call SET_SHARED_LIBRARY_ORIGIN), \
@@ -357,6 +358,7 @@
             format-security int-to-pointer-cast parentheses, \
         DISABLED_WARNINGS_solstudio := E_DECLARATION_IN_CODE \
             E_ASSIGNMENT_TYPE_MISMATCH E_NON_CONST_INIT, \
+        WARNINGS_AS_ERRORS_gcc := false, \
         MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libawt_xawt/mapfile-vers, \
         LDFLAGS := $(LDFLAGS_JDKLIB) \
             $(X_LIBS) $(LIBAWT_XAWT_LDFLAGS) \
@@ -408,11 +410,11 @@
     INCLUDE_FILES := $(BUILD_LIBLCMS_INCLUDE_FILES), \
     OPTIMIZATION := HIGHEST, \
     CFLAGS := $(filter-out -xc99=%none, $(CFLAGS_JDKLIB)) \
-        $(SHARED_LIBRARY_FLAGS) $(LIBLCMS_CPPFLAGS) \
+        $(LIBLCMS_CPPFLAGS) \
         $(LCMS_CFLAGS), \
     CFLAGS_solaris := -xc99=no_lib, \
     CFLAGS_windows := -DCMS_IS_WINDOWS_, \
-    DISABLED_WARNINGS_gcc := format-nonliteral, \
+    DISABLED_WARNINGS_gcc := format-nonliteral type-limits, \
     DISABLED_WARNINGS_clang := tautological-compare, \
     DISABLED_WARNINGS_solstudio := E_STATEMENT_NOT_REACHED, \
     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/liblcms/mapfile-vers, \
@@ -647,10 +649,13 @@
     OPTIMIZATION := $(LIBFONTMANAGER_OPTIMIZATION), \
     CFLAGS_windows = -DCC_NOEX, \
     DISABLED_WARNINGS_gcc := sign-compare int-to-pointer-cast reorder \
-        delete-non-virtual-dtor, \
-    DISABLED_WARNINGS_clang := unused-value incompatible-pointer-types, \
+        delete-non-virtual-dtor type-limits, \
+    DISABLED_WARNINGS_clang := unused-value incompatible-pointer-types \
+        tautological-constant-out-of-range-compare int-to-pointer-cast, \
     DISABLED_WARNINGS_solstudio := truncwarn, \
-    DISABLED_WARNINGS_microsoft := 4267 4244 4018 4090, \
+    DISABLED_WARNINGS_microsoft := 4267 4244 4018 4090 4996 4146, \
+    WARNINGS_AS_ERRORS_gcc := false, \
+    WARNINGS_AS_ERRORS_solstudio := false, \
     MAPFILE := $(BUILD_LIBFONTMANAGER_MAPFILE), \
     LDFLAGS := $(subst -Xlinker -z -Xlinker defs,,$(LDFLAGS_JDKLIB)) $(LDFLAGS_CXX_JDK) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
@@ -880,10 +885,10 @@
       OPTIMIZATION := LOW, \
       CFLAGS := $(LIBSPLASHSCREEN_CFLAGS) $(CFLAGS_JDKLIB) \
                 $(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS) $(PNG_CFLAGS), \
-      DISABLED_WARNINGS_gcc := type-limits unused-result maybe-uninitialized, \
+      DISABLED_WARNINGS_gcc := sign-compare type-limits unused-result maybe-uninitialized, \
       DISABLED_WARNINGS_clang := incompatible-pointer-types, \
-      DISABLED_WARNINGS_solstudio := E_NEWLINE_NOT_LAST, \
-      DISABLED_WARNINGS_microsoft := 4244 4267, \
+      DISABLED_WARNINGS_solstudio := E_NEWLINE_NOT_LAST E_DECLARATION_IN_CODE, \
+      DISABLED_WARNINGS_microsoft := 4018 4244 4267, \
       MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libsplashscreen/mapfile-vers, \
       LDFLAGS := $(LDFLAGS_JDKLIB) \
           $(call SET_SHARED_LIBRARY_ORIGIN), \
@@ -956,6 +961,7 @@
       DISABLED_WARNINGS_clang := incomplete-implementation \
           deprecated-declarations objc-method-access bitwise-op-parentheses \
           incompatible-pointer-types parentheses-equality extra-tokens, \
+      WARNINGS_AS_ERRORS_clang := false, \
       LDFLAGS := $(LDFLAGS_JDKLIB) \
           $(call SET_SHARED_LIBRARY_ORIGIN) \
           -L$(INSTALL_LIBRARIES_HERE), \
--- a/make/lib/CoreLibraries.gmk	Thu May 14 12:38:11 2015 -0700
+++ b/make/lib/CoreLibraries.gmk	Thu May 14 20:15:26 2015 -0700
@@ -149,7 +149,8 @@
     DISABLED_WARNINGS_gcc := type-limits format-nonliteral, \
     DISABLED_WARNINGS_clang := int-conversion, \
     DISABLED_WARNINGS_solstudio := E_DECLARATION_IN_CODE, \
-    DISABLED_WARNINGS_microsoft := 4022 4267, \
+    DISABLED_WARNINGS_microsoft := 4022 4267 4996, \
+    WARNINGS_AS_ERRORS_solstudio := false, \
     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjava/mapfile-vers, \
     LDFLAGS := $(LDFLAGS_JDKLIB) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
--- a/make/lib/Lib-jdk.crypto.ucrypto.gmk	Thu May 14 12:38:11 2015 -0700
+++ b/make/lib/Lib-jdk.crypto.ucrypto.gmk	Thu May 14 20:15:26 2015 -0700
@@ -38,6 +38,7 @@
       OPTIMIZATION := LOW, \
       CFLAGS := $(CFLAGS_JDKLIB) \
           $(addprefix -I, $(LIBJ2UCRYPTO_SRC)), \
+      DISABLED_WARNINGS_solstudio := E_MACRO_REDEFINED, \
       MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libj2ucrypto/mapfile-vers, \
       LDFLAGS := $(LDFLAGS_JDKLIB), \
       LDFLAGS_SUFFIX := $(LIBDL), \
--- a/make/lib/NetworkingLibraries.gmk	Thu May 14 12:38:11 2015 -0700
+++ b/make/lib/NetworkingLibraries.gmk	Thu May 14 20:15:26 2015 -0700
@@ -34,7 +34,7 @@
         $(LIBJAVA_HEADER_FLAGS) $(addprefix -I, $(LIBNET_SRC_DIRS)), \
     DISABLED_WARNINGS_gcc := format-nonliteral, \
     DISABLED_WARNINGS_clang := parentheses-equality constant-logical-operand, \
-    DISABLED_WARNINGS_microsoft := 4244 4047 4133, \
+    DISABLED_WARNINGS_microsoft := 4244 4047 4133 4996, \
     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libnet/mapfile-vers, \
     LDFLAGS := $(LDFLAGS_JDKLIB) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
--- a/make/lib/NioLibraries.gmk	Thu May 14 12:38:11 2015 -0700
+++ b/make/lib/NioLibraries.gmk	Thu May 14 20:15:26 2015 -0700
@@ -70,7 +70,7 @@
         $(BUILD_LIBNIO_CFLAGS), \
     DISABLED_WARNINGS_gcc := type-limits, \
     DISABLED_WARNINGS_clang := tautological-compare, \
-    DISABLED_WARNINGS_microsoft := 4244, \
+    DISABLED_WARNINGS_microsoft := 4244 4996, \
     MAPFILE := $(BUILD_LIBNIO_MAPFILE), \
     LDFLAGS := $(LDFLAGS_JDKLIB) $(BUILD_LIBNIO_LDFLAGS) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
--- a/make/lib/SoundLibraries.gmk	Thu May 14 12:38:11 2015 -0700
+++ b/make/lib/SoundLibraries.gmk	Thu May 14 20:15:26 2015 -0700
@@ -111,10 +111,6 @@
   LIBJSOUND_SRC_FILES += $(LIBJSOUND_DAUDIOFILES)
 endif # OPENJDK_TARGET_OS solaris
 
-
-  ifeq ($(OPENJDK_TARGET_CPU), aarch64)
-       LIBJSOUND_CFLAGS += -DX_ARCH=X_AARCH64
-  endif
 LIBJSOUND_CFLAGS += -DEXTRA_SOUND_JNI_LIBS='"$(EXTRA_SOUND_JNI_LIBS)"'
 
 $(eval $(call SetupNativeCompilation,BUILD_LIBJSOUND, \
@@ -129,6 +125,7 @@
     CXXFLAGS := $(CXXFLAGS_JDKLIB) $(LIBJSOUND_CFLAGS), \
     DISABLED_WARNINGS_clang := implicit-function-declaration \
         deprecated-writable-strings, \
+    WARNINGS_AS_ERRORS_clang := false, \
     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjsound/mapfile-vers, \
     LDFLAGS := $(LDFLAGS_JDKLIB) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
--- a/src/java.base/macosx/native/libjli/java_md_macosx.c	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.base/macosx/native/libjli/java_md_macosx.c	Thu May 14 20:15:26 2015 -0700
@@ -948,8 +948,15 @@
     jmethodID getCanonicalNameMID = NULL;
     NULL_CHECK(getCanonicalNameMID = (*env)->GetMethodID(env, classClass, "getCanonicalName", "()Ljava/lang/String;"));
 
-    jstring mainClassString = NULL;
-    NULL_CHECK(mainClassString = (*env)->CallObjectMethod(env, mainClass, getCanonicalNameMID));
+    jstring mainClassString = (*env)->CallObjectMethod(env, mainClass, getCanonicalNameMID);
+    if ((*env)->ExceptionCheck(env)) {
+        /*
+         * Clears all errors caused by getCanonicalName() on the mainclass and
+         * leaves the JAVA_MAIN_CLASS__<pid> empty.
+         */
+        (*env)->ExceptionClear(env);
+        return;
+    }
 
     const char *mainClassName = NULL;
     NULL_CHECK(mainClassName = (*env)->GetStringUTFChars(env, mainClassString, NULL));
@@ -1056,7 +1063,7 @@
  * Note the jvmInstance must be initialized first before entering into
  * ShowSplashScreen, as there is a callback into the JLI_GetJavaVMInstance.
  */
-void PostJVMInit(JNIEnv *env, jstring mainClass, JavaVM *vm) {
+void PostJVMInit(JNIEnv *env, jclass mainClass, JavaVM *vm) {
     jvmInstance = vm;
     SetMainClassForAWT(env, mainClass);
     CHECK_EXCEPTION_RETURN();
--- a/src/java.base/share/classes/java/io/BufferedReader.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.base/share/classes/java/io/BufferedReader.java	Thu May 14 20:15:26 2015 -0700
@@ -272,6 +272,7 @@
      *             stream has been reached
      *
      * @exception  IOException  If an I/O error occurs
+     * @exception  IndexOutOfBoundsException {@inheritDoc}
      */
     public int read(char cbuf[], int off, int len) throws IOException {
         synchronized (lock) {
--- a/src/java.base/share/classes/java/io/CharArrayReader.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.base/share/classes/java/io/CharArrayReader.java	Thu May 14 20:15:26 2015 -0700
@@ -116,6 +116,7 @@
      *          the end of the stream has been reached
      *
      * @exception   IOException  If an I/O error occurs
+     * @exception   IndexOutOfBoundsException {@inheritDoc}
      */
     public int read(char b[], int off, int len) throws IOException {
         synchronized (lock) {
--- a/src/java.base/share/classes/java/io/FilterReader.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.base/share/classes/java/io/FilterReader.java	Thu May 14 20:15:26 2015 -0700
@@ -69,6 +69,7 @@
      * Reads characters into a portion of an array.
      *
      * @exception  IOException  If an I/O error occurs
+     * @exception  IndexOutOfBoundsException {@inheritDoc}
      */
     public int read(char cbuf[], int off, int len) throws IOException {
         return in.read(cbuf, off, len);
--- a/src/java.base/share/classes/java/io/InputStreamReader.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.base/share/classes/java/io/InputStreamReader.java	Thu May 14 20:15:26 2015 -0700
@@ -179,6 +179,7 @@
      *             stream has been reached
      *
      * @exception  IOException  If an I/O error occurs
+     * @exception  IndexOutOfBoundsException {@inheritDoc}
      */
     public int read(char cbuf[], int offset, int length) throws IOException {
         return sd.read(cbuf, offset, length);
--- a/src/java.base/share/classes/java/io/LineNumberReader.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.base/share/classes/java/io/LineNumberReader.java	Thu May 14 20:15:26 2015 -0700
@@ -159,6 +159,8 @@
      *
      * @throws  IOException
      *          If an I/O error occurs
+     *
+     * @throws  IndexOutOfBoundsException {@inheritDoc}
      */
     @SuppressWarnings("fallthrough")
     public int read(char cbuf[], int off, int len) throws IOException {
--- a/src/java.base/share/classes/java/io/PipedReader.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.base/share/classes/java/io/PipedReader.java	Thu May 14 20:15:26 2015 -0700
@@ -286,6 +286,7 @@
      *                  <a href=PipedInputStream.html#BROKEN> <code>broken</code></a>,
      *                  {@link #connect(java.io.PipedWriter) unconnected}, closed,
      *                  or an I/O error occurs.
+     * @exception  IndexOutOfBoundsException {@inheritDoc}
      */
     public synchronized int read(char cbuf[], int off, int len)  throws IOException {
         if (!connected) {
--- a/src/java.base/share/classes/java/io/PushbackReader.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.base/share/classes/java/io/PushbackReader.java	Thu May 14 20:15:26 2015 -0700
@@ -102,6 +102,7 @@
      *             stream has been reached
      *
      * @exception  IOException  If an I/O error occurs
+     * @exception  IndexOutOfBoundsException {@inheritDoc}
      */
     public int read(char cbuf[], int off, int len) throws IOException {
         synchronized (lock) {
--- a/src/java.base/share/classes/java/io/Reader.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.base/share/classes/java/io/Reader.java	Thu May 14 20:15:26 2015 -0700
@@ -153,6 +153,9 @@
      *             stream has been reached
      *
      * @exception  IOException  If an I/O error occurs
+     * @exception  IndexOutOfBoundsException
+     *             If {@code off} is negative, or {@code len} is negative,
+     *             or {@code len} is greater than {@code cbuf.length - off}
      */
     abstract public int read(char cbuf[], int off, int len) throws IOException;
 
--- a/src/java.base/share/classes/java/io/StringReader.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.base/share/classes/java/io/StringReader.java	Thu May 14 20:15:26 2015 -0700
@@ -84,6 +84,7 @@
      *             stream has been reached
      *
      * @exception  IOException  If an I/O error occurs
+     * @exception  IndexOutOfBoundsException {@inheritDoc}
      */
     public int read(char cbuf[], int off, int len) throws IOException {
         synchronized (lock) {
--- a/src/java.base/share/classes/java/lang/annotation/Documented.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.base/share/classes/java/lang/annotation/Documented.java	Thu May 14 20:15:26 2015 -0700
@@ -26,12 +26,24 @@
 package java.lang.annotation;
 
 /**
- * Indicates that annotations with a type are to be documented by javadoc
- * and similar tools by default.  This type should be used to annotate the
- * declarations of types whose annotations affect the use of annotated
- * elements by their clients.  If a type declaration is annotated with
- * Documented, its annotations become part of the public API
- * of the annotated elements.
+ * If the annotation {@code @Documented} is present on the declaration
+ * of an annotation type <i>A</i>, then any {@code @A} annotation on
+ * an element is considered part of the element's public contract.
+ *
+ * In more detail, when an annotation type <i>A</i> is annotated with
+ * {@code Documented}, the presence and value of annotations of type
+ * <i>A</i> are a part of the public contract of the elements <i>A</i>
+ * annotates.
+ *
+ * Conversely, if an annotation type <i>B</i> is <em>not</em>
+ * annotated with {@code Documented}, the presence and value of
+ * <i>B</i> annotations are <em>not</em> part of the public contract
+ * of the elements <i>B</i> annotates.
+ *
+ * Concretely, if an annotation type is annotated with {@code
+ * Documented}, by default a tool like javadoc will display
+ * annotations of that type in its output while annotations of
+ * annotation types without {@code Documented} will not be displayed.
  *
  * @author  Joshua Bloch
  * @since 1.5
--- a/src/java.base/share/classes/java/security/Policy.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.base/share/classes/java/security/Policy.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -49,7 +49,8 @@
  * implementation (a default subclass implementation of this abstract class).
  * The default Policy implementation can be changed by setting the value
  * of the {@code policy.provider} security property to the fully qualified
- * name of the desired Policy subclass implementation.
+ * name of the desired Policy subclass implementation. The system class loader
+ * is used to load this class.
  *
  * <p> Application code can directly subclass Policy to provide a custom
  * implementation.  In addition, an instance of a Policy object can be
@@ -111,6 +112,10 @@
 
     private static final Debug debug = Debug.getInstance("policy");
 
+    // Default policy provider
+    private static final String DEFAULT_POLICY =
+        "sun.security.provider.PolicyFile";
+
     // Cache mapping ProtectionDomain.Key to PermissionCollection
     private WeakHashMap<ProtectionDomain.Key, PermissionCollection> pdMapping;
 
@@ -169,74 +174,7 @@
             synchronized (Policy.class) {
                 PolicyInfo pinfo = policy.get();
                 if (pinfo.policy == null) {
-                    String policy_class = AccessController.doPrivileged(
-                        new PrivilegedAction<>() {
-                        public String run() {
-                            return Security.getProperty("policy.provider");
-                        }
-                    });
-                    if (policy_class == null) {
-                        policy_class = "sun.security.provider.PolicyFile";
-                    }
-
-                    try {
-                        pinfo = new PolicyInfo(
-                            (Policy) Class.forName(policy_class).newInstance(),
-                            true);
-                    } catch (Exception e) {
-                        /*
-                         * The policy_class seems to be an extension
-                         * so we have to bootstrap loading it via a policy
-                         * provider that is on the bootclasspath.
-                         * If it loads then shift gears to using the configured
-                         * provider.
-                         */
-
-                        // install the bootstrap provider to avoid recursion
-                        Policy polFile = new sun.security.provider.PolicyFile();
-                        pinfo = new PolicyInfo(polFile, false);
-                        policy.set(pinfo);
-
-                        final String pc = policy_class;
-                        Policy pol = AccessController.doPrivileged(
-                            new PrivilegedAction<>() {
-                            public Policy run() {
-                                try {
-                                    ClassLoader cl =
-                                            ClassLoader.getSystemClassLoader();
-                                    // we want the extension loader
-                                    ClassLoader extcl = null;
-                                    while (cl != null) {
-                                        extcl = cl;
-                                        cl = cl.getParent();
-                                    }
-                                    return (extcl != null ? (Policy)Class.forName(
-                                            pc, true, extcl).newInstance() : null);
-                                } catch (Exception e) {
-                                    if (debug != null) {
-                                        debug.println("policy provider " +
-                                                    pc +
-                                                    " not available");
-                                        e.printStackTrace();
-                                    }
-                                    return null;
-                                }
-                            }
-                        });
-                        /*
-                         * if it loaded install it as the policy provider. Otherwise
-                         * continue to use the system default implementation
-                         */
-                        if (pol != null) {
-                            pinfo = new PolicyInfo(pol, true);
-                        } else {
-                            if (debug != null) {
-                                debug.println("using sun.security.provider.PolicyFile");
-                            }
-                            pinfo = new PolicyInfo(polFile, true);
-                        }
-                    }
-                    policy.set(pinfo);
+                    return loadPolicyProvider();
                 }
                 return pinfo.policy;
             }
@@ -245,6 +183,70 @@
     }
 
     /**
+     * Loads and instantiates a Policy implementation specified by the
+     * policy.provider security property. Note that this method should only
+     * be called by getPolicyNoCheck and from within a synchronized block with
+     * an intrinsic lock on the Policy.class.
+     */
+    private static Policy loadPolicyProvider() {
+        String policyProvider =
+            AccessController.doPrivileged(new PrivilegedAction<>() {
+                @Override
+                public String run() {
+                    return Security.getProperty("policy.provider");
+                }
+            });
+
+        /*
+         * If policy.provider is not set or is set to the default provider,
+         * simply instantiate it and return.
+         */
+        if (policyProvider == null || policyProvider.isEmpty() ||
+            policyProvider.equals(DEFAULT_POLICY))
+        {
+            Policy polFile = new sun.security.provider.PolicyFile();
+            policy.set(new PolicyInfo(polFile, true));
+            return polFile;
+        }
+
+        /*
+         * Locate, load, and instantiate the policy.provider impl using
+         * the system class loader. While doing so, install the bootstrap
+         * provider to avoid potential recursion.
+         */
+        Policy polFile = new sun.security.provider.PolicyFile();
+        policy.set(new PolicyInfo(polFile, false));
+
+        Policy pol = AccessController.doPrivileged(new PrivilegedAction<>() {
+            @Override
+            public Policy run() {
+                try {
+                    ClassLoader scl = ClassLoader.getSystemClassLoader();
+                    Class<?> c = Class.forName(policyProvider, true, scl);
+                    return (Policy)c.newInstance();
+                } catch (Exception e) {
+                    if (debug != null) {
+                        debug.println("policy provider " + policyProvider +
+                                      " not available");
+                        e.printStackTrace();
+                    }
+                    return null;
+                }
+            }
+        });
+
+        if (pol == null) {
+            // Fallback and use the system default implementation
+            if (debug != null) {
+                debug.println("using " + DEFAULT_POLICY);
+            }
+            pol = polFile;
+        }
+        policy.set(new PolicyInfo(pol, true));
+        return pol;
+    }
+
+    /**
      * Sets the system-wide Policy object. This method first calls
      * {@code SecurityManager.checkPermission} with a
      * {@code SecurityPermission("setPolicy")}
--- a/src/java.base/share/classes/java/security/cert/LDAPCertStoreParameters.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.base/share/classes/java/security/cert/LDAPCertStoreParameters.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,12 @@
  * <p>
  * This class is used to provide necessary configuration parameters (server
  * name and port number) to implementations of the LDAP {@code CertStore}
- * algorithm.
+ * algorithm. However, if you are retrieving certificates or CRLs from
+ * an ldap URI as specified by RFC 5280, use the
+ * {@link java.security.cert.URICertStoreParameters URICertStoreParameters}
+ * instead as the URI may contain additional information such as the
+ * distinguished name that will help the LDAP CertStore find the specific
+ * certificates and CRLs.
  * <p>
  * <b>Concurrent Access</b>
  * <p>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/java/security/cert/URICertStoreParameters.java	Thu May 14 20:15:26 2015 -0700
@@ -0,0 +1,149 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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 java.security.cert;
+
+import java.net.URI;
+
+/**
+ * Parameters used as input for {@code CertStore} algorithms which use
+ * information contained in a URI to retrieve certificates and CRLs.
+ * <p>
+ * This class is used to provide necessary configuration parameters
+ * through a URI as defined in RFC 5280 to implementations of
+ * {@code CertStore} algorithms.
+ * <p>
+ * <b>Concurrent Access</b>
+ * <p>
+ * Unless otherwise specified, the methods defined in this class are not
+ * thread-safe. Multiple threads that need to access a single
+ * object concurrently should synchronize amongst themselves and
+ * provide the necessary locking. Multiple threads each manipulating
+ * separate objects need not synchronize.
+ *
+ * @since       1.9
+ * @see         CertStore
+ * @see         java.net.URI
+ */
+public final class URICertStoreParameters implements CertStoreParameters {
+
+    /**
+     * The uri, cannot be null
+     */
+    private final URI uri;
+
+    /*
+     * Hash code for this parameters.
+     */
+    private int myhash = -1;
+
+    /**
+     * Creates an instance of {@code URICertStoreParameters} with the
+     * specified URI.
+     *
+     * @param uri the URI which contains configuration information.
+     * @throws NullPointerException if {@code uri} is null
+     */
+    public URICertStoreParameters(URI uri) {
+        if (uri == null) {
+            throw new NullPointerException();
+        }
+        this.uri = uri;
+    }
+
+    /**
+     * Returns the URI used to construct this
+     * {@code URICertStoreParameters} object.
+     *
+     * @return the URI.
+     */
+    public URI getURI() {
+        return uri;
+    }
+
+    /**
+     * Returns a copy of this object. Changes to the copy will not affect
+     * the original and vice versa.
+     *
+     * @return the copy
+     */
+    @Override
+    public URICertStoreParameters clone() {
+        try {
+            return new URICertStoreParameters(uri);
+        } catch (NullPointerException e) {
+            /* Cannot happen */
+            throw new InternalError(e.toString(), e);
+        }
+    }
+
+    /**
+     * Returns a hash code value for this parameters object.
+     * The hash code is generated using the URI supplied at construction.
+     *
+     * @return a hash code value for this parameters.
+     */
+    @Override
+    public int hashCode() {
+        if (myhash == -1) {
+            myhash = uri.hashCode()*7;
+        }
+        return myhash;
+    }
+
+    /**
+     * Compares the specified object with this parameters object for equality.
+     * Two URICertStoreParameters are considered equal if the URIs used
+     * to construct them are equal.
+     *
+     * @param p the object to test for equality with this parameters.
+     *
+     * @return true if the specified object is equal to this parameters object.
+     */
+    @Override
+    public boolean equals(Object p) {
+        if (p == null || (!(p instanceof URICertStoreParameters))) {
+            return false;
+        }
+
+        if (p == this) {
+            return true;
+        }
+
+        URICertStoreParameters other = (URICertStoreParameters)p;
+        return uri.equals(other.getURI());
+    }
+
+    /**
+     * Returns a formatted string describing the parameters
+     * including the URI used to construct this object.
+     *
+     * @return a formatted string describing the parameters
+     */
+    @Override
+    public String toString() {
+        return "URICertStoreParameters: " + uri.toString();
+    }
+}
--- a/src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java	Thu May 14 20:15:26 2015 -0700
@@ -64,6 +64,7 @@
 import java.util.function.Function;
 import java.util.function.IntBinaryOperator;
 import java.util.function.LongBinaryOperator;
+import java.util.function.Predicate;
 import java.util.function.ToDoubleBiFunction;
 import java.util.function.ToDoubleFunction;
 import java.util.function.ToIntBiFunction;
@@ -1619,6 +1620,45 @@
     }
 
     /**
+     * Helper method for EntrySet.removeIf
+     */
+    boolean removeEntryIf(Predicate<? super Entry<K, V>> function) {
+        if (function == null) throw new NullPointerException();
+        Node<K,V>[] t;
+        boolean removed = false;
+        if ((t = table) != null) {
+            Traverser<K,V> it = new Traverser<K,V>(t, t.length, 0, t.length);
+            for (Node<K,V> p; (p = it.advance()) != null; ) {
+                K k = p.key;
+                V v = p.val;
+                Map.Entry<K,V> e = new AbstractMap.SimpleImmutableEntry<>(k, v);
+                if (function.test(e) && replaceNode(k, null, v) != null)
+                    removed = true;
+            }
+        }
+        return removed;
+    }
+
+    /**
+     * Helper method for Values.removeIf
+     */
+    boolean removeValueIf(Predicate<? super  V> function) {
+        if (function == null) throw new NullPointerException();
+        Node<K,V>[] t;
+        boolean removed = false;
+        if ((t = table) != null) {
+            Traverser<K,V> it = new Traverser<K,V>(t, t.length, 0, t.length);
+            for (Node<K,V> p; (p = it.advance()) != null; ) {
+                K k = p.key;
+                V v = p.val;
+                if (function.test(v) && replaceNode(k, null, v) != null)
+                    removed = true;
+            }
+        }
+        return removed;
+    }
+
+    /**
      * If the specified key is not already associated with a value,
      * attempts to compute its value using the given mapping function
      * and enters it into this map unless {@code null}.  The entire
@@ -4690,6 +4730,10 @@
             throw new UnsupportedOperationException();
         }
 
+        public boolean removeIf(Predicate<? super V> filter) {
+            return map.removeValueIf(filter);
+        }
+
         public Spliterator<V> spliterator() {
             Node<K,V>[] t;
             ConcurrentHashMap<K,V> m = map;
@@ -4759,6 +4803,10 @@
             return added;
         }
 
+        public boolean removeIf(Predicate<? super Entry<K, V>> filter) {
+            return map.removeEntryIf(filter);
+        }
+
         public final int hashCode() {
             int h = 0;
             Node<K,V>[] t;
--- a/src/java.base/share/classes/java/util/concurrent/ConcurrentMap.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.base/share/classes/java/util/concurrent/ConcurrentMap.java	Thu May 14 20:15:26 2015 -0700
@@ -34,6 +34,7 @@
  */
 
 package java.util.concurrent;
+
 import java.util.Map;
 import java.util.Objects;
 import java.util.function.BiConsumer;
@@ -44,6 +45,14 @@
  * A {@link java.util.Map} providing thread safety and atomicity
  * guarantees.
  *
+ * <p>To maintain the specified guarantees, default implementations of
+ * methods including {@link #putIfAbsent} inherited from {@link Map}
+ * must be overridden by implementations of this interface. Similarly,
+ * implementations of the collections returned by methods {@link
+ * #keySet}, {@link #values}, and {@link #entrySet} must override
+ * methods such as {@code removeIf} when necessary to
+ * preserve atomicity guarantees.
+ *
  * <p>Memory consistency effects: As with other concurrent
  * collections, actions in a thread prior to placing an object into a
  * {@code ConcurrentMap} as a key or value
@@ -60,7 +69,7 @@
  * @param <K> the type of keys maintained by this map
  * @param <V> the type of mapped values
  */
-public interface ConcurrentMap<K, V> extends Map<K, V> {
+public interface ConcurrentMap<K,V> extends Map<K,V> {
 
     /**
      * {@inheritDoc}
@@ -86,9 +95,9 @@
      * @implSpec The default implementation is equivalent to, for this
      * {@code map}:
      * <pre> {@code
-     * for ((Map.Entry<K, V> entry : map.entrySet())
-     *     action.accept(entry.getKey(), entry.getValue());
-     * }</pre>
+     * for (Map.Entry<K,V> entry : map.entrySet()) {
+     *   action.accept(entry.getKey(), entry.getValue());
+     * }}</pre>
      *
      * @implNote The default implementation assumes that
      * {@code IllegalStateException} thrown by {@code getKey()} or
@@ -101,13 +110,13 @@
     @Override
     default void forEach(BiConsumer<? super K, ? super V> action) {
         Objects.requireNonNull(action);
-        for (Map.Entry<K, V> entry : entrySet()) {
+        for (Map.Entry<K,V> entry : entrySet()) {
             K k;
             V v;
             try {
                 k = entry.getKey();
                 v = entry.getValue();
-            } catch(IllegalStateException ise) {
+            } catch (IllegalStateException ise) {
                 // this usually means the entry is no longer in the map.
                 continue;
             }
@@ -117,14 +126,13 @@
 
     /**
      * If the specified key is not already associated
-     * with a value, associate it with the given value.
-     * This is equivalent to
-     *  <pre> {@code
+     * with a value, associates it with the given value.
+     * This is equivalent to, for this {@code map}:
+     * <pre> {@code
      * if (!map.containsKey(key))
      *   return map.put(key, value);
      * else
-     *   return map.get(key);
-     * }</pre>
+     *   return map.get(key);}</pre>
      *
      * except that the action is performed atomically.
      *
@@ -147,18 +155,19 @@
      * @throws IllegalArgumentException if some property of the specified key
      *         or value prevents it from being stored in this map
      */
-     V putIfAbsent(K key, V value);
+    V putIfAbsent(K key, V value);
 
     /**
      * Removes the entry for a key only if currently mapped to a given value.
-     * This is equivalent to
-     *  <pre> {@code
-     * if (map.containsKey(key) && Objects.equals(map.get(key), value)) {
+     * This is equivalent to, for this {@code map}:
+     * <pre> {@code
+     * if (map.containsKey(key)
+     *     && Objects.equals(map.get(key), value)) {
      *   map.remove(key);
      *   return true;
-     * } else
+     * } else {
      *   return false;
-     * }</pre>
+     * }}</pre>
      *
      * except that the action is performed atomically.
      *
@@ -181,14 +190,15 @@
 
     /**
      * Replaces the entry for a key only if currently mapped to a given value.
-     * This is equivalent to
-     *  <pre> {@code
-     * if (map.containsKey(key) && Objects.equals(map.get(key), oldValue)) {
+     * This is equivalent to, for this {@code map}:
+     * <pre> {@code
+     * if (map.containsKey(key)
+     *     && Objects.equals(map.get(key), oldValue)) {
      *   map.put(key, newValue);
      *   return true;
-     * } else
+     * } else {
      *   return false;
-     * }</pre>
+     * }}</pre>
      *
      * except that the action is performed atomically.
      *
@@ -212,13 +222,12 @@
 
     /**
      * Replaces the entry for a key only if currently mapped to some value.
-     * This is equivalent to
-     *  <pre> {@code
-     * if (map.containsKey(key)) {
+     * This is equivalent to, for this {@code map}:
+     * <pre> {@code
+     * if (map.containsKey(key))
      *   return map.put(key, value);
-     * } else
-     *   return null;
-     * }</pre>
+     * else
+     *   return null;}</pre>
      *
      * except that the action is performed atomically.
      *
@@ -249,12 +258,14 @@
      * @implSpec
      * <p>The default implementation is equivalent to, for this {@code map}:
      * <pre> {@code
-     * for ((Map.Entry<K, V> entry : map.entrySet())
-     *     do {
-     *        K k = entry.getKey();
-     *        V v = entry.getValue();
-     *     } while(!replace(k, v, function.apply(k, v)));
-     * }</pre>
+     * for (Map.Entry<K,V> entry : map.entrySet()) {
+     *   K k;
+     *   V v;
+     *   do {
+     *     k = entry.getKey();
+     *     v = entry.getValue();
+     *   } while (!map.replace(k, v, function.apply(k, v)));
+     * }}</pre>
      *
      * The default implementation may retry these steps when multiple
      * threads attempt updates including potentially calling the function
@@ -275,7 +286,7 @@
     default void replaceAll(BiFunction<? super K, ? super V, ? extends V> function) {
         Objects.requireNonNull(function);
         forEach((k,v) -> {
-            while(!replace(k, v, function.apply(k, v))) {
+            while (!replace(k, v, function.apply(k, v))) {
                 // v changed or k is gone
                 if ( (v = get(k)) == null) {
                     // k is no longer in the map.
@@ -295,11 +306,10 @@
      *
      * <pre> {@code
      * if (map.get(key) == null) {
-     *     V newValue = mappingFunction.apply(key);
-     *     if (newValue != null)
-     *         return map.putIfAbsent(key, newValue);
-     * }
-     * }</pre>
+     *   V newValue = mappingFunction.apply(key);
+     *   if (newValue != null)
+     *     return map.putIfAbsent(key, newValue);
+     * }}</pre>
      *
      * The default implementation may retry these steps when multiple
      * threads attempt updates including potentially calling the mapping
@@ -331,18 +341,17 @@
      * @implSpec
      * The default implementation is equivalent to performing the following
      * steps for this {@code map}, then returning the current value or
-     * {@code null} if now absent. :
+     * {@code null} if now absent:
      *
      * <pre> {@code
      * if (map.get(key) != null) {
-     *     V oldValue = map.get(key);
-     *     V newValue = remappingFunction.apply(key, oldValue);
-     *     if (newValue != null)
-     *         map.replace(key, oldValue, newValue);
-     *     else
-     *         map.remove(key, oldValue);
-     * }
-     * }</pre>
+     *   V oldValue = map.get(key);
+     *   V newValue = remappingFunction.apply(key, oldValue);
+     *   if (newValue != null)
+     *     map.replace(key, oldValue, newValue);
+     *   else
+     *     map.remove(key, oldValue);
+     * }}</pre>
      *
      * The default implementation may retry these steps when multiple threads
      * attempt updates including potentially calling the remapping function
@@ -363,13 +372,13 @@
             BiFunction<? super K, ? super V, ? extends V> remappingFunction) {
         Objects.requireNonNull(remappingFunction);
         V oldValue;
-        while((oldValue = get(key)) != null) {
+        while ((oldValue = get(key)) != null) {
             V newValue = remappingFunction.apply(key, oldValue);
             if (newValue != null) {
                 if (replace(key, oldValue, newValue))
                     return newValue;
             } else if (remove(key, oldValue))
-               return null;
+                return null;
         }
         return oldValue;
     }
@@ -386,17 +395,16 @@
      * V oldValue = map.get(key);
      * V newValue = remappingFunction.apply(key, oldValue);
      * if (oldValue != null ) {
-     *    if (newValue != null)
-     *       map.replace(key, oldValue, newValue);
-     *    else
-     *       map.remove(key, oldValue);
+     *   if (newValue != null)
+     *     map.replace(key, oldValue, newValue);
+     *   else
+     *     map.remove(key, oldValue);
      * } else {
-     *    if (newValue != null)
-     *       map.putIfAbsent(key, newValue);
-     *    else
-     *       return null;
-     * }
-     * }</pre>
+     *   if (newValue != null)
+     *     map.putIfAbsent(key, newValue);
+     *   else
+     *     return null;
+     * }}</pre>
      *
      * The default implementation may retry these steps when multiple
      * threads attempt updates including potentially calling the remapping
@@ -417,7 +425,7 @@
             BiFunction<? super K, ? super V, ? extends V> remappingFunction) {
         Objects.requireNonNull(remappingFunction);
         V oldValue = get(key);
-        for(;;) {
+        for (;;) {
             V newValue = remappingFunction.apply(key, oldValue);
             if (newValue == null) {
                 // delete mapping
@@ -458,7 +466,6 @@
         }
     }
 
-
     /**
      * {@inheritDoc}
      *
@@ -470,12 +477,11 @@
      * <pre> {@code
      * V oldValue = map.get(key);
      * V newValue = (oldValue == null) ? value :
-     *              remappingFunction.apply(oldValue, value);
+     *     remappingFunction.apply(oldValue, value);
      * if (newValue == null)
-     *     map.remove(key);
+     *   map.remove(key);
      * else
-     *     map.put(key, newValue);
-     * }</pre>
+     *   map.put(key, newValue);}</pre>
      *
      * <p>The default implementation may retry these steps when multiple
      * threads attempt updates including potentially calling the remapping
--- a/src/java.base/share/classes/java/util/concurrent/ConcurrentSkipListMap.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.base/share/classes/java/util/concurrent/ConcurrentSkipListMap.java	Thu May 14 20:15:26 2015 -0700
@@ -58,6 +58,7 @@
 import java.util.function.Consumer;
 import java.util.function.BiConsumer;
 import java.util.function.Function;
+import java.util.function.Predicate;
 
 /**
  * A scalable concurrent {@link ConcurrentNavigableMap} implementation.
@@ -2492,6 +2493,22 @@
             else
                 return (Spliterator<E>)((SubMap<?,E>)m).valueIterator();
         }
+        public boolean removeIf(Predicate<? super E> filter) {
+            if (filter == null) throw new NullPointerException();
+            if (m instanceof ConcurrentSkipListMap)
+                return ((ConcurrentSkipListMap<?,E>)m).removeValueIf(filter);
+            // else use iterator
+            @SuppressWarnings("unchecked") Iterator<Map.Entry<Object,E>> it =
+                    ((SubMap<Object,E>)m).entryIterator();
+            boolean removed = false;
+            while (it.hasNext()) {
+                Map.Entry<Object,E> e = it.next();
+                E v = e.getValue();
+                if (filter.test(v) && m.remove(e.getKey(), v))
+                    removed = true;
+            }
+            return removed;
+        }
     }
 
     static final class EntrySet<K1,V1> extends AbstractSet<Map.Entry<K1,V1>> {
@@ -2554,6 +2571,20 @@
                 return (Spliterator<Map.Entry<K1,V1>>)
                     ((SubMap<K1,V1>)m).entryIterator();
         }
+        public boolean removeIf(Predicate<? super Entry<K1, V1>> filter) {
+            if (filter == null) throw new NullPointerException();
+            if (m instanceof ConcurrentSkipListMap)
+                return ((ConcurrentSkipListMap<K1,V1>)m).removeEntryIf(filter);
+            // else use iterator
+            Iterator<Map.Entry<K1,V1>> it = ((SubMap<K1,V1>)m).entryIterator();
+            boolean removed = false;
+            while (it.hasNext()) {
+                Map.Entry<K1,V1> e = it.next();
+                if (filter.test(e) && m.remove(e.getKey(), e.getValue()))
+                    removed = true;
+            }
+            return removed;
+        }
     }
 
     /**
@@ -3267,6 +3298,41 @@
     }
 
     /**
+     * Helper method for EntrySet.removeIf
+     */
+    boolean removeEntryIf(Predicate<? super Entry<K, V>> function) {
+        if (function == null) throw new NullPointerException();
+        boolean removed = false;
+        for (Node<K,V> n = findFirst(); n != null; n = n.next) {
+            V v;
+            if ((v = n.getValidValue()) != null) {
+                K k = n.key;
+                Map.Entry<K,V> e = new AbstractMap.SimpleImmutableEntry<>(k, v);
+                if (function.test(e) && remove(k, v))
+                    removed = true;
+            }
+        }
+        return removed;
+    }
+
+    /**
+     * Helper method for Values.removeIf
+     */
+    boolean removeValueIf(Predicate<? super V> function) {
+        if (function == null) throw new NullPointerException();
+        boolean removed = false;
+        for (Node<K,V> n = findFirst(); n != null; n = n.next) {
+            V v;
+            if ((v = n.getValidValue()) != null) {
+                K k = n.key;
+                if (function.test(v) && remove(k, v))
+                    removed = true;
+            }
+        }
+        return removed;
+    }
+
+    /**
      * Base class providing common structure for Spliterators.
      * (Although not all that much common functionality; as usual for
      * view classes, details annoyingly vary in key, value, and entry
--- a/src/java.base/share/classes/javax/security/auth/Subject.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.base/share/classes/javax/security/auth/Subject.java	Thu May 14 20:15:26 2015 -0700
@@ -1522,17 +1522,20 @@
             }
         }
 
+        @Override
         public int size() {
             return set.size();
         }
 
+        @Override
         public Iterator<T> iterator() {
             return set.iterator();
         }
 
+        @Override
         public boolean add(T o) {
 
-            if (!o.getClass().isAssignableFrom(c)) {
+            if (!c.isAssignableFrom(o.getClass())) {
                 MessageFormat form = new MessageFormat(ResourcesMgr.getString
                         ("attempting.to.add.an.object.which.is.not.an.instance.of.class"));
                 Object[] source = {c.toString()};
--- a/src/java.base/share/classes/sun/security/provider/SunEntries.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.base/share/classes/sun/security/provider/SunEntries.java	Thu May 14 20:15:26 2015 -0700
@@ -67,10 +67,6 @@
  *   in RFC 5280. The ValidationAlgorithm attribute notes the
  *   specification that this provider implements.
  *
- * - LDAP is the CertStore type for LDAP repositories. The
- *   LDAPSchema attribute notes the specification defining the
- *   schema that this provider uses to find certificates and CRLs.
- *
  * - JavaPolicy is the default file-based Policy type.
  *
  * - JavaLoginConfig is the default file-based LoginModule Configuration type.
@@ -275,9 +271,6 @@
         /*
          * CertStores
          */
-        map.put("CertStore.LDAP",
-            "sun.security.provider.certpath.ldap.LDAPCertStore");
-        map.put("CertStore.LDAP LDAPSchema", "RFC2587");
         map.put("CertStore.Collection",
             "sun.security.provider.certpath.CollectionCertStore");
         map.put("CertStore.com.sun.security.IndexedCollection",
@@ -310,7 +303,6 @@
         map.put("KeyStore.JKS ImplementedIn", "Software");
         map.put("CertPathValidator.PKIX ImplementedIn", "Software");
         map.put("CertPathBuilder.PKIX ImplementedIn", "Software");
-        map.put("CertStore.LDAP ImplementedIn", "Software");
         map.put("CertStore.Collection ImplementedIn", "Software");
         map.put("CertStore.com.sun.security.IndexedCollection ImplementedIn",
             "Software");
--- a/src/java.base/share/classes/sun/security/provider/certpath/CertStoreHelper.java	Thu May 14 12:38:11 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,148 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.security.provider.certpath;
-
-import java.net.URI;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-import java.security.AccessController;
-import java.security.NoSuchAlgorithmException;
-import java.security.InvalidAlgorithmParameterException;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-import java.security.cert.CertStore;
-import java.security.cert.CertStoreException;
-import java.security.cert.X509CertSelector;
-import java.security.cert.X509CRLSelector;
-import javax.security.auth.x500.X500Principal;
-import java.io.IOException;
-
-import sun.security.util.Cache;
-
-/**
- * Helper used by URICertStore and others when delegating to another CertStore
- * to fetch certs and CRLs.
- */
-
-public abstract class CertStoreHelper {
-
-    private static final int NUM_TYPES = 2;
-    private final static Map<String,String> classMap = new HashMap<>(NUM_TYPES);
-    static {
-        classMap.put(
-            "LDAP",
-            "sun.security.provider.certpath.ldap.LDAPCertStoreHelper");
-        classMap.put(
-            "SSLServer",
-            "sun.security.provider.certpath.ssl.SSLServerCertStoreHelper");
-    };
-    private static Cache<String, CertStoreHelper> cache
-        = Cache.newSoftMemoryCache(NUM_TYPES);
-
-    public static CertStoreHelper getInstance(final String type)
-        throws NoSuchAlgorithmException
-    {
-        CertStoreHelper helper = cache.get(type);
-        if (helper != null) {
-            return helper;
-        }
-        final String cl = classMap.get(type);
-        if (cl == null) {
-            throw new NoSuchAlgorithmException(type + " not available");
-        }
-        try {
-            helper = AccessController.doPrivileged(
-                new PrivilegedExceptionAction<CertStoreHelper>() {
-                    public CertStoreHelper run() throws ClassNotFoundException {
-                        try {
-                            Class<?> c = Class.forName(cl, true, null);
-                            CertStoreHelper csh
-                                = (CertStoreHelper)c.newInstance();
-                            cache.put(type, csh);
-                            return csh;
-                        } catch (InstantiationException |
-                                 IllegalAccessException e) {
-                            throw new AssertionError(e);
-                        }
-                    }
-            });
-            return helper;
-        } catch (PrivilegedActionException e) {
-            throw new NoSuchAlgorithmException(type + " not available",
-                                               e.getException());
-        }
-    }
-
-    static boolean isCausedByNetworkIssue(String type, CertStoreException cse) {
-        switch (type) {
-            case "LDAP":
-            case "SSLServer":
-                try {
-                    CertStoreHelper csh = CertStoreHelper.getInstance(type);
-                    return csh.isCausedByNetworkIssue(cse);
-                } catch (NoSuchAlgorithmException nsae) {
-                    return false;
-                }
-            case "URI":
-                Throwable t = cse.getCause();
-                return (t != null && t instanceof IOException);
-            default:
-                // we don't know about any other remote CertStore types
-                return false;
-        }
-    }
-
-    /**
-     * Returns a CertStore using the given URI as parameters.
-     */
-    public abstract CertStore getCertStore(URI uri)
-        throws NoSuchAlgorithmException, InvalidAlgorithmParameterException;
-
-    /**
-     * Wraps an existing X509CertSelector when needing to avoid DN matching
-     * issues.
-     */
-    public abstract X509CertSelector wrap(X509CertSelector selector,
-                          X500Principal certSubject,
-                          String dn)
-        throws IOException;
-
-    /**
-     * Wraps an existing X509CRLSelector when needing to avoid DN matching
-     * issues.
-     */
-    public abstract X509CRLSelector wrap(X509CRLSelector selector,
-                         Collection<X500Principal> certIssuers,
-                         String dn)
-        throws IOException;
-
-    /**
-     * Returns true if the cause of the CertStoreException is a network
-     * related issue.
-     */
-    public abstract boolean isCausedByNetworkIssue(CertStoreException e);
-}
--- a/src/java.base/share/classes/sun/security/provider/certpath/RevocationChecker.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.base/share/classes/sun/security/provider/certpath/RevocationChecker.java	Thu May 14 20:15:26 2015 -0700
@@ -466,6 +466,34 @@
                   stackedCerts, params.trustAnchors());
     }
 
+    static boolean isCausedByNetworkIssue(String type, CertStoreException cse) {
+        boolean result;
+        Throwable t = cse.getCause();
+
+        switch (type) {
+            case "LDAP":
+                if (t != null) {
+                    // These two exception classes are inside java.naming module
+                    String cn = t.getClass().getName();
+                    result = (cn.equals("javax.naming.ServiceUnavailableException") ||
+                        cn.equals("javax.naming.CommunicationException"));
+                } else {
+                    result = false;
+                }
+                break;
+            case "SSLServer":
+                result = (t != null && t instanceof IOException);
+                break;
+            case "URI":
+                result = (t != null && t instanceof IOException);
+                break;
+            default:
+                // we don't know about any other remote CertStore types
+                return false;
+        }
+        return result;
+    }
+
     private void checkCRLs(X509Certificate cert, PublicKey prevKey,
                            X509Certificate prevCert, boolean signFlag,
                            boolean allowSeparateKey,
@@ -510,7 +538,7 @@
                                   "CertStoreException: " + e.getMessage());
                 }
                 if (networkFailureException == null &&
-                    CertStoreHelper.isCausedByNetworkIssue(store.getType(),e)) {
+                    isCausedByNetworkIssue(store.getType(),e)) {
                     // save this exception, we may need to throw it later
                     networkFailureException = new CertPathValidatorException(
                         "Unable to determine revocation status due to " +
@@ -557,8 +585,7 @@
             } catch (CertStoreException e) {
                 if (e instanceof CertStoreTypeException) {
                     CertStoreTypeException cste = (CertStoreTypeException)e;
-                    if (CertStoreHelper.isCausedByNetworkIssue(cste.getType(),
-                                                               e)) {
+                    if (isCausedByNetworkIssue(cste.getType(), e)) {
                         throw new CertPathValidatorException(
                             "Unable to determine revocation status due to " +
                             "network error", e, null, -1,
--- a/src/java.base/share/classes/sun/security/provider/certpath/URICertStore.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.base/share/classes/sun/security/provider/certpath/URICertStore.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -42,6 +42,7 @@
 import java.security.cert.CertStoreSpi;
 import java.security.cert.CRLException;
 import java.security.cert.CRLSelector;
+import java.security.cert.URICertStoreParameters;
 import java.security.cert.X509Certificate;
 import java.security.cert.X509CertSelector;
 import java.security.cert.X509CRL;
@@ -118,9 +119,7 @@
 
     // true if URI is ldap
     private boolean ldap = false;
-    private CertStoreHelper ldapHelper;
     private CertStore ldapCertStore;
-    private String ldapPath;
 
     // Default maximum connect timeout in milliseconds (15 seconds)
     // allowed when downloading CRLs
@@ -165,13 +164,8 @@
         // if ldap URI, use an LDAPCertStore to fetch certs and CRLs
         if (uri.getScheme().toLowerCase(Locale.ENGLISH).equals("ldap")) {
             ldap = true;
-            ldapHelper = CertStoreHelper.getInstance("LDAP");
-            ldapCertStore = ldapHelper.getCertStore(uri);
-            ldapPath = uri.getPath();
-            // strip off leading '/'
-            if (ldapPath.charAt(0) == '/') {
-                ldapPath = ldapPath.substring(1);
-            }
+            URICertStoreParameters lparams = new URICertStoreParameters(uri);
+            ldapCertStore = CertStore.getInstance("LDAP", lparams);
         }
         try {
             factory = CertificateFactory.getInstance("X.509");
@@ -246,20 +240,10 @@
     public synchronized Collection<X509Certificate> engineGetCertificates
         (CertSelector selector) throws CertStoreException {
 
-        // if ldap URI we wrap the CertSelector in an LDAPCertSelector to
-        // avoid LDAP DN matching issues (see LDAPCertSelector for more info)
         if (ldap) {
-            X509CertSelector xsel = (X509CertSelector) selector;
-            try {
-                xsel = ldapHelper.wrap(xsel, xsel.getSubject(), ldapPath);
-            } catch (IOException ioe) {
-                throw new CertStoreException(ioe);
-            }
-            // Fetch the certificates via LDAP. LDAPCertStore has its own
             // caching mechanism, see the class description for more info.
-            // Safe cast since xsel is an X509 certificate selector.
             return (Collection<X509Certificate>)
-                ldapCertStore.getCertificates(xsel);
+                ldapCertStore.getCertificates(selector);
         }
 
         // Return the Certificates for this entry. It returns the cached value
@@ -356,20 +340,11 @@
     public synchronized Collection<X509CRL> engineGetCRLs(CRLSelector selector)
         throws CertStoreException {
 
-        // if ldap URI we wrap the CRLSelector in an LDAPCRLSelector to
-        // avoid LDAP DN matching issues (see LDAPCRLSelector for more info)
         if (ldap) {
-            X509CRLSelector xsel = (X509CRLSelector) selector;
-            try {
-                xsel = ldapHelper.wrap(xsel, null, ldapPath);
-            } catch (IOException ioe) {
-                throw new CertStoreException(ioe);
-            }
             // Fetch the CRLs via LDAP. LDAPCertStore has its own
             // caching mechanism, see the class description for more info.
-            // Safe cast since xsel is an X509 certificate selector.
             try {
-                return (Collection<X509CRL>) ldapCertStore.getCRLs(xsel);
+                return (Collection<X509CRL>) ldapCertStore.getCRLs(selector);
             } catch (CertStoreException cse) {
                 throw new PKIX.CertStoreTypeException("LDAP", cse);
             }
--- a/src/java.base/share/classes/sun/security/provider/certpath/ssl/SSLServerCertStore.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.base/share/classes/sun/security/provider/certpath/ssl/SSLServerCertStore.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -153,7 +153,7 @@
         throw new UnsupportedOperationException();
     }
 
-    static CertStore getInstance(URI uri)
+    public static CertStore getInstance(URI uri)
         throws InvalidAlgorithmParameterException
     {
         return new CS(new SSLServerCertStore(uri), null, "SSLServer", null);
--- a/src/java.base/share/classes/sun/security/provider/certpath/ssl/SSLServerCertStoreHelper.java	Thu May 14 12:38:11 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.security.provider.certpath.ssl;
-
-import java.io.IOException;
-import java.net.URI;
-import java.security.NoSuchAlgorithmException;
-import java.security.InvalidAlgorithmParameterException;
-import java.security.cert.CertStore;
-import java.security.cert.CertStoreException;
-import java.security.cert.X509CertSelector;
-import java.security.cert.X509CRLSelector;
-import java.util.Collection;
-import javax.security.auth.x500.X500Principal;
-
-import sun.security.provider.certpath.CertStoreHelper;
-
-/**
- * SSL implementation of CertStoreHelper.
- */
-public final class SSLServerCertStoreHelper extends CertStoreHelper {
-
-    @Override
-    public CertStore getCertStore(URI uri)
-        throws NoSuchAlgorithmException, InvalidAlgorithmParameterException
-    {
-        return SSLServerCertStore.getInstance(uri);
-    }
-
-    @Override
-    public X509CertSelector wrap(X509CertSelector selector,
-                                 X500Principal certSubject,
-                                 String ldapDN)
-        throws IOException
-    {
-        throw new UnsupportedOperationException();
-    }
-
-    @Override
-    public X509CRLSelector wrap(X509CRLSelector selector,
-                                Collection<X500Principal> certIssuers,
-                                String ldapDN)
-        throws IOException
-    {
-        throw new UnsupportedOperationException();
-    }
-
-    @Override
-    public boolean isCausedByNetworkIssue(CertStoreException e) {
-        Throwable t = e.getCause();
-        return (t != null && t instanceof IOException);
-    }
-}
--- a/src/java.base/share/classes/sun/security/tools/keytool/Main.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.base/share/classes/sun/security/tools/keytool/Main.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -46,6 +46,9 @@
 import java.security.cert.CRL;
 import java.security.cert.X509Certificate;
 import java.security.cert.CertificateException;
+import java.security.cert.URICertStoreParameters;
+
+
 import java.text.Collator;
 import java.text.MessageFormat;
 import java.util.*;
@@ -69,7 +72,7 @@
 import sun.security.pkcs10.PKCS10;
 import sun.security.pkcs10.PKCS10Attribute;
 import sun.security.provider.X509Factory;
-import sun.security.provider.certpath.CertStoreHelper;
+import sun.security.provider.certpath.ssl.SSLServerCertStore;
 import sun.security.util.Password;
 import javax.crypto.KeyGenerator;
 import javax.crypto.SecretKey;
@@ -2208,14 +2211,10 @@
                 }
             }
         } else {    // must be LDAP, and uri is not null
-            // Lazily load LDAPCertStoreHelper if present
-            CertStoreHelper helper = CertStoreHelper.getInstance("LDAP");
-            String path = uri.getPath();
-            if (path.charAt(0) == '/') path = path.substring(1);
-            CertStore s = helper.getCertStore(uri);
-            X509CRLSelector sel =
-                    helper.wrap(new X509CRLSelector(), null, path);
-            return s.getCRLs(sel);
+            URICertStoreParameters params =
+                new URICertStoreParameters(uri);
+            CertStore s = CertStore.getInstance("LDAP", params);
+            return s.getCRLs(new X509CRLSelector());
         }
     }
 
@@ -2463,9 +2462,7 @@
                 out.println(rb.getString("Not.a.signed.jar.file"));
             }
         } else if (sslserver != null) {
-            // Lazily load SSLCertStoreHelper if present
-            CertStoreHelper helper = CertStoreHelper.getInstance("SSLServer");
-            CertStore cs = helper.getCertStore(new URI("https://" + sslserver));
+            CertStore cs = SSLServerCertStore.getInstance(new URI("https://" + sslserver));
             Collection<? extends Certificate> chain;
             try {
                 chain = cs.getCertificates(null);
--- a/src/java.base/share/conf/security/java.security	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.base/share/conf/security/java.security	Thu May 14 20:15:26 2015 -0700
@@ -78,6 +78,7 @@
 security.provider.tbd=com.sun.security.sasl.Provider
 security.provider.tbd=org.jcp.xml.dsig.internal.dom.XMLDSigRI
 security.provider.tbd=sun.security.smartcardio.SunPCSC
+security.provider.tbd=sun.security.provider.certpath.ldap.JdkLDAP
 #ifdef windows
 security.provider.tbd=sun.security.mscapi.SunMSCAPI
 #endif
@@ -156,7 +157,8 @@
 
 #
 # Class to instantiate as the system Policy. This is the name of the class
-# that will be used as the Policy object.
+# that will be used as the Policy object. The system class loader is used to
+# locate this class.
 #
 policy.provider=sun.security.provider.PolicyFile
 
--- a/src/java.base/share/native/libjli/java.h	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.base/share/native/libjli/java.h	Thu May 14 20:15:26 2015 -0700
@@ -194,7 +194,7 @@
  * For MacOSX and Windows/Unix compatibility we require these
  * entry points, some of them may be stubbed out on Windows/Unixes.
  */
-void     PostJVMInit(JNIEnv *env, jstring mainClass, JavaVM *vm);
+void     PostJVMInit(JNIEnv *env, jclass mainClass, JavaVM *vm);
 void     ShowSplashScreen();
 void     RegisterThread();
 /*
--- a/src/java.base/share/native/libzip/zip_util.c	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.base/share/native/libzip/zip_util.c	Thu May 14 20:15:26 2015 -0700
@@ -1206,7 +1206,7 @@
         }
 
         /* Slash is already there? */
-        if (name[ulen-1] == '/') {
+        if (ulen > 0 && name[ulen - 1] == '/') {
             break;
         }
 
--- a/src/java.base/unix/classes/sun/util/locale/provider/HostLocaleProviderAdapterImpl.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.base/unix/classes/sun/util/locale/provider/HostLocaleProviderAdapterImpl.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2014 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
--- a/src/java.base/unix/native/libjli/java_md_solinux.c	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.base/unix/native/libjli/java_md_solinux.c	Thu May 14 20:15:26 2015 -0700
@@ -938,7 +938,7 @@
 }
 
 void
-PostJVMInit(JNIEnv *env, jstring mainClass, JavaVM *vm)
+PostJVMInit(JNIEnv *env, jclass mainClass, JavaVM *vm)
 {
     // stubbed out for windows and *nixes.
 }
--- a/src/java.base/windows/native/libjli/java_md.c	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.base/windows/native/libjli/java_md.c	Thu May 14 20:15:26 2015 -0700
@@ -970,7 +970,7 @@
 }
 
 void
-PostJVMInit(JNIEnv *env, jstring mainClass, JavaVM *vm)
+PostJVMInit(JNIEnv *env, jclass mainClass, JavaVM *vm)
 {
     // stubbed out for windows and *nixes.
 }
--- a/src/java.desktop/macosx/classes/com/apple/eawt/Application.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/macosx/classes/com/apple/eawt/Application.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,14 +25,18 @@
 
 package com.apple.eawt;
 
-import java.awt.*;
-import java.awt.peer.*;
+import java.awt.Image;
+import java.awt.Point;
+import java.awt.PopupMenu;
+import java.awt.Toolkit;
+import java.awt.Window;
 import java.beans.Beans;
 
 import javax.swing.JMenuBar;
 
-import sun.lwawt.*;
-import sun.lwawt.macosx.*;
+import sun.awt.AWTAccessor;
+import sun.lwawt.LWWindowPeer;
+import sun.lwawt.macosx.CPlatformWindow;
 
 /**
  * The <code>Application</code> class allows you to integrate your Java application with the native Mac OS X environment.
@@ -385,10 +389,8 @@
      *
      * @since Java for Mac OS X 10.7 Update 1
      */
-    @SuppressWarnings("deprecation")
     public void requestToggleFullScreen(final Window window) {
-        final ComponentPeer peer = window.getPeer();
-
+        final Object peer = AWTAccessor.getComponentAccessor().getPeer(window);
         if (!(peer instanceof LWWindowPeer)) return;
         Object platformWindow = ((LWWindowPeer) peer).getPlatformWindow();
         if (!(platformWindow instanceof CPlatformWindow)) return;
--- a/src/java.desktop/macosx/classes/com/apple/eawt/_AppDockIconHandler.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/macosx/classes/com/apple/eawt/_AppDockIconHandler.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,7 @@
 import java.awt.*;
 import java.lang.reflect.*;
 
+import sun.awt.AWTAccessor;
 import sun.lwawt.macosx.*;
 import sun.lwawt.macosx.CImage.Creator;
 
@@ -41,7 +42,6 @@
 
     _AppDockIconHandler() { }
 
-    @SuppressWarnings("deprecation")
     public void setDockMenu(final PopupMenu menu) {
         fDockMenu = menu;
 
@@ -61,8 +61,8 @@
 
         // instantiate the menu peer and set the native fDockMenu ivar
         menu.addNotify();
-        final long nsMenuPtr = ((CMenu)fDockMenu.getPeer()).getNativeMenu();
-        nativeSetDockMenu(nsMenuPtr);
+        CMenu peer = AWTAccessor.getMenuComponentAccessor().getPeer(fDockMenu);
+        nativeSetDockMenu(peer.getNativeMenu());
     }
 
     public PopupMenu getDockMenu() {
--- a/src/java.desktop/macosx/classes/com/apple/eawt/_AppMenuBarHandler.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/macosx/classes/com/apple/eawt/_AppMenuBarHandler.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,6 +32,7 @@
 import javax.swing.plaf.MenuBarUI;
 
 import com.apple.laf.ScreenMenuBar;
+import sun.awt.AWTAccessor;
 import sun.lwawt.macosx.CMenuBar;
 
 import com.apple.laf.AquaMenuBarUI;
@@ -49,7 +50,10 @@
     }
 
     // callback from the native delegate -init function
-    private static void initMenuStates(final boolean aboutMenuItemVisible, final boolean aboutMenuItemEnabled, final boolean prefsMenuItemVisible, final boolean prefsMenuItemEnabled) {
+    private static void initMenuStates(final boolean aboutMenuItemVisible,
+                                       final boolean aboutMenuItemEnabled,
+                                       final boolean prefsMenuItemVisible,
+                                       final boolean prefsMenuItemEnabled) {
         synchronized (instance) {
             instance.aboutMenuItemVisible = aboutMenuItemVisible;
             instance.aboutMenuItemEnabled = aboutMenuItemEnabled;
@@ -92,7 +96,6 @@
         return (frame.getExtendedState() & Frame.ICONIFIED) != 0;
     }
 
-    @SuppressWarnings("deprecation")
     static void installDefaultMenuBar(final JMenuBar menuBar) {
         if (menuBar == null) {
             // intentionally clearing the default menu
@@ -114,7 +117,7 @@
         }
 
         screenMenuBar.addNotify();
-        final MenuComponentPeer peer = screenMenuBar.getPeer();
+        final Object peer = AWTAccessor.getMenuComponentAccessor().getPeer(screenMenuBar);
         if (!(peer instanceof CMenuBar)) {
             // such a thing should not be possible
             throw new IllegalStateException("Unable to determine native menu bar from provided JMenuBar");
--- a/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxUI.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxUI.java	Thu May 14 20:15:26 2015 -0700
@@ -152,20 +152,6 @@
         }
 
         @Override
-        public void focusGained(final FocusEvent e) {
-            if (arrowButton != null) {
-                arrowButton.repaint();
-            }
-        }
-
-        @Override
-        public void focusLost(final FocusEvent e) {
-            if (arrowButton != null) {
-                arrowButton.repaint();
-            }
-        }
-
-        @Override
         public void changedUpdate(final DocumentEvent e) {
             editorTextChanged();
         }
@@ -252,6 +238,16 @@
      */
     protected FocusListener createFocusListener() {
         return new BasicComboBoxUI.FocusHandler() {
+            @Override
+            public void focusGained(FocusEvent e) {
+                super.focusGained(e);
+
+                if (arrowButton != null) {
+                    arrowButton.repaint();
+                }
+            }
+
+            @Override
             public void focusLost(final FocusEvent e) {
                 hasFocus = false;
                 if (!e.isTemporary()) {
@@ -264,6 +260,10 @@
                 if (ac != null) {
                     ac.firePropertyChange(AccessibleContext.ACCESSIBLE_STATE_PROPERTY, AccessibleState.FOCUSED, null);
                 }
+
+                if (arrowButton != null) {
+                    arrowButton.repaint();
+                }
             }
         };
     }
@@ -438,6 +438,7 @@
             if (editor != null) {
                 final Rectangle editorRect = rectangleForCurrentValue();
                 editorRect.width += 4;
+                editorRect.height += 1;
                 editor.setBounds(editorRect);
             }
         }
--- a/src/java.desktop/macosx/classes/com/apple/laf/AquaTextFieldBorder.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/macosx/classes/com/apple/laf/AquaTextFieldBorder.java	Thu May 14 20:15:26 2015 -0700
@@ -124,7 +124,7 @@
 
     public Insets getBorderInsets(final Component c) {
         if (!(c instanceof JTextComponent) || c.isOpaque()) return new InsetsUIResource(3, 7, 3, 7);
-        return new InsetsUIResource(6, 7, 6, 7);
+        return new InsetsUIResource(5, 5, 5, 5);
     }
 
     protected static State getStateFor(final JTextComponent jc) {
--- a/src/java.desktop/macosx/classes/com/apple/laf/ScreenMenu.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/macosx/classes/com/apple/laf/ScreenMenu.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,11 +27,11 @@
 
 import java.awt.*;
 import java.awt.event.*;
-import java.awt.peer.MenuComponentPeer;
 import java.util.Hashtable;
 
 import javax.swing.*;
 
+import sun.awt.AWTAccessor;
 import sun.awt.SunToolkit;
 import sun.lwawt.LWToolkit;
 import sun.lwawt.macosx.*;
@@ -212,24 +212,36 @@
                 // Send a mouseExited to the previously hilited item, if it wasn't 0.
                 if (target != fLastMouseEventTarget) {
                     if (fLastMouseEventTarget != null) {
-                        LWToolkit.postEvent(new MouseEvent(fLastMouseEventTarget, MouseEvent.MOUSE_EXITED, when, modifiers, x - fLastTargetRect.x, y - fLastTargetRect.y, 0, false));
+                        LWToolkit.postEvent(
+                                new MouseEvent(fLastMouseEventTarget,
+                                               MouseEvent.MOUSE_EXITED, when,
+                                               modifiers, x - fLastTargetRect.x,
+                                               y - fLastTargetRect.y, 0,
+                                               false));
                     }
-                    // Send a mouseEntered to the current hilited item, if it wasn't 0.
+                    // Send a mouseEntered to the current hilited item, if it
+                    // wasn't 0.
                     if (target != null) {
-                        LWToolkit.postEvent(new MouseEvent(target, MouseEvent.MOUSE_ENTERED, when, modifiers, x - targetRect.x, y - targetRect.y, 0, false));
+                        LWToolkit.postEvent(
+                                new MouseEvent(target, MouseEvent.MOUSE_ENTERED,
+                                               when, modifiers,
+                                               x - targetRect.x,
+                                               y - targetRect.y, 0, false));
                     }
                     fLastMouseEventTarget = target;
                     fLastTargetRect = targetRect;
                 }
                 // Post a mouse event to the current item.
                 if (target == null) return;
-                LWToolkit.postEvent(new MouseEvent(target, kind, when, modifiers, x - targetRect.x, y - targetRect.y, 0, false));
+                LWToolkit.postEvent(
+                        new MouseEvent(target, kind, when, modifiers,
+                                       x - targetRect.x, y - targetRect.y, 0,
+                                       false));
             }
         });
     }
 
     @Override
-    @SuppressWarnings("deprecation")
     public void addNotify() {
         synchronized (getTreeLock()) {
             super.addNotify();
@@ -248,7 +260,8 @@
                 if (tooltipText != null) {
                     setToolTipText(tooltipText);
                 }
-                final MenuComponentPeer peer = getPeer();
+                final Object peer = AWTAccessor.getMenuComponentAccessor()
+                                               .getPeer(this);
                 if (peer instanceof CMenu) {
                     final CMenu menu = (CMenu) peer;
                     final long nativeMenu = menu.getNativeMenu();
@@ -355,9 +368,8 @@
     public void setIndeterminate(boolean indeterminate) { }
 
     @Override
-    @SuppressWarnings("deprecation")
     public void setToolTipText(final String text) {
-        final MenuComponentPeer peer = getPeer();
+        Object peer = AWTAccessor.getMenuComponentAccessor().getPeer(this);
         if (!(peer instanceof CMenuItem)) return;
 
         final CMenuItem cmi = (CMenuItem)peer;
@@ -365,9 +377,8 @@
     }
 
     @Override
-    @SuppressWarnings("deprecation")
     public void setIcon(final Icon i) {
-        final MenuComponentPeer peer = getPeer();
+        Object peer = AWTAccessor.getMenuComponentAccessor().getPeer(this);
         if (!(peer instanceof CMenuItem)) return;
 
         final CMenuItem cmi = (CMenuItem)peer;
--- a/src/java.desktop/macosx/classes/com/apple/laf/ScreenMenuBar.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/macosx/classes/com/apple/laf/ScreenMenuBar.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,19 +25,21 @@
 
 package com.apple.laf;
 
-import sun.awt.AWTAccessor;
 import sun.lwawt.macosx.CMenuBar;
 
 import java.awt.*;
 import java.awt.event.*;
-import java.lang.reflect.*;
-import java.security.*;
 import java.util.*;
 
 import javax.swing.*;
 
+import static sun.awt.AWTAccessor.*;
+
 @SuppressWarnings("serial") // JDK implementation class
-public class ScreenMenuBar extends MenuBar implements ContainerListener, ScreenMenuPropertyHandler, ComponentListener {
+public class ScreenMenuBar extends MenuBar
+        implements ContainerListener, ScreenMenuPropertyHandler,
+                   ComponentListener {
+
     static boolean sJMenuBarHasHelpMenus = false; //$ could check by calling getHelpMenu in a try block
 
     JMenuBar fSwingBar;
@@ -246,22 +248,23 @@
             fSubmenus.remove(menu);
     }
 
-    @SuppressWarnings("deprecation")
     public Menu add(final Menu m, final int index) {
         synchronized (getTreeLock()) {
             if (m.getParent() != null) {
                 m.getParent().remove(m);
             }
 
-            final Vector<Menu> menus = AWTAccessor.getMenuBarAccessor().getMenus(this);
+            final Vector<Menu> menus = getMenuBarAccessor().getMenus(this);
             menus.insertElementAt(m, index);
-            AWTAccessor.getMenuComponentAccessor().setParent(m, this);
+            final MenuComponentAccessor acc = getMenuComponentAccessor();
+            acc.setParent(m, this);
 
-            final CMenuBar peer = (CMenuBar)getPeer();
+            final CMenuBar peer = acc.getPeer(this);
             if (peer == null) return m;
 
             peer.setNextInsertionIndex(index);
-            if (m.getPeer() == null) {
+            final CMenuBar mPeer = acc.getPeer(m);
+            if (mPeer == null) {
                 m.addNotify();
             }
 
--- a/src/java.desktop/macosx/classes/com/apple/laf/ScreenMenuItem.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/macosx/classes/com/apple/laf/ScreenMenuItem.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,15 +27,18 @@
 
 import java.awt.*;
 import java.awt.event.*;
-import java.awt.peer.MenuComponentPeer;
 
 import javax.swing.*;
 import javax.swing.plaf.ComponentUI;
 
+import sun.awt.AWTAccessor;
 import sun.lwawt.macosx.CMenuItem;
 
 @SuppressWarnings("serial") // JDK implementation class
-final class ScreenMenuItem extends MenuItem implements ActionListener, ComponentListener, ScreenMenuPropertyHandler {
+final class ScreenMenuItem extends MenuItem
+        implements ActionListener, ComponentListener,
+                   ScreenMenuPropertyHandler {
+
     ScreenMenuPropertyListener fListener;
     JMenuItem fMenuItem;
 
@@ -97,9 +100,8 @@
         fMenuItem.removeComponentListener(this);
     }
 
-    @SuppressWarnings("deprecation")
     static void syncLabelAndKS(MenuItem menuItem, String label, KeyStroke ks) {
-        final MenuComponentPeer peer = menuItem.getPeer();
+        Object peer = AWTAccessor.getMenuComponentAccessor().getPeer(menuItem);
         if (!(peer instanceof CMenuItem)) {
             //Is it possible?
             return;
@@ -166,18 +168,16 @@
         }
     }
 
-    @SuppressWarnings("deprecation")
     public void setToolTipText(final String text) {
-        final MenuComponentPeer peer = getPeer();
+        Object peer = AWTAccessor.getMenuComponentAccessor().getPeer(this);
         if (!(peer instanceof CMenuItem)) return;
 
         final CMenuItem cmi = (CMenuItem)peer;
         cmi.setToolTipText(text);
     }
 
-    @SuppressWarnings("deprecation")
     public void setIcon(final Icon i) {
-        final MenuComponentPeer peer = getPeer();
+        Object peer = AWTAccessor.getMenuComponentAccessor().getPeer(this);
         if (!(peer instanceof CMenuItem)) return;
 
         final CMenuItem cmi = (CMenuItem)peer;
--- a/src/java.desktop/macosx/classes/com/apple/laf/ScreenMenuItemCheckbox.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/macosx/classes/com/apple/laf/ScreenMenuItemCheckbox.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,17 +27,20 @@
 
 import java.awt.*;
 import java.awt.event.*;
-import java.awt.peer.MenuComponentPeer;
 
 import javax.swing.*;
 import javax.swing.plaf.ButtonUI;
 
 import com.apple.laf.AquaMenuItemUI.IndeterminateListener;
 
+import sun.awt.AWTAccessor;
 import sun.lwawt.macosx.*;
 
 @SuppressWarnings("serial") // JDK implementation class
-final class ScreenMenuItemCheckbox extends CheckboxMenuItem implements ActionListener, ComponentListener, ScreenMenuPropertyHandler, ItemListener {
+final class ScreenMenuItemCheckbox extends CheckboxMenuItem
+        implements ActionListener, ComponentListener, ScreenMenuPropertyHandler,
+                   ItemListener {
+
     JMenuItem fMenuItem;
     MenuContainer fParent;
 
@@ -57,12 +60,12 @@
     }
 
     ScreenMenuPropertyListener fPropertyListener;
-    @SuppressWarnings("deprecation")
+
     public void addNotify() {
         super.addNotify();
 
         // Avoid the Auto toggle behavior of AWT CheckBoxMenuItem
-        CCheckboxMenuItem ccb = (CCheckboxMenuItem) getPeer();
+        CCheckboxMenuItem ccb = AWTAccessor.getMenuComponentAccessor().getPeer(this);
         ccb.setAutoToggle(false);
 
         fMenuItem.addComponentListener(this);
@@ -155,17 +158,15 @@
         setVisible(false);
     }
 
-    @SuppressWarnings("deprecation")
     public void setToolTipText(final String text) {
-        final MenuComponentPeer peer = getPeer();
+        Object peer = AWTAccessor.getMenuComponentAccessor().getPeer(this);
         if (!(peer instanceof CMenuItem)) return;
 
         ((CMenuItem)peer).setToolTipText(text);
     }
 
-    @SuppressWarnings("deprecation")
     public void setIcon(final Icon i) {
-        final MenuComponentPeer peer = getPeer();
+        Object peer = AWTAccessor.getMenuComponentAccessor().getPeer(this);
         if (!(peer instanceof CMenuItem)) return;
 
         final CMenuItem cmi = (CMenuItem)peer;
@@ -208,9 +209,8 @@
             }
         }
 
-    @SuppressWarnings("deprecation")
     public void setIndeterminate(final boolean indeterminate) {
-        final MenuComponentPeer peer = getPeer();
+        Object peer = AWTAccessor.getMenuComponentAccessor().getPeer(this);
         if (peer instanceof CCheckboxMenuItem) {
             ((CCheckboxMenuItem)peer).setIsIndeterminate(indeterminate);
         }
--- a/src/java.desktop/macosx/classes/sun/awt/CGraphicsConfig.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/macosx/classes/sun/awt/CGraphicsConfig.java	Thu May 14 20:15:26 2015 -0700
@@ -72,7 +72,8 @@
 
     @Override
     public AffineTransform getDefaultTransform() {
-        return new AffineTransform();
+        double scaleFactor = device.getScaleFactor();
+        return AffineTransform.getScaleInstance(scaleFactor, scaleFactor);
     }
 
     @Override
--- a/src/java.desktop/macosx/classes/sun/awt/CGraphicsDevice.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/macosx/classes/sun/awt/CGraphicsDevice.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -206,17 +206,15 @@
         return true;
     }
 
-    @SuppressWarnings("deprecation")
     private static void enterFullScreenExclusive(Window w) {
-        FullScreenCapable peer = (FullScreenCapable)w.getPeer();
+        FullScreenCapable peer = AWTAccessor.getComponentAccessor().getPeer(w);
         if (peer != null) {
             peer.enterFullScreenMode();
         }
     }
 
-    @SuppressWarnings("deprecation")
     private static void exitFullScreenExclusive(Window w) {
-        FullScreenCapable peer = (FullScreenCapable)w.getPeer();
+        FullScreenCapable peer = AWTAccessor.getComponentAccessor().getPeer(w);
         if (peer != null) {
             peer.exitFullScreenMode();
         }
--- a/src/java.desktop/macosx/classes/sun/java2d/opengl/CGLVolatileSurfaceManager.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/macosx/classes/sun/java2d/opengl/CGLVolatileSurfaceManager.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,13 +33,14 @@
 import java.awt.image.ColorModel;
 import java.awt.peer.ComponentPeer;
 
+import sun.awt.AWTAccessor;
+import sun.awt.AWTAccessor.ComponentAccessor;
 import sun.awt.image.SunVolatileImage;
 import sun.awt.image.VolatileSurfaceManager;
 import sun.java2d.BackBufferCapsProvider;
 import sun.java2d.SurfaceData;
 import static sun.java2d.opengl.OGLContext.OGLContextCaps.*;
 import sun.java2d.pipe.hw.ExtendedBufferCapabilities;
-import static sun.java2d.pipe.hw.AccelSurface.*;
 import static sun.java2d.pipe.hw.ExtendedBufferCapabilities.VSyncType.*;
 
 public class CGLVolatileSurfaceManager extends VolatileSurfaceManager {
@@ -74,11 +75,11 @@
      * Create a pbuffer-based SurfaceData object (or init the backbuffer
      * of an existing window if this is a double buffered GraphicsConfig)
      */
-    @SuppressWarnings("deprecation")
     protected SurfaceData initAcceleratedSurface() {
         SurfaceData sData = null;
         Component comp = vImg.getComponent();
-        final ComponentPeer peer = (comp != null) ? comp.getPeer() : null;
+        final ComponentAccessor acc = AWTAccessor.getComponentAccessor();
+        final ComponentPeer peer = (comp != null) ? acc.getPeer(comp) : null;
 
         try {
             boolean createVSynced = false;
--- a/src/java.desktop/macosx/classes/sun/lwawt/LWComponentPeer.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/macosx/classes/sun/lwawt/LWComponentPeer.java	Thu May 14 20:15:26 2015 -0700
@@ -930,8 +930,8 @@
                     return false;
                 }
                 final LWWindowPeer parentPeer =
-                        (LWWindowPeer) AWTAccessor.getComponentAccessor()
-                                                  .getPeer(parentWindow);
+                        AWTAccessor.getComponentAccessor()
+                                   .getPeer(parentWindow);
                 if (parentPeer == null) {
                     focusLog.fine("request rejected, parentPeer is null");
                     LWKeyboardFocusManagerPeer.removeLastFocusRequest(getTarget());
--- a/src/java.desktop/macosx/classes/sun/lwawt/LWWindowPeer.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/macosx/classes/sun/lwawt/LWWindowPeer.java	Thu May 14 20:15:26 2015 -0700
@@ -33,6 +33,7 @@
 import javax.swing.*;
 
 import sun.awt.*;
+import sun.awt.AWTAccessor.ComponentAccessor;
 import sun.java2d.*;
 import sun.java2d.loops.Blit;
 import sun.java2d.loops.CompositeType;
@@ -505,7 +506,7 @@
     @Override
     public void repositionSecurityWarning() {
         if (warningWindow != null) {
-            AWTAccessor.ComponentAccessor compAccessor = AWTAccessor.getComponentAccessor();
+            ComponentAccessor compAccessor = AWTAccessor.getComponentAccessor();
             Window target = getTarget();
             int x = compAccessor.getX(target);
             int y = compAccessor.getY(target);
@@ -563,8 +564,7 @@
     public void blockWindows(List<Window> windows) {
         //TODO: LWX will probably need some collectJavaToplevels to speed this up
         for (Window w : windows) {
-            WindowPeer wp =
-                    (WindowPeer) AWTAccessor.getComponentAccessor().getPeer(w);
+            WindowPeer wp = AWTAccessor.getComponentAccessor().getPeer(w);
             if (wp != null) {
                 wp.setModalBlocked((Dialog)getTarget(), true);
             }
@@ -1247,7 +1247,8 @@
     private boolean isOneOfOwnersOf(LWWindowPeer peer) {
         Window owner = (peer != null ? peer.getTarget().getOwner() : null);
         while (owner != null) {
-            if ((LWWindowPeer)owner.getPeer() == this) {
+            final ComponentAccessor acc = AWTAccessor.getComponentAccessor();
+            if (acc.getPeer(owner) == this) {
                 return true;
             }
             owner = owner.getOwner();
@@ -1321,8 +1322,8 @@
         while (owner != null && !(owner instanceof Frame || owner instanceof Dialog)) {
             owner = owner.getOwner();
         }
-        return owner == null ? null :
-               (LWWindowPeer) AWTAccessor.getComponentAccessor().getPeer(owner);
+        return owner == null ? null : AWTAccessor.getComponentAccessor()
+                                                 .getPeer(owner);
     }
 
     /**
--- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,6 +39,7 @@
 import java.util.Map;
 import java.util.concurrent.Callable;
 
+import sun.awt.AWTAccessor;
 import sun.awt.dnd.*;
 import sun.lwawt.LWComponentPeer;
 import sun.lwawt.LWWindowPeer;
@@ -88,7 +89,6 @@
         super.startDrag(dsc, cursor, dragImage, dragImageOffset);
     }
 
-    @SuppressWarnings("deprecation")
     protected void startDrag(Transferable transferable, long[] formats, Map<Long, DataFlavor> formatMap) {
         DragGestureEvent trigger = getTrigger();
         InputEvent         triggerEvent = trigger.getTriggerEvent();
@@ -135,7 +135,9 @@
 
         try {
             //It sure will be LWComponentPeer instance as rootComponent is a Window
-            PlatformWindow platformWindow = ((LWComponentPeer)rootComponent.getPeer()).getPlatformWindow();
+            LWComponentPeer<?, ?> peer = AWTAccessor.getComponentAccessor()
+                                                    .getPeer(rootComponent);
+            PlatformWindow platformWindow = peer.getPlatformWindow();
             long nativeViewPtr = CPlatformWindow.getNativeViewPtr(platformWindow);
             if (nativeViewPtr == 0L) throw new InvalidDnDOperationException("Unsupported platform window implementation");
 
--- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,6 +30,7 @@
 import java.awt.Point;
 import java.awt.Toolkit;
 
+import sun.awt.AWTAccessor;
 import sun.awt.EmbeddedFrame;
 import sun.lwawt.LWWindowPeer;
 
@@ -46,9 +47,8 @@
         show();
     }
 
-    @SuppressWarnings("deprecation")
     public void addNotify() {
-        if (getPeer() == null) {
+        if (!isDisplayable()) {
             LWCToolkit toolkit = (LWCToolkit)Toolkit.getDefaultToolkit();
             LWWindowPeer peer = toolkit.createEmbeddedFrame(this);
             setPeer(peer);
@@ -61,10 +61,9 @@
 
     public void unregisterAccelerator(AWTKeyStroke stroke) {}
 
-    @SuppressWarnings("deprecation")
     protected long getLayerPtr() {
-        LWWindowPeer peer = (LWWindowPeer)getPeer();
-        return peer.getLayerPtr();
+        return AWTAccessor.getComponentAccessor().<LWWindowPeer>getPeer(this)
+                          .getLayerPtr();
     }
 
     // -----------------------------------------------------------------------
--- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CImage.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CImage.java	Thu May 14 20:15:26 2015 -0700
@@ -138,17 +138,6 @@
             return ((DataBufferInt)bimg.getRaster().getDataBuffer()).getData();
         }
 
-        public CImage createFromImageImmediately(final Image image) {
-            int[]  buffer = imageToArray(image, false);
-
-            if (buffer == null) {
-                return null;
-            }
-
-            return new CImage(nativeCreateNSImageFromArray(buffer, image.getWidth(null),
-                                                           image.getHeight(null)));
-        }
-
         public byte[] getPlatformImageBytes(final Image image) {
             int[] buffer = imageToArray(image, false);
 
@@ -168,20 +157,33 @@
 
         // This is used to create a CImage from a Image
         public CImage createFromImage(final Image image) {
+            return createFromImage(image, true);
+        }
+
+        public CImage createFromImageImmediately(final Image image) {
+            return createFromImage(image, false);
+        }
+
+        // This is used to create a CImage from a Image
+        private CImage createFromImage(final Image image, final boolean prepareImage) {
             if (image instanceof MultiResolutionImage) {
                 List<Image> resolutionVariants
                         = ((MultiResolutionImage) image).getResolutionVariants();
-                return createFromImages(resolutionVariants);
+                return createFromImages(resolutionVariants, prepareImage);
             }
 
-            int[] buffer = imageToArray(image, true);
+            int[] buffer = imageToArray(image, prepareImage);
             if (buffer == null) {
                 return null;
             }
             return new CImage(nativeCreateNSImageFromArray(buffer, image.getWidth(null), image.getHeight(null)));
         }
 
-        public CImage createFromImages(List<Image> images) {
+        public CImage createFromImages(final List<Image> images) {
+            return createFromImages(images, true);
+        }
+
+        private CImage createFromImages(final List<Image> images, final boolean prepareImage) {
             if (images == null || images.isEmpty()) {
                 return null;
             }
@@ -194,8 +196,8 @@
 
             num = 0;
 
-            for (Image img : images) {
-                buffers[num] = imageToArray(img, true);
+            for (final Image img : images) {
+                buffers[num] = imageToArray(img, prepareImage);
                 if (buffers[num] == null) {
                     // Unable to process the image
                     continue;
@@ -210,9 +212,9 @@
             }
 
             return new CImage(nativeCreateNSImageFromArrays(
-                        Arrays.copyOf(buffers, num),
-                        Arrays.copyOf(w, num),
-                        Arrays.copyOf(h, num)));
+                    Arrays.copyOf(buffers, num),
+                    Arrays.copyOf(w, num),
+                    Arrays.copyOf(h, num)));
         }
 
         static int getSelectorAsInt(final String fromString) {
--- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CInputMethod.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CInputMethod.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,9 +38,12 @@
 import java.text.*;
 import javax.swing.text.JTextComponent;
 
+import sun.awt.AWTAccessor;
 import sun.awt.im.InputMethodAdapter;
 import sun.lwawt.*;
 
+import static sun.awt.AWTAccessor.ComponentAccessor;
+
 public class CInputMethod extends InputMethodAdapter {
     private InputMethodContext fIMContext;
     private Component fAwtFocussedComponent;
@@ -385,12 +388,11 @@
 
     // java.awt.Toolkit#getNativeContainer() is not available
     //    from this package
-    @SuppressWarnings("deprecation")
     private LWComponentPeer<?, ?> getNearestNativePeer(Component comp) {
         if (comp==null)
             return null;
-
-        ComponentPeer peer = comp.getPeer();
+        final ComponentAccessor acc = AWTAccessor.getComponentAccessor();
+        ComponentPeer peer = acc.getPeer(comp);
         if (peer==null)
             return null;
 
@@ -398,7 +400,7 @@
             comp = comp.getParent();
             if (comp==null)
                 return null;
-            peer = comp.getPeer();
+            peer = acc.getPeer(comp);
             if (peer==null)
                 return null;
         }
--- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CMenuBar.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CMenuBar.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,8 @@
 import java.awt.MenuBar;
 import java.awt.peer.MenuBarPeer;
 
+import sun.awt.AWTAccessor;
+
 public class CMenuBar extends CMenuComponent implements MenuBarPeer {
 
     private int nextInsertionIndex = -1;
@@ -43,9 +45,8 @@
     }
 
     @Override
-    @SuppressWarnings("deprecation")
     public void addHelpMenu(Menu m) {
-        CMenu cMenu = (CMenu)m.getPeer();
+        CMenu cMenu = AWTAccessor.getMenuComponentAccessor().getPeer(m);
         nativeSetHelpMenu(getModel(), cMenu.getModel());
     }
 
--- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,12 +31,11 @@
 import java.awt.peer.WindowPeer;
 import java.beans.*;
 import java.lang.reflect.InvocationTargetException;
-import java.util.List;
-import java.util.Objects;
 
 import javax.swing.*;
 
 import sun.awt.*;
+import sun.awt.AWTAccessor.ComponentAccessor;
 import sun.java2d.SurfaceData;
 import sun.java2d.opengl.CGLSurfaceData;
 import sun.lwawt.*;
@@ -193,8 +192,9 @@
         @SuppressWarnings("deprecation")
         public CPlatformWindow convertJComponentToTarget(final JRootPane p) {
             Component root = SwingUtilities.getRoot(p);
-            if (root == null || (LWWindowPeer)root.getPeer() == null) return null;
-            return (CPlatformWindow)((LWWindowPeer)root.getPeer()).getPlatformWindow();
+            final ComponentAccessor acc = AWTAccessor.getComponentAccessor();
+            if (root == null || acc.getPeer(root) == null) return null;
+            return (CPlatformWindow)((LWWindowPeer)acc.getPeer(root)).getPlatformWindow();
         }
     };
 
@@ -523,15 +523,15 @@
     }
 
     @Override // PlatformWindow
-    @SuppressWarnings("deprecation")
     public void setVisible(boolean visible) {
         final long nsWindowPtr = getNSWindowPtr();
 
         // Process parent-child relationship when hiding
+        final ComponentAccessor acc = AWTAccessor.getComponentAccessor();
         if (!visible) {
             // Unparent my children
             for (Window w : target.getOwnedWindows()) {
-                WindowPeer p = (WindowPeer)w.getPeer();
+                WindowPeer p = acc.getPeer(w);
                 if (p instanceof LWWindowPeer) {
                     CPlatformWindow pw = (CPlatformWindow)((LWWindowPeer)p).getPlatformWindow();
                     if (pw != null && pw.isVisible()) {
@@ -627,7 +627,7 @@
 
             // Add my own children to myself
             for (Window w : target.getOwnedWindows()) {
-                WindowPeer p = (WindowPeer)w.getPeer();
+                final Object p = acc.getPeer(w);
                 if (p instanceof LWWindowPeer) {
                     CPlatformWindow pw = (CPlatformWindow)((LWWindowPeer)p).getPlatformWindow();
                     if (pw != null && pw.isVisible()) {
@@ -679,13 +679,13 @@
     }
 
     @Override  // PlatformWindow
-    @SuppressWarnings("deprecation")
     public void toFront() {
         final long nsWindowPtr = getNSWindowPtr();
         LWCToolkit lwcToolkit = (LWCToolkit) Toolkit.getDefaultToolkit();
         Window w = DefaultKeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow();
-        if( w != null && w.getPeer() != null
-                && ((LWWindowPeer)w.getPeer()).getPeerType() == LWWindowPeer.PeerType.EMBEDDED_FRAME
+        final ComponentAccessor acc = AWTAccessor.getComponentAccessor();
+        if( w != null && acc.getPeer(w) != null
+                && ((LWWindowPeer)acc.getPeer(w)).getPeerType() == LWWindowPeer.PeerType.EMBEDDED_FRAME
                 && !lwcToolkit.isApplicationActive()) {
             lwcToolkit.activateApplicationIgnoringOtherApps();
         }
--- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java	Thu May 14 20:15:26 2015 -0700
@@ -36,6 +36,10 @@
 import javax.print.*;
 import javax.print.attribute.PrintRequestAttributeSet;
 import javax.print.attribute.HashPrintRequestAttributeSet;
+import javax.print.attribute.standard.Media;
+import javax.print.attribute.standard.MediaPrintableArea;
+import javax.print.attribute.standard.MediaSize;
+import javax.print.attribute.standard.MediaSizeName;
 import javax.print.attribute.standard.PageRanges;
 
 import sun.java2d.*;
@@ -745,4 +749,34 @@
     protected void startPage(PageFormat arg0, Printable arg1, int arg2, boolean arg3) throws PrinterException {
         // TODO Auto-generated method stub
     }
-}
+
+    @Override
+    protected MediaSize getMediaSize(Media media, PrintService service,
+            PageFormat page) {
+        if (media == null || !(media instanceof MediaSizeName)) {
+            return getDefaultMediaSize(page);
+        }
+        MediaSize size = MediaSize.getMediaSizeForName((MediaSizeName) media);
+        return size != null ? size : getDefaultMediaSize(page);
+    }
+
+    private MediaSize getDefaultMediaSize(PageFormat page){
+            final int inch = 72;
+            Paper paper = page.getPaper();
+            float width = (float) (paper.getWidth() / inch);
+            float height = (float) (paper.getHeight() / inch);
+            return new MediaSize(width, height, MediaSize.INCH);
+    }
+
+    @Override
+    protected MediaPrintableArea getDefaultPrintableArea(PageFormat page, double w, double h) {
+        final float dpi = 72.0f;
+        Paper paper = page.getPaper();
+        return new MediaPrintableArea(
+                (float) (paper.getImageableX() / dpi),
+                (float) (paper.getImageableY() / dpi),
+                (float) (paper.getImageableWidth() / dpi),
+                (float) (paper.getImageableHeight() / dpi),
+                MediaPrintableArea.INCH);
+    }
+}
\ No newline at end of file
--- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CTrayIcon.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CTrayIcon.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -37,6 +37,8 @@
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
 
+import static sun.awt.AWTAccessor.*;
+
 public class CTrayIcon extends CFRetainedResource implements TrayIconPeer {
     private TrayIcon target;
     private PopupMenu popup;
@@ -68,15 +70,15 @@
         updateImage();
     }
 
-    @SuppressWarnings("deprecation")
     private CPopupMenu checkAndCreatePopupPeer() {
         CPopupMenu menuPeer = null;
         if (popup != null) {
             try {
-                menuPeer = (CPopupMenu)popup.getPeer();
+                final MenuComponentAccessor acc = getMenuComponentAccessor();
+                menuPeer = acc.getPeer(popup);
                 if (menuPeer == null) {
                     popup.addNotify();
-                    menuPeer = (CPopupMenu)popup.getPeer();
+                    menuPeer = acc.getPeer(popup);
                 }
             } catch (Exception e) {
                 e.printStackTrace();
--- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CViewEmbeddedFrame.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CViewEmbeddedFrame.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,6 +30,7 @@
 import java.awt.Toolkit;
 import java.lang.reflect.InvocationTargetException;
 
+import sun.awt.AWTAccessor;
 import sun.awt.EmbeddedFrame;
 import sun.lwawt.LWWindowPeer;
 
@@ -48,10 +49,9 @@
         this.nsViewPtr = nsViewPtr;
     }
 
-    @SuppressWarnings("deprecation")
     @Override
     public void addNotify() {
-        if (getPeer() == null) {
+        if (!isDisplayable()) {
             LWCToolkit toolkit = (LWCToolkit) Toolkit.getDefaultToolkit();
             setPeer(toolkit.createEmbeddedFrame(this));
         }
@@ -78,11 +78,12 @@
      * Synthetic event delivery for focus management
      */
     @Override
-    @SuppressWarnings("deprecation")
     public void synthesizeWindowActivation(boolean activated) {
         if (isActive != activated) {
             isActive = activated;
-            ((LWWindowPeer)getPeer()).notifyActivation(activated, null);
+            final LWWindowPeer peer = AWTAccessor.getComponentAccessor()
+                                                 .getPeer(this);
+            peer.notifyActivation(activated, null);
         }
     }
 
@@ -91,13 +92,14 @@
      * Designed to be called from the main thread
      * This method should be called once from the initialization of the SWT_AWT Bridge
      */
-    @SuppressWarnings("deprecation")
     public void validateWithBounds(final int x, final int y, final int width, final int height) {
         try {
+            final LWWindowPeer peer = AWTAccessor.getComponentAccessor()
+                                                 .getPeer(this);
             LWCToolkit.invokeAndWait(new Runnable() {
                 @Override
                 public void run() {
-                    ((LWWindowPeer) getPeer()).setBoundsPrivate(0, 0, width, height);
+                    peer.setBoundsPrivate(0, 0, width, height);
                     validate();
                     setVisible(true);
                 }
--- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -293,7 +293,7 @@
     }
 
     @Override
-    protected DesktopPeer createDesktopPeer(Desktop target) {
+    public DesktopPeer createDesktopPeer(Desktop target) {
         return new CDesktopPeer();
     }
 
@@ -575,7 +575,8 @@
 
         final boolean[] ret = new boolean[1];
 
-        try {  invokeAndWait(new Runnable() { public void run() { synchronized(ret) {
+        try {  invokeAndWait(new Runnable() { @Override
+                                              public void run() { synchronized(ret) {
             ret[0] = a.equals(b);
         }}}, c); } catch (Exception e) { e.printStackTrace(); }
 
--- a/src/java.desktop/share/classes/java/awt/Button.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/java/awt/Button.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -168,13 +168,12 @@
      * application to change the look of the button without changing
      * its functionality.
      *
-     * @see     java.awt.Toolkit#createButton(java.awt.Button)
      * @see     java.awt.Component#getToolkit()
      */
     public void addNotify() {
         synchronized(getTreeLock()) {
             if (peer == null)
-                peer = getToolkit().createButton(this);
+                peer = getComponentFactory().createButton(this);
             super.addNotify();
         }
     }
--- a/src/java.desktop/share/classes/java/awt/Canvas.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/java/awt/Canvas.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -58,11 +58,13 @@
     }
 
     /**
-     * Constructs a new Canvas given a GraphicsConfiguration object.
+     * Constructs a new Canvas given a GraphicsConfiguration object. If null is
+     * passed, then the default GraphicsConfiguration will be used.
      *
-     * @param config a reference to a GraphicsConfiguration object.
+     * @param config a reference to a GraphicsConfiguration object or null
      *
      * @see GraphicsConfiguration
+     * @see Component#getGraphicsConfiguration()
      */
     public Canvas(GraphicsConfiguration config) {
         this();
@@ -70,10 +72,9 @@
     }
 
     @Override
-    @SuppressWarnings("deprecation")
     void setGraphicsConfiguration(GraphicsConfiguration gc) {
         synchronized(getTreeLock()) {
-            CanvasPeer peer = (CanvasPeer)getPeer();
+            CanvasPeer peer = (CanvasPeer) this.peer;
             if (peer != null) {
                 gc = peer.getAppropriateGraphicsConfiguration(gc);
             }
@@ -94,13 +95,12 @@
     /**
      * Creates the peer of the canvas.  This peer allows you to change the
      * user interface of the canvas without changing its functionality.
-     * @see     java.awt.Toolkit#createCanvas(java.awt.Canvas)
      * @see     java.awt.Component#getToolkit()
      */
     public void addNotify() {
         synchronized (getTreeLock()) {
             if (peer == null)
-                peer = getToolkit().createCanvas(this);
+                peer = getComponentFactory().createCanvas(this);
             super.addNotify();
         }
     }
--- a/src/java.desktop/share/classes/java/awt/Checkbox.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/java/awt/Checkbox.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,13 +239,12 @@
      * Creates the peer of the Checkbox. The peer allows you to change the
      * look of the Checkbox without changing its functionality.
      *
-     * @see     java.awt.Toolkit#createCheckbox(java.awt.Checkbox)
      * @see     java.awt.Component#getToolkit()
      */
     public void addNotify() {
         synchronized (getTreeLock()) {
             if (peer == null)
-                peer = getToolkit().createCheckbox(this);
+                peer = getComponentFactory().createCheckbox(this);
             super.addNotify();
         }
     }
--- a/src/java.desktop/share/classes/java/awt/CheckboxMenuItem.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/java/awt/CheckboxMenuItem.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -155,13 +155,12 @@
      * change the look of the checkbox item without changing its
      * functionality.
      * Most applications do not call this method directly.
-     * @see     java.awt.Toolkit#createCheckboxMenuItem(java.awt.CheckboxMenuItem)
      * @see     java.awt.Component#getToolkit()
      */
     public void addNotify() {
         synchronized (getTreeLock()) {
             if (peer == null)
-                peer = Toolkit.getDefaultToolkit().createCheckboxMenuItem(this);
+                peer = getComponentFactory().createCheckboxMenuItem(this);
             super.addNotify();
         }
     }
--- a/src/java.desktop/share/classes/java/awt/Choice.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/java/awt/Choice.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -143,13 +143,12 @@
      * Creates the <code>Choice</code>'s peer.  This peer allows us
      * to change the look
      * of the <code>Choice</code> without changing its functionality.
-     * @see     java.awt.Toolkit#createChoice(java.awt.Choice)
      * @see     java.awt.Component#getToolkit()
      */
     public void addNotify() {
         synchronized (getTreeLock()) {
             if (peer == null)
-                peer = getToolkit().createChoice(this);
+                peer = getComponentFactory().createChoice(this);
             super.addNotify();
         }
     }
--- a/src/java.desktop/share/classes/java/awt/Component.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/java/awt/Component.java	Thu May 14 20:15:26 2015 -0700
@@ -61,6 +61,7 @@
 import javax.accessibility.*;
 import java.applet.Applet;
 
+import sun.awt.ComponentFactory;
 import sun.security.action.GetPropertyAction;
 import sun.awt.AppContext;
 import sun.awt.AWTAccessor;
@@ -198,7 +199,7 @@
      * @see #addNotify
      * @see #removeNotify
      */
-    transient ComponentPeer peer;
+    transient volatile ComponentPeer peer;
 
     /**
      * The parent of the object. It may be <code>null</code>
@@ -924,8 +925,9 @@
             public Cursor getCursor(Component comp) {
                 return comp.getCursor_NoClientCode();
             }
-            public ComponentPeer getPeer(Component comp) {
-                return comp.peer;
+            @SuppressWarnings("unchecked")
+            public <T extends ComponentPeer> T getPeer(Component comp) {
+                return (T) comp.peer;
             }
             public void setPeer(Component comp, ComponentPeer peer) {
                 comp.peer = peer;
@@ -1069,17 +1071,6 @@
     }
 
     /**
-     * @deprecated As of JDK version 1.1,
-     * programs should not directly manipulate peers;
-     * replaced by <code>boolean isDisplayable()</code>.
-     * @return the peer for this component
-     */
-    @Deprecated
-    public ComponentPeer getPeer() {
-        return peer;
-    }
-
-    /**
      * Associate a <code>DropTarget</code> with this component.
      * The <code>Component</code> will receive drops only if it
      * is enabled.
@@ -1095,7 +1086,7 @@
         DropTarget old;
 
         if ((old = dropTarget) != null) {
-            if (peer != null) dropTarget.removeNotify(peer);
+            dropTarget.removeNotify();
 
             DropTarget t = dropTarget;
 
@@ -1113,12 +1104,12 @@
         if ((dropTarget = dt) != null) {
             try {
                 dropTarget.setComponent(this);
-                if (peer != null) dropTarget.addNotify(peer);
+                dropTarget.addNotify();
             } catch (IllegalArgumentException iae) {
                 if (old != null) {
                     try {
                         old.setComponent(this);
-                        if (peer != null) dropTarget.addNotify(peer);
+                        dropTarget.addNotify();
                     } catch (IllegalArgumentException iae1) {
                         // ignore it!
                     }
@@ -1179,7 +1170,7 @@
 
         graphicsConfig = gc;
 
-        ComponentPeer peer = getPeer();
+        ComponentPeer peer = this.peer;
         if (peer != null) {
             return peer.updateGraphicsData(gc);
         }
@@ -1239,6 +1230,14 @@
         return Toolkit.getDefaultToolkit();
     }
 
+    final ComponentFactory getComponentFactory() {
+        final Toolkit toolkit = getToolkit();
+        if (toolkit instanceof ComponentFactory) {
+            return (ComponentFactory) toolkit;
+        }
+        throw new AWTError("UI components are unsupported by: " + toolkit);
+    }
+
     /**
      * Determines whether this component is valid. A component is valid
      * when it is correctly sized and positioned within its parent
@@ -1281,7 +1280,7 @@
      * @since 1.2
      */
     public boolean isDisplayable() {
-        return getPeer() != null;
+        return peer != null;
     }
 
     /**
@@ -1336,7 +1335,11 @@
             return null;
         }
         Window win = getContainingWindow();
-        if (!Toolkit.getDefaultToolkit().getMouseInfoPeer().isWindowUnderMouse(win)) {
+        Toolkit toolkit = Toolkit.getDefaultToolkit();
+        if (!(toolkit instanceof ComponentFactory)) {
+            return null;
+        }
+        if (!((ComponentFactory) toolkit).getMouseInfoPeer().isWindowUnderMouse(win)) {
             return null;
         }
         final boolean INCLUDE_DISABLED = true;
@@ -2582,7 +2585,7 @@
      * @since 1.2
      */
     public boolean isOpaque() {
-        if (getPeer() == null) {
+        if (peer == null) {
             return false;
         }
         else {
@@ -2608,7 +2611,7 @@
      * @since 1.2
      */
     public boolean isLightweight() {
-        return getPeer() instanceof LightweightPeer;
+        return peer instanceof LightweightPeer;
     }
 
 
@@ -3126,7 +3129,6 @@
      *          obtained
      * @return the font metrics for <code>font</code>
      * @see       #getFont
-     * @see       #getPeer
      * @see       java.awt.peer.ComponentPeer#getFontMetrics(Font)
      * @see       Toolkit#getFontMetrics(Font)
      * @since     1.0
@@ -3186,7 +3188,7 @@
 
             if (nativeContainer == null) return;
 
-            ComponentPeer cPeer = nativeContainer.getPeer();
+            ComponentPeer cPeer = nativeContainer.peer;
 
             if (cPeer != null) {
                 cPeer.updateCursorImmediately();
@@ -5019,7 +5021,7 @@
                 if (source != null) {
                     Container target = source.getNativeContainer();
                     if (target != null) {
-                        tpeer = target.getPeer();
+                        tpeer = target.peer;
                     }
                 }
             }
@@ -6972,7 +6974,7 @@
                 if (peer == null) {
                     // Update both the Component's peer variable and the local
                     // variable we use for thread safety.
-                    this.peer = peer = getToolkit().createComponent(this);
+                    this.peer = peer = getComponentFactory().createComponent(this);
                 }
 
                 // This is a lightweight component which means it won't be
@@ -7022,7 +7024,7 @@
                 popup.addNotify();
             }
 
-            if (dropTarget != null) dropTarget.addNotify(peer);
+            if (dropTarget != null) dropTarget.addNotify();
 
             peerFont = getFont();
 
@@ -7109,7 +7111,7 @@
                     ((FlipBufferStrategy)bufferStrategy).destroyBuffers();
                 }
 
-                if (dropTarget != null) dropTarget.removeNotify(peer);
+                if (dropTarget != null) dropTarget.removeNotify();
 
                 // Hide peer first to stop system events such as cursor moves.
                 if (visible) {
@@ -9851,7 +9853,7 @@
         }
 
         if (!isLightweight()) {
-            ComponentPeer peer = getPeer();
+            ComponentPeer peer = this.peer;
             if (peer != null) {
                 // The Region class has some optimizations. That's why
                 // we should manually check whether it's empty and
@@ -9975,7 +9977,7 @@
             for (int i = indexAbove; i > -1; i--) {
                 Component comp = cont.getComponent(i);
                 if (comp != null && comp.isDisplayable() && !comp.isLightweight()) {
-                    return comp.getPeer();
+                    return comp.peer;
                 }
             }
             // traversing the hierarchy up to the closest HW container;
--- a/src/java.desktop/share/classes/java/awt/Container.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/java/awt/Container.java	Thu May 14 20:15:26 2015 -0700
@@ -820,7 +820,7 @@
                 }
             } else {
                 // Q: Need to update NativeInLightFixer?
-                comp.getPeer().reparent(parentPeer);
+                comp.peer.reparent(parentPeer);
             }
         }
     }
@@ -840,10 +840,10 @@
             // If component is lightweight container we need to reparent all its explicit  heavyweight children
             if (comp instanceof Container) {
                 // Traverse component's tree till depth-first until encountering heavyweight component
-                reparentTraverse((ContainerPeer)getPeer(), (Container)comp);
+                reparentTraverse((ContainerPeer)peer, (Container)comp);
             }
         } else {
-            comp.getPeer().reparent((ContainerPeer)getPeer());
+            comp.peer.reparent((ContainerPeer) peer);
         }
     }
 
@@ -4195,7 +4195,7 @@
                 }
             } else {
                 if (comp.isVisible()) {
-                    ComponentPeer peer = comp.getPeer();
+                    ComponentPeer peer = comp.peer;
                     if (peer != null) {
                         peer.setVisible(true);
                     }
@@ -4217,7 +4217,7 @@
                 }
             } else {
                 if (comp.isVisible()) {
-                    ComponentPeer peer = comp.getPeer();
+                    ComponentPeer peer = comp.peer;
                     if (peer != null) {
                         peer.setVisible(false);
                     }
@@ -4239,7 +4239,7 @@
                     ((Container)comp).recursiveRelocateHeavyweightChildren(newOrigin);
                 }
             } else {
-                ComponentPeer peer = comp.getPeer();
+                ComponentPeer peer = comp.peer;
                 if (peer != null) {
                     peer.setBounds(origin.x + comp.getX(), origin.y + comp.getY(),
                             comp.getWidth(), comp.getHeight(),
--- a/src/java.desktop/share/classes/java/awt/ContainerOrderFocusTraversalPolicy.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/java/awt/ContainerOrderFocusTraversalPolicy.java	Thu May 14 20:15:26 2015 -0700
@@ -504,7 +504,10 @@
                 } else if (comp instanceof Container && comp != aContainer) {
                     Container cont = (Container)comp;
                     if (cont.isFocusTraversalPolicyProvider()) {
-                        return cont.getFocusTraversalPolicy().getLastComponent(cont);
+                        Component retComp = cont.getFocusTraversalPolicy().getLastComponent(cont);
+                        if (retComp != null) {
+                            return retComp;
+                        }
                     }
                 }
             }
--- a/src/java.desktop/share/classes/java/awt/DefaultFocusTraversalPolicy.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/java/awt/DefaultFocusTraversalPolicy.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -93,7 +93,6 @@
      * @return <code>true</code> if aComponent meets the above requirements;
      *         <code>false</code> otherwise
      */
-    @SuppressWarnings("deprecation")
     protected boolean accept(Component aComponent) {
         if (!(aComponent.isVisible() && aComponent.isDisplayable() &&
               aComponent.isEnabled()))
@@ -123,7 +122,7 @@
             return focusable;
         }
 
-        ComponentPeer peer = aComponent.getPeer();
+        ComponentPeer peer = aComponent.peer;
         return (peer != null && peer.isFocusable());
     }
 }
--- a/src/java.desktop/share/classes/java/awt/DefaultKeyboardFocusManager.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/java/awt/DefaultKeyboardFocusManager.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -796,7 +796,6 @@
      * @return <code>true</code>
      * @see Component#dispatchEvent
      */
-    @SuppressWarnings("deprecation")
     public boolean dispatchKeyEvent(KeyEvent e) {
         Component focusOwner = (((AWTEvent)e).isPosted) ? getFocusOwner() : e.getComponent();
 
@@ -824,14 +823,14 @@
 
         // Allow the peer to process KeyEvent
         Component source = e.getComponent();
-        ComponentPeer peer = source.getPeer();
+        ComponentPeer peer = source.peer;
 
         if (peer == null || peer instanceof LightweightPeer) {
             // if focus owner is lightweight then its native container
             // processes event
             Container target = source.getNativeContainer();
             if (target != null) {
-                peer = target.getPeer();
+                peer = target.peer;
             }
         }
         if (peer != null) {
@@ -1049,7 +1048,7 @@
             Component source = (Component)ke.getSource();
             Container target = source.getNativeContainer();
             if (target != null) {
-                ComponentPeer peer = target.getPeer();
+                ComponentPeer peer = target.peer;
                 if (peer != null) {
                     peer.handleEvent(ke);
                     /**
--- a/src/java.desktop/share/classes/java/awt/Desktop.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/java/awt/Desktop.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,19 +25,16 @@
 
 package java.awt;
 
+import java.awt.peer.DesktopPeer;
 import java.io.File;
+import java.io.FilePermission;
 import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URI;
 import java.net.URISyntaxException;
-import java.net.URI;
 import java.net.URL;
-import java.net.MalformedURLException;
-import java.awt.AWTPermission;
-import java.awt.GraphicsEnvironment;
-import java.awt.HeadlessException;
-import java.awt.peer.DesktopPeer;
+
 import sun.awt.SunToolkit;
-import sun.awt.HeadlessToolkit;
-import java.io.FilePermission;
 import sun.security.util.SecurityConstants;
 
 /**
@@ -122,7 +119,11 @@
      * Suppresses default constructor for noninstantiability.
      */
     private Desktop() {
-        peer = Toolkit.getDefaultToolkit().createDesktopPeer(this);
+        Toolkit defaultToolkit = Toolkit.getDefaultToolkit();
+        // same cast as in isDesktopSupported()
+        if (defaultToolkit instanceof SunToolkit) {
+            peer = ((SunToolkit) defaultToolkit).createDesktopPeer(this);
+        }
     }
 
     /**
--- a/src/java.desktop/share/classes/java/awt/Dialog.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/java/awt/Dialog.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,11 +36,9 @@
 import sun.awt.AppContext;
 import sun.awt.AWTPermissions;
 import sun.awt.SunToolkit;
-import sun.awt.PeerEvent;
 import sun.awt.util.IdentityArrayList;
 import sun.awt.util.IdentityLinkedList;
 import java.security.AccessControlException;
-import java.util.function.BooleanSupplier;
 
 /**
  * A Dialog is a top-level window with a title and a border
@@ -749,15 +747,14 @@
      * @see Component#isDisplayable
      * @see #removeNotify
      */
-    @SuppressWarnings("deprecation")
     public void addNotify() {
         synchronized (getTreeLock()) {
-            if (parent != null && parent.getPeer() == null) {
+            if (parent != null && parent.peer == null) {
                 parent.addNotify();
             }
 
             if (peer == null) {
-                peer = getToolkit().createDialog(this);
+                peer = getComponentFactory().createDialog(this);
             }
             super.addNotify();
         }
--- a/src/java.desktop/share/classes/java/awt/FileDialog.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/java/awt/FileDialog.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -314,14 +314,13 @@
      * Creates the file dialog's peer.  The peer allows us to change the look
      * of the file dialog without changing its functionality.
      */
-    @SuppressWarnings("deprecation")
     public void addNotify() {
         synchronized(getTreeLock()) {
-            if (parent != null && parent.getPeer() == null) {
+            if (parent != null && parent.peer == null) {
                 parent.addNotify();
             }
             if (peer == null)
-                peer = getToolkit().createFileDialog(this);
+                peer = getComponentFactory().createFileDialog(this);
             super.addNotify();
         }
     }
--- a/src/java.desktop/share/classes/java/awt/Font.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/java/awt/Font.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -41,10 +41,11 @@
 import java.security.PrivilegedExceptionAction;
 import java.text.AttributedCharacterIterator.Attribute;
 import java.text.CharacterIterator;
-import java.text.StringCharacterIterator;
 import java.util.Hashtable;
 import java.util.Locale;
 import java.util.Map;
+
+import sun.awt.ComponentFactory;
 import sun.font.StandardGlyphVector;
 
 import sun.font.AttributeMap;
@@ -239,6 +240,11 @@
         public boolean isCreatedFont(Font font) {
             return font.createdFont;
         }
+
+        @Override
+        public FontPeer getFontPeer(final Font font) {
+            return font.getFontPeer();
+        }
     }
 
     static {
@@ -434,24 +440,16 @@
     private static final long serialVersionUID = -4206021311591459213L;
 
     /**
-     * Gets the peer of this <code>Font</code>.
-     * @return  the peer of the <code>Font</code>.
-     * @since 1.1
-     * @deprecated Font rendering is now platform independent.
+     * Gets the peer of this {@code Font}.
+     *
+     * @return the peer of the {@code Font}.
      */
-    @Deprecated
-    public FontPeer getPeer(){
-        return getPeer_NoClientCode();
-    }
-    // NOTE: This method is called by privileged threads.
-    //       We implement this functionality in a package-private method
-    //       to insure that it cannot be overridden by client subclasses.
-    //       DO NOT INVOKE CLIENT CODE ON THIS THREAD!
-    @SuppressWarnings("deprecation")
-    final FontPeer getPeer_NoClientCode() {
+    private FontPeer getFontPeer() {
         if(peer == null) {
             Toolkit tk = Toolkit.getDefaultToolkit();
-            this.peer = tk.getFontPeer(name, style);
+            if (tk instanceof ComponentFactory) {
+                peer = ((ComponentFactory) tk).getFontPeer(name, style);
+            }
         }
         return peer;
     }
--- a/src/java.desktop/share/classes/java/awt/Frame.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/java/awt/Frame.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,21 +24,23 @@
  */
 package java.awt;
 
+import java.awt.event.KeyEvent;
+import java.awt.event.WindowEvent;
 import java.awt.peer.FramePeer;
-import java.awt.event.*;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
 import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
 import java.util.Vector;
-import java.io.Serializable;
-import java.io.ObjectOutputStream;
-import java.io.ObjectInputStream;
-import java.io.IOException;
-import sun.awt.AppContext;
+
+import javax.accessibility.AccessibleContext;
+import javax.accessibility.AccessibleRole;
+import javax.accessibility.AccessibleState;
+import javax.accessibility.AccessibleStateSet;
+
+import sun.awt.AWTAccessor;
 import sun.awt.SunToolkit;
-import sun.awt.AWTAccessor;
-import java.lang.ref.WeakReference;
-import javax.accessibility.*;
 
 /**
  * A <code>Frame</code> is a top-level window with a title and a border.
@@ -474,7 +476,7 @@
     public void addNotify() {
         synchronized (getTreeLock()) {
             if (peer == null) {
-                peer = getToolkit().createFrame(this);
+                peer = getComponentFactory().createFrame(this);
             }
             FramePeer p = (FramePeer)peer;
             MenuBar menuBar = this.menuBar;
--- a/src/java.desktop/share/classes/java/awt/KeyboardFocusManager.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/java/awt/KeyboardFocusManager.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -3054,11 +3054,10 @@
         return (wto != wfrom);
     }
 
-    @SuppressWarnings("deprecation")
     static Component getHeavyweight(Component comp) {
-        if (comp == null || comp.getPeer() == null) {
+        if (comp == null || comp.peer == null) {
             return null;
-        } else if (comp.getPeer() instanceof LightweightPeer) {
+        } else if (comp.peer instanceof LightweightPeer) {
             return comp.getNativeContainer();
         } else {
             return comp;
--- a/src/java.desktop/share/classes/java/awt/Label.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/java/awt/Label.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -184,7 +184,7 @@
     public void addNotify() {
         synchronized (getTreeLock()) {
             if (peer == null)
-                peer = getToolkit().createLabel(this);
+                peer = getComponentFactory().createLabel(this);
             super.addNotify();
         }
     }
--- a/src/java.desktop/share/classes/java/awt/List.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/java/awt/List.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -252,7 +252,7 @@
     public void addNotify() {
         synchronized (getTreeLock()) {
             if (peer == null)
-                peer = getToolkit().createList(this);
+                peer = getComponentFactory().createList(this);
             super.addNotify();
         }
     }
--- a/src/java.desktop/share/classes/java/awt/Menu.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/java/awt/Menu.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -174,7 +174,7 @@
     public void addNotify() {
         synchronized (getTreeLock()) {
             if (peer == null)
-                peer = Toolkit.getDefaultToolkit().createMenu(this);
+                peer = getComponentFactory().createMenu(this);
             int nitems = getItemCount();
             for (int i = 0 ; i < nitems ; i++) {
                 MenuItem mi = getItem(i);
--- a/src/java.desktop/share/classes/java/awt/MenuBar.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/java/awt/MenuBar.java	Thu May 14 20:15:26 2015 -0700
@@ -143,7 +143,7 @@
     public void addNotify() {
         synchronized (getTreeLock()) {
             if (peer == null)
-                peer = Toolkit.getDefaultToolkit().createMenuBar(this);
+                peer = getComponentFactory().createMenuBar(this);
 
             int nmenus = getMenuCount();
             for (int i = 0 ; i < nmenus ; i++) {
--- a/src/java.desktop/share/classes/java/awt/MenuComponent.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/java/awt/MenuComponent.java	Thu May 14 20:15:26 2015 -0700
@@ -30,6 +30,8 @@
 import java.io.ObjectInputStream;
 import sun.awt.AppContext;
 import sun.awt.AWTAccessor;
+import sun.awt.ComponentFactory;
+
 import javax.accessibility.*;
 
 import java.security.AccessControlContext;
@@ -57,7 +59,7 @@
         }
     }
 
-    transient MenuComponentPeer peer;
+    transient volatile MenuComponentPeer peer;
     transient MenuContainer parent;
 
     /**
@@ -142,6 +144,11 @@
                     menuComp.appContext = appContext;
                 }
                 @Override
+                @SuppressWarnings("unchecked")
+                public <T extends MenuComponentPeer> T getPeer(MenuComponent menuComp) {
+                    return (T) menuComp.peer;
+                }
+                @Override
                 public MenuContainer getParent(MenuComponent menuComp) {
                     return menuComp.parent;
                 }
@@ -179,6 +186,14 @@
                      // getName()
     }
 
+    final ComponentFactory getComponentFactory() {
+        final Toolkit toolkit = Toolkit.getDefaultToolkit();
+        if (toolkit instanceof ComponentFactory) {
+            return (ComponentFactory) toolkit;
+        }
+        throw new AWTError("UI components are unsupported by: " + toolkit);
+    }
+
     /**
      * Gets the name of the menu component.
      * @return        the name of the menu component
@@ -226,16 +241,6 @@
     }
 
     /**
-     * @deprecated As of JDK version 1.1,
-     * programs should not directly manipulate peers.
-     * @return the peer for this component
-     */
-    @Deprecated
-    public MenuComponentPeer getPeer() {
-        return peer;
-    }
-
-    /**
      * Gets the font used for this menu component.
      * @return   the font used in this menu component, if there is one;
      *                  <code>null</code> otherwise
--- a/src/java.desktop/share/classes/java/awt/MenuItem.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/java/awt/MenuItem.java	Thu May 14 20:15:26 2015 -0700
@@ -233,7 +233,7 @@
     public void addNotify() {
         synchronized (getTreeLock()) {
             if (peer == null)
-                peer = Toolkit.getDefaultToolkit().createMenuItem(this);
+                peer = getComponentFactory().createMenuItem(this);
         }
     }
 
--- a/src/java.desktop/share/classes/java/awt/MouseInfo.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/java/awt/MouseInfo.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
 package java.awt;
 
 import sun.awt.AWTPermissions;
+import sun.awt.ComponentFactory;
 
 /**
  * <code>MouseInfo</code>  provides methods for getting information about the mouse,
@@ -80,8 +81,13 @@
             security.checkPermission(AWTPermissions.WATCH_MOUSE_PERMISSION);
         }
 
+        Toolkit toolkit = Toolkit.getDefaultToolkit();
         Point point = new Point(0, 0);
-        int deviceNum = Toolkit.getDefaultToolkit().getMouseInfoPeer().fillPointWithCoords(point);
+        int deviceNum = 0;
+        if (toolkit instanceof ComponentFactory) {
+            deviceNum = ((ComponentFactory) toolkit).getMouseInfoPeer().fillPointWithCoords(point);
+        }
+
         GraphicsDevice[] gds = GraphicsEnvironment.getLocalGraphicsEnvironment().
                                    getScreenDevices();
         PointerInfo retval = null;
@@ -113,9 +119,13 @@
     /**
      * Returns the number of buttons on the mouse.
      * On systems without a mouse, returns <code>-1</code>.
+     * The number of buttons is obtained from the AWT Toolkit
+     * by requesting the {@code "awt.mouse.numButtons"} desktop property
+     * which is set by the underlying native platform.
      *
      * @exception HeadlessException if GraphicsEnvironment.isHeadless() returns true
      * @return number of buttons on the mouse
+     * @see Toolkit#getDesktopProperty
      * @since 1.5
      */
     public static int getNumberOfButtons() throws HeadlessException {
--- a/src/java.desktop/share/classes/java/awt/Panel.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/java/awt/Panel.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -83,7 +83,7 @@
     public void addNotify() {
         synchronized (getTreeLock()) {
             if (peer == null)
-                peer = getToolkit().createPanel(this);
+                peer = getComponentFactory().createPanel(this);
             super.addNotify();
         }
     }
--- a/src/java.desktop/share/classes/java/awt/PopupMenu.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/java/awt/PopupMenu.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,7 +121,7 @@
             }
             else {
                 if (peer == null)
-                    peer = Toolkit.getDefaultToolkit().createPopupMenu(this);
+                    peer = getComponentFactory().createPopupMenu(this);
                 int nitems = getItemCount();
                 for (int i = 0 ; i < nitems ; i++) {
                     MenuItem mi = getItem(i);
@@ -153,7 +153,6 @@
      *                parent's hierarchy
      * @exception RuntimeException if the parent is not showing on screen
      */
-    @SuppressWarnings("deprecation")
     public void show(Component origin, int x, int y) {
         // Use localParent for thread safety.
         MenuContainer localParent = parent;
@@ -177,7 +176,7 @@
                 throw new IllegalArgumentException("origin not in parent's hierarchy");
             }
         }
-        if (compParent.getPeer() == null || !compParent.isShowing()) {
+        if (compParent.peer == null || !compParent.isShowing()) {
             throw new RuntimeException("parent not showing on screen");
         }
         if (peer == null) {
--- a/src/java.desktop/share/classes/java/awt/ScrollPane.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/java/awt/ScrollPane.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,6 @@
  */
 package java.awt;
 
-import java.awt.peer.LightweightPeer;
 import java.awt.peer.ScrollPanePeer;
 import java.awt.event.*;
 import javax.accessibility.*;
@@ -562,7 +561,7 @@
             }
 
             if (peer == null)
-                peer = getToolkit().createScrollPane(this);
+                peer = getComponentFactory().createScrollPane(this);
             super.addNotify();
 
             // Bug 4124460. Restore the adjustable values.
--- a/src/java.desktop/share/classes/java/awt/Scrollbar.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/java/awt/Scrollbar.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -433,7 +433,7 @@
     public void addNotify() {
         synchronized (getTreeLock()) {
             if (peer == null)
-                peer = getToolkit().createScrollbar(this);
+                peer = getComponentFactory().createScrollbar(this);
             super.addNotify();
         }
     }
--- a/src/java.desktop/share/classes/java/awt/TextArea.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/java/awt/TextArea.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,15 +24,15 @@
  */
 package java.awt;
 
-import java.awt.event.InputEvent;
-import java.awt.event.KeyEvent;
 import java.awt.peer.TextAreaPeer;
-import java.io.ObjectOutputStream;
+import java.io.IOException;
 import java.io.ObjectInputStream;
-import java.io.IOException;
 import java.util.HashSet;
 import java.util.Set;
-import javax.accessibility.*;
+
+import javax.accessibility.AccessibleContext;
+import javax.accessibility.AccessibleState;
+import javax.accessibility.AccessibleStateSet;
 
 /**
  * A <code>TextArea</code> object is a multi-line region
@@ -290,7 +290,7 @@
     public void addNotify() {
         synchronized (getTreeLock()) {
             if (peer == null)
-                peer = getToolkit().createTextArea(this);
+                peer = getComponentFactory().createTextArea(this);
             super.addNotify();
         }
     }
--- a/src/java.desktop/share/classes/java/awt/TextField.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/java/awt/TextField.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -219,7 +219,7 @@
     public void addNotify() {
         synchronized (getTreeLock()) {
             if (peer == null)
-                peer = getToolkit().createTextField(this);
+                peer = getComponentFactory().createTextField(this);
             super.addNotify();
         }
     }
--- a/src/java.desktop/share/classes/java/awt/Toolkit.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/java/awt/Toolkit.java	Thu May 14 20:15:26 2015 -0700
@@ -25,36 +25,37 @@
 
 package java.awt;
 
-import java.beans.PropertyChangeEvent;
+import java.awt.datatransfer.Clipboard;
+import java.awt.dnd.DragGestureListener;
+import java.awt.dnd.DragGestureRecognizer;
+import java.awt.dnd.DragSource;
 import java.awt.event.*;
-import java.awt.peer.*;
 import java.awt.im.InputMethodHighlight;
+import java.awt.image.ColorModel;
 import java.awt.image.ImageObserver;
 import java.awt.image.ImageProducer;
-import java.awt.image.ColorModel;
-import java.awt.datatransfer.Clipboard;
-import java.awt.dnd.DragSource;
-import java.awt.dnd.DragGestureRecognizer;
-import java.awt.dnd.DragGestureEvent;
-import java.awt.dnd.DragGestureListener;
-import java.awt.dnd.InvalidDnDOperationException;
-import java.awt.dnd.peer.DragSourceContextPeer;
-import java.net.URL;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
 import java.io.File;
 import java.io.FileInputStream;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.EventListener;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.MissingResourceException;
+import java.util.Properties;
+import java.util.ResourceBundle;
+import java.util.StringTokenizer;
+import java.util.WeakHashMap;
 
-import java.util.*;
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyChangeSupport;
+import sun.awt.AWTAccessor;
+import sun.awt.AWTPermissions;
 import sun.awt.AppContext;
-
 import sun.awt.HeadlessToolkit;
-import sun.awt.NullComponentPeer;
 import sun.awt.PeerEvent;
 import sun.awt.SunToolkit;
-import sun.awt.AWTAccessor;
-import sun.awt.AWTPermissions;
-
 import sun.util.CoreResourceBundleControl;
 
 /**
@@ -112,341 +113,6 @@
  */
 public abstract class Toolkit {
 
-    /**
-     * Creates this toolkit's implementation of the <code>Desktop</code>
-     * using the specified peer interface.
-     * @param     target the desktop to be implemented
-     * @return    this toolkit's implementation of the <code>Desktop</code>
-     * @exception HeadlessException if GraphicsEnvironment.isHeadless()
-     * returns true
-     * @see       java.awt.GraphicsEnvironment#isHeadless
-     * @see       java.awt.Desktop
-     * @see       java.awt.peer.DesktopPeer
-     * @since 1.6
-     */
-    protected abstract DesktopPeer createDesktopPeer(Desktop target)
-      throws HeadlessException;
-
-
-    /**
-     * Creates this toolkit's implementation of <code>Button</code> using
-     * the specified peer interface.
-     * @param     target the button to be implemented.
-     * @return    this toolkit's implementation of <code>Button</code>.
-     * @exception HeadlessException if GraphicsEnvironment.isHeadless()
-     * returns true
-     * @see       java.awt.GraphicsEnvironment#isHeadless
-     * @see       java.awt.Button
-     * @see       java.awt.peer.ButtonPeer
-     */
-    protected abstract ButtonPeer createButton(Button target)
-        throws HeadlessException;
-
-    /**
-     * Creates this toolkit's implementation of <code>TextField</code> using
-     * the specified peer interface.
-     * @param     target the text field to be implemented.
-     * @return    this toolkit's implementation of <code>TextField</code>.
-     * @exception HeadlessException if GraphicsEnvironment.isHeadless()
-     * returns true
-     * @see       java.awt.GraphicsEnvironment#isHeadless
-     * @see       java.awt.TextField
-     * @see       java.awt.peer.TextFieldPeer
-     */
-    protected abstract TextFieldPeer createTextField(TextField target)
-        throws HeadlessException;
-
-    /**
-     * Creates this toolkit's implementation of <code>Label</code> using
-     * the specified peer interface.
-     * @param     target the label to be implemented.
-     * @return    this toolkit's implementation of <code>Label</code>.
-     * @exception HeadlessException if GraphicsEnvironment.isHeadless()
-     * returns true
-     * @see       java.awt.GraphicsEnvironment#isHeadless
-     * @see       java.awt.Label
-     * @see       java.awt.peer.LabelPeer
-     */
-    protected abstract LabelPeer createLabel(Label target)
-        throws HeadlessException;
-
-    /**
-     * Creates this toolkit's implementation of <code>List</code> using
-     * the specified peer interface.
-     * @param     target the list to be implemented.
-     * @return    this toolkit's implementation of <code>List</code>.
-     * @exception HeadlessException if GraphicsEnvironment.isHeadless()
-     * returns true
-     * @see       java.awt.GraphicsEnvironment#isHeadless
-     * @see       java.awt.List
-     * @see       java.awt.peer.ListPeer
-     */
-    protected abstract ListPeer createList(java.awt.List target)
-        throws HeadlessException;
-
-    /**
-     * Creates this toolkit's implementation of <code>Checkbox</code> using
-     * the specified peer interface.
-     * @param     target the check box to be implemented.
-     * @return    this toolkit's implementation of <code>Checkbox</code>.
-     * @exception HeadlessException if GraphicsEnvironment.isHeadless()
-     * returns true
-     * @see       java.awt.GraphicsEnvironment#isHeadless
-     * @see       java.awt.Checkbox
-     * @see       java.awt.peer.CheckboxPeer
-     */
-    protected abstract CheckboxPeer createCheckbox(Checkbox target)
-        throws HeadlessException;
-
-    /**
-     * Creates this toolkit's implementation of <code>Scrollbar</code> using
-     * the specified peer interface.
-     * @param     target the scroll bar to be implemented.
-     * @return    this toolkit's implementation of <code>Scrollbar</code>.
-     * @exception HeadlessException if GraphicsEnvironment.isHeadless()
-     * returns true
-     * @see       java.awt.GraphicsEnvironment#isHeadless
-     * @see       java.awt.Scrollbar
-     * @see       java.awt.peer.ScrollbarPeer
-     */
-    protected abstract ScrollbarPeer createScrollbar(Scrollbar target)
-        throws HeadlessException;
-
-    /**
-     * Creates this toolkit's implementation of <code>ScrollPane</code> using
-     * the specified peer interface.
-     * @param     target the scroll pane to be implemented.
-     * @return    this toolkit's implementation of <code>ScrollPane</code>.
-     * @exception HeadlessException if GraphicsEnvironment.isHeadless()
-     * returns true
-     * @see       java.awt.GraphicsEnvironment#isHeadless
-     * @see       java.awt.ScrollPane
-     * @see       java.awt.peer.ScrollPanePeer
-     * @since     1.1
-     */
-    protected abstract ScrollPanePeer createScrollPane(ScrollPane target)
-        throws HeadlessException;
-
-    /**
-     * Creates this toolkit's implementation of <code>TextArea</code> using
-     * the specified peer interface.
-     * @param     target the text area to be implemented.
-     * @return    this toolkit's implementation of <code>TextArea</code>.
-     * @exception HeadlessException if GraphicsEnvironment.isHeadless()
-     * returns true
-     * @see       java.awt.GraphicsEnvironment#isHeadless
-     * @see       java.awt.TextArea
-     * @see       java.awt.peer.TextAreaPeer
-     */
-    protected abstract TextAreaPeer createTextArea(TextArea target)
-        throws HeadlessException;
-
-    /**
-     * Creates this toolkit's implementation of <code>Choice</code> using
-     * the specified peer interface.
-     * @param     target the choice to be implemented.
-     * @return    this toolkit's implementation of <code>Choice</code>.
-     * @exception HeadlessException if GraphicsEnvironment.isHeadless()
-     * returns true
-     * @see       java.awt.GraphicsEnvironment#isHeadless
-     * @see       java.awt.Choice
-     * @see       java.awt.peer.ChoicePeer
-     */
-    protected abstract ChoicePeer createChoice(Choice target)
-        throws HeadlessException;
-
-    /**
-     * Creates this toolkit's implementation of <code>Frame</code> using
-     * the specified peer interface.
-     * @param     target the frame to be implemented.
-     * @return    this toolkit's implementation of <code>Frame</code>.
-     * @exception HeadlessException if GraphicsEnvironment.isHeadless()
-     * returns true
-     * @see       java.awt.GraphicsEnvironment#isHeadless
-     * @see       java.awt.Frame
-     * @see       java.awt.peer.FramePeer
-     */
-    protected abstract FramePeer createFrame(Frame target)
-        throws HeadlessException;
-
-    /**
-     * Creates this toolkit's implementation of <code>Canvas</code> using
-     * the specified peer interface.
-     * @param     target the canvas to be implemented.
-     * @return    this toolkit's implementation of <code>Canvas</code>.
-     * @see       java.awt.Canvas
-     * @see       java.awt.peer.CanvasPeer
-     */
-    protected abstract CanvasPeer       createCanvas(Canvas target);
-
-    /**
-     * Creates this toolkit's implementation of <code>Panel</code> using
-     * the specified peer interface.
-     * @param     target the panel to be implemented.
-     * @return    this toolkit's implementation of <code>Panel</code>.
-     * @see       java.awt.Panel
-     * @see       java.awt.peer.PanelPeer
-     */
-    protected abstract PanelPeer        createPanel(Panel target);
-
-    /**
-     * Creates this toolkit's implementation of <code>Window</code> using
-     * the specified peer interface.
-     * @param     target the window to be implemented.
-     * @return    this toolkit's implementation of <code>Window</code>.
-     * @exception HeadlessException if GraphicsEnvironment.isHeadless()
-     * returns true
-     * @see       java.awt.GraphicsEnvironment#isHeadless
-     * @see       java.awt.Window
-     * @see       java.awt.peer.WindowPeer
-     */
-    protected abstract WindowPeer createWindow(Window target)
-        throws HeadlessException;
-
-    /**
-     * Creates this toolkit's implementation of <code>Dialog</code> using
-     * the specified peer interface.
-     * @param     target the dialog to be implemented.
-     * @return    this toolkit's implementation of <code>Dialog</code>.
-     * @exception HeadlessException if GraphicsEnvironment.isHeadless()
-     * returns true
-     * @see       java.awt.GraphicsEnvironment#isHeadless
-     * @see       java.awt.Dialog
-     * @see       java.awt.peer.DialogPeer
-     */
-    protected abstract DialogPeer createDialog(Dialog target)
-        throws HeadlessException;
-
-    /**
-     * Creates this toolkit's implementation of <code>MenuBar</code> using
-     * the specified peer interface.
-     * @param     target the menu bar to be implemented.
-     * @return    this toolkit's implementation of <code>MenuBar</code>.
-     * @exception HeadlessException if GraphicsEnvironment.isHeadless()
-     * returns true
-     * @see       java.awt.GraphicsEnvironment#isHeadless
-     * @see       java.awt.MenuBar
-     * @see       java.awt.peer.MenuBarPeer
-     */
-    protected abstract MenuBarPeer createMenuBar(MenuBar target)
-        throws HeadlessException;
-
-    /**
-     * Creates this toolkit's implementation of <code>Menu</code> using
-     * the specified peer interface.
-     * @param     target the menu to be implemented.
-     * @return    this toolkit's implementation of <code>Menu</code>.
-     * @exception HeadlessException if GraphicsEnvironment.isHeadless()
-     * returns true
-     * @see       java.awt.GraphicsEnvironment#isHeadless
-     * @see       java.awt.Menu
-     * @see       java.awt.peer.MenuPeer
-     */
-    protected abstract MenuPeer createMenu(Menu target)
-        throws HeadlessException;
-
-    /**
-     * Creates this toolkit's implementation of <code>PopupMenu</code> using
-     * the specified peer interface.
-     * @param     target the popup menu to be implemented.
-     * @return    this toolkit's implementation of <code>PopupMenu</code>.
-     * @exception HeadlessException if GraphicsEnvironment.isHeadless()
-     * returns true
-     * @see       java.awt.GraphicsEnvironment#isHeadless
-     * @see       java.awt.PopupMenu
-     * @see       java.awt.peer.PopupMenuPeer
-     * @since     1.1
-     */
-    protected abstract PopupMenuPeer createPopupMenu(PopupMenu target)
-        throws HeadlessException;
-
-    /**
-     * Creates this toolkit's implementation of <code>MenuItem</code> using
-     * the specified peer interface.
-     * @param     target the menu item to be implemented.
-     * @return    this toolkit's implementation of <code>MenuItem</code>.
-     * @exception HeadlessException if GraphicsEnvironment.isHeadless()
-     * returns true
-     * @see       java.awt.GraphicsEnvironment#isHeadless
-     * @see       java.awt.MenuItem
-     * @see       java.awt.peer.MenuItemPeer
-     */
-    protected abstract MenuItemPeer createMenuItem(MenuItem target)
-        throws HeadlessException;
-
-    /**
-     * Creates this toolkit's implementation of <code>FileDialog</code> using
-     * the specified peer interface.
-     * @param     target the file dialog to be implemented.
-     * @return    this toolkit's implementation of <code>FileDialog</code>.
-     * @exception HeadlessException if GraphicsEnvironment.isHeadless()
-     * returns true
-     * @see       java.awt.GraphicsEnvironment#isHeadless
-     * @see       java.awt.FileDialog
-     * @see       java.awt.peer.FileDialogPeer
-     */
-    protected abstract FileDialogPeer createFileDialog(FileDialog target)
-        throws HeadlessException;
-
-    /**
-     * Creates this toolkit's implementation of <code>CheckboxMenuItem</code> using
-     * the specified peer interface.
-     * @param     target the checkbox menu item to be implemented.
-     * @return    this toolkit's implementation of <code>CheckboxMenuItem</code>.
-     * @exception HeadlessException if GraphicsEnvironment.isHeadless()
-     * returns true
-     * @see       java.awt.GraphicsEnvironment#isHeadless
-     * @see       java.awt.CheckboxMenuItem
-     * @see       java.awt.peer.CheckboxMenuItemPeer
-     */
-    protected abstract CheckboxMenuItemPeer createCheckboxMenuItem(
-        CheckboxMenuItem target) throws HeadlessException;
-
-    /**
-     * Obtains this toolkit's implementation of helper class for
-     * <code>MouseInfo</code> operations.
-     * @return    this toolkit's implementation of  helper for <code>MouseInfo</code>
-     * @throws    UnsupportedOperationException if this operation is not implemented
-     * @see       java.awt.peer.MouseInfoPeer
-     * @see       java.awt.MouseInfo
-     * @since 1.5
-     */
-    protected MouseInfoPeer getMouseInfoPeer() {
-        throw new UnsupportedOperationException("Not implemented");
-    }
-
-    private static LightweightPeer lightweightMarker;
-
-    /**
-     * Creates a peer for a component or container.  This peer is windowless
-     * and allows the Component and Container classes to be extended directly
-     * to create windowless components that are defined entirely in java.
-     *
-     * @param  target The Component to be created.
-     * @return the peer for the specified component
-     */
-    protected LightweightPeer createComponent(Component target) {
-        if (lightweightMarker == null) {
-            lightweightMarker = new NullComponentPeer();
-        }
-        return lightweightMarker;
-    }
-
-    /**
-     * Creates this toolkit's implementation of <code>Font</code> using
-     * the specified peer interface.
-     * @param     name the font to be implemented
-     * @param     style the style of the font, such as <code>PLAIN</code>,
-     *            <code>BOLD</code>, <code>ITALIC</code>, or a combination
-     * @return    this toolkit's implementation of <code>Font</code>
-     * @see       java.awt.Font
-     * @see       java.awt.peer.FontPeer
-     * @see       java.awt.GraphicsEnvironment#getAllFonts
-     * @deprecated  see java.awt.GraphicsEnvironment#getAllFonts
-     */
-    @Deprecated
-    protected abstract FontPeer getFontPeer(String name, int style);
-
     // The following method is called by the private method
     // <code>updateSystemColors</code> in <code>SystemColor</code>.
 
@@ -1749,17 +1415,6 @@
     }
 
     /**
-     * Creates the peer for a DragSourceContext.
-     * Always throws InvalidDndOperationException if
-     * GraphicsEnvironment.isHeadless() returns true.
-     *
-     * @param  dge the {@code DragGestureEvent}
-     * @return the peer created
-     * @see java.awt.GraphicsEnvironment#isHeadless
-     */
-    public abstract DragSourceContextPeer createDragSourceContextPeer(DragGestureEvent dge) throws InvalidDnDOperationException;
-
-    /**
      * Creates a concrete, platform dependent, subclass of the abstract
      * DragGestureRecognizer class requested, and associates it with the
      * DragSource, Component and DragGestureListener specified.
--- a/src/java.desktop/share/classes/java/awt/Window.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/java/awt/Window.java	Thu May 14 20:15:26 2015 -0700
@@ -29,7 +29,6 @@
 import java.awt.geom.Point2D;
 import java.awt.im.InputContext;
 import java.awt.image.BufferStrategy;
-import java.awt.image.BufferedImage;
 import java.awt.peer.ComponentPeer;
 import java.awt.peer.WindowPeer;
 import java.beans.PropertyChangeListener;
@@ -56,7 +55,6 @@
 import sun.awt.CausedFocusEvent;
 import sun.awt.SunToolkit;
 import sun.awt.util.IdentityArrayList;
-import sun.java2d.Disposer;
 import sun.java2d.pipe.Region;
 import sun.security.action.GetPropertyAction;
 import sun.util.logging.PlatformLogger;
@@ -755,15 +753,14 @@
      * @see Container#removeNotify
      * @since 1.0
      */
-    @SuppressWarnings("deprecation")
     public void addNotify() {
         synchronized (getTreeLock()) {
             Container parent = this.parent;
-            if (parent != null && parent.getPeer() == null) {
+            if (parent != null && parent.peer == null) {
                 parent.addNotify();
             }
             if (peer == null) {
-                peer = getToolkit().createWindow(this);
+                peer = getComponentFactory().createWindow(this);
             }
             synchronized (allWindows) {
                 allWindows.add(this);
@@ -802,7 +799,7 @@
     @SuppressWarnings("deprecation")
     public void pack() {
         Container parent = this.parent;
-        if (parent != null && parent.getPeer() == null) {
+        if (parent != null && parent.peer == null) {
             parent.addNotify();
         }
         if (peer == null) {
@@ -1072,10 +1069,9 @@
         }
     }
 
-    @SuppressWarnings("deprecation")
     static void updateChildFocusableWindowState(Window w) {
-        if (w.getPeer() != null && w.isShowing()) {
-            ((WindowPeer)w.getPeer()).updateFocusableWindowState();
+        if (w.peer != null && w.isShowing()) {
+            ((WindowPeer)w.peer).updateFocusableWindowState();
         }
         for (int i = 0; i < w.ownedWindowList.size(); i++) {
             Window child = w.ownedWindowList.elementAt(i).get();
@@ -1160,10 +1156,9 @@
      * as reported in javadoc. So we need to implement this functionality even if a
      * child overrides dispose() in a wrong way without calling super.dispose().
      */
-    @SuppressWarnings("deprecation")
     void disposeImpl() {
         dispose();
-        if (getPeer() != null) {
+        if (peer != null) {
             doDispose();
         }
     }
@@ -3651,7 +3646,7 @@
                 }
             }
             this.opacity = opacity;
-            WindowPeer peer = (WindowPeer)getPeer();
+            WindowPeer peer = (WindowPeer) this.peer;
             if (peer != null) {
                 peer.setOpacity(opacity);
             }
@@ -3728,7 +3723,6 @@
      *
      * @since 1.7
      */
-    @SuppressWarnings("deprecation")
     public void setShape(Shape shape) {
         synchronized (getTreeLock()) {
             if (shape != null) {
@@ -3746,7 +3740,7 @@
                 }
             }
             this.shape = (shape == null) ? null : new Path2D.Float(shape);
-            WindowPeer peer = (WindowPeer)getPeer();
+            WindowPeer peer = (WindowPeer) this.peer;
             if (peer != null) {
                 peer.applyShape(shape == null ? null : Region.getInstance(shape, null));
             }
@@ -3846,7 +3840,6 @@
      * @see GraphicsConfiguration#isTranslucencyCapable()
      */
     @Override
-    @SuppressWarnings("deprecation")
     public void setBackground(Color bgColor) {
         Color oldBg = getBackground();
         super.setBackground(bgColor);
@@ -3874,7 +3867,7 @@
         } else if ((oldAlpha < 255) && (alpha == 255)) {
             setLayersOpaque(this, true);
         }
-        WindowPeer peer = (WindowPeer)getPeer();
+        WindowPeer peer = (WindowPeer) this.peer;
         if (peer != null) {
             peer.setOpaque(alpha == 255);
         }
@@ -3899,10 +3892,9 @@
         return bg != null ? bg.getAlpha() == 255 : true;
     }
 
-    @SuppressWarnings("deprecation")
     private void updateWindow() {
         synchronized (getTreeLock()) {
-            WindowPeer peer = (WindowPeer)getPeer();
+            WindowPeer peer = (WindowPeer) this.peer;
             if (peer != null) {
                 peer.updateWindow();
             }
@@ -4090,7 +4082,6 @@
                 window.securityWarningHeight = height;
             }
 
-            @SuppressWarnings("deprecation")
             public void setSecurityWarningPosition(Window window,
                     Point2D point, float alignmentX, float alignmentY)
             {
@@ -4100,7 +4091,7 @@
                 window.securityWarningAlignmentY = alignmentY;
 
                 synchronized (window.getTreeLock()) {
-                    WindowPeer peer = (WindowPeer)window.getPeer();
+                    WindowPeer peer = (WindowPeer) window.peer;
                     if (peer != null) {
                         peer.repositionSecurityWarning();
                     }
--- a/src/java.desktop/share/classes/java/awt/dnd/DragSource.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/java/awt/dnd/DragSource.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,13 +35,15 @@
 import java.awt.datatransfer.FlavorMap;
 import java.awt.datatransfer.SystemFlavorMap;
 import java.awt.datatransfer.Transferable;
-import java.awt.dnd.peer.DragSourceContextPeer;
 import java.io.IOException;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.io.Serializable;
 import java.security.AccessController;
 import java.util.EventListener;
+
+import sun.awt.AWTAccessor;
+import sun.awt.AWTAccessor.DragSourceContextAccessor;
 import sun.awt.dnd.SunDragSourceContextPeer;
 import sun.security.action.GetIntegerAction;
 
@@ -303,22 +305,16 @@
         try {
             if (flavorMap != null) this.flavorMap = flavorMap;
 
-            DragSourceContextPeer dscp = Toolkit.getDefaultToolkit().createDragSourceContextPeer(trigger);
-
-            DragSourceContext     dsc = createDragSourceContext(dscp,
-                                                                trigger,
-                                                                dragCursor,
-                                                                dragImage,
-                                                                imageOffset,
-                                                                transferable,
-                                                                dsl
-                                                                );
+            DragSourceContext dsc = createDragSourceContext(trigger, dragCursor,
+                                                            dragImage,
+                                                            imageOffset,
+                                                            transferable, dsl);
 
             if (dsc == null) {
                 throw new InvalidDnDOperationException();
             }
-
-            dscp.startDrag(dsc, dsc.getCursor(), dragImage, imageOffset); // may throw
+            DragSourceContextAccessor acc = AWTAccessor.getDragSourceContextAccessor();
+            acc.getPeer(dsc).startDrag(dsc, dsc.getCursor(), dragImage, imageOffset); // may throw
         } catch (RuntimeException e) {
             SunDragSourceContextPeer.setDragDropInProgress(false);
             throw e;
@@ -442,7 +438,6 @@
      * is registered with the created <code>DragSourceContext</code>,
      * but <code>NullPointerException</code> is not thrown.
      *
-     * @param dscp          The <code>DragSourceContextPeer</code> for this drag
      * @param dgl           The <code>DragGestureEvent</code> that triggered the
      *                      drag
      * @param dragCursor     The initial {@code Cursor} for this drag operation
@@ -473,8 +468,13 @@
      *         event are equal to <code>DnDConstants.ACTION_NONE</code>.
      */
 
-    protected DragSourceContext createDragSourceContext(DragSourceContextPeer dscp, DragGestureEvent dgl, Cursor dragCursor, Image dragImage, Point imageOffset, Transferable t, DragSourceListener dsl) {
-        return new DragSourceContext(dscp, dgl, dragCursor, dragImage, imageOffset, t, dsl);
+    protected DragSourceContext createDragSourceContext(DragGestureEvent dgl,
+                                                        Cursor dragCursor,
+                                                        Image dragImage,
+                                                        Point imageOffset,
+                                                        Transferable t,
+                                                        DragSourceListener dsl) {
+        return new DragSourceContext(dgl, dragCursor, dragImage, imageOffset, t, dsl);
     }
 
     /**
--- a/src/java.desktop/share/classes/java/awt/dnd/DragSourceContext.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/java/awt/dnd/DragSourceContext.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,24 +25,25 @@
 
 package java.awt.dnd;
 
+import java.awt.AWTError;
 import java.awt.Component;
 import java.awt.Cursor;
 import java.awt.Image;
 import java.awt.Point;
-
+import java.awt.Toolkit;
 import java.awt.datatransfer.DataFlavor;
 import java.awt.datatransfer.Transferable;
 import java.awt.datatransfer.UnsupportedFlavorException;
-
 import java.awt.dnd.peer.DragSourceContextPeer;
-
 import java.io.IOException;
 import java.io.InvalidObjectException;
+import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
-import java.io.ObjectInputStream;
 import java.io.Serializable;
+import java.util.TooManyListenersException;
 
-import java.util.TooManyListenersException;
+import sun.awt.AWTAccessor;
+import sun.awt.ComponentFactory;
 
 /**
  * The <code>DragSourceContext</code> class is responsible for managing the
@@ -123,6 +124,10 @@
 
     protected static final int CHANGED = 3;
 
+    static {
+        AWTAccessor.setDragSourceContextAccessor(dsc -> dsc.peer);
+    }
+
     /**
      * Called from <code>DragSource</code>, this constructor creates a new
      * <code>DragSourceContext</code> given the
@@ -155,7 +160,6 @@
      * If <code>DragSourceListener</code> is <code>null</code> no exception
      * is thrown.
      *
-     * @param dscp       the <code>DragSourceContextPeer</code> for this drag
      * @param trigger    the triggering event
      * @param dragCursor     the initial {@code Cursor} for this drag operation
      *                       or {@code null} for the default cursor handling;
@@ -179,10 +183,16 @@
      * @throws NullPointerException if dscp, trigger, or t are null, or
      *         if dragImage is non-null and offset is null
      */
-    public DragSourceContext(DragSourceContextPeer dscp,
-                             DragGestureEvent trigger, Cursor dragCursor,
+    public DragSourceContext(DragGestureEvent trigger, Cursor dragCursor,
                              Image dragImage, Point offset, Transferable t,
                              DragSourceListener dsl) {
+        Toolkit toolkit = Toolkit.getDefaultToolkit();
+        if (!(toolkit instanceof ComponentFactory)) {
+            throw new AWTError("Unsupported toolkit: " + toolkit);
+        }
+        DragSourceContextPeer dscp = ((ComponentFactory) toolkit).
+                createDragSourceContextPeer(trigger);
+
         if (dscp == null) {
             throw new NullPointerException("DragSourceContextPeer");
         }
@@ -623,8 +633,7 @@
     /*
      * fields
      */
-
-    private transient DragSourceContextPeer peer;
+    private final transient DragSourceContextPeer peer;
 
     /**
      * The event which triggered the start of the drag.
--- a/src/java.desktop/share/classes/java/awt/dnd/DropTarget.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/java/awt/dnd/DropTarget.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -49,6 +49,9 @@
 import java.awt.peer.LightweightPeer;
 import java.awt.dnd.peer.DropTargetPeer;
 
+import sun.awt.AWTAccessor;
+import sun.awt.AWTAccessor.ComponentAccessor;
+
 
 /**
  * The <code>DropTarget</code> is associated
@@ -204,19 +207,13 @@
         if (component == c || component != null && component.equals(c))
             return;
 
-        Component     old;
-        ComponentPeer oldPeer = null;
+        final Component old = component;
 
-        if ((old = component) != null) {
+        if (old  != null) {
             clearAutoscroll();
 
             component = null;
-
-            if (componentPeer != null) {
-                oldPeer = componentPeer;
-                removeNotify(componentPeer);
-            }
-
+            removeNotify();
             old.setDropTarget(null);
 
         }
@@ -226,7 +223,7 @@
         } catch (Exception e) { // undo the change
             if (old != null) {
                 old.setDropTarget(this);
-                addNotify(oldPeer);
+                addNotify();
             }
         }
     }
@@ -494,24 +491,24 @@
      * association of the ComponentPeer with the Component may result in
      * a malfunction of the DnD system.
      **********************************************************************
-     *
-     * @param peer The Peer of the Component we are associated with!
-     *
      */
-
-    @SuppressWarnings("deprecation")
-    public void addNotify(ComponentPeer peer) {
-        if (peer == componentPeer) return;
+    public void addNotify() {
+        final ComponentAccessor acc = AWTAccessor.getComponentAccessor();
+        ComponentPeer peer = acc.getPeer(component);
+        if (peer == null || peer == componentPeer) {
+            return;
+        }
 
         componentPeer = peer;
 
+
         for (Component c = component;
              c != null && peer instanceof LightweightPeer; c = c.getParent()) {
-            peer = c.getPeer();
+            peer = acc.getPeer(c);
         }
 
         if (peer instanceof DropTargetPeer) {
-            nativePeer = peer;
+            nativePeer = (DropTargetPeer) peer;
             ((DropTargetPeer)peer).addDropTarget(this);
         } else {
             nativePeer = null;
@@ -530,15 +527,14 @@
      * disassociation of the ComponentPeer from the Component may result in
      * a malfunction of the DnD system.
      **********************************************************************
-     *
-     * @param peer The Peer of the Component we are being disassociated from!
      */
 
-    public void removeNotify(ComponentPeer peer) {
-        if (nativePeer != null)
-            ((DropTargetPeer)nativePeer).removeDropTarget(this);
-
-        componentPeer = nativePeer = null;
+    public void removeNotify() {
+        if (nativePeer != null) {
+            nativePeer.removeDropTarget(this);
+        }
+        componentPeer = null;
+        nativePeer = null;
 
         synchronized (this) {
             if (isDraggingInside) {
@@ -834,7 +830,7 @@
     /*
      * That Component's "native" Peer
      */
-    private transient ComponentPeer nativePeer;
+    private transient DropTargetPeer nativePeer;
 
 
     /**
--- a/src/java.desktop/share/classes/java/awt/dnd/DropTargetContext.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/java/awt/dnd/DropTargetContext.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,6 +39,8 @@
 import java.util.Arrays;
 import java.util.List;
 
+import sun.awt.AWTAccessor;
+import sun.awt.AWTAccessor.DropTargetContextAccessor;
 
 /**
  * A <code>DropTargetContext</code> is created
@@ -58,6 +60,19 @@
 
     private static final long serialVersionUID = -634158968993743371L;
 
+    static {
+        AWTAccessor.setDropTargetContextAccessor(new DropTargetContextAccessor() {
+            @Override
+            public void reset(DropTargetContext dtc) {
+                dtc.reset();
+            }
+            @Override
+            public void setDropTargetContextPeer(DropTargetContext dtc,
+                                                 DropTargetContextPeer dtcp) {
+                dtc.setDropTargetContextPeer(dtcp);
+            }
+        });
+    }
     /**
      * Construct a <code>DropTargetContext</code>
      * given a specified <code>DropTarget</code>.
@@ -90,20 +105,9 @@
     public Component getComponent() { return dropTarget.getComponent(); }
 
     /**
-     * Called when associated with the <code>DropTargetContextPeer</code>.
-     *
-     * @param dtcp the <code>DropTargetContextPeer</code>
-     */
-
-    public void addNotify(DropTargetContextPeer dtcp) {
-        dropTargetContextPeer = dtcp;
-    }
-
-    /**
      * Called when disassociated with the <code>DropTargetContextPeer</code>.
      */
-
-    public void removeNotify() {
+    void reset() {
         dropTargetContextPeer = null;
         transferable          = null;
     }
@@ -282,12 +286,18 @@
      *
      * @return the platform peer
      */
-
     DropTargetContextPeer getDropTargetContextPeer() {
         return dropTargetContextPeer;
     }
 
     /**
+     * Sets the {@code DropTargetContextPeer}
+     */
+    void setDropTargetContextPeer(final DropTargetContextPeer dtcp) {
+        dropTargetContextPeer = dtcp;
+    }
+
+    /**
      * Creates a TransferableProxy to proxy for the specified
      * Transferable.
      *
@@ -412,7 +422,7 @@
      *
      * @serial
      */
-    private DropTarget dropTarget;
+    private final DropTarget dropTarget;
 
     private transient DropTargetContextPeer dropTargetContextPeer;
 
--- a/src/java.desktop/share/classes/java/awt/geom/Path2D.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/java/awt/geom/Path2D.java	Thu May 14 20:15:26 2015 -0700
@@ -101,6 +101,8 @@
 
     static final int INIT_SIZE = 20;
     static final int EXPAND_MAX = 500;
+    static final int EXPAND_MAX_COORDS = EXPAND_MAX * 2;
+    static final int EXPAND_MIN = 10; // ensure > 6 (cubics)
 
     /**
      * Constructs a new empty {@code Path2D} object.
@@ -141,6 +143,42 @@
     abstract int rectCrossings(double rxmin, double rymin,
                                double rxmax, double rymax);
 
+    static byte[] expandPointTypes(byte[] oldPointTypes, int needed) {
+        final int oldSize = oldPointTypes.length;
+        final int newSizeMin = oldSize + needed;
+        if (newSizeMin < oldSize) {
+            // hard overflow failure - we can't even accommodate
+            // new items without overflowing
+            throw new ArrayIndexOutOfBoundsException(
+                          "pointTypes exceeds maximum capacity !");
+        }
+        // growth algorithm computation
+        int grow = oldSize;
+        if (grow > EXPAND_MAX) {
+            grow = Math.max(EXPAND_MAX, oldSize >> 3); // 1/8th min
+        } else if (grow < EXPAND_MIN) {
+            grow = EXPAND_MIN;
+        }
+        assert grow > 0;
+
+        int newSize = oldSize + grow;
+        if (newSize < newSizeMin) {
+            // overflow in growth algorithm computation
+            newSize = Integer.MAX_VALUE;
+        }
+        while (true) {
+            try {
+                // try allocating the larger array
+                return Arrays.copyOf(oldPointTypes, newSize);
+            } catch (OutOfMemoryError oome) {
+                if (newSize == newSizeMin) {
+                    throw oome;
+                }
+            }
+            newSize = newSizeMin + (newSize - newSizeMin) / 2;
+        }
+    }
+
     /**
      * The {@code Float} class defines a geometric path with
      * coordinates stored in single precision floating point.
@@ -279,31 +317,53 @@
                                      floatCoords[coordindex+1]);
         }
 
+        @Override
         void needRoom(boolean needMove, int newCoords) {
-            if (needMove && numTypes == 0) {
+            if ((numTypes == 0) && needMove) {
                 throw new IllegalPathStateException("missing initial moveto "+
                                                     "in path definition");
             }
-            int size = pointTypes.length;
-            if (numTypes >= size) {
-                int grow = size;
-                if (grow > EXPAND_MAX) {
-                    grow = EXPAND_MAX;
-                } else if (grow == 0) {
-                    grow = 1;
+            if (numTypes >= pointTypes.length) {
+                pointTypes = expandPointTypes(pointTypes, 1);
+            }
+            if (numCoords > (floatCoords.length - newCoords)) {
+                floatCoords = expandCoords(floatCoords, newCoords);
+            }
+        }
+
+        static float[] expandCoords(float[] oldCoords, int needed) {
+            final int oldSize = oldCoords.length;
+            final int newSizeMin = oldSize + needed;
+            if (newSizeMin < oldSize) {
+                // hard overflow failure - we can't even accommodate
+                // new items without overflowing
+                throw new ArrayIndexOutOfBoundsException(
+                              "coords exceeds maximum capacity !");
+            }
+            // growth algorithm computation
+            int grow = oldSize;
+            if (grow > EXPAND_MAX_COORDS) {
+                grow = Math.max(EXPAND_MAX_COORDS, oldSize >> 3); // 1/8th min
+            } else if (grow < EXPAND_MIN) {
+                grow = EXPAND_MIN;
+            }
+            assert grow > needed;
+
+            int newSize = oldSize + grow;
+            if (newSize < newSizeMin) {
+                // overflow in growth algorithm computation
+                newSize = Integer.MAX_VALUE;
+            }
+            while (true) {
+                try {
+                    // try allocating the larger array
+                    return Arrays.copyOf(oldCoords, newSize);
+                } catch (OutOfMemoryError oome) {
+                    if (newSize == newSizeMin) {
+                        throw oome;
+                    }
                 }
-                pointTypes = Arrays.copyOf(pointTypes, size+grow);
-            }
-            size = floatCoords.length;
-            if (numCoords + newCoords > size) {
-                int grow = size;
-                if (grow > EXPAND_MAX * 2) {
-                    grow = EXPAND_MAX * 2;
-                }
-                if (grow < newCoords) {
-                    grow = newCoords;
-                }
-                floatCoords = Arrays.copyOf(floatCoords, size+grow);
+                newSize = newSizeMin + (newSize - newSizeMin) / 2;
             }
         }
 
@@ -1126,31 +1186,53 @@
                                       doubleCoords[coordindex+1]);
         }
 
+        @Override
         void needRoom(boolean needMove, int newCoords) {
-            if (needMove && numTypes == 0) {
+            if ((numTypes == 0) && needMove) {
                 throw new IllegalPathStateException("missing initial moveto "+
                                                     "in path definition");
             }
-            int size = pointTypes.length;
-            if (numTypes >= size) {
-                int grow = size;
-                if (grow > EXPAND_MAX) {
-                    grow = EXPAND_MAX;
-                } else if (grow == 0) {
-                    grow = 1;
+            if (numTypes >= pointTypes.length) {
+                pointTypes = expandPointTypes(pointTypes, 1);
+            }
+            if (numCoords > (doubleCoords.length - newCoords)) {
+                doubleCoords = expandCoords(doubleCoords, newCoords);
+            }
+        }
+
+        static double[] expandCoords(double[] oldCoords, int needed) {
+            final int oldSize = oldCoords.length;
+            final int newSizeMin = oldSize + needed;
+            if (newSizeMin < oldSize) {
+                // hard overflow failure - we can't even accommodate
+                // new items without overflowing
+                throw new ArrayIndexOutOfBoundsException(
+                              "coords exceeds maximum capacity !");
+            }
+            // growth algorithm computation
+            int grow = oldSize;
+            if (grow > EXPAND_MAX_COORDS) {
+                grow = Math.max(EXPAND_MAX_COORDS, oldSize >> 3); // 1/8th min
+            } else if (grow < EXPAND_MIN) {
+                grow = EXPAND_MIN;
+            }
+            assert grow > needed;
+
+            int newSize = oldSize + grow;
+            if (newSize < newSizeMin) {
+                // overflow in growth algorithm computation
+                newSize = Integer.MAX_VALUE;
+            }
+            while (true) {
+                try {
+                    // try allocating the larger array
+                    return Arrays.copyOf(oldCoords, newSize);
+                } catch (OutOfMemoryError oome) {
+                    if (newSize == newSizeMin) {
+                        throw oome;
+                    }
                 }
-                pointTypes = Arrays.copyOf(pointTypes, size+grow);
-            }
-            size = doubleCoords.length;
-            if (numCoords + newCoords > size) {
-                int grow = size;
-                if (grow > EXPAND_MAX * 2) {
-                    grow = EXPAND_MAX * 2;
-                }
-                if (grow < newCoords) {
-                    grow = newCoords;
-                }
-                doubleCoords = Arrays.copyOf(doubleCoords, size+grow);
+                newSize = newSizeMin + (newSize - newSizeMin) / 2;
             }
         }
 
--- a/src/java.desktop/share/classes/java/beans/IndexedPropertyDescriptor.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/java/beans/IndexedPropertyDescriptor.java	Thu May 14 20:15:26 2015 -0700
@@ -431,7 +431,7 @@
     /**
      * Package-private constructor.
      * Merge two property descriptors.  Where they conflict, give the
-     * second argument (y) priority over the first argumnnt (x).
+     * second argument (y) priority over the first argument (x).
      *
      * @param x  The first (lower priority) PropertyDescriptor
      * @param y  The second (higher priority) PropertyDescriptor
@@ -439,39 +439,37 @@
 
     IndexedPropertyDescriptor(PropertyDescriptor x, PropertyDescriptor y) {
         super(x,y);
+        Method tr = null;
+        Method tw = null;
+
         if (x instanceof IndexedPropertyDescriptor) {
-            IndexedPropertyDescriptor ix = (IndexedPropertyDescriptor)x;
-            try {
-                Method xr = ix.getIndexedReadMethod();
-                if (xr != null) {
-                    setIndexedReadMethod(xr);
-                }
+            IndexedPropertyDescriptor ix = (IndexedPropertyDescriptor) x;
+            tr = ix.getIndexedReadMethod();
+            tw = ix.getIndexedWriteMethod();
+        }
+        if (y instanceof IndexedPropertyDescriptor) {
+            IndexedPropertyDescriptor iy = (IndexedPropertyDescriptor) y;
+            Method yr = iy.getIndexedReadMethod();
+            if (isAssignable(tr, yr)) {
+                tr = yr;
+            }
 
-                Method xw = ix.getIndexedWriteMethod();
-                if (xw != null) {
-                    setIndexedWriteMethod(xw);
-                }
-            } catch (IntrospectionException ex) {
-                // Should not happen
-                throw new AssertionError(ex);
+            Method yw = iy.getIndexedWriteMethod();
+            if (isAssignable(tw, yw)) {
+                tw = yw;
             }
         }
-        if (y instanceof IndexedPropertyDescriptor) {
-            IndexedPropertyDescriptor iy = (IndexedPropertyDescriptor)y;
-            try {
-                Method yr = iy.getIndexedReadMethod();
-                if (yr != null && yr.getDeclaringClass() == getClass0()) {
-                    setIndexedReadMethod(yr);
-                }
 
-                Method yw = iy.getIndexedWriteMethod();
-                if (yw != null && yw.getDeclaringClass() == getClass0()) {
-                    setIndexedWriteMethod(yw);
-                }
-            } catch (IntrospectionException ex) {
-                // Should not happen
-                throw new AssertionError(ex);
+        try {
+            if(tr != null) {
+                setIndexedReadMethod(tr);
             }
+            if(tw != null) {
+                setIndexedWriteMethod(tw);
+            }
+        } catch(IntrospectionException ex) {
+            // Should not happen
+            throw new AssertionError(ex);
         }
     }
 
--- a/src/java.desktop/share/classes/java/beans/PropertyDescriptor.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/java/beans/PropertyDescriptor.java	Thu May 14 20:15:26 2015 -0700
@@ -748,7 +748,7 @@
         appendTo(sb, "writeMethod", this.writeMethodRef.get());
     }
 
-    private boolean isAssignable(Method m1, Method m2) {
+    boolean isAssignable(Method m1, Method m2) {
         if (m1 == null) {
             return true; // choose second method
         }
--- a/src/java.desktop/share/classes/javax/swing/AbstractCellEditor.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/javax/swing/AbstractCellEditor.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -53,7 +53,13 @@
 @SuppressWarnings("serial") // Same-version serialization only
 public abstract class AbstractCellEditor implements CellEditor, Serializable {
 
+    /**
+     * The list of listeners.
+     */
     protected EventListenerList listenerList = new EventListenerList();
+    /**
+     * The change event.
+     */
     transient protected ChangeEvent changeEvent = null;
 
     // Force this to be implemented.
--- a/src/java.desktop/share/classes/javax/swing/AbstractListModel.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/javax/swing/AbstractListModel.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -50,6 +50,9 @@
 @SuppressWarnings("serial") // Same-version serialization only
 public abstract class AbstractListModel<E> implements ListModel<E>, Serializable
 {
+    /**
+     * The listener list.
+     */
     protected EventListenerList listenerList = new EventListenerList();
 
 
--- a/src/java.desktop/share/classes/javax/swing/ButtonGroup.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/javax/swing/ButtonGroup.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,7 +69,9 @@
 @SuppressWarnings("serial")
 public class ButtonGroup implements Serializable {
 
-    // the list of buttons participating in this group
+    /**
+     * The list of buttons participating in this group.
+     */
     protected Vector<AbstractButton> buttons = new Vector<AbstractButton>();
 
     /**
--- a/src/java.desktop/share/classes/javax/swing/DefaultFocusManager.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/javax/swing/DefaultFocusManager.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -57,10 +57,19 @@
     private final LayoutComparator comparator =
         new LayoutComparator();
 
+    /**
+     * Constructs a {@code DefaultFocusManager}.
+     */
     public DefaultFocusManager() {
         setDefaultFocusTraversalPolicy(gluePolicy);
     }
 
+    /**
+     * Returns the component after.
+     * @return the component after
+     * @param aContainer a container
+     * @param aComponent a component
+     */
     public Component getComponentAfter(Container aContainer,
                                        Component aComponent)
     {
@@ -83,6 +92,12 @@
         return null;
     }
 
+    /**
+     * Returns the component before.
+     * @return the component before
+     * @param aContainer a container
+     * @param aComponent a component
+     */
     public Component getComponentBefore(Container aContainer,
                                         Component aComponent)
     {
@@ -105,6 +120,11 @@
         return null;
     }
 
+    /**
+     * Returns the first component.
+     * @return the first component
+     * @param aContainer a container
+     */
     public Component getFirstComponent(Container aContainer) {
         Container root = (aContainer.isFocusCycleRoot())
             ? aContainer
@@ -125,6 +145,11 @@
         return null;
     }
 
+    /**
+     * Returns the last component.
+     * @return the last component
+     * @param aContainer a container
+     */
     public Component getLastComponent(Container aContainer) {
         Container root = (aContainer.isFocusCycleRoot())
             ? aContainer
@@ -145,6 +170,12 @@
         return null;
     }
 
+    /**
+     * Compares the components by their focus traversal cycle order.
+     * @param a the first component
+     * @param b the second component
+     * @return a comparison of the components by their focus traversal cycle order
+     */
     public boolean compareTabOrder(Component a, Component b) {
         return (comparator.compare(a, b) < 0);
     }
--- a/src/java.desktop/share/classes/javax/swing/DefaultListCellRenderer.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/javax/swing/DefaultListCellRenderer.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -84,6 +84,9 @@
     */
     private static final Border SAFE_NO_FOCUS_BORDER = new EmptyBorder(1, 1, 1, 1);
     private static final Border DEFAULT_NO_FOCUS_BORDER = new EmptyBorder(1, 1, 1, 1);
+    /**
+     * No focus border
+     */
     protected static Border noFocusBorder = DEFAULT_NO_FOCUS_BORDER;
 
     /**
--- a/src/java.desktop/share/classes/javax/swing/DefaultListSelectionModel.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/javax/swing/DefaultListSelectionModel.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,8 +68,14 @@
     private int lastChangedIndex = MIN;
 
     private BitSet value = new BitSet(32);
+    /**
+     * The list of listeners.
+     */
     protected EventListenerList listenerList = new EventListenerList();
 
+    /**
+     * Whether or not the lead anchor notification is enabled.
+     */
     protected boolean leadAnchorNotificationEnabled = true;
 
     /** {@inheritDoc} */
@@ -139,6 +145,8 @@
 
     /**
      * Notifies listeners that we have ended a series of adjustments.
+     * @param isAdjusting true if this is the final change in a series of
+     *          adjustments
      */
     protected void fireValueChanged(boolean isAdjusting) {
         if (lastChangedIndex == MIN) {
--- a/src/java.desktop/share/classes/javax/swing/DefaultSingleSelectionModel.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/javax/swing/DefaultSingleSelectionModel.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,8 @@
 @SuppressWarnings("serial") // Same-version serialization only
 public class DefaultSingleSelectionModel implements SingleSelectionModel,
 Serializable {
-    /* Only one ModelChangeEvent is needed per model instance since the
+    /**
+     * Only one ModelChangeEvent is needed per model instance since the
      * event's only (read-only) state is the source property.  The source
      * of events generated here is always "this".
      */
@@ -57,12 +58,16 @@
 
     private int index = -1;
 
-    // implements javax.swing.SingleSelectionModel
+    /**
+     * {@inheritDoc}
+     */
     public int getSelectedIndex() {
         return index;
     }
 
-    // implements javax.swing.SingleSelectionModel
+    /**
+     * {@inheritDoc}
+     */
     public void setSelectedIndex(int index) {
         if (this.index != index) {
             this.index = index;
@@ -70,12 +75,16 @@
         }
     }
 
-    // implements javax.swing.SingleSelectionModel
+    /**
+     * {@inheritDoc}
+     */
     public void clearSelection() {
         setSelectedIndex(-1);
     }
 
-    // implements javax.swing.SingleSelectionModel
+    /**
+     * {@inheritDoc}
+     */
     public boolean isSelected() {
         boolean ret = false;
         if (getSelectedIndex() != -1) {
--- a/src/java.desktop/share/classes/javax/swing/DesktopManager.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/javax/swing/DesktopManager.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -145,6 +145,7 @@
      * necessary state.  Normally <b>f</b> will be a JInternalFrame.
      *
      * @param f  the {@code JComponent} being resized
+     * @param direction the direction
      */
     void beginResizingFrame(JComponent f, int direction);
 
--- a/src/java.desktop/share/classes/javax/swing/JColorChooser.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/javax/swing/JColorChooser.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -561,6 +561,9 @@
 // Accessibility support
 ////////////////
 
+    /**
+     * The accessible context.
+     */
     protected AccessibleContext accessibleContext = null;
 
     /**
--- a/src/java.desktop/share/classes/javax/swing/JComboBox.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/javax/swing/JComboBox.java	Thu May 14 20:15:26 2015 -0700
@@ -577,6 +577,8 @@
                 if (!found) {
                     return;
                 }
+
+                getEditor().setItem(anObject);
             }
 
             // Must toggle the state of this flag since this method
@@ -1319,16 +1321,12 @@
      * do not call or override.
      */
     public void actionPerformed(ActionEvent e) {
-        ComboBoxEditor editor = getEditor();
-        if ((editor != null) && (e != null) && (editor == e.getSource()
-                || editor.getEditorComponent() == e.getSource())) {
-            setPopupVisible(false);
-            getModel().setSelectedItem(editor.getItem());
-            String oldCommand = getActionCommand();
-            setActionCommand("comboBoxEdited");
-            fireActionEvent();
-            setActionCommand(oldCommand);
-        }
+        setPopupVisible(false);
+        getModel().setSelectedItem(getEditor().getItem());
+        String oldCommand = getActionCommand();
+        setActionCommand("comboBoxEdited");
+        fireActionEvent();
+        setActionCommand(oldCommand);
     }
 
     /**
--- a/src/java.desktop/share/classes/javax/swing/JComponent.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/javax/swing/JComponent.java	Thu May 14 20:15:26 2015 -0700
@@ -57,6 +57,7 @@
 import static javax.swing.ClientPropertyKey.*;
 import javax.accessibility.*;
 
+import sun.awt.AWTAccessor;
 import sun.awt.SunToolkit;
 import sun.swing.SwingUtilities2;
 import sun.swing.UIClientPropertyKey;
@@ -4218,9 +4219,10 @@
      * @param c  the {@code Component} to be checked
      * @return true if this component is lightweight
      */
-    @SuppressWarnings("deprecation")
     public static boolean isLightweightComponent(Component c) {
-        return c.getPeer() instanceof LightweightPeer;
+        // TODO we cannot call c.isLightweight() because it is incorrectly
+        // overriden in DelegateContainer on osx.
+        return AWTAccessor.getComponentAccessor().isLightweight(c);
     }
 
 
@@ -5033,7 +5035,6 @@
         this.paintingChild = paintingChild;
     }
 
-    @SuppressWarnings("deprecation")
     void _paintImmediately(int x, int y, int w, int h) {
         Graphics g;
         Container c;
@@ -5159,7 +5160,7 @@
         }
 
         // If the clip width or height is negative, don't bother painting
-        if(c == null || c.getPeer() == null ||
+        if(c == null || !c.isDisplayable() ||
                         paintImmediatelyClip.width <= 0 ||
                         paintImmediatelyClip.height <= 0) {
             recycleRectangle(paintImmediatelyClip);
--- a/src/java.desktop/share/classes/javax/swing/JEditorPane.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/javax/swing/JEditorPane.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -726,6 +726,8 @@
      * URL's can be properly resolved.
      *
      * @param page  the URL of the page
+     * @return a stream for the URL which is about to be loaded
+     * @throws IOException if an I/O problem occurs
      */
     protected InputStream getStream(URL page) throws IOException {
         final URLConnection conn = page.openConnection();
@@ -1712,10 +1714,17 @@
 
         private AccessibleContext accessibleContext;
 
+        /**
+         * Returns the accessible text.
+         * @return the accessible text
+         */
         public AccessibleText getAccessibleText() {
             return new JEditorPaneAccessibleHypertextSupport();
         }
 
+        /**
+         * Constructs an {@code AccessibleJEditorPaneHTML}.
+         */
         protected AccessibleJEditorPaneHTML () {
             HTMLEditorKit kit = (HTMLEditorKit)JEditorPane.this.getEditorKit();
             accessibleContext = kit.getAccessibleContext();
@@ -1791,9 +1800,16 @@
     protected class JEditorPaneAccessibleHypertextSupport
     extends AccessibleJEditorPane implements AccessibleHypertext {
 
+        /**
+         * An HTML link.
+         */
         public class HTMLLink extends AccessibleHyperlink {
             Element element;
 
+            /**
+             * Constructs a {@code HTMLLink}.
+             * @param e the element
+             */
             public HTMLLink(Element e) {
                 element = e;
             }
--- a/src/java.desktop/share/classes/javax/swing/JInternalFrame.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/javax/swing/JInternalFrame.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,7 +38,6 @@
 
 import java.io.ObjectOutputStream;
 import java.io.IOException;
-import java.lang.StringBuilder;
 import java.beans.PropertyChangeListener;
 import sun.awt.AppContext;
 import sun.swing.SwingUtilities2;
@@ -1654,7 +1653,7 @@
      * <dt><code>DO_NOTHING_ON_CLOSE</code>
      * <dd> Do nothing.
      *      This requires the program to handle the operation
-     *      in the <code>windowClosing</code> method
+     *      in the <code>internalFrameClosing</code> method
      *      of a registered <code>InternalFrameListener</code> object.
      * <dt><code>HIDE_ON_CLOSE</code>
      * <dd> Automatically make the internal frame invisible.
--- a/src/java.desktop/share/classes/javax/swing/JList.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/javax/swing/JList.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -2890,6 +2890,9 @@
 
         int leadSelectionIndex;
 
+        /**
+         * Constructs an {@code AccessibleJList}.
+         */
         public AccessibleJList() {
             super();
             JList.this.addPropertyChangeListener(this);
@@ -3193,6 +3196,11 @@
             private ListModel<E> listModel;
             private ListCellRenderer<? super E> cellRenderer = null;
 
+            /**
+             * Constructs an {@code AccessibleJListChild}.
+             * @param parent the parent
+             * @param indexInParent the index in the parent
+             */
             public AccessibleJListChild(JList<E> parent, int indexInParent) {
                 this.parent = parent;
                 this.setAccessibleParent(parent);
--- a/src/java.desktop/share/classes/javax/swing/JTable.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/javax/swing/JTable.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -6803,12 +6803,25 @@
         protected class AccessibleJTableModelChange
             implements AccessibleTableModelChange {
 
+            /** The type */
             protected int type;
+            /** The first row */
             protected int firstRow;
+            /** The last row */
             protected int lastRow;
+            /** The first column */
             protected int firstColumn;
+            /** The last column */
             protected int lastColumn;
 
+            /**
+             * Constructs an {@code AccessibleJTableModelChange}.
+             * @param type the type
+             * @param firstRow the first row
+             * @param lastRow the last row
+             * @param firstColumn the first column
+             * @param lastColumn the last column
+             */
             protected AccessibleJTableModelChange(int type, int firstRow,
                                                   int lastRow, int firstColumn,
                                                   int lastColumn) {
@@ -6819,22 +6832,42 @@
                 this.lastColumn = lastColumn;
             }
 
+            /**
+             * Returns the type.
+             * @return the type
+             */
             public int getType() {
                 return type;
             }
 
+            /**
+             * Returns the first row.
+             * @return the first row
+             */
             public int getFirstRow() {
                 return firstRow;
             }
 
+            /**
+             * Returns the last row.
+             * @return the last row
+             */
             public int getLastRow() {
                 return lastRow;
             }
 
+            /**
+             * Returns the first column.
+             * @return the first column
+             */
             public int getFirstColumn() {
                 return firstColumn;
             }
 
+            /**
+             * Returns the last column.
+             * @return the last column
+             */
             public int getLastColumn() {
                 return lastColumn;
             }
--- a/src/java.desktop/share/classes/javax/swing/JViewport.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/javax/swing/JViewport.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -37,6 +37,8 @@
 
 import java.io.Serializable;
 
+import sun.awt.AWTAccessor;
+
 /**
  * The "viewport" or "porthole" through which you see the underlying
  * information. When you scroll, what moves is the viewport. It is like
@@ -380,7 +382,6 @@
      * @param contentRect the <code>Rectangle</code> to display
      * @see JComponent#isValidateRoot
      * @see java.awt.Component#isValid
-     * @see java.awt.Component#getPeer
      */
     public void scrollRectToVisible(Rectangle contentRect) {
         Component view = getView();
@@ -1448,7 +1449,6 @@
      * Returns true if the component needs to be completely repainted after
      * a blit and a paint is received.
      */
-    @SuppressWarnings("deprecation")
     private boolean needsRepaintAfterBlit() {
         // Find the first heavy weight ancestor. isObscured and
         // canDetermineObscurity are only appropriate for heavy weights.
@@ -1459,7 +1459,8 @@
         }
 
         if (heavyParent != null) {
-            ComponentPeer peer = heavyParent.getPeer();
+            ComponentPeer peer = AWTAccessor.getComponentAccessor()
+                                            .getPeer(heavyParent);
 
             if (peer != null && peer.canDetermineObscurity() &&
                                 !peer.isObscured()) {
--- a/src/java.desktop/share/classes/javax/swing/RepaintManager.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/javax/swing/RepaintManager.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -401,7 +401,6 @@
      *
      * @see JComponent#repaint
      */
-    @SuppressWarnings("deprecation")
     private void addDirtyRegion0(Container c, int x, int y, int w, int h) {
         /* Special cases we don't have to bother with.
          */
@@ -432,7 +431,7 @@
         // it could lead to the possibility of getting locks out
         // of order and deadlocking.
         for (Container p = c; p != null; p = p.getParent()) {
-            if (!p.isVisible() || (p.getPeer() == null)) {
+            if (!p.isVisible() || !p.isDisplayable()) {
                 return;
             }
             if ((p instanceof Window) || (p instanceof Applet)) {
--- a/src/java.desktop/share/classes/javax/swing/SortingFocusTraversalPolicy.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/javax/swing/SortingFocusTraversalPolicy.java	Thu May 14 20:15:26 2015 -0700
@@ -570,7 +570,10 @@
             } else if (comp instanceof Container && comp != aContainer) {
                 Container cont = (Container)comp;
                 if (cont.isFocusTraversalPolicyProvider()) {
-                    return cont.getFocusTraversalPolicy().getLastComponent(cont);
+                    Component retComp = cont.getFocusTraversalPolicy().getLastComponent(cont);
+                    if (retComp != null) {
+                        return retComp;
+                    }
                 }
             }
         }
--- a/src/java.desktop/share/classes/javax/swing/ToolTipManager.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/javax/swing/ToolTipManager.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -80,8 +80,13 @@
     private KeyStroke postTip;
     private KeyStroke hideTip;
 
-    // PENDING(ges)
+    /**
+     * Lightweight popup enabled.
+     */
     protected boolean lightWeightPopupEnabled = true;
+    /**
+     * Heavyweight popup enabled.
+     */
     protected boolean heavyWeightPopupEnabled = false;
 
     ToolTipManager() {
@@ -657,7 +662,13 @@
         }
     }
 
+    /**
+     * Inside timer action.
+     */
     protected class insideTimerAction implements ActionListener {
+        /**
+         * {@inheritDoc}
+         */
         public void actionPerformed(ActionEvent e) {
             if(insideComponent != null && insideComponent.isShowing()) {
                 // Lazy lookup
@@ -681,13 +692,25 @@
         }
     }
 
+    /**
+     * Outside timer action.
+     */
     protected class outsideTimerAction implements ActionListener {
+        /**
+         * {@inheritDoc}
+         */
         public void actionPerformed(ActionEvent e) {
             showImmediately = false;
         }
     }
 
+    /**
+     * Still inside timer action.
+     */
     protected class stillInsideTimerAction implements ActionListener {
+        /**
+         * {@inheritDoc}
+         */
         public void actionPerformed(ActionEvent e) {
             hideTipWindow();
             enterTimer.stop();
--- a/src/java.desktop/share/classes/javax/swing/UIDefaults.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/javax/swing/UIDefaults.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1191,6 +1191,10 @@
         /** Key bindings are registered under. */
         private Object[] bindings;
 
+        /**
+         * Constructs a {@code LazyInputMap}.
+         * @param bindings the bindings
+         */
         public LazyInputMap(Object[] bindings) {
             this.bindings = bindings;
         }
--- a/src/java.desktop/share/classes/javax/swing/border/BevelBorder.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/javax/swing/border/BevelBorder.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -52,10 +52,25 @@
     /** Lowered bevel type. */
     public static final int LOWERED = 1;
 
+    /**
+     * The bevel type.
+     */
     protected int bevelType;
+    /**
+     * The color to use for the bevel outer highlight.
+     */
     protected Color highlightOuter;
+    /**
+     * The color to use for the bevel inner highlight.
+     */
     protected Color highlightInner;
+    /**
+     * The color to use for the bevel inner shadow.
+     */
     protected Color shadowInner;
+    /**
+     * the color to use for the bevel outer shadow
+     */
     protected Color shadowOuter;
 
     /**
@@ -262,6 +277,17 @@
      */
     public boolean isBorderOpaque() { return true; }
 
+    /**
+     * Paints a raised bevel for the specified component with the specified
+     * position and size.
+     *
+     * @param c the component for which the raised bevel is being painted
+     * @param g the paint graphics
+     * @param x the x position of the raised bevel
+     * @param y the y position of the raised bevel
+     * @param width the width of the raised bevel
+     * @param height the height of the raised bevel
+     */
     protected void paintRaisedBevel(Component c, Graphics g, int x, int y,
                                     int width, int height)  {
         Color oldColor = g.getColor();
@@ -291,6 +317,17 @@
 
     }
 
+    /**
+     * Paints a lowered bevel for the specified component with the specified
+     * position and size.
+     *
+     * @param c the component for which the lowered bevel is being painted
+     * @param g the paint graphics
+     * @param x the x position of the lowered bevel
+     * @param y the y position of the lowered bevel
+     * @param width the width of the lowered bevel
+     * @param height the height of the lowered bevel
+     */
     protected void paintLoweredBevel(Component c, Graphics g, int x, int y,
                                         int width, int height)  {
         Color oldColor = g.getColor();
--- a/src/java.desktop/share/classes/javax/swing/border/CompoundBorder.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/javax/swing/border/CompoundBorder.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -56,7 +56,13 @@
  */
 @SuppressWarnings("serial")
 public class CompoundBorder extends AbstractBorder {
+    /**
+     * The outside border.
+     */
     protected Border outsideBorder;
+    /**
+     * The inside border.
+     */
     protected Border insideBorder;
 
     /**
--- a/src/java.desktop/share/classes/javax/swing/border/EmptyBorder.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/javax/swing/border/EmptyBorder.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -49,7 +49,22 @@
 @SuppressWarnings("serial")
 public class EmptyBorder extends AbstractBorder implements Serializable
 {
-    protected int left, right, top, bottom;
+    /**
+     * The left inset of the border.
+     */
+    protected int left;
+    /**
+     * The right inset of the border.
+     */
+    protected int right;
+    /**
+     * The top inset of the border.
+     */
+    protected int top;
+    /**
+     * The bottom inset of the border.
+     */
+    protected int bottom;
 
     /**
      * Creates an empty border with the specified insets.
--- a/src/java.desktop/share/classes/javax/swing/border/EtchedBorder.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/javax/swing/border/EtchedBorder.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -59,8 +59,17 @@
     /** Lowered etched type. */
     public static final int LOWERED = 1;
 
+    /**
+     * The type of etch to be drawn by the border.
+     */
     protected int etchType;
+    /**
+     * The color to use for the etched highlight.
+     */
     protected Color highlight;
+    /**
+     * The color to use for the etched shadow.
+     */
     protected Color shadow;
 
     /**
--- a/src/java.desktop/share/classes/javax/swing/border/LineBorder.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/javax/swing/border/LineBorder.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -56,8 +56,17 @@
     private static Border blackLine;
     private static Border grayLine;
 
+    /**
+     * Thickness of the border.
+     */
     protected int thickness;
+    /**
+     * Color of the border.
+     */
     protected Color lineColor;
+    /**
+     * Whether or not the border has rounded corners.
+     */
     protected boolean roundedCorners;
 
     /**
--- a/src/java.desktop/share/classes/javax/swing/border/MatteBorder.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/javax/swing/border/MatteBorder.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -49,7 +49,13 @@
 @SuppressWarnings("serial")
 public class MatteBorder extends EmptyBorder
 {
+    /**
+     * The color rendered for the border.
+     */
     protected Color color;
+    /**
+     * The icon to be used for tiling the border.
+     */
     protected Icon tileIcon;
 
     /**
--- a/src/java.desktop/share/classes/javax/swing/border/TitledBorder.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/javax/swing/border/TitledBorder.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -70,11 +70,29 @@
 @SuppressWarnings("serial")
 public class TitledBorder extends AbstractBorder
 {
+    /**
+     * The title the border should display.
+     */
     protected String title;
+    /**
+     * The border.
+     */
     protected Border border;
+    /**
+     * The position for the title.
+     */
     protected int titlePosition;
+    /**
+     * The justification for the title.
+     */
     protected int titleJustification;
+    /**
+     * The font for rendering the title.
+     */
     protected Font titleFont;
+    /**
+     * The color of the title.
+     */
     protected Color titleColor;
 
     private final JLabel label;
@@ -117,13 +135,19 @@
      */
     static public final int     TRAILING = 5;
 
-    // Space between the border and the component's edge
+    /**
+     * Space between the border and the component's edge
+     */
     static protected final int EDGE_SPACING = 2;
 
-    // Space between the border and text
+    /**
+     * Space between the border and text
+     */
     static protected final int TEXT_SPACING = 2;
 
-    // Horizontal inset of text that is left or right justified
+    /**
+     * Horizontal inset of text that is left or right justified
+     */
     static protected final int TEXT_INSET_H = 5;
 
     /**
@@ -676,6 +700,11 @@
         return justification;
     }
 
+    /**
+     * Returns default font of the titled border.
+     * @return default font of the titled border
+     * @param c the component
+     */
     protected Font getFont(Component c) {
         Font font = getTitleFont();
         if (font != null) {
--- a/src/java.desktop/share/classes/javax/swing/plaf/ActionMapUIResource.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/javax/swing/plaf/ActionMapUIResource.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -37,6 +37,9 @@
  */
 @SuppressWarnings("serial") // Superclass is not serializable across versions
 public class ActionMapUIResource extends ActionMap implements UIResource {
+    /**
+     * Constructs an {@code ActionMapUIResource}.
+     */
     public ActionMapUIResource() {
     }
 }
--- a/src/java.desktop/share/classes/javax/swing/plaf/BorderUIResource.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/javax/swing/plaf/BorderUIResource.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,7 +38,7 @@
 import javax.swing.plaf.UIResource;
 
 
-/*
+/**
  * A Border wrapper class which implements UIResource.  UI
  * classes which set border properties should use this class
  * to wrap any borders specified as defaults.
@@ -67,6 +67,10 @@
     static Border raisedBevel;
     static Border blackLine;
 
+    /**
+     * Returns a etched border UI resource.
+     * @return a etched border UI resource
+     */
     public static Border getEtchedBorderUIResource() {
         if (etched == null) {
             etched = new EtchedBorderUIResource();
@@ -74,6 +78,10 @@
         return etched;
     }
 
+    /**
+     * Returns a lowered bevel border UI resource.
+     * @return a lowered bevel border UI resource
+     */
     public static Border getLoweredBevelBorderUIResource() {
         if (loweredBevel == null) {
             loweredBevel = new BevelBorderUIResource(BevelBorder.LOWERED);
@@ -81,6 +89,10 @@
         return loweredBevel;
     }
 
+    /**
+     * Returns a raised bevel border UI resource.
+     * @return a raised bevel border UI resource
+     */
     public static Border getRaisedBevelBorderUIResource() {
         if (raisedBevel == null) {
             raisedBevel = new BevelBorderUIResource(BevelBorder.RAISED);
@@ -88,6 +100,10 @@
         return raisedBevel;
     }
 
+    /**
+     * Returns a black line border UI resource.
+     * @return a black line border UI resource
+     */
     public static Border getBlackLineBorderUIResource() {
         if (blackLine == null) {
             blackLine = new LineBorderUIResource(Color.black);
@@ -122,7 +138,15 @@
         return delegate.isBorderOpaque();
     }
 
+    /**
+     * A compound border UI resource.
+     */
     public static class CompoundBorderUIResource extends CompoundBorder implements UIResource {
+        /**
+         * Constructs a {@code CompoundBorderUIResource}.
+         * @param outsideBorder the outside border
+         * @param insideBorder the inside border
+         */
         @ConstructorProperties({"outsideBorder", "insideBorder"})
         public CompoundBorderUIResource(Border outsideBorder, Border insideBorder) {
             super(outsideBorder, insideBorder);
@@ -130,23 +154,49 @@
 
     }
 
+    /**
+     * An empty border UI resource.
+     */
     public static class EmptyBorderUIResource extends EmptyBorder implements UIResource {
 
+        /**
+         * Constructs a {@code EmptyBorderUIResource}.
+         * @param top the top inset of the border
+         * @param left the left inset of the border
+         * @param bottom the bottom inset of the border
+         * @param right the right inset of the border
+         */
         public EmptyBorderUIResource(int top, int left, int bottom, int right)   {
             super(top, left, bottom, right);
         }
+        /**
+         * Constructs a {@code EmptyBorderUIResource}.
+         * @param insets the insets of the border
+         */
         @ConstructorProperties({"borderInsets"})
         public EmptyBorderUIResource(Insets insets) {
             super(insets);
         }
     }
 
+    /**
+     * A line border UI resource.
+     */
     public static class LineBorderUIResource extends LineBorder implements UIResource {
 
+        /**
+         * Constructs a {@code LineBorderUIResource}.
+         * @param color the color for the border
+         */
         public LineBorderUIResource(Color color) {
             super(color);
         }
 
+        /**
+         * Constructs a {@code LineBorderUIResource}.
+         * @param color the color for the border
+         * @param thickness the thickness of the border
+         */
         @ConstructorProperties({"lineColor", "thickness"})
         public LineBorderUIResource(Color color, int thickness)  {
             super(color, thickness);
@@ -154,16 +204,37 @@
     }
 
 
+    /**
+     * A bevel border UI resource.
+     */
     public static class BevelBorderUIResource extends BevelBorder implements UIResource {
 
+        /**
+         * Constructs a {@code BevelBorderUIResource}.
+         * @param bevelType the type of bevel for the border
+         */
         public BevelBorderUIResource(int bevelType) {
             super(bevelType);
         }
 
+        /**
+         * Constructs a {@code BevelBorderUIResource}.
+         * @param bevelType the type of bevel for the border
+         * @param highlight the color to use for the bevel highlight
+         * @param shadow the color to use for the bevel shadow
+         */
         public BevelBorderUIResource(int bevelType, Color highlight, Color shadow) {
             super(bevelType, highlight, shadow);
         }
 
+        /**
+         * Constructs a {@code BevelBorderUIResource}.
+         * @param bevelType the type of bevel for the border
+         * @param highlightOuter the color to use for the bevel outer highlight
+         * @param highlightInner the color to use for the bevel inner highlight
+         * @param shadowOuter the color to use for the bevel outer shadow
+         * @param shadowInner the color to use for the bevel inner shadow
+         */
         @ConstructorProperties({"bevelType", "highlightOuterColor", "highlightInnerColor", "shadowOuterColor", "shadowInnerColor"})
         public BevelBorderUIResource(int bevelType,
                                      Color highlightOuter, Color highlightInner,
@@ -172,57 +243,124 @@
         }
     }
 
+    /**
+     * An etched border UI resource.
+     */
     public static class EtchedBorderUIResource extends EtchedBorder implements UIResource {
 
+        /**
+         * Constructs an {@code EtchedBorderUIResource}.
+         */
         public EtchedBorderUIResource()    {
             super();
         }
 
+        /**
+         * Constructs an {@code EtchedBorderUIResource}.
+         * @param etchType the type of etch to be drawn by the border
+         */
         public EtchedBorderUIResource(int etchType)    {
             super(etchType);
         }
 
+        /**
+         * Constructs an {@code EtchedBorderUIResource}.
+         * @param highlight the color to use for the etched highlight
+         * @param shadow the color to use for the etched shadow
+         */
         public EtchedBorderUIResource(Color highlight, Color shadow)    {
             super(highlight, shadow);
         }
 
+        /**
+         * Constructs an {@code EtchedBorderUIResource}.
+         * @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
+         */
         @ConstructorProperties({"etchType", "highlightColor", "shadowColor"})
         public EtchedBorderUIResource(int etchType, Color highlight, Color shadow)    {
             super(etchType, highlight, shadow);
         }
     }
 
+    /**
+     * A matte border UI resource.
+     */
     public static class MatteBorderUIResource extends MatteBorder implements UIResource {
 
+        /**
+         * Constructs a {@code MatteBorderUIResource}.
+         * @param top the top inset of the border
+         * @param left the left inset of the border
+         * @param bottom the bottom inset of the border
+         * @param right the right inset of the border
+         * @param color the color rendered for the border
+         */
         public MatteBorderUIResource(int top, int left, int bottom, int right,
                                      Color color)   {
             super(top, left, bottom, right, color);
         }
 
+        /**
+         * Constructs a {@code MatteBorderUIResource}.
+         * @param top the top inset of the border
+         * @param left the left inset of the border
+         * @param bottom the bottom inset of the border
+         * @param right the right inset of the border
+         * @param tileIcon the icon to be used for tiling the border
+         */
         public MatteBorderUIResource(int top, int left, int bottom, int right,
                                      Icon tileIcon)   {
             super(top, left, bottom, right, tileIcon);
         }
 
+        /**
+         * Constructs a {@code MatteBorderUIResource}.
+         * @param tileIcon the icon to be used for tiling the border
+         */
         public MatteBorderUIResource(Icon tileIcon)   {
             super(tileIcon);
         }
     }
 
+    /**
+     * A titled border UI resource.
+     */
     public static class TitledBorderUIResource extends TitledBorder implements UIResource {
 
+        /**
+         * Constructs a {@code TitledBorderUIResource}.
+         * @param title the title the border should display
+         */
         public TitledBorderUIResource(String title)     {
             super(title);
         }
 
+        /**
+         * Constructs a {@code TitledBorderUIResource}.
+         * @param border the border
+         */
         public TitledBorderUIResource(Border border)       {
             super(border);
         }
 
+        /**
+         * Constructs a {@code TitledBorderUIResource}.
+         * @param border the border
+         * @param title the title the border should display
+         */
         public TitledBorderUIResource(Border border, String title) {
             super(border, title);
         }
 
+        /**
+         * Constructs a {@code TitledBorderUIResource}.
+         * @param border the border
+         * @param title the title the border should display
+         * @param titleJustification the justification fro the title
+         * @param titlePosition the position for the title
+         */
         public TitledBorderUIResource(Border border,
                         String title,
                         int titleJustification,
@@ -230,6 +368,14 @@
             super(border, title, titleJustification, titlePosition);
         }
 
+        /**
+         * Constructs a {@code TitledBorderUIResource}.
+         * @param border the border
+         * @param title the title the border should display
+         * @param titleJustification the justification fro the title
+         * @param titlePosition the position for the title
+         * @param titleFont the font for rendering the title
+         */
         public TitledBorderUIResource(Border border,
                         String title,
                         int titleJustification,
@@ -238,6 +384,15 @@
             super(border, title, titleJustification, titlePosition, titleFont);
         }
 
+        /**
+         * Constructs a {@code TitledBorderUIResource}.
+         * @param border the border
+         * @param title the title the border should display
+         * @param titleJustification the justification fro the title
+         * @param titlePosition the position for the title
+         * @param titleFont the font for rendering the title
+         * @param titleColor the color of the title
+         */
         @ConstructorProperties({"border", "title", "titleJustification", "titlePosition", "titleFont", "titleColor"})
         public TitledBorderUIResource(Border border,
                         String title,
--- a/src/java.desktop/share/classes/javax/swing/plaf/ColorUIResource.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/javax/swing/plaf/ColorUIResource.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,7 @@
 import java.awt.Color;
 import java.beans.ConstructorProperties;
 
-/*
+/**
  * A subclass of Color that implements UIResource.  UI
  * classes that create colors should use this class.
  * <p>
@@ -48,19 +48,39 @@
 @SuppressWarnings("serial") // Same-version serialization only
 public class ColorUIResource extends Color implements UIResource
 {
+    /**
+     * Constructs a {@code ColorUIResource}.
+     * @param r the red component
+     * @param g the green component
+     * @param b the blue component
+     */
     @ConstructorProperties({"red", "green", "blue"})
     public ColorUIResource(int r, int g, int b) {
         super(r, g, b);
     }
 
+    /**
+     * Constructs a {@code ColorUIResource}.
+     * @param rgb the combined RGB components
+     */
     public ColorUIResource(int rgb) {
         super(rgb);
     }
 
+    /**
+     * Constructs a {@code ColorUIResource}.
+     * @param r the red component
+     * @param g the green component
+     * @param b the blue component
+     */
     public ColorUIResource(float r, float g, float b) {
         super(r, g, b);
     }
 
+    /**
+     * Constructs a {@code ColorUIResource}.
+     * @param c the color
+     */
     public ColorUIResource(Color c) {
         super(c.getRGB(), (c.getRGB() & 0xFF000000) != 0xFF000000);
     }
--- a/src/java.desktop/share/classes/javax/swing/plaf/ComponentInputMapUIResource.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/javax/swing/plaf/ComponentInputMapUIResource.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,6 +38,10 @@
  */
 @SuppressWarnings("serial") // Superclass is not serializable across versions
 public class ComponentInputMapUIResource extends ComponentInputMap implements UIResource {
+    /**
+     * Constructs a {@code ComponentInputMapUIResource}.
+     * @param component a non-null JComponent
+     */
     public ComponentInputMapUIResource(JComponent component) {
         super(component);
     }
--- a/src/java.desktop/share/classes/javax/swing/plaf/DimensionUIResource.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/javax/swing/plaf/DimensionUIResource.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,7 @@
 import javax.swing.plaf.UIResource;
 
 
-/*
+/**
  * A subclass of <code>Dimension</code> that implements
  * <code>UIResource</code>.  UI classes that use
  * <code>Dimension</code> values for default properties
@@ -51,6 +51,11 @@
 @SuppressWarnings("serial") // Same-version serialization only
 public class DimensionUIResource extends Dimension implements UIResource
 {
+    /**
+     * Constructs a {@code DimensionUIResource}.
+     * @param width the width
+     * @param height the height
+     */
     public DimensionUIResource(int width, int height) {
         super(width, height);
     }
--- a/src/java.desktop/share/classes/javax/swing/plaf/FileChooserUI.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/javax/swing/plaf/FileChooserUI.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,13 +38,42 @@
 
 public abstract class FileChooserUI extends ComponentUI
 {
+    /**
+     * Returns an accept-all file filter.
+     * @param fc the file chooser
+     * @return an accept-all file filter
+     */
     public abstract FileFilter getAcceptAllFileFilter(JFileChooser fc);
+    /**
+     * Returns a file view.
+     * @param fc the file chooser
+     * @return a file view
+     */
     public abstract FileView getFileView(JFileChooser fc);
 
+    /**
+     * Returns approve button text.
+     * @param fc the file chooser
+     * @return approve button text.
+     */
     public abstract String getApproveButtonText(JFileChooser fc);
+    /**
+     * Returns the dialog title.
+     * @param fc the file chooser
+     * @return the dialog title.
+     */
     public abstract String getDialogTitle(JFileChooser fc);
 
+    /**
+     * Rescan the current directory.
+     * @param fc the file chooser
+     */
     public abstract void rescanCurrentDirectory(JFileChooser fc);
+    /**
+     * Ensure the file in question is visible.
+     * @param fc the file chooser
+     * @param f the file
+     */
     public abstract void ensureFileIsVisible(JFileChooser fc, File f);
 
     /**
--- a/src/java.desktop/share/classes/javax/swing/plaf/FontUIResource.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/javax/swing/plaf/FontUIResource.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -50,10 +50,20 @@
 @SuppressWarnings("serial") // Same-version serialization only
 public class FontUIResource extends Font implements UIResource
 {
+    /**
+     * Constructs a {@code FontUIResource}.
+     * @param name the font name
+     * @param style the style constant for the font
+     * @param size the point size of the font
+     */
     public FontUIResource(String name, int style, int size) {
         super(name, style, size);
     }
 
+    /**
+     * Constructs a {@code FontUIResource}.
+     * @param font the font
+     */
     public FontUIResource(Font font) {
         super(font);
     }
--- a/src/java.desktop/share/classes/javax/swing/plaf/InputMapUIResource.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/javax/swing/plaf/InputMapUIResource.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -37,6 +37,9 @@
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class InputMapUIResource extends InputMap implements UIResource {
+    /**
+     * Constructs an {@code InputMapUIResource}.
+     */
     public InputMapUIResource() {
     }
 }
--- a/src/java.desktop/share/classes/javax/swing/plaf/InsetsUIResource.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/javax/swing/plaf/InsetsUIResource.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,7 @@
 import javax.swing.plaf.UIResource;
 
 
-/*
+/**
  * A subclass of Insets that implements UIResource.  UI
  * classes that use Insets values for default properties
  * should use this class.
@@ -50,6 +50,13 @@
 @SuppressWarnings("serial") // Same-version serialization only
 public class InsetsUIResource extends Insets implements UIResource
 {
+    /**
+     * Constructs an {@code InsetsUIResource}.
+     * @param top the inset from the top
+     * @param left the inset from the left
+     * @param bottom the inset from the bottom
+     * @param right the inset from the right
+     */
     public InsetsUIResource(int top, int left, int bottom, int right) {
         super(top, left, bottom, right);
     }
--- a/src/java.desktop/share/classes/javax/swing/plaf/LayerUI.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/javax/swing/plaf/LayerUI.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -730,6 +730,15 @@
      * This method is to be overridden instead of {@code JLayer.imageUpdate}.
      * <p>
      * <b>Note:</b> This method is usually called <b>not</b> on the Event Dispatching Thread.
+     *
+     * @param img the image being observed
+     * @param infoflags see imageUpdate for information
+     * @param x the x coordinate
+     * @param y the y coordinate
+     * @param w the width
+     * @param h the height
+     * @param l a {@code JLayer} component
+     * @return false if the infoflags indicate that the image is completely loaded; true otherwise
      */
     public boolean imageUpdate(Image img, int infoflags, int x, int y, int w, int h, JLayer<? extends V> l) {
         return l.imageUpdate(img, infoflags, x, y, w, h);
--- a/src/java.desktop/share/classes/javax/swing/plaf/TabbedPaneUI.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/javax/swing/plaf/TabbedPaneUI.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,25 @@
  * @author Amy Fowler
  */
 public abstract class TabbedPaneUI extends ComponentUI {
+    /**
+     * Returns the tab for the coordinate.
+     * @param pane the pane
+     * @param x the x coordinate
+     * @param y the y coordinate
+     * @return the tab for the coordinate
+     */
     public abstract int tabForCoordinate(JTabbedPane pane, int x, int y);
+    /**
+     * Returns the rectangle for the tab bounds.
+     * @param pane the pane
+     * @param index the index
+     * @return the rectangle for the tab bounds
+     */
     public abstract Rectangle getTabBounds(JTabbedPane pane, int index);
+    /**
+     * Returns the tab run count.
+     * @param pane the pane
+     * @return the tab run count
+     */
     public abstract int getTabRunCount(JTabbedPane pane);
 }
--- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java	Thu May 14 20:15:26 2015 -0700
@@ -992,7 +992,7 @@
         getDisplaySize();
         if (sameBaseline) {
             Insets insets = c.getInsets();
-            height = height - insets.top - insets.bottom;
+            height = Math.max(height - insets.top - insets.bottom, 0);
             if (!comboBox.isEditable()) {
                 ListCellRenderer<Object> renderer = comboBox.getRenderer();
                 if (renderer == null)  {
--- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicDirectoryModel.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicDirectoryModel.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -222,12 +222,14 @@
 
     /**
      * Obsolete - not used.
+     * @param e list data event
      */
     public void intervalAdded(ListDataEvent e) {
     }
 
     /**
      * Obsolete - not used.
+     * @param e list data event
      */
     public void intervalRemoved(ListDataEvent e) {
     }
@@ -241,7 +243,12 @@
         ShellFolder.sort(v);
     }
 
-    // Obsolete - not used
+    /**
+     * Obsolete - not used
+     * @return a comparison of the file names
+     * @param a a file
+     * @param b another file
+     */
     protected boolean lt(File a, File b) {
         // First ignore case when comparing
         int diff = a.getName().toLowerCase().compareTo(b.getName().toLowerCase());
--- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -50,23 +50,39 @@
 public class BasicFileChooserUI extends FileChooserUI {
 
     /* FileView icons */
+    /** Directory icon */
     protected Icon directoryIcon = null;
+    /** File icon */
     protected Icon fileIcon = null;
+    /** Computer icon */
     protected Icon computerIcon = null;
+    /** Hard drive icon */
     protected Icon hardDriveIcon = null;
+    /** Floppy drive icon */
     protected Icon floppyDriveIcon = null;
 
+    /** New folder icon */
     protected Icon newFolderIcon = null;
+    /** Up folder icon */
     protected Icon upFolderIcon = null;
+    /** Home folder icon */
     protected Icon homeFolderIcon = null;
+    /** List view icon */
     protected Icon listViewIcon = null;
+    /** Details view icon */
     protected Icon detailsViewIcon = null;
+    /** View menu icon */
     protected Icon viewMenuIcon = null;
 
+    /** Save button mnemonic */
     protected int saveButtonMnemonic = 0;
+    /** Open button mnemonic */
     protected int openButtonMnemonic = 0;
+    /** Cancel button mnemonic */
     protected int cancelButtonMnemonic = 0;
+    /** Update button mnemonic */
     protected int updateButtonMnemonic = 0;
+    /** Help button mnemonic */
     protected int helpButtonMnemonic = 0;
 
     /**
@@ -77,10 +93,15 @@
      */
     protected int directoryOpenButtonMnemonic = 0;
 
+    /** Save button text */
     protected String saveButtonText = null;
+    /** Open button text */
     protected String openButtonText = null;
+    /** Cancel button text */
     protected String cancelButtonText = null;
+    /** Update button text */
     protected String updateButtonText = null;
+    /** Help button text */
     protected String helpButtonText = null;
 
     /**
@@ -91,13 +112,20 @@
      */
     protected String directoryOpenButtonText = null;
 
+    /** Open dialog title text */
     private String openDialogTitleText = null;
+    /** Save dialog title text */
     private String saveDialogTitleText = null;
 
+    /** Save button tool tip text */
     protected String saveButtonToolTipText = null;
+    /** Open button tool tip text */
     protected String openButtonToolTipText = null;
+    /** Cancel button tool tip text */
     protected String cancelButtonToolTipText = null;
+    /** Update button tool tip text */
     protected String updateButtonToolTipText = null;
+    /** Help button tool tip text */
     protected String helpButtonToolTipText = null;
 
     /**
@@ -158,9 +186,17 @@
         return new BasicFileChooserUI((JFileChooser) c);
     }
 
+    /**
+     * Constructs a {@code BasicFileChooserUI}.
+     * @param b file chooser
+     */
     public BasicFileChooserUI(JFileChooser b) {
     }
 
+    /**
+     * Installs the UI.
+     * @param c the component
+     */
     public void installUI(JComponent c) {
         accessoryPanel = new JPanel(new BorderLayout());
         filechooser = (JFileChooser) c;
@@ -175,6 +211,10 @@
         filechooser.applyComponentOrientation(filechooser.getComponentOrientation());
     }
 
+    /**
+     * Uninstalls the UI.
+     * @param c the component
+     */
     public void uninstallUI(JComponent c) {
         uninstallListeners(filechooser);
         uninstallComponents(filechooser);
@@ -190,12 +230,24 @@
         handler = null;
     }
 
+    /**
+     * Installs the components.
+     * @param fc the file chooser
+     */
     public void installComponents(JFileChooser fc) {
     }
 
+    /**
+     * Uninstalls the components.
+     * @param fc the file chooser
+     */
     public void uninstallComponents(JFileChooser fc) {
     }
 
+    /**
+     * Installs the listeners.
+     * @param fc the file chooser
+     */
     protected void installListeners(JFileChooser fc) {
         propertyChangeListener = createPropertyChangeListener(fc);
         if(propertyChangeListener != null) {
@@ -241,6 +293,10 @@
     }
 
 
+    /**
+     * Uninstalls the listeners.
+     * @param fc the file chooser
+     */
     protected void uninstallListeners(JFileChooser fc) {
         if(propertyChangeListener != null) {
             fc.removePropertyChangeListener(propertyChangeListener);
@@ -252,6 +308,10 @@
     }
 
 
+    /**
+     * Installs the defaults.
+     * @param fc the file chooser
+     */
     protected void installDefaults(JFileChooser fc) {
         installIcons(fc);
         installStrings(fc);
@@ -264,6 +324,10 @@
         LookAndFeel.installProperty(fc, "opaque", Boolean.FALSE);
     }
 
+    /**
+     * Installs the icons.
+     * @param fc the file chooser
+     */
     protected void installIcons(JFileChooser fc) {
         directoryIcon    = UIManager.getIcon("FileView.directoryIcon");
         fileIcon         = UIManager.getIcon("FileView.fileIcon");
@@ -279,6 +343,10 @@
         viewMenuIcon     = UIManager.getIcon("FileChooser.viewMenuIcon");
     }
 
+    /**
+     * Installs the strings.
+     * @param fc the file chooser
+     */
     protected void installStrings(JFileChooser fc) {
 
         Locale l = fc.getLocale();
@@ -315,6 +383,10 @@
         directoryOpenButtonToolTipText = UIManager.getString("FileChooser.directoryOpenButtonToolTipText",l);
     }
 
+    /**
+     * Uninstalls the defaults.
+     * @param fc the file chooser
+     */
     protected void uninstallDefaults(JFileChooser fc) {
         uninstallIcons(fc);
         uninstallStrings(fc);
@@ -323,6 +395,10 @@
         }
     }
 
+    /**
+     * Uninstalls the icons.
+     * @param fc the file chooser
+     */
     protected void uninstallIcons(JFileChooser fc) {
         directoryIcon    = null;
         fileIcon         = null;
@@ -338,6 +414,10 @@
         viewMenuIcon     = null;
     }
 
+    /**
+     * Uninstalls the strings.
+     * @param fc the file chooser
+     */
     protected void uninstallStrings(JFileChooser fc) {
         saveButtonText   = null;
         openButtonText   = null;
@@ -354,6 +434,9 @@
         directoryOpenButtonToolTipText = null;
     }
 
+    /**
+     * Creates the model.
+     */
     protected void createModel() {
         if (model != null) {
             model.invalidateFileCache();
@@ -361,50 +444,102 @@
         model = new BasicDirectoryModel(getFileChooser());
     }
 
+    /**
+     * Returns the model.
+     * @return the model
+     */
     public BasicDirectoryModel getModel() {
         return model;
     }
 
+    /**
+     * Creates the property change listener.
+     * @param fc the file chooser
+     * @return the property change listener
+     */
     public PropertyChangeListener createPropertyChangeListener(JFileChooser fc) {
         return null;
     }
 
+    /**
+     * Returns the file name.
+     * @return the file name
+     */
     public String getFileName() {
         return null;
     }
 
+    /**
+     * Returns the directory name.
+     * @return the directory name
+     */
     public String getDirectoryName() {
         return null;
     }
 
+    /**
+     * Sets the file name.
+     * @param filename the file name
+     */
     public void setFileName(String filename) {
     }
 
+    /**
+     * Sets the directory name.
+     * @param dirname the file name
+     */
     public void setDirectoryName(String dirname) {
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public void rescanCurrentDirectory(JFileChooser fc) {
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public void ensureFileIsVisible(JFileChooser fc, File f) {
     }
 
+    /**
+     * Returns the file chooser.
+     * @return the file chooser
+     */
     public JFileChooser getFileChooser() {
         return filechooser;
     }
 
+    /**
+     * Returns the accessory panel.
+     * @return the accessory panel
+     */
     public JPanel getAccessoryPanel() {
         return accessoryPanel;
     }
 
+    /**
+     * Returns the approve button.
+     * @param fc the file chooser
+     * @return the approve button
+     */
     protected JButton getApproveButton(JFileChooser fc) {
         return null;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public JButton getDefaultButton(JFileChooser fc) {
         return getApproveButton(fc);
     }
 
+    /**
+     * Returns the approve button tool tip.
+     * @param fc the file chooser
+     * @return the approve button tool tip
+     */
     public String getApproveButtonToolTipText(JFileChooser fc) {
         String tooltipText = fc.getApproveButtonToolTipText();
         if(tooltipText != null) {
@@ -419,6 +554,9 @@
         return null;
     }
 
+    /**
+     * Clears the icon cache.
+     */
     public void clearIconCache() {
         fileView.clearIconCache();
     }
@@ -435,11 +573,22 @@
         return handler;
     }
 
+    /**
+     * Creates a double click listener.
+     * @param fc the file chooser
+     * @param list the list
+     * @return a double click listener
+     */
     protected MouseListener createDoubleClickListener(JFileChooser fc,
                                                       JList<?> list) {
         return new Handler(list);
     }
 
+    /**
+     * Creates a list selection listener.
+     * @param fc the file chooser
+     * @return a list selection listener
+     */
     public ListSelectionListener createListSelectionListener(JFileChooser fc) {
         return getHandler();
     }
@@ -566,12 +715,19 @@
         }
     }
 
+    /**
+     * A double click listener.
+     */
     protected class DoubleClickListener extends MouseAdapter {
         // NOTE: This class exists only for backward compatibility. All
         // its functionality has been moved into Handler. If you need to add
         // new functionality add it to the Handler, but make sure this
         // class calls into the Handler.
         Handler handler;
+        /**
+         * Constucts a {@code DoubleClickListener}.
+         * @param list the lsit
+         */
         public  DoubleClickListener(JList<?> list) {
             handler = new Handler(list);
         }
@@ -587,16 +743,21 @@
             handler.mouseEntered(e);
         }
 
+        /** {@inheritDoc} */
         public void mouseClicked(MouseEvent e) {
             handler.mouseClicked(e);
         }
     }
 
+    /**
+     * A selection listener.
+     */
     protected class SelectionListener implements ListSelectionListener {
         // NOTE: This class exists only for backward compatibility. All
         // its functionality has been moved into Handler. If you need to add
         // new functionality add it to the Handler, but make sure this
         // class calls into the Handler.
+        /** {@inheritDoc} */
         public void valueChanged(ListSelectionEvent e) {
             getHandler().valueChanged(e);
         }
@@ -672,6 +833,8 @@
 
     /**
      * Returns the title of this dialog
+     * @param fc the file chooser
+     * @return the title of this dialog
      */
     public String getDialogTitle(JFileChooser fc) {
         String dialogTitle = fc.getDialogTitle();
@@ -686,7 +849,11 @@
         }
     }
 
-
+    /**
+     * Returns the approve button mnemonic.
+     * @param fc the file chooser
+     * @return the approve button mnemonic
+     */
     public int getApproveButtonMnemonic(JFileChooser fc) {
         int mnemonic = fc.getApproveButtonMnemonic();
         if (mnemonic > 0) {
@@ -700,6 +867,7 @@
         }
     }
 
+    /** {@inheritDoc} */
     public String getApproveButtonText(JFileChooser fc) {
         String buttonText = fc.getApproveButtonText();
         if (buttonText != null) {
@@ -718,6 +886,10 @@
     // ***** Directory Actions *****
     // *****************************
 
+    /**
+     * Returns a new folder action.
+     * @return a new folder action
+     */
     public Action getNewFolderAction() {
         if (newFolderAction == null) {
             newFolderAction = new NewFolderAction();
@@ -730,22 +902,42 @@
         return newFolderAction;
     }
 
+    /**
+     * Returns a go home action.
+     * @return a go home action
+     */
     public Action getGoHomeAction() {
         return goHomeAction;
     }
 
+    /**
+     * Returns a change to parent directory action.
+     * @return a change to parent directory action
+     */
     public Action getChangeToParentDirectoryAction() {
         return changeToParentDirectoryAction;
     }
 
+    /**
+     * Returns an approve selection action.
+     * @return an approve selection  action
+     */
     public Action getApproveSelectionAction() {
         return approveSelectionAction;
     }
 
+    /**
+     * Returns a cancel selection action.
+     * @return a cancel selection action
+     */
     public Action getCancelSelectionAction() {
         return cancelSelectionAction;
     }
 
+    /**
+     * Returns an update action.
+     * @return an update action
+     */
     public Action getUpdateAction() {
         return updateAction;
     }
@@ -756,9 +948,11 @@
      */
     @SuppressWarnings("serial") // Superclass is not serializable across versions
     protected class NewFolderAction extends AbstractAction {
+        /** Constructs a {@code NewFolderAction}. */
         protected NewFolderAction() {
             super(FilePane.ACTION_NEW_FOLDER);
         }
+        /** {@inheritDoc} */
         public void actionPerformed(ActionEvent e) {
             if (readOnly) {
                 return;
@@ -799,6 +993,7 @@
      */
     @SuppressWarnings("serial") // Superclass is not serializable across versions
     protected class GoHomeAction extends AbstractAction {
+        /** Constructs a {@code GoHomeAction}. */
         protected GoHomeAction() {
             super("Go Home");
         }
@@ -808,12 +1003,17 @@
         }
     }
 
+    /**
+     * Change to parent directory action.
+     */
     @SuppressWarnings("serial") // Superclass is not serializable across versions
     protected class ChangeToParentDirectoryAction extends AbstractAction {
+        /** Constructs a {@code ChangeToParentDirectoryAction}. */
         protected ChangeToParentDirectoryAction() {
             super("Go Up");
             putValue(Action.ACTION_COMMAND_KEY, FilePane.ACTION_CHANGE_TO_PARENT_DIRECTORY);
         }
+        /** {@inheritDoc} */
         public void actionPerformed(ActionEvent e) {
             getFileChooser().changeToParentDirectory();
         }
@@ -824,9 +1024,11 @@
      */
     @SuppressWarnings("serial") // Superclass is not serializable across versions
     protected class ApproveSelectionAction extends AbstractAction {
+        /** Constructs an {@code ApproveSelectionAction}. */
         protected ApproveSelectionAction() {
             super(FilePane.ACTION_APPROVE_SELECTION);
         }
+        /** {@inheritDoc} */
         public void actionPerformed(ActionEvent e) {
             if (isDirectorySelected()) {
                 File dir = getDirectory();
@@ -1133,6 +1335,7 @@
      */
     @SuppressWarnings("serial") // Superclass is not serializable across versions
     protected class CancelSelectionAction extends AbstractAction {
+        /** {@inheritDoc} */
         public void actionPerformed(ActionEvent e) {
             getFileChooser().cancelSelection();
         }
@@ -1143,6 +1346,7 @@
      */
     @SuppressWarnings("serial") // Superclass is not serializable across versions
     protected class UpdateAction extends AbstractAction {
+        /** {@inheritDoc} */
         public void actionPerformed(ActionEvent e) {
             JFileChooser fc = getFileChooser();
             fc.setCurrentDirectory(fc.getFileSystemView().createFileObject(getDirectoryName()));
@@ -1188,15 +1392,27 @@
     // *****************************************
     // ***** default AcceptAll file filter *****
     // *****************************************
+    /**
+     * Accept all file filter.
+     */
     protected class AcceptAllFileFilter extends FileFilter {
 
+        /** Constructs an {@code AcceptAllFileFilter}. */
         public AcceptAllFileFilter() {
         }
 
+        /**
+         * Returns true.
+         * @param f the file
+         * @return true
+         */
         public boolean accept(File f) {
             return true;
         }
 
+        /**
+         * {@inheritDoc}
+         */
         public String getDescription() {
             return UIManager.getString("FileChooser.acceptAllFileFilterText");
         }
@@ -1206,18 +1422,26 @@
     // ***********************
     // * FileView operations *
     // ***********************
+    /**
+     * A basic file view.
+     */
     protected class BasicFileView extends FileView {
         /* FileView type descriptions */
-        // PENDING(jeff) - pass in the icon cache size
+        /** The icon cache */
         protected Hashtable<File,Icon> iconCache = new Hashtable<File,Icon>();
 
+        /** Constructs a {@code BasicFileView}. */
         public BasicFileView() {
         }
 
+        /**
+         * Clears the icon cache.
+         */
         public void clearIconCache() {
             iconCache = new Hashtable<File,Icon>();
         }
 
+        /** {@inheritDoc} */
         public String getName(File f) {
             // Note: Returns display name rather than file name
             String fileName = null;
@@ -1227,11 +1451,12 @@
             return fileName;
         }
 
-
+        /** {@inheritDoc} */
         public String getDescription(File f) {
             return f.getName();
         }
 
+        /** {@inheritDoc} */
         public String getTypeDescription(File f) {
             String type = getFileChooser().getFileSystemView().getSystemTypeDescription(f);
             if (type == null) {
@@ -1244,10 +1469,20 @@
             return type;
         }
 
+        /**
+         * Returns the cached icon for the file.
+         * @param f the file
+         * @return the cached icon for the file
+         */
         public Icon getCachedIcon(File f) {
             return iconCache.get(f);
         }
 
+        /**
+         * Caches an icon for a file.
+         * @param f the file
+         * @param i the icon
+         */
         public void cacheIcon(File f, Icon i) {
             if(f == null || i == null) {
                 return;
@@ -1255,6 +1490,7 @@
             iconCache.put(f, i);
         }
 
+        /** {@inheritDoc} */
         public Icon getIcon(File f) {
             Icon icon = getCachedIcon(f);
             if(icon != null) {
@@ -1278,6 +1514,11 @@
             return icon;
         }
 
+        /**
+         * Returns whether or not a file is hidden.
+         * @param f the file
+         * @return whether or not a file is hidden
+         */
         public Boolean isHidden(File f) {
             String name = f.getName();
             if(name != null && name.charAt(0) == '.') {
--- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicInternalFrameUI.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicInternalFrameUI.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -42,22 +42,31 @@
  */
 public class BasicInternalFrameUI extends InternalFrameUI
 {
-
+    /** frame */
     protected JInternalFrame frame;
 
     private Handler handler;
+    /** Border listener */
     protected MouseInputAdapter          borderListener;
+    /** Property change listener */
     protected PropertyChangeListener     propertyChangeListener;
+    /** Internal frame layout */
     protected LayoutManager              internalFrameLayout;
+    /** Component listener */
     protected ComponentListener          componentListener;
+    /** Glass pane dispatcher */
     protected MouseInputListener         glassPaneDispatcher;
     private InternalFrameListener        internalFrameListener;
 
+    /** North pane */
     protected JComponent northPane;
+    /** South pane */
     protected JComponent southPane;
+    /** West pane */
     protected JComponent westPane;
+    /** East pane */
     protected JComponent eastPane;
-
+    /** Title pane */
     protected BasicInternalFrameTitlePane titlePane; // access needs this
 
     private static DesktopManager sharedDesktopManager;
@@ -85,10 +94,19 @@
 /////////////////////////////////////////////////////////////////////////////
 // ComponentUI Interface Implementation methods
 /////////////////////////////////////////////////////////////////////////////
+    /**
+     * Returns a component UI.
+     * @param b a component
+     * @return a component UI
+     */
     public static ComponentUI createUI(JComponent b)    {
         return new BasicInternalFrameUI((JInternalFrame)b);
     }
 
+    /**
+     * Constructs a {@code BasicInternalFrameUI}.
+     * @param b the internal frame
+     */
     public BasicInternalFrameUI(JInternalFrame b)   {
         LookAndFeel laf = UIManager.getLookAndFeel();
         if (laf instanceof BasicLookAndFeel) {
@@ -96,6 +114,10 @@
         }
     }
 
+    /**
+     * Installs the UI.
+     * @param c the component
+     */
     public void installUI(JComponent c)   {
 
         frame = (JInternalFrame)c;
@@ -108,6 +130,10 @@
         LookAndFeel.installProperty(frame, "opaque", Boolean.TRUE);
     }
 
+    /**
+     * Uninstalls the UI.
+     * @param c the component
+     */
     public void uninstallUI(JComponent c) {
         if(c != frame)
             throw new IllegalComponentStateException(
@@ -124,6 +150,9 @@
         frame = null;
     }
 
+    /**
+     * Installs the defaults.
+     */
     protected void installDefaults(){
         Icon frameIcon = frame.getFrameIcon();
         if (frameIcon == null || frameIcon instanceof UIResource) {
@@ -144,6 +173,9 @@
         LookAndFeel.installBorder(frame, "InternalFrame.border");
 
     }
+    /**
+     * Installs the keyboard actions.
+     */
     protected void installKeyboardActions(){
         createInternalFrameListener();
         if (internalFrameListener != null) {
@@ -184,6 +216,9 @@
         BasicLookAndFeel.installAudioActionMap(map);
     }
 
+    /**
+     * Installs the components.
+     */
     protected void installComponents(){
         setNorthPane(createNorthPane(frame));
         setSouthPane(createSouthPane(frame));
@@ -192,6 +227,7 @@
     }
 
     /**
+     * Installs the listeners.
      * @since 1.3
      */
     protected void installListeners() {
@@ -257,6 +293,9 @@
         return null;
     }
 
+    /**
+     * Uninstalls the defaults.
+     */
     protected void uninstallDefaults() {
         Icon frameIcon = frame.getFrameIcon();
         if (frameIcon instanceof UIResource) {
@@ -267,6 +306,9 @@
         LookAndFeel.uninstallBorder(frame);
     }
 
+    /**
+     * Uninstalls the components.
+     */
     protected void uninstallComponents(){
         setNorthPane(null);
         setSouthPane(null);
@@ -279,6 +321,7 @@
     }
 
     /**
+     * Uninstalls the listeners.
      * @since 1.3
      */
     protected void uninstallListeners() {
@@ -298,6 +341,9 @@
       borderListener = null;
     }
 
+    /**
+     * Uninstalls the keyboard actions.
+     */
     protected void uninstallKeyboardActions(){
         if (internalFrameListener != null) {
             frame.removeInternalFrameListener(internalFrameListener);
@@ -321,22 +367,38 @@
         frame.setCursor(s);
     }
 
+    /**
+     * Creates the layout manager.
+     * @return the layout manager
+     */
     protected LayoutManager createLayoutManager(){
         return getHandler();
     }
 
+    /**
+     * Creates the property change listener.
+     * @return the property change listener
+     */
     protected PropertyChangeListener createPropertyChangeListener(){
         return getHandler();
     }
 
-
-
+    /**
+     * Returns the preferred size.
+     * @param x the component
+     * @return the preferred size
+     */
     public Dimension getPreferredSize(JComponent x)    {
         if(frame == x)
             return frame.getLayout().preferredLayoutSize(x);
         return new Dimension(100, 100);
     }
 
+    /**
+     * Returns the minimum size.
+     * @param x the component
+     * @return the minimum size
+     */
     public Dimension getMinimumSize(JComponent x)  {
         if(frame == x) {
             return frame.getLayout().minimumLayoutSize(x);
@@ -344,6 +406,11 @@
         return new Dimension(0, 0);
     }
 
+    /**
+     * Returns the maximum size.
+     * @param x the component
+     * @return the maximum size
+     */
     public Dimension getMaximumSize(JComponent x) {
         return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
     }
@@ -371,60 +438,114 @@
         }
     }
 
+    /**
+     * Deinstalls the mouse handlers.
+     * @param c the component
+     */
     protected void deinstallMouseHandlers(JComponent c) {
       c.removeMouseListener(borderListener);
       c.removeMouseMotionListener(borderListener);
     }
 
+    /**
+     * Installs the mouse handlers.
+     * @param c the component
+     */
     protected void installMouseHandlers(JComponent c) {
       c.addMouseListener(borderListener);
       c.addMouseMotionListener(borderListener);
     }
 
+    /**
+     * Creates the north pane.
+     * @param w the internal frame
+     * @return the north pane
+     */
     protected JComponent createNorthPane(JInternalFrame w) {
       titlePane = new BasicInternalFrameTitlePane(w);
       return titlePane;
     }
 
 
+    /**
+     * Creates the north pane.
+     * @param w the internal frame
+     * @return the north pane
+     */
     protected JComponent createSouthPane(JInternalFrame w) {
         return null;
     }
 
+    /**
+     * Creates the west pane.
+     * @param w the internal frame
+     * @return the west pane
+     */
     protected JComponent createWestPane(JInternalFrame w) {
         return null;
     }
 
+    /**
+     * Creates the east pane.
+     * @param w the internal frame
+     * @return the east pane
+     */
     protected JComponent createEastPane(JInternalFrame w) {
         return null;
     }
 
-
+    /**
+     * Creates the border listener.
+     * @param w the internal frame
+     * @return the border listener
+     */
     protected MouseInputAdapter createBorderListener(JInternalFrame w) {
         return new BorderListener();
     }
 
+    /**
+     * Creates the internal frame listener.
+     */
     protected void createInternalFrameListener(){
         internalFrameListener = getHandler();
     }
 
+    /**
+     * Returns whether or no the key binding is registered.
+     * @return whether or no the key binding is registered
+     */
     protected final boolean isKeyBindingRegistered(){
       return keyBindingRegistered;
     }
 
+    /**
+     * Sets the key binding registration.
+     * @param b new value for key binding registration
+     */
     protected final void setKeyBindingRegistered(boolean b){
       keyBindingRegistered = b;
     }
 
+    /**
+     * Returns whether or no the key binding is active.
+     * @return whether or no the key binding is active
+     */
     public final boolean isKeyBindingActive(){
       return keyBindingActive;
     }
 
+    /**
+     * Sets the key binding activity.
+     * @param b new value for key binding activity
+     */
     protected final void setKeyBindingActive(boolean b){
       keyBindingActive = b;
     }
 
 
+    /**
+     * Setup the menu open key.
+     */
     protected void setupMenuOpenKey(){
         // PENDING(hania): Why are these WHEN_IN_FOCUSED_WINDOWs? Shouldn't
         // they be WHEN_ANCESTOR_OF_FOCUSED_COMPONENT?
@@ -437,13 +558,24 @@
         //SwingUtilities.replaceUIActionMap(frame, actionMap);
     }
 
+    /**
+     * Setup the menu close key.
+     */
     protected void setupMenuCloseKey(){
     }
 
+    /**
+     * Returns the north pane.
+     * @return the north pane
+     */
     public JComponent getNorthPane() {
         return northPane;
     }
 
+    /**
+     * Sets the north pane.
+     * @param c the new north pane
+     */
     public void setNorthPane(JComponent c) {
         if (northPane != null &&
                 northPane instanceof BasicInternalFrameTitlePane) {
@@ -456,30 +588,57 @@
         }
     }
 
+    /**
+     * Returns the south pane.
+     * @return the south pane
+     */
     public JComponent getSouthPane() {
         return southPane;
     }
 
+    /**
+     * Sets the south pane.
+     * @param c the new south pane
+     */
     public void setSouthPane(JComponent c) {
         southPane = c;
     }
 
+    /**
+     * Returns the west pane.
+     * @return the west pane
+     */
     public JComponent getWestPane() {
         return westPane;
     }
 
+    /**
+     * Sets the west pane.
+     * @param c the new west pane
+     */
     public void setWestPane(JComponent c) {
         westPane = c;
     }
 
+    /**
+     * Returns the east pane.
+     * @return the east pane
+     */
     public JComponent getEastPane() {
         return eastPane;
     }
 
+    /**
+     * Sets the east pane.
+     * @param c the new east pane
+     */
     public void setEastPane(JComponent c) {
         eastPane = c;
     }
 
+    /**
+     * Internal frame property change listener.
+     */
     public class InternalFramePropertyChangeListener implements
         PropertyChangeListener {
         // NOTE: This class exists only for backward compatibility. All
@@ -495,27 +654,45 @@
         }
     }
 
+    /**
+     * Internal frame layout.
+     */
   public class InternalFrameLayout implements LayoutManager {
     // NOTE: This class exists only for backward compatibility. All
     // its functionality has been moved into Handler. If you need to add
     // new functionality add it to the Handler, but make sure this
     // class calls into the Handler.
+      /**
+       * {@inheritDoc}
+       */
     public void addLayoutComponent(String name, Component c) {
         getHandler().addLayoutComponent(name, c);
     }
 
+      /**
+       * {@inheritDoc}
+       */
     public void removeLayoutComponent(Component c) {
         getHandler().removeLayoutComponent(c);
     }
 
+      /**
+       * {@inheritDoc}
+       */
     public Dimension preferredLayoutSize(Container c)  {
         return getHandler().preferredLayoutSize(c);
     }
 
+      /**
+       * {@inheritDoc}
+       */
     public Dimension minimumLayoutSize(Container c) {
         return getHandler().minimumLayoutSize(c);
     }
 
+      /**
+       * {@inheritDoc}
+       */
     public void layoutContainer(Container c) {
         getHandler().layoutContainer(c);
     }
@@ -527,6 +704,7 @@
      * find the JDesktop component and returns the desktopManager from
      * it. If this fails, it will return a default DesktopManager that
      * should work in arbitrary parents.
+     * @return the proper DesktopManager
      */
     protected DesktopManager getDesktopManager() {
         if(frame.getDesktopPane() != null
@@ -537,6 +715,10 @@
         return sharedDesktopManager;
     }
 
+    /**
+     * Creates the desktop manager.
+     * @return the desktop manager
+     */
     protected DesktopManager createDesktopManager(){
       return new DefaultDesktopManager();
     }
@@ -653,7 +835,7 @@
         Rectangle startingBounds;
         int resizeDir;
 
-
+        /** resize none */
         protected final int RESIZE_NONE  = 0;
         private boolean discardRelease = false;
 
@@ -1114,6 +1296,9 @@
 
     }    /// End BorderListener Class
 
+    /**
+     * Component handler.
+     */
     protected class ComponentHandler implements ComponentListener {
       // NOTE: This class exists only for backward compatibility. All
       // its functionality has been moved into Handler. If you need to add
@@ -1124,92 +1309,155 @@
           getHandler().componentResized(e);
       }
 
+        /**
+         * {@inheritDoc}
+         */
       public void componentMoved(ComponentEvent e) {
           getHandler().componentMoved(e);
       }
+        /**
+         * {@inheritDoc}
+         */
       public void componentShown(ComponentEvent e) {
           getHandler().componentShown(e);
       }
+        /**
+         * {@inheritDoc}
+         */
       public void componentHidden(ComponentEvent e) {
           getHandler().componentHidden(e);
       }
     }
 
+    /**
+     * Creates a component listener.
+     * @return a component listener
+     */
     protected ComponentListener createComponentListener() {
       return getHandler();
     }
 
 
+    /**
+     * Glass pane dispatcher.
+     */
     protected class GlassPaneDispatcher implements MouseInputListener {
         // NOTE: This class exists only for backward compatibility. All
         // its functionality has been moved into Handler. If you need to add
         // new functionality add it to the Handler, but make sure this
         // class calls into the Handler.
+        /**
+         * {@inheritDoc}
+         */
         public void mousePressed(MouseEvent e) {
             getHandler().mousePressed(e);
         }
 
+        /**
+         * {@inheritDoc}
+         */
         public void mouseEntered(MouseEvent e) {
             getHandler().mouseEntered(e);
         }
 
+        /**
+         * {@inheritDoc}
+         */
         public void mouseMoved(MouseEvent e) {
             getHandler().mouseMoved(e);
         }
 
+        /**
+         * {@inheritDoc}
+         */
         public void mouseExited(MouseEvent e) {
             getHandler().mouseExited(e);
         }
 
+        /**
+         * {@inheritDoc}
+         */
         public void mouseClicked(MouseEvent e) {
             getHandler().mouseClicked(e);
         }
 
+        /**
+         * {@inheritDoc}
+         */
         public void mouseReleased(MouseEvent e) {
             getHandler().mouseReleased(e);
         }
 
+        /**
+         * {@inheritDoc}
+         */
         public void mouseDragged(MouseEvent e) {
             getHandler().mouseDragged(e);
         }
     }
 
+    /**
+     * Creates a {@code GlassPaneDispatcher}.
+     * @return a {@code GlassPaneDispatcher}
+     */
     protected MouseInputListener createGlassPaneDispatcher() {
         return null;
     }
 
-
+    /**
+     * Basic internal frame listener.
+     */
     protected class BasicInternalFrameListener implements InternalFrameListener
     {
       // NOTE: This class exists only for backward compatibility. All
       // its functionality has been moved into Handler. If you need to add
       // new functionality add it to the Handler, but make sure this
       // class calls into the Handler.
+        /**
+         * {@inheritDoc}
+         */
       public void internalFrameClosing(InternalFrameEvent e) {
           getHandler().internalFrameClosing(e);
       }
 
+        /**
+         * {@inheritDoc}
+         */
       public void internalFrameClosed(InternalFrameEvent e) {
           getHandler().internalFrameClosed(e);
       }
 
+        /**
+         * {@inheritDoc}
+         */
       public void internalFrameOpened(InternalFrameEvent e) {
           getHandler().internalFrameOpened(e);
       }
 
+        /**
+         * {@inheritDoc}
+         */
       public void internalFrameIconified(InternalFrameEvent e) {
           getHandler().internalFrameIconified(e);
       }
 
+        /**
+         * {@inheritDoc}
+         */
       public void internalFrameDeiconified(InternalFrameEvent e) {
           getHandler().internalFrameDeiconified(e);
       }
 
+        /**
+         * {@inheritDoc}
+         */
       public void internalFrameActivated(InternalFrameEvent e) {
           getHandler().internalFrameActivated(e);
       }
 
-
+        /**
+         * {@inheritDoc}
+         */
       public void internalFrameDeactivated(InternalFrameEvent e) {
           getHandler().internalFrameDeactivated(e);
       }
--- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -875,30 +875,38 @@
         if (dumpStack == true)
             Thread.dumpStack();
     }
+    /** Mouse input handler */
     protected class MouseInputHandler implements MouseInputListener {
         // NOTE: This class exists only for backward compatibility. All
         // its functionality has been moved into Handler. If you need to add
         // new functionality add it to the Handler, but make sure this
         // class calls into the Handler.
 
+        /** {@inheritDoc} */
         public void mouseClicked(MouseEvent e) {
             getHandler().mouseClicked(e);
         }
+        /** {@inheritDoc} */
         public void mousePressed(MouseEvent e) {
             getHandler().mousePressed(e);
         }
+        /** {@inheritDoc} */
         public void mouseReleased(MouseEvent e) {
             getHandler().mouseReleased(e);
         }
+        /** {@inheritDoc} */
         public void mouseEntered(MouseEvent e) {
             getHandler().mouseEntered(e);
         }
+        /** {@inheritDoc} */
         public void mouseExited(MouseEvent e) {
             getHandler().mouseExited(e);
         }
+        /** {@inheritDoc} */
         public void mouseDragged(MouseEvent e) {
             getHandler().mouseDragged(e);
         }
+        /** {@inheritDoc} */
         public void mouseMoved(MouseEvent e) {
             getHandler().mouseMoved(e);
         }
--- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -136,7 +136,7 @@
 
     /**
      * Creates a new {@code BasicOptionPaneUI} instance.
-     *
+     * @param x the component
      * @return a new {@code BasicOptionPaneUI} instance
      */
     public static ComponentUI createUI(JComponent x) {
--- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicScrollBarUI.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicScrollBarUI.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -60,35 +60,59 @@
 
     // NOTE: DO NOT use this field directly, SynthScrollBarUI assumes you'll
     // call getMinimumThumbSize to access it.
+    /** Minimum thumb size */
     protected Dimension minimumThumbSize;
+    /** Maximum thumb size */
     protected Dimension maximumThumbSize;
 
+    /** Thumb highlight color */
     protected Color thumbHighlightColor;
+    /** Thumb light shadow color */
     protected Color thumbLightShadowColor;
+    /** Thumb dark shadow color */
     protected Color thumbDarkShadowColor;
+    /** Thumb color */
     protected Color thumbColor;
+    /** Track color */
     protected Color trackColor;
+    /** Track highlight color */
     protected Color trackHighlightColor;
 
+    /** Scrollbar */
     protected JScrollBar scrollbar;
+    /** Increment button */
     protected JButton incrButton;
+    /** Decrement button */
     protected JButton decrButton;
+    /** Dragging */
     protected boolean isDragging;
+    /** Track listener */
     protected TrackListener trackListener;
+    /** Button listener */
     protected ArrowButtonListener buttonListener;
+    /** Model listener */
     protected ModelListener modelListener;
 
+    /** Thumb rectangle */
     protected Rectangle thumbRect;
+    /** Track rectangle */
     protected Rectangle trackRect;
 
+    /** Track highlight */
     protected int trackHighlight;
 
+    /** No highlight */
     protected static final int NO_HIGHLIGHT = 0;
+    /** Decrease highlight */
     protected static final int DECREASE_HIGHLIGHT = 1;
+    /** Increase highlight */
     protected static final int INCREASE_HIGHLIGHT = 2;
 
+    /** Scroll listener */
     protected ScrollListener scrollListener;
+    /** Property change listener */
     protected PropertyChangeListener propertyChangeListener;
+    /** Scroll timer */
     protected Timer scrollTimer;
 
     private final static int scrollSpeedThrottle = 60; // delay in milli seconds
@@ -148,12 +172,18 @@
         map.put(new Actions(Actions.MAX_SCROLL));
     }
 
-
+    /**
+     * Creates the UI.
+     * @param c the component
+     * @return the UI
+     */
     public static ComponentUI createUI(JComponent c)    {
         return new BasicScrollBarUI();
     }
 
-
+    /**
+     * Configures the scroll bar colors.
+     */
     protected void configureScrollBarColors()
     {
         LookAndFeel.installColors(scrollbar, "ScrollBar.background",
@@ -166,7 +196,10 @@
         trackHighlightColor = UIManager.getColor("ScrollBar.trackHighlight");
     }
 
-
+    /**
+     * Installs the UI.
+     * @param c the component
+     */
     public void installUI(JComponent c)   {
         scrollbar = (JScrollBar)c;
         thumbRect = new Rectangle(0, 0, 0, 0);
@@ -177,6 +210,10 @@
         installKeyboardActions();
     }
 
+    /**
+     * Uninstalls the UI.
+     * @param c the component
+     */
     public void uninstallUI(JComponent c) {
         scrollbar = (JScrollBar)c;
         uninstallListeners();
@@ -189,7 +226,9 @@
         decrButton = null;
     }
 
-
+    /**
+     * Installs the defaults.
+     */
     protected void installDefaults()
     {
         scrollBarWidth = UIManager.getInt("ScrollBar.width");
@@ -240,7 +279,9 @@
         }
     }
 
-
+    /**
+     * Installs the components.
+     */
     protected void installComponents(){
         switch (scrollbar.getOrientation()) {
         case JScrollBar.VERTICAL:
@@ -264,12 +305,17 @@
         scrollbar.setEnabled(scrollbar.isEnabled());
     }
 
+    /**
+     * Uninstalls the components.
+     */
     protected void uninstallComponents(){
         scrollbar.remove(incrButton);
         scrollbar.remove(decrButton);
     }
 
-
+    /**
+     * Installs the listeners.
+     */
     protected void installListeners(){
         trackListener = createTrackListener();
         buttonListener = createArrowButtonListener();
@@ -294,7 +340,9 @@
         scrollTimer.setInitialDelay(300);  // default InitialDelay?
     }
 
-
+    /**
+     * Installs the keyboard actions.
+     */
     protected void installKeyboardActions(){
         LazyActionMap.installLazyActionMap(scrollbar, BasicScrollBarUI.class,
                                            "ScrollBar.actionMap");
@@ -307,6 +355,9 @@
                    JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, inputMap);
     }
 
+    /**
+     * Uninstalls the keyboard actions.
+     */
     protected void uninstallKeyboardActions(){
         SwingUtilities.replaceUIInputMap(scrollbar, JComponent.WHEN_FOCUSED,
                                          null);
@@ -343,7 +394,9 @@
         return null;
     }
 
-
+    /**
+     * Uninstall the listeners.
+     */
     protected void uninstallListeners() {
         scrollTimer.stop();
         scrollTimer = null;
@@ -363,7 +416,9 @@
         handler = null;
     }
 
-
+    /**
+     * Uninstalls the defaults.
+     */
     protected void uninstallDefaults(){
         LookAndFeel.uninstallBorder(scrollbar);
         if (scrollbar.getLayout() == this) {
@@ -379,22 +434,42 @@
         return handler;
     }
 
+    /**
+     * Creates a track listener.
+     * @return a track listener
+     */
     protected TrackListener createTrackListener(){
         return new TrackListener();
     }
 
+    /**
+     * Creates an arrow button listener.
+     * @return an arrow button   listener
+     */
     protected ArrowButtonListener createArrowButtonListener(){
         return new ArrowButtonListener();
     }
 
+    /**
+     * Creates a model listener.
+     * @return a model listener
+     */
     protected ModelListener createModelListener(){
         return new ModelListener();
     }
 
+    /**
+     * Creates a scroll listener.
+     * @return a scroll listener
+     */
     protected ScrollListener createScrollListener(){
         return new ScrollListener();
     }
 
+    /**
+     * Creates a property change listener.
+     * @return a property change listener
+     */
     protected PropertyChangeListener createPropertyChangeListener() {
         return getHandler();
     }
@@ -470,6 +545,11 @@
         return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
     }
 
+    /**
+     * Creates a decrease button.
+     * @param orientation the orientation
+     * @return a decrease button
+     */
     protected JButton createDecreaseButton(int orientation)  {
         return new BasicArrowButton(orientation,
                                     UIManager.getColor("ScrollBar.thumb"),
@@ -478,6 +558,11 @@
                                     UIManager.getColor("ScrollBar.thumbHighlight"));
     }
 
+    /**
+     * Creates an increase button.
+     * @param orientation the orientation
+     * @return an increase button
+     */
     protected JButton createIncreaseButton(int orientation)  {
         return new BasicArrowButton(orientation,
                                     UIManager.getColor("ScrollBar.thumb"),
@@ -487,6 +572,10 @@
     }
 
 
+    /**
+     * Paints the decrease highlight.
+     * @param g the graphics
+     */
     protected void paintDecreaseHighlight(Graphics g)
     {
         Insets insets = scrollbar.getInsets();
@@ -519,6 +608,10 @@
     }
 
 
+    /**
+     * Paints the increase highlight.
+     * @param g the graphics
+     */
     protected void paintIncreaseHighlight(Graphics g)
     {
         Insets insets = scrollbar.getInsets();
@@ -552,6 +645,12 @@
     }
 
 
+    /**
+     * Paints the track.
+     * @param g the graphics
+     * @param c the component
+     * @param trackBounds the track bounds
+     */
     protected void paintTrack(Graphics g, JComponent c, Rectangle trackBounds)
     {
         g.setColor(trackColor);
@@ -565,7 +664,12 @@
         }
     }
 
-
+    /**
+     * Paints the thumb.
+     * @param g the graphics
+     * @param c the component
+     * @param thumbBounds the thumb bounds
+     */
     protected void paintThumb(Graphics g, JComponent c, Rectangle thumbBounds)
     {
         if(thumbBounds.isEmpty() || !scrollbar.isEnabled())     {
@@ -644,6 +748,10 @@
         return (useCachedValue) ? scrollBarValue : sb.getValue();
     }
 
+    /**
+     * Laysouts a  vertical scroll bar.
+     * @param sb the scroll bar
+     */
     protected void layoutVScrollbar(JScrollBar sb)
     {
         Dimension sbSize = sb.getSize();
@@ -742,7 +850,10 @@
         }
     }
 
-
+    /**
+     * Laysouts a  vertical scroll bar.
+     * @param sb the scroll bar
+     */
     protected void layoutHScrollbar(JScrollBar sb)
     {
         Dimension sbSize = sb.getSize();
@@ -966,6 +1077,10 @@
             scrollbar.setValue(newValue);
     }
 
+    /**
+     * Scrolls by block.
+     * @param direction the direction to scroll
+     */
     protected void scrollByBlock(int direction)
     {
         scrollByBlock(scrollbar, direction);
@@ -1033,6 +1148,10 @@
         }
     }
 
+    /**
+     * Scrolls by unit.
+     * @param direction the direction to scroll
+     */
     protected void scrollByUnit(int direction)  {
         scrollByUnits(scrollbar, direction, 1, false);
     }
@@ -1050,7 +1169,6 @@
 
     /**
      * A listener to listen for model changes.
-     *
      */
     protected class ModelListener implements ChangeListener {
         public void stateChanged(ChangeEvent e) {
@@ -1069,10 +1187,15 @@
     protected class TrackListener
         extends MouseAdapter implements MouseMotionListener
     {
+        /** The offset */
         protected transient int offset;
-        protected transient int currentMouseX, currentMouseY;
+        /** Current mouse x position */
+        protected transient int currentMouseX;
+        /** Current mouse y position */
+        protected transient int currentMouseY;
         private transient int direction = +1;
 
+        /** {@inheritDoc} */
         public void mouseReleased(MouseEvent e)
         {
             if (isDragging) {
@@ -1339,6 +1462,7 @@
             }
         }
 
+        /** {@inheritDoc} */
         public void mouseMoved(MouseEvent e) {
             if (!isDragging) {
                 updateThumbState(e.getX(), e.getY());
@@ -1406,19 +1530,34 @@
         int direction = +1;
         boolean useBlockIncrement;
 
+        /** Constructs a {@code ScrollListener}. */
         public ScrollListener() {
             direction = +1;
             useBlockIncrement = false;
         }
 
+        /**
+         * Constructs a {@code ScrollListener}.
+         * @param dir direction
+         * @param block use block increment
+         */
         public ScrollListener(int dir, boolean block)   {
             direction = dir;
             useBlockIncrement = block;
         }
 
+        /**
+         * Sets the direction.
+         * @param direction the new direction
+         */
         public void setDirection(int direction) { this.direction = direction; }
+        /**
+         * Sets the scrolling by block
+         * @param block whether or not to scroll by block
+         */
         public void setScrollByBlock(boolean block) { this.useBlockIncrement = block; }
 
+        /** {@inheritDoc} */
         public void actionPerformed(ActionEvent e) {
             if(useBlockIncrement)       {
                 scrollByBlock(direction);
@@ -1497,13 +1636,14 @@
         }
     }
 
+    /** Property change handler */
     public class PropertyChangeHandler implements PropertyChangeListener
     {
         // NOTE: This class exists only for backward compatibility. All
         // its functionality has been moved into Handler. If you need to add
         // new functionality add it to the Handler, but make sure this
         // class calls into the Handler.
-
+        /** {@inheritDoc} */
         public void propertyChange(PropertyChangeEvent e) {
             getHandler().propertyChange(e);
         }
--- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicScrollPaneUI.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicScrollPaneUI.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -746,6 +746,9 @@
         }
     }
 
+    /**
+     * Property change handler.
+     */
     public class PropertyChangeHandler implements PropertyChangeListener
     {
 
@@ -754,6 +757,9 @@
         // new functionality add it to the Handler, but make sure this
         // class calls into the Handler.
 
+        /**
+         * {@inheritDoc}
+         */
         public void propertyChange(PropertyChangeEvent e)
         {
             getHandler().propertyChange(e);
--- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicSliderUI.java	Thu May 14 12:38:11 2015 -0700
+++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicSliderUI.java	Thu May 14 20:15:26 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,33 +47,55 @@
     // Old actions forward to an instance of this.
     private static final Actions SHARED_ACTION = new Actions();
 
+    /** Positive scroll */
     public static final int POSITIVE_SCROLL = +1;
+    /** Negative scroll */
     public static final int NEGATIVE_SCROLL = -1;
+    /** Minimum scroll */
     public static final int MIN_SCROLL = -2;
+    /** Maximum scroll */
     public static final int MAX_SCROLL = +2;
 
+    /** Scroll timer */
     protected Timer scrollTimer;
+    /** Slider */
     protected JSlider slider;
 
+    /** Focus insets */
     protected Insets focusInsets = null;
+    /** Inset cache */
     protected Insets insetCache = null;
+    /** Left-to-right cache */
     protected boolean leftToRightCache = true;
+    /** Focus rectangle */
     protected Rectangle focusRect = null;
+    /** Content rectangle */
     protected Rectangle contentRect = null;
+    /** Label rectangle */
     protected Rectangle labelRect = null;
+    /** Tick rectangle */
     protected Rectangle tickRect = null;
+    /** Track rectangle */
     protected Rectangle trackRect = null;
+    /** Thumb rectangle */
     protected Rectangle thumbRect = null;
 
-    protected int trackBuffer = 0;  // The distance that the track is from the side of the control
+    /** The distance that the track is from the side of the control */
+    protected int trackBuffer = 0;
 
     private transient boolean isDragging;
 
+    /** Track listener */
     protected TrackListener trackListener;
+    /** Change listener */
     protected ChangeListener changeListener;
+    /** Component listener */
     protected ComponentListener componentListener;
+    /** Focus listener */
     protected FocusListener focusListener;
+    /** Scroll listener */
     protected ScrollListener scrollListener;
+    /** Property chane listener */
     protected PropertyChangeListener propertyChangeListener;
     private Handler handler;
     private int lastValue;
@@ -93,15 +115,26 @@
      */
     private boolean sameLabelBaselines;
 
-
+    /**
+     * Returns the shadow color.
+     * @return the shadow color
+     */
     protected Color getShadowColor() {
         return shadowColor;
     }
 
+    /**
+     * Returns the highlight color.
+     * @return the highlight color
+     */
     protected Color getHighlightColor() {
         return highlightColor;
     }
 
+    /**
+     * Returns the focus color.
+     * @return the focus color
+     */
     protected Color getFocusColor() {
         return focusColor;
     }
@@ -119,13 +152,26 @@
     /////////////////////////////////////////////////////////////////////////////
     // ComponentUI Interface Implementation methods
     /////////////////////////////////////////////////////////////////////////////
+    /**
+     * Creates a UI.
+     * @param b a component
+     * @return a UI
+     */
     public static ComponentUI createUI(JComponent b)    {
         return new BasicSliderUI((JSlider)b);
     }
 
+    /**
+     * Constructs a {@code BasicSliderUI}.
+     * @param b a slider
+     */
     public BasicSliderUI(JSlider b)   {
     }
 
+    /**
+     * Installs a UI.
+     * @param c a component
+     */
     public void installUI(JComponent c)   {
         slider = (JSlider) c;
 
@@ -162,6 +208,10 @@
         calculateGeometry(); // This figures out where the labels, ticks, track, and thumb are.
     }
 
+    /**
+     * Uninstalls a UI.
+     * @param c a component
+     */
     public void uninstallUI(JComponent c) {
         if ( c != slider )
             throw new IllegalComponentStateException(
@@ -193,6 +243,10 @@
         slider = null;
     }
 
+    /**
+     * Installs the defaults.
+     * @param slider a slider
+     */
     protected void installDefaults( JSlider slider ) {
         LookAndFeel.installBorder(slider, "Slider.border");
         LookAndFeel.installColorsAndFont(slider, "Slider.background",
@@ -208,32 +262,66 @@
         if (focusInsets == null) focusInsets = new InsetsUIResource(2,2,2,2);
     }
 
+    /**
+     * Uninstalls the defaults.
+     * @param slider a slider
+     */
     protected void uninstallDefaults(JSlider slider) {
         LookAndFeel.uninstallBorder(slider);
 
         focusInsets = null;
     }
 
+    /**
+     * Creates a track listener.
+     * @return a track listener
+     * @param slider a slider
+     */
     protected TrackListener createTrackListener(JSlider slider) {
         return new TrackListener();
     }
 
+    /**
+     * Creates a change listener.
+     * @return a change listener
+     * @param slider a slider
+     */
     protected ChangeListener createChangeListener(JSlider slider) {
         return getHandler();
     }
 
+    /**
+     * Creates a composite listener.
+     * @return a composite listener
+     * @param slider a slider
+     */
     protected ComponentListener createComponentListener(JSlider slider) {
         return getHandler();
     }
 
+    /**
+     * Creates a focus listener.
+     * @return a focus listener
+     * @param slider a slider
+     */
     protected FocusListener createFocusListener(JSlider slider) {
         return getHandler();
     }
 
+    /**
+     * Creates a scroll listener.
+     * @return a scroll listener
+     * @param slider a slider
+     */
     protected ScrollListener createScrollListener( JSlider slider ) {
         return new ScrollListener();
     }
 
+    /**
+     * Creates a property change listener.
+     * @return a property change listener
+     * @param slider a slider
+     */
     protected PropertyChangeListener createPropertyChangeListener(
             JSlider slider) {
         return getHandler();
@@ -246,6 +334,10 @@
         return handler;
     }
 
+    /**
+     * Installs listeners.
+     * @param slider a slider
+     */
     protected void installListeners( JSlider slider ) {
         slider.addMouseListener(trackListener);
         slider.addMouseMotionListener(trackListener);
@@ -255,6 +347,10 @@
         slider.getModel().addChangeListener(changeListener);
     }
 
+    /**
+     * Uninstalls listeners.
+     * @param slider a slider
+     */
     protected void uninstallListeners( JSlider slider ) {
         slider.removeMouseListener(trackListener);
         slider.removeMouseMotionListener(trackListener);
@@ -265,6 +361,10 @@
         handler = null;
     }
 
+    /**
+     * Installs keyboard actions.
+     * @param slider a slider
+     */
     protected void installKeyboardActions( JSlider slider ) {
         InputMap km = getInputMap(JComponent.WHEN_FOCUSED, slider);
         SwingUtilities.replaceUIInputMap(slider, JComponent.WHEN_FOCUSED, km);
@@ -302,6 +402,10 @@
         map.put(new Actions(Actions.MAX_SCROLL_INCREMENT));
     }
 
+    /**
+     * Uninstalls keyboard actions.
+     * @param slider a slider
+     */
     protected void uninstallKeyboardActions( JSlider slider ) {
         SwingUtilities.replaceUIActionMap(slider, null);
         SwingUtilities.replaceUIInputMap(slider, JComponent.WHEN_FOCUSED,
@@ -430,6 +534,10 @@
         return sameLabelBaselines;
     }
 
+    /**
+     * Returns the preferred horizontal size.
+     * @return the preferred horizontal size
+     */
     public Dimension getPreferredHorizontalSize() {
         Dimension horizDim = (Dimension)DefaultLookup.get(slider,
                 this, "Slider.horizontalSize");
@@ -439,6 +547,10 @@
         return horizDim;
     }
 
+    /**
+     * Returns the preferred vertical size.
+     * @return the preferred vertical size
+     */
     public Dimension getPreferredVerticalSize() {
         Dimension vertDim = (Dimension)DefaultLookup.get(slider,
                 this, "Slider.verticalSize");
@@ -448,6 +560,10 @@
         return vertDim;
     }
 
+    /**
+     * Returns the minimum horizontal size.
+     * @return the minimum horizontal size
+     */
     public Dimension getMinimumHorizontalSize() {
         Dimension minHorizDim = (Dimension)DefaultLookup.get(slider,
                 this,