Merge
authorpsadhukhan
Tue, 02 Apr 2019 10:57:57 +0530
changeset 54409 94986cf5e969
parent 54408 8fe16bf92ebd (diff)
parent 54373 13935056b05e (current diff)
child 54410 7feb5e303c83
Merge
src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/UnsafeAccess.java
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/UnsafeAccess.java
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/UnsafeAccess.java
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/NodeCostDumpUtil.java
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/UnsafeAccess.java
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/UnsafeAccess.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesFrameWriter.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FrameOutputWriter.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleFrameWriter.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexFrameWriter.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModulePackageIndexFrameWriter.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageFrameWriter.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexFrameWriter.java
test/hotspot/jtreg/runtime/containers/docker/Dockerfile-BasicTest
test/hotspot/jtreg/runtime/containers/docker/Dockerfile-BasicTest-aarch64
test/hotspot/jtreg/runtime/containers/docker/Dockerfile-BasicTest-ppc64le
test/hotspot/jtreg/runtime/containers/docker/Dockerfile-BasicTest-s390x
test/hotspot/jtreg/runtime/handshake/HandshakeWalkSuspendExitTest.java
test/hotspot/jtreg/runtime/noClassDefFoundMsg/NoClassDefFoundMsg.java
test/hotspot/jtreg/runtime/noClassDefFoundMsg/libNoClassDefFoundMsg.c
test/jdk/jdk/internal/platform/docker/Dockerfile-BasicTest
test/jdk/jdk/internal/platform/docker/Dockerfile-BasicTest-aarch64
test/jdk/jdk/internal/platform/docker/Dockerfile-BasicTest-ppc64le
test/jdk/jdk/internal/platform/docker/Dockerfile-BasicTest-s390x
test/jdk/sun/security/ssl/rsa/BrokenRSAPrivateCrtKey.java
test/langtools/jdk/javadoc/doclet/AccessFrameTitle/AccessFrameTitle.java
test/langtools/jdk/javadoc/doclet/AccessFrameTitle/p1/C1.java
test/langtools/jdk/javadoc/doclet/AccessFrameTitle/p2/C2.java
test/langtools/jdk/javadoc/doclet/PackagesHeader/PackagesHeader.java
test/langtools/jdk/javadoc/doclet/PackagesHeader/p1/C1.java
test/langtools/jdk/javadoc/doclet/PackagesHeader/p2/C2.java
test/langtools/jdk/javadoc/doclet/testClassDocCatalog/TestClassDocCatalog.java
test/langtools/jdk/javadoc/doclet/testClassDocCatalog/pkg1/EmptyAnnotation.java
test/langtools/jdk/javadoc/doclet/testClassDocCatalog/pkg1/EmptyClass.java
test/langtools/jdk/javadoc/doclet/testClassDocCatalog/pkg1/EmptyEnum.java
test/langtools/jdk/javadoc/doclet/testClassDocCatalog/pkg1/EmptyError.java
test/langtools/jdk/javadoc/doclet/testClassDocCatalog/pkg1/EmptyException.java
test/langtools/jdk/javadoc/doclet/testClassDocCatalog/pkg1/EmptyInterface.java
test/langtools/jdk/javadoc/doclet/testClassDocCatalog/pkg2/EmptyAnnotation.java
test/langtools/jdk/javadoc/doclet/testClassDocCatalog/pkg2/EmptyClass.java
test/langtools/jdk/javadoc/doclet/testClassDocCatalog/pkg2/EmptyEnum.java
test/langtools/jdk/javadoc/doclet/testClassDocCatalog/pkg2/EmptyError.java
test/langtools/jdk/javadoc/doclet/testClassDocCatalog/pkg2/EmptyException.java
test/langtools/jdk/javadoc/doclet/testClassDocCatalog/pkg2/EmptyInterface.java
test/langtools/jdk/javadoc/doclet/testFramesNoFrames/TestFramesNoFrames.java
test/langtools/jdk/javadoc/doclet/testWindowTitle/TestWindowTitle.java
test/langtools/jdk/javadoc/doclet/testWindowTitle/p1/C1.java
test/langtools/jdk/javadoc/doclet/testWindowTitle/p2/C2.java
--- a/make/CompileJavaModules.gmk	Tue Apr 02 11:05:08 2019 +0800
+++ b/make/CompileJavaModules.gmk	Tue Apr 02 10:57:57 2019 +0530
@@ -79,7 +79,7 @@
 
 ################################################################################
 
-java.desktop_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-reference,-accessibility \
+java.desktop_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-reference \
     '-Xdoclint/package:java.*,javax.*' -Xlint:exports \
     --doclint-format html4
 java.desktop_COPY += .gif .png .wav .txt .xml .css .pf
--- a/src/java.desktop/macosx/native/libawt_lwawt/awt/CMenuItem.m	Tue Apr 02 11:05:08 2019 +0800
+++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/CMenuItem.m	Tue Apr 02 10:57:57 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,7 +70,7 @@
     AWT_ASSERT_APPKIT_THREAD;
     JNIEnv *env = [ThreadUtilities getJNIEnv];
     JNF_COCOA_ENTER(env);
-    
+
     // If we are called as a result of user pressing a shortcut, do nothing,
     // because AVTView has already sent corresponding key event to the Java
     // layer from performKeyEquivalent.
@@ -81,45 +81,26 @@
     // from this "frameless" menu, because there are no active windows. This
     // means we have to handle it here.
     NSEvent *currEvent = [[NSApplication sharedApplication] currentEvent];
+
+    if ([currEvent type] == NSKeyDown) {
+        // The action event can be ignored only if the key window is an AWT window.
+        // Otherwise, the action event is the only notification and must be processed.
+        NSWindow *keyWindow = [NSApp keyWindow];
+        if (keyWindow != nil && [AWTWindow isAWTWindow: keyWindow]) {
+            return;
+        }
+    }
+
     if (fIsCheckbox) {
         static JNF_CLASS_CACHE(jc_CCheckboxMenuItem, "sun/lwawt/macosx/CCheckboxMenuItem");
         static JNF_MEMBER_CACHE(jm_ckHandleAction, jc_CCheckboxMenuItem, "handleAction", "(Z)V");
-        
+
         // Send the opposite of what's currently checked -- the action
         // indicates what state we're going to.
         NSInteger state = [sender state];
         jboolean newState = (state == NSOnState ? JNI_FALSE : JNI_TRUE);
         JNFCallVoidMethod(env, fPeer, jm_ckHandleAction, newState);
-    }
-    else {
-        if ([currEvent type] == NSKeyDown) {
-            // Event available through sender variable hence NSApplication
-            // not needed for checking the keyboard input sans the modifier keys
-            // Also, the method used to fetch eventKey earlier would be locale dependent
-            // With earlier implementation, if MenuKey: e EventKey: ा ; if input method
-            // is not U.S. (Devanagari in this case)
-            // With current implementation, EventKey = MenuKey = e irrespective of
-            // input method
-            NSString *eventKey = [sender keyEquivalent];
-            // Apple uses characters from private Unicode range for some of the
-            // keys, so we need to do the same translation here that we do
-            // for the regular key down events
-            if ([eventKey length] == 1) {
-                unichar origChar = [eventKey characterAtIndex:0];
-                unichar newChar =  NsCharToJavaChar(origChar, 0);
-                if (newChar == java_awt_event_KeyEvent_CHAR_UNDEFINED) {
-                    newChar = origChar;
-                }
-                eventKey = [NSString stringWithCharacters: &newChar length: 1];
-            }
-            // The action event can be ignored only if the key window is an AWT window.
-            // Otherwise, the action event is the only notification and must be processed.
-            NSWindow *keyWindow = [NSApp keyWindow];
-            if (keyWindow != nil && [AWTWindow isAWTWindow: keyWindow]) {
-                return;
-            }
-        }
-        
+    } else {
         static JNF_CLASS_CACHE(jc_CMenuItem, "sun/lwawt/macosx/CMenuItem");
         static JNF_MEMBER_CACHE(jm_handleAction, jc_CMenuItem, "handleAction", "(JI)V"); // AWT_THREADING Safe (event)
 
@@ -129,7 +110,6 @@
         JNFCallVoidMethod(env, fPeer, jm_handleAction, UTC(currEvent), javaModifiers); // AWT_THREADING Safe (event)
     }
     JNF_COCOA_EXIT(env);
-    
 }
 
 - (void) setJavaLabel:(NSString *)theLabel shortcut:(NSString *)theKeyEquivalent modifierMask:(jint)modifiers {
--- a/src/java.desktop/macosx/native/libawt_lwawt/awt/CRobot.m	Tue Apr 02 11:05:08 2019 +0800
+++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/CRobot.m	Tue Apr 02 10:57:57 2019 +0530
@@ -300,7 +300,7 @@
 
     // create a graphics context around the Java int array
     CGColorSpaceRef picColorSpace = CGColorSpaceCreateWithName(
-                                            kCGColorSpaceGenericRGB);
+                                            kCGColorSpaceSRGB);
     CGContextRef jPicContextRef = CGBitmapContextCreate(
                                             jPixelData,
                                             picWidth, picHeight,
--- a/src/java.desktop/share/classes/com/sun/beans/introspect/PropertyInfo.java	Tue Apr 02 11:05:08 2019 +0800
+++ b/src/java.desktop/share/classes/com/sun/beans/introspect/PropertyInfo.java	Tue Apr 02 10:57:57 2019 +0530
@@ -72,10 +72,12 @@
     }
 
     private boolean initialize() {
+        boolean isInitedToIsGetter = false;
         if (this.read != null) {
             this.type = this.read.type;
+            isInitedToIsGetter = isPrefix(this.read.method.getName(), "is");
         }
-        if (this.readList != null) {
+        if (!isInitedToIsGetter && this.readList != null) {
             for (MethodInfo info : this.readList) {
                 if ((this.read == null) || this.read.type.isAssignableFrom(info.type)) {
                     this.read = info;
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java	Tue Apr 02 11:05:08 2019 +0800
+++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java	Tue Apr 02 10:57:57 2019 +0530
@@ -60,8 +60,12 @@
  * long term persistence.
  *
  * @author unattributed
+ * @deprecated The Motif Look and Feel is deprecated with the intent to remove
+ *             it in some future release. It is recommended to use
+ *             {@link javax.swing.plaf.metal.MetalLookAndFeel} instead.
  */
 @SuppressWarnings("serial") // Superclass is not serializable across versions
+@Deprecated(since="13", forRemoval=true)
 public class MotifLookAndFeel extends BasicLookAndFeel
 {
     public String getName() {
--- a/src/java.desktop/share/classes/java/awt/AlphaComposite.java	Tue Apr 02 11:05:08 2019 +0800
+++ b/src/java.desktop/share/classes/java/awt/AlphaComposite.java	Tue Apr 02 10:57:57 2019 +0530
@@ -163,7 +163,7 @@
  * </tbody>
  * </table>
  *
- * <h3>Preparing Inputs</h3>
+ * <h2>Preparing Inputs</h2>
  *
  * <p>
  * The {@code AlphaComposite} class defines an additional alpha
@@ -204,7 +204,7 @@
  *      <em>C<sub>d</sub></em> = <em>C<sub>dr</sub></em> * <em>A<sub>d</sub></em>    (if destination is not premultiplied)
  *      <em>C<sub>d</sub></em> = <em>C<sub>dr</sub></em>         (if destination is premultiplied) </pre>
  *
- * <h3>Applying the Blending Equation</h3>
+ * <h2>Applying the Blending Equation</h2>
  *
  * <p>
  * The adjusted <em>A<sub>s</sub></em>, <em>A<sub>d</sub></em>,
@@ -213,7 +213,7 @@
  * <em>F<sub>s</sub></em> and <em>F<sub>d</sub></em> and then the resulting
  * premultiplied components <em>A<sub>r</sub></em> and <em>C<sub>r</sub></em>.
  *
- * <h3>Preparing Results</h3>
+ * <h2>Preparing Results</h2>
  *
  * <p>
  * The results only need to be adjusted if they are to be stored
@@ -230,7 +230,7 @@
  * by zero" and the color components are left as
  * all zeros.
  *
- * <h3>Performance Considerations</h3>
+ * <h2>Performance Considerations</h2>
  *
  * <p>
  * For performance reasons, it is preferable that
@@ -243,7 +243,7 @@
  * appropriate conversions are performed before and after the compositing
  * operation.
  *
- * <h3><a id="caveats">Implementation Caveats</a></h3>
+ * <h2><a id="caveats">Implementation Caveats</a></h2>
  *
  * <ul>
  * <li>
--- a/src/java.desktop/share/classes/java/awt/Component.java	Tue Apr 02 11:05:08 2019 +0800
+++ b/src/java.desktop/share/classes/java/awt/Component.java	Tue Apr 02 10:57:57 2019 +0530
@@ -135,7 +135,7 @@
  * validated afterwards by means of the {@link Container#validate()} method
  * invoked on the top-most invalid container of the hierarchy.
  *
- * <h3>Serialization</h3>
+ * <h2>Serialization</h2>
  * It is important to note that only AWT listeners which conform
  * to the {@code Serializable} protocol will be saved when
  * the object is stored.  If an AWT object has listeners that
--- a/src/java.desktop/share/classes/java/awt/Font.java	Tue Apr 02 11:05:08 2019 +0800
+++ b/src/java.desktop/share/classes/java/awt/Font.java	Tue Apr 02 10:57:57 2019 +0530
@@ -74,7 +74,7 @@
  * and to render sequences of glyphs on {@code Graphics} and
  * {@code Component} objects.
  *
- * <h3>Characters and Glyphs</h3>
+ * <h2>Characters and Glyphs</h2>
  *
  * A <em>character</em> is a symbol that represents an item such as a letter,
  * a digit, or punctuation in an abstract way. For example, {@code 'g'},
@@ -96,7 +96,7 @@
  * of characters as well as the tables needed to map sequences of characters to
  * corresponding sequences of glyphs.
  *
- * <h3>Physical and Logical Fonts</h3>
+ * <h2>Physical and Logical Fonts</h2>
  *
  * The Java Platform distinguishes between two kinds of fonts:
  * <em>physical</em> fonts and <em>logical</em> fonts.
@@ -135,7 +135,7 @@
  * in <a href="https://docs.oracle.com/javase/tutorial/index.html">The Java Tutorials</a>
  * document.
  *
- * <h3>Font Faces and Names</h3>
+ * <h2>Font Faces and Names</h2>
  *
  * A {@code Font}
  * can have many faces, such as heavy, medium, oblique, gothic and
@@ -169,7 +169,7 @@
  * with varying sizes, styles, transforms and font features via the
  * {@code deriveFont} methods in this class.
  *
- * <h3>Font and TextAttribute</h3>
+ * <h2>Font and TextAttribute</h2>
  *
  * <p>{@code Font} supports most
  * {@code TextAttribute}s.  This makes some operations, such as
--- a/src/java.desktop/share/classes/java/awt/font/TextAttribute.java	Tue Apr 02 11:05:08 2019 +0800
+++ b/src/java.desktop/share/classes/java/awt/font/TextAttribute.java	Tue Apr 02 10:57:57 2019 +0530
@@ -67,7 +67,7 @@
  *   <LI>a description of the effect.
  * </UL>
  *
- * <H3>Values</H3>
+ * <H2>Values</H2>
  * <UL>
  *   <LI>The values of attributes must always be immutable.
  *   <LI>Where value limitations are given, any value outside of that
@@ -95,7 +95,7 @@
  *
  * </UL>
  *
- * <h4>Summary of attributes</h4>
+ * <h3>Summary of attributes</h3>
  *
  * <table style="width:95%;margin: 0px auto" class="striped">
  * <caption>Key, value type, principal constants, and default value behavior of
--- a/src/java.desktop/share/classes/java/awt/geom/AffineTransform.java	Tue Apr 02 11:05:08 2019 +0800
+++ b/src/java.desktop/share/classes/java/awt/geom/AffineTransform.java	Tue Apr 02 10:57:57 2019 +0530
@@ -46,7 +46,7 @@
  *      [ y'] = [  m10  m11  m12  ] [ y ] = [ m10x + m11y + m12 ]
  *      [ 1 ]   [   0    0    1   ] [ 1 ]   [         1         ]
  * </pre>
- * <h3><a id="quadrantapproximation">Handling 90-Degree Rotations</a></h3>
+ * <h2><a id="quadrantapproximation">Handling 90-Degree Rotations</a></h2>
  * <p>
  * In some variations of the {@code rotate} methods in the
  * {@code AffineTransform} class, a double-precision argument
--- a/src/java.desktop/share/classes/javax/accessibility/package-info.java	Tue Apr 02 11:05:08 2019 +0800
+++ b/src/java.desktop/share/classes/javax/accessibility/package-info.java	Tue Apr 02 10:57:57 2019 +0530
@@ -37,8 +37,8 @@
  * interfaces, and 6 Java programming language classes. These are described
  * below.
  *
- * <h3><a id="Accessible"></a><a href="Accessible.html">Interface
- * Accessible</a></h3>
+ * <h2><a id="Accessible"></a><a href="Accessible.html">Interface
+ * Accessible</a></h2>
  * <a href="Accessible.html">Interface Accessible</a> is the main interface of
  * the Java Accessibility API. All components that support the Java
  * Accessibility API must implement this interface. It contains a single method,
@@ -48,8 +48,8 @@
  * object that is part of the user interface of a Java application, if that
  * program is to be compatible with assistive technologies.
  *
- * <h3><a id="AccessibleContext"></a><a href="AccessibleContext.html">Class
- * AccessibleContext</a></h3>
+ * <h2><a id="AccessibleContext"></a><a href="AccessibleContext.html">Class
+ * AccessibleContext</a></h2>
  * <a href="AccessibleContext.html">AccessibleContext</a> represents the minimum
  * information all accessible objects return and is obtained by calling the
  * {@code getAccessibleContext} method on an object that implements the
@@ -108,8 +108,8 @@
  *     called on an AccessibleContext.</li>
  * </ul>
  *
- * <h3><a id="AccessibleRole"></a><a href="AccessibleRole.html">Class
- * AccessibleRole</a></h3>
+ * <h2><a id="AccessibleRole"></a><a href="AccessibleRole.html">Class
+ * AccessibleRole</a></h2>
  * This class encapsulates the Accessible object's role in the user interface
  * and is obtained by calling the {@code getAccessibleRole} method on an
  * <a href="#AccessibleContext">AccessibleContext</a>. Accessible roles include
@@ -123,8 +123,8 @@
  * programmer-defined roles can be added in the future without needing to modify
  * the base class.
  *
- * <h3><a id="AccessibleState"></a><a href="AccessibleState.html">Class
- * AccessibleState</a></h3>
+ * <h2><a id="AccessibleState"></a><a href="AccessibleState.html">Class
+ * AccessibleState</a></h2>
  * This class encapsulates a particular state of the Accessible object.
  * Accessible states include things like "Armed", "Busy", "Checked", "Focused",
  * etc. These roles are identified by the constants in this class such as
@@ -142,8 +142,8 @@
  * additional, programmer-defined roles can be added in the future without
  * needing to modify the base class.
  *
- * <h3><a id="AccessibleStateSet"></a><a href="AccessibleStateSet.html">Class
- * AccessibleStateSet</a></h3>
+ * <h2><a id="AccessibleStateSet"></a><a href="AccessibleStateSet.html">Class
+ * AccessibleStateSet</a></h2>
  * This class encapsulates a collection of states of the Accessible object and
  * is obtained by calling the {@code getAccessibleStateSet} method on an
  * <a href="#AccessibleContext">AccessibleContext</a>. Since an object might
@@ -152,8 +152,8 @@
  * class provide for retrieving the individual
  * <a href="#AccessibleState">AccessibleStates</a> on the state set.
  *
- * <h3><a id="AccessibleBundle"></a><a href="AccessibleBundle.html">Class
- * AccessibleBundle</a></h3>
+ * <h2><a id="AccessibleBundle"></a><a href="AccessibleBundle.html">Class
+ * AccessibleBundle</a></h2>
  * This class is used to maintain a strongly typed enumeration. It is the super
  * class of both the <a href="#AccessibleRole">AccessibleRole</a> and
  * <a href="#AccessibleState">AccessibleState</a> classes. Programmers normally
@@ -161,8 +161,8 @@
  * <a href="#AccessibleRole">AccessibleRole</a> and
  * <a href="#AccessibleState">AccessibleState</a> classes.
  *
- * <h3><a id="AccessibleAction"></a><a href="AccessibleAction.html">Interface
- * AccessibleAction</a></h3>
+ * <h2><a id="AccessibleAction"></a><a href="AccessibleAction.html">Interface
+ * AccessibleAction</a></h2>
  * The <a href="AccessibleAction.html">AccessibleAction</a> interface should be
  * supported by any object that can perform one or more actions. This interface
  * provides the standard mechanism for an assistive technology to determine what
@@ -177,8 +177,8 @@
  * <a href="#AccessibleContext">AccessibleContext</a>. If the return value is
  * not {@code null}, the object supports this interface.
  *
- * <h3> <a id="AccessibleComponent"></a><a href="AccessibleComponent.html">
- * Interface AccessibleComponent</a></h3>
+ * <h2> <a id="AccessibleComponent"></a><a href="AccessibleComponent.html">
+ * Interface AccessibleComponent</a></h2>
  * The <a href="AccessibleComponent.html">AccessibleComponent</a> interface
  * should be supported by any object that is rendered on the screen. This
  * interface provides the standard mechanism for an assistive technology to
@@ -190,8 +190,8 @@
  * <a href="#AccessibleContext">AccessibleContext</a>. If the return value is
  * not {@code null}, the object supports this interface.
  *
- * <h3><a id="AccessibleSelection"></a><a href="AccessibleSelection.html">
- * Interface AccessibleSelection</a></h3>
+ * <h2><a id="AccessibleSelection"></a><a href="AccessibleSelection.html">
+ * Interface AccessibleSelection</a></h2>
  * The <a href="AccessibleSelection.html">AccessibleSelection</a> interface
  * provides the standard mechanism for an assistive technology to determine what
  * the current selected children are, as well as modify the selection set. Any
@@ -206,8 +206,8 @@
  * <a href="#AccessibleContext">AccessibleContext</a>. If the return value is
  * not {@code null}, the object supports this interface.
  *
- * <h3><a id="AccessibleText"></a><a href="AccessibleText.html">Interface
- * AccessibleText</a></h3>
+ * <h2><a id="AccessibleText"></a><a href="AccessibleText.html">Interface
+ * AccessibleText</a></h2>
  * Interface <a href="AccessibleText.html">AccessibleText</a> is the contract
  * for making rich, editable text Accessible. Not all text displayed on the
  * screen is rich and editable (e.g. text contained in buttons, labels, menus,
@@ -230,8 +230,8 @@
  * <a href="#AccessibleContext">AccessibleContext</a>. If the return value is
  * not {@code null}, the object supports this interface.
  *
- * <h3><a id="AccessibleHypertext"></a> <a href="AccessibleHypertext.html">
- * Interface AccessibleHypertext</a></h3>
+ * <h2><a id="AccessibleHypertext"></a> <a href="AccessibleHypertext.html">
+ * Interface AccessibleHypertext</a></h2>
  * The <a href="AccessibleHypertext.html">AccessibleHypertext</a> interface
  * should be supported by any object that presents hypertext information on the
  * display. This interface provides the standard mechanism for an assistive
@@ -246,16 +246,16 @@
  * class which extends AccessibleHypertext, then that object supports
  * AccessibleHypertext.
  *
- * <h3><a id="AccessibleHyperlink"></a><a href="AccessibleHyperlink.html">
- * Interface AccessibleHyperlink</a></h3>
+ * <h2><a id="AccessibleHyperlink"></a><a href="AccessibleHyperlink.html">
+ * Interface AccessibleHyperlink</a></h2>
  * An object that is a hyperlink should support the
  * <a href="AccessibleHyperlink.html">AccessibleHyperlink</a> interface.&nbsp;
  * An object that implements this interface will be returned by calling the
  * getLink method on an <a href="#AccessibleHypertext">AccessibleHypertext</a>
  * object.
  *
- * <h3><a id="AccessibleValue"></a><a href="AccessibleValue.html">Interface
- * AccessibleValue</a></h3>
+ * <h2><a id="AccessibleValue"></a><a href="AccessibleValue.html">Interface
+ * AccessibleValue</a></h2>
  * The <a href="AccessibleValue.html">AccessibleValue</a> interface should be
  * supported by any object that supports a numerical value (e.g., a scroll bar).
  * This interface provides the standard mechanism for an assistive technology to
--- a/src/java.desktop/share/classes/javax/print/DocFlavor.java	Tue Apr 02 11:05:08 2019 +0800
+++ b/src/java.desktop/share/classes/javax/print/DocFlavor.java	Tue Apr 02 10:57:57 2019 +0530
@@ -60,7 +60,7 @@
  * class, from which the {@code DocPrintJob} then obtains the actual print data.
  *
  * <hr>
- * <h3>Client Formatted Print Data</h3>
+ * <h2>Client Formatted Print Data</h2>
  * There are two broad categories of print data, client formatted print data and
  * service formatted print data.
  * <p>
@@ -120,7 +120,7 @@
  * </ul>
  *
  * <hr>
- * <h3>Default and Platform Encodings</h3>
+ * <h2>Default and Platform Encodings</h2>
  * For byte print data where the doc flavor's MIME type does not include a
  * {@code charset} parameter, the Java Print Service instance assumes the
  * US-ASCII character set by default. This is in accordance with
@@ -161,7 +161,7 @@
  * the Java platform.
  *
  * <hr>
- * <h3>Recommended DocFlavors</h3>
+ * <h2>Recommended DocFlavors</h2>
  * The Java Print Service API does not define any mandatorily supported
  * {@code DocFlavors}. However, here are some examples of MIME types that a Java
  * Print Service instance might support for client formatted print data. Nested
@@ -261,7 +261,7 @@
  * </ul>
  *
  * <hr>
- * <h3>Service Formatted Print Data</h3>
+ * <h2>Service Formatted Print Data</h2>
  * For <b>service formatted print data</b>, the Java Print Service instance
  * determines the print data format. The doc flavor's representation class
  * denotes an interface whose methods the {@code DocPrintJob} invokes to
@@ -296,7 +296,7 @@
  * </ul>
  *
  * <hr>
- * <h3>Pre-defined Doc Flavors</h3>
+ * <h2>Pre-defined Doc Flavors</h2>
  * A Java Print Service instance is not <b><i>required</i></b> to support the
  * following print data formats and print data representation classes. In fact,
  * a developer using this class should <b>never</b> assume that a particular
@@ -342,7 +342,7 @@
  * The client must itself perform all plain text print data formatting not
  * addressed by the above requirements.
  *
- * <h3>Design Rationale</h3>
+ * <h2>Design Rationale</h2>
  * Class {@code DocFlavor} in package {@code javax.print} is similar to class
  * {@link java.awt.datatransfer.DataFlavor}. Class {@code DataFlavor} is not
  * used in the Java Print Service (JPS) API for three reasons which are all
--- a/src/java.desktop/share/classes/javax/print/attribute/package-info.java	Tue Apr 02 11:05:08 2019 +0800
+++ b/src/java.desktop/share/classes/javax/print/attribute/package-info.java	Tue Apr 02 10:57:57 2019 +0530
@@ -27,7 +27,7 @@
  * Provides classes and interfaces that describe the types of Java&trade; Print
  * Service attributes and how they can be collected into attribute sets.
  *
- * <h3>What is an Attribute?</h3>
+ * <h2>What is an Attribute?</h2>
  * When setting up a print job, a client specifies two things: <b>print data</b>
  * and <b>processing instructions.</b> The print data is the actual content to
  * be printed. The processing instructions tell the printer how to print the
@@ -60,7 +60,7 @@
  * instructions as descriptive items provides more flexibility for implementing
  * print jobs.
  *
- * <h4>Attribute Categories and Values</h4>
+ * <h3>Attribute Categories and Values</h3>
  * Each printer has a set of capabilities, such as the ability to print on
  * different paper sizes or the ability to print more than one copy. Each of the
  * capabilities has a range of values. For example, a printer's orientation
@@ -80,7 +80,7 @@
  * attribute category, and the {@code Copies} instance represents the attribute
  * value.
  *
- * <h4><a id="role"></a>Attribute Roles</h4>
+ * <h3><a id="role"></a>Attribute Roles</h3>
  * When submitting a print job to a printer, the client provides the attributes
  * describing the characteristics of the print data, such as the document name,
  * and how the print data should be printed, such as double-sided, five copies.
@@ -128,7 +128,7 @@
  * conceptually separate from the generic apparatus defined in package
  * {@code javax.print.attribute}.
  *
- * <h3>Attribute Sets</h3>
+ * <h2>Attribute Sets</h2>
  * A client usually needs to provide more than one processing instruction when
  * submitting a print job. For example, the client might need to specify a media
  * size of A4 and a landscape orientation. To send more than one processing
@@ -201,7 +201,7 @@
  * restriction that the attribute set is only allowed to contain the
  * corresponding kind of attribute.
  *
- * <h3>Attribute Class Design</h3>
+ * <h2>Attribute Class Design</h2>
  * An attribute value is a small, atomic data item, such as an integer or an
  * enumerated value. The Java Print Service API does not use primitive data
  * types, such as int, to represent attribute values for these reasons:
@@ -295,7 +295,7 @@
  * references can be passed around freely. To get a different attribute value,
  * construct a different attribute object.
  *
- * <h3>Attribute Vendors</h3>
+ * <h2>Attribute Vendors</h2>
  * The Java Print Service API is designed so that vendors can:
  * <ul>
  *   <li>define new vendor-specific values for any standard attribute defined in
@@ -321,7 +321,7 @@
  * a new one. The new vendor-defined attribute can be used wherever an
  * {@code Attribute} is used, such as in an {@code AttributeSet}.
  *
- * <h3>Using Attributes</h3>
+ * <h2>Using Attributes</h2>
  * A typical printing application uses the {@code PrintRequestAttributeSet}
  * because print-request attributes are the types of attributes that client
  * usually specifies. This example demonstrates creating an attribute set of
--- a/src/java.desktop/share/classes/javax/print/attribute/standard/package-info.java	Tue Apr 02 11:05:08 2019 +0800
+++ b/src/java.desktop/share/classes/javax/print/attribute/standard/package-info.java	Tue Apr 02 10:57:57 2019 +0530
@@ -82,19 +82,19 @@
  * from the above documents. The above authors' contribution to the API is
  * gratefully acknowledged.
  *
- * <h3>Attribute Organization</h3>
+ * <h2>Attribute Organization</h2>
  * There are five kinds of printing attributes: doc attributes, print request
  * attributes, print job attributes, print service attributes, and
  * supported-values attributes.
  *
- * <h4>Doc Attributes</h4>
+ * <h3>Doc Attributes</h3>
  * Doc attributes specify the characteristics of an individual doc and the print
  * job settings to be applied to an individual doc. A doc attribute class
  * implements interface <a href="../DocAttribute.html">DocAttribute</a>. A doc
  * attribute can appear in a <a href="../DocAttributeSet.html">
  * DocAttributeSet</a>.
  *
- * <h4>Print Request Attributes</h4>
+ * <h3>Print Request Attributes</h3>
  * Print request attributes specify the settings to be applied to a whole print
  * job and to all the docs in the print job. A print request attribute class
  * implements interface <a href="../PrintRequestAttribute.html">
@@ -114,7 +114,7 @@
  * the doc level overrides an attribute in the same category specified at the
  * Print Request level.
  *
- * <h4>Print Job Attributes</h4>
+ * <h3>Print Job Attributes</h3>
  * Print job attributes report the status of a Print Job. A print job attribute
  * class implements interface <a href="../PrintJobAttribute.html">
  * PrintJobAttribute</a>. A print job attribute can appear in a
@@ -127,14 +127,14 @@
  * attributes but not print request attributes; the print service itself adds
  * these attributes to the Print Job's attribute set.
  *
- * <h4>Print Service Attributes</h4>
+ * <h3>Print Service Attributes</h3>
  * Print service attributes report the status of a print service. A print
  * service attribute class implements interface
  * <a href="../PrintServiceAttribute.html">PrintServiceAttribute</a>. A print
  * service attribute can appear in a <a href="../PrintServiceAttributeSet.html">
  * PrintServiceAttributeSet</a>.
  *
- * <h4>Supported-Values Attributes</h4>
+ * <h3>Supported-Values Attributes</h3>
  * A supported-value attribute indicates the legal values for another attribute
  * that a print service supports. A supported-values attribute class implements
  * interface <a href="../SupportedValuesAttribute.html">
@@ -142,7 +142,7 @@
  * appear in attribute sets, so there is no restricted
  * <a href="../AttributeSet.html">AttributeSet</a> subinterface for them.
  *
- * <h4>Attribute Table</h4>
+ * <h3>Attribute Table</h3>
  * The table below lists all the printing attributes. The table shows the
  * tagging interfaces each attribute class implements in addition to interface
  * <a href="../Attribute.html"> Attribute</a>, thus indicating how each
--- a/src/java.desktop/share/classes/javax/print/package-info.java	Tue Apr 02 11:05:08 2019 +0800
+++ b/src/java.desktop/share/classes/javax/print/package-info.java	Tue Apr 02 10:57:57 2019 +0530
@@ -34,7 +34,7 @@
  *   printed.
  * </ul>
  *
- * <h3>Print Service Discovery</h3>
+ * <h2>Print Service Discovery</h2>
  * An application invokes the static methods of the abstract class
  * {@link javax.print.PrintServiceLookup PrintServiceLookup} to locate print
  * services that have the capabilities to satisfy the application's print
@@ -48,7 +48,7 @@
  * dynamically install these {@code PrintServiceLookup} implementations using
  * the {@link java.util.ServiceLoader} facility.
  *
- * <h3>Attribute Definitions</h3>
+ * <h2>Attribute Definitions</h2>
  * The {@link javax.print.attribute} and {@link javax.print.attribute.standard}
  * packages define print attributes, which describe the capabilities of a print
  * service, specify the requirements of a print job, and track the progress of a
@@ -65,7 +65,7 @@
  * capabilities, such as: resolution, copies, media sizes, job priority, and
  * page ranges.
  *
- * <h3>Document Type Specification</h3>
+ * <h2>Document Type Specification</h2>
  * The {@link javax.print.DocFlavor DocFlavor} class represents the print data
  * format, such as JPEG or PostScript. A {@code DocFlavor} object consists of a
  * MIME type, which describes the format, and a document representation class
@@ -74,7 +74,7 @@
  * find printers that can print the document type specified by the
  * {@code DocFlavor} and have the capabilities specified by the attribute set.
  *
- * <h3>Using the API</h3>
+ * <h2>Using the API</h2>
  * A typical application using the Java Print Service API performs these steps
  * to process a print request:
  * <ol>
--- a/src/java.desktop/share/classes/javax/sound/sampled/Line.java	Tue Apr 02 11:05:08 2019 +0800
+++ b/src/java.desktop/share/classes/javax/sound/sampled/Line.java	Tue Apr 02 10:57:57 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -324,20 +324,11 @@
          */
         @Override
         public String toString() {
-
-            String fullPackagePath = "javax.sound.sampled.";
-            String initialString = new String(getLineClass().toString());
-            String finalString;
-
-            int index = initialString.indexOf(fullPackagePath);
-
-            if (index != -1) {
-                finalString = initialString.substring(0, index) + initialString.substring( (index + fullPackagePath.length()), initialString.length() );
-            } else {
-                finalString = initialString;
+            final String str = getLineClass().toString();
+            if (getLineClass().getPackage() == Line.class.getPackage()) {
+                return str.replace("javax.sound.sampled.", "");
             }
-
-            return finalString;
+            return str;
         }
     }
 }
--- a/src/java.desktop/share/classes/javax/swing/Action.java	Tue Apr 02 11:05:08 2019 +0800
+++ b/src/java.desktop/share/classes/javax/swing/Action.java	Tue Apr 02 10:57:57 2019 +0530
@@ -69,7 +69,7 @@
  * are desired, and use simple <code>ActionListener</code>s elsewhere.
  * <br>
  *
- * <h3><a id="buttonActions"></a>Swing Components Supporting <code>Action</code></h3>
+ * <h2><a id="buttonActions"></a>Swing Components Supporting <code>Action</code></h2>
  * <p>
  * Many of Swing's components have an <code>Action</code> property.  When
  * an <code>Action</code> is set on a component, the following things
--- a/src/java.desktop/share/classes/javax/swing/GroupLayout.java	Tue Apr 02 11:05:08 2019 +0800
+++ b/src/java.desktop/share/classes/javax/swing/GroupLayout.java	Tue Apr 02 10:57:57 2019 +0530
@@ -2377,7 +2377,7 @@
      * {@code ParallelGroup} aligns its children in
      * four possible ways: along the baseline, centered, anchored to the
      * leading edge, or anchored to the trailing edge.
-     * <h3>Baseline</h3>
+     * <h2>Baseline</h2>
      * A {@code ParallelGroup} that aligns its children along the
      * baseline must first decide where the baseline is
      * anchored. The baseline can either be anchored to the top, or
@@ -2427,7 +2427,7 @@
      * ways: centered, anchored to the leading edge, or anchored to the
      * trailing edge.
      *
-     * <h3>Non-baseline {@code ParallelGroup}</h3>
+     * <h2>Non-baseline {@code ParallelGroup}</h2>
      * {@code ParallelGroup}s created with an alignment other than
      * {@code BASELINE} align elements that are smaller than the size
      * of the group in one of three ways: centered, anchored to the
--- a/src/java.desktop/share/classes/javax/swing/JTable.java	Tue Apr 02 11:05:08 2019 +0800
+++ b/src/java.desktop/share/classes/javax/swing/JTable.java	Tue Apr 02 10:57:57 2019 +0530
@@ -3050,9 +3050,9 @@
      *   of elements with a size, preferred size, maximum size and minimum size
      *   to have its elements manipulated by the algorithm.
      *
-     * <H3> Distributing the delta </H3>
-     *
-     * <H4> Overview </H4>
+     * <H4> Distributing the delta </H4>
+     *
+     * <H5> Overview </H5>
      * <P>
      * Call "DELTA" the difference between the target size and the
      * sum of the preferred sizes of the elements in r. The individual
@@ -3061,7 +3061,7 @@
      * how far each preferred size is from its limiting bound (minimum or
      * maximum).
      *
-     * <H4>Definition</H4>
+     * <H5>Definition</H5>
      * <P>
      * Call the individual constraints min[i], max[i], and pref[i].
      * <p>
@@ -3093,7 +3093,7 @@
      * k, towards the total minimum or maximum and that percentage guarantees
      * accommodation of the required space, DELTA.
      *
-     * <H4>Details</H4>
+     * <H5>Details</H5>
      * <P>
      * Naive evaluation of the formulae presented here would be subject to
      * the aggregated rounding errors caused by doing this operation in finite
@@ -3104,7 +3104,7 @@
      * <code>targetSize</code>, and does so by spreading the rounding
      * errors evenly over the given elements.
      *
-     * <H4>When the MAX and MIN bounds are hit</H4>
+     * <H5>When the MAX and MIN bounds are hit</H5>
      * <P>
      * When <code>targetSize</code> is outside the [MIN, MAX] range,
      * the algorithm sets all sizes to their appropriate limiting value
--- a/src/java.desktop/share/classes/javax/swing/SizeSequence.java	Tue Apr 02 11:05:08 2019 +0800
+++ b/src/java.desktop/share/classes/javax/swing/SizeSequence.java	Tue Apr 02 10:57:57 2019 +0530
@@ -76,7 +76,7 @@
  * could be just as valid.
  *
  *
- * <h3>Implementation Notes</h3>
+ * <h2>Implementation Notes</h2>
  *
  * Normally when storing the size and position of entries,
  * one would choose between
--- a/src/java.desktop/share/classes/javax/swing/SpringLayout.java	Tue Apr 02 11:05:08 2019 +0800
+++ b/src/java.desktop/share/classes/javax/swing/SpringLayout.java	Tue Apr 02 10:57:57 2019 +0530
@@ -128,9 +128,9 @@
  * the edges of components from different containers (either internal or
  * external) is undefined.
  *
- * <h3>
+ * <h2>
  * SpringLayout vs. Other Layout Managers
- * </h3>
+ * </h2>
  *
  * <blockquote>
  * <hr>
--- a/src/java.desktop/share/classes/javax/swing/UIManager.java	Tue Apr 02 11:05:08 2019 +0800
+++ b/src/java.desktop/share/classes/javax/swing/UIManager.java	Tue Apr 02 10:57:57 2019 +0530
@@ -70,7 +70,7 @@
  * are notified when the look and feel changes, look and feel defaults, and
  * convenience methods for obtaining various default values.
  *
- * <h3>Specifying the look and feel</h3>
+ * <h2>Specifying the look and feel</h2>
  *
  * The look and feel can be specified in two distinct ways: by
  * specifying the fully qualified name of the class for the look and
@@ -94,7 +94,7 @@
  * unspecified. It is very possible to receive unexpected exceptions,
  * painting problems, or worse.
  *
- * <h3>Default look and feel</h3>
+ * <h2>Default look and feel</h2>
  *
  * The class used for the default look and feel is chosen in the following
  * manner:
@@ -114,7 +114,7 @@
  *   <li>Otherwise use the cross platform look and feel.
  * </ol>
  *
- * <h3>Defaults</h3>
+ * <h2>Defaults</h2>
  *
  * {@code UIManager} manages three sets of {@code UIDefaults}. In order, they
  * are:
--- a/src/java.desktop/share/classes/javax/swing/plaf/metal/DefaultMetalTheme.java	Tue Apr 02 11:05:08 2019 +0800
+++ b/src/java.desktop/share/classes/javax/swing/plaf/metal/DefaultMetalTheme.java	Tue Apr 02 10:57:57 2019 +0530
@@ -42,7 +42,7 @@
  * All colors returned by {@code DefaultMetalTheme} are completely
  * opaque.
  *
- * <h3><a id="fontStyle"></a>Font Style</h3>
+ * <h2><a id="fontStyle"></a>Font Style</h2>
  *
  * {@code DefaultMetalTheme} uses bold fonts for many controls.  To make all
  * controls (with the exception of the internal frame title bars and
--- a/src/java.desktop/share/classes/javax/swing/text/Utilities.java	Tue Apr 02 11:05:08 2019 +0800
+++ b/src/java.desktop/share/classes/javax/swing/text/Utilities.java	Tue Apr 02 10:57:57 2019 +0530
@@ -657,7 +657,7 @@
     public static final int getBreakLocation(Segment s, FontMetrics metrics,
                                              float x0, float x, TabExpander e,
                                              int startOffset) {
-        return getBreakLocation(s, metrics, x0, x, e, startOffset, false);
+        return getBreakLocation(s, metrics, x0, x, e, startOffset, true);
     }
 
     /**
--- a/src/java.desktop/share/classes/javax/swing/text/WrappedPlainView.java	Tue Apr 02 11:05:08 2019 +0800
+++ b/src/java.desktop/share/classes/javax/swing/text/WrappedPlainView.java	Tue Apr 02 10:57:57 2019 +0530
@@ -360,7 +360,8 @@
         int currentWidth = getWidth();
         if (wordWrap) {
             p = p0 + Utilities.getBreakLocation(segment, metrics,
-                                                tabBase, tabBase + currentWidth,
+                                                (float)tabBase,
+                                                (float)(tabBase + currentWidth),
                                                 this, p0);
         } else {
             p = p0 + Utilities.getTabbedTextOffset(segment, metrics,
--- a/src/java.desktop/share/classes/sun/print/RasterPrinterJob.java	Tue Apr 02 11:05:08 2019 +0800
+++ b/src/java.desktop/share/classes/sun/print/RasterPrinterJob.java	Tue Apr 02 10:57:57 2019 +0530
@@ -1275,10 +1275,12 @@
                printerResAttr = (PrinterResolution)
                    service.getDefaultAttributeValue(PrinterResolution.class);
             }
-            double xr =
-               printerResAttr.getCrossFeedResolution(ResolutionSyntax.DPI);
-            double yr = printerResAttr.getFeedResolution(ResolutionSyntax.DPI);
-            setXYRes(xr, yr);
+            if (printerResAttr != null) {
+                double xr =
+                        printerResAttr.getCrossFeedResolution(ResolutionSyntax.DPI);
+                double yr = printerResAttr.getFeedResolution(ResolutionSyntax.DPI);
+                setXYRes(xr, yr);
+            }
         }
 
         pageRangesAttr =  (PageRanges)attributes.get(PageRanges.class);
--- a/src/java.desktop/share/legal/giflib.md	Tue Apr 02 11:05:08 2019 +0800
+++ b/src/java.desktop/share/legal/giflib.md	Tue Apr 02 10:57:57 2019 +0530
@@ -1,4 +1,4 @@
-## GIFLIB v5.1.4
+## GIFLIB v5.1.8
 
 ### GIFLIB License
 <pre>
--- a/src/java.desktop/share/native/common/awt/debug/debug_trace.c	Tue Apr 02 11:05:08 2019 +0800
+++ b/src/java.desktop/share/native/common/awt/debug/debug_trace.c	Tue Apr 02 10:57:57 2019 +0530
@@ -25,7 +25,7 @@
 
 #include "debug_util.h"
 
-static void DTrace_PrintStdErr(const char *msg);
+static void JNICALL DTrace_PrintStdErr(const char *msg);
 
 #if defined(DEBUG)
 enum {
@@ -298,7 +298,7 @@
  * Support for Java tracing in release or debug mode builds
  */
 
-static void DTrace_PrintStdErr(const char *msg) {
+static void JNICALL DTrace_PrintStdErr(const char *msg) {
     fprintf(stderr, "%s", msg);
     fflush(stderr);
 }
--- a/src/java.desktop/share/native/common/awt/debug/debug_trace.h	Tue Apr 02 11:05:08 2019 +0800
+++ b/src/java.desktop/share/native/common/awt/debug/debug_trace.h	Tue Apr 02 10:57:57 2019 +0530
@@ -45,10 +45,10 @@
 };
 
 /* prototype for client provided output callback function */
-typedef void (*DTRACE_OUTPUT_CALLBACK)(const char * msg);
+typedef void (JNICALL *DTRACE_OUTPUT_CALLBACK)(const char * msg);
 
 /* prototype for client provided print callback function */
-typedef void (*DTRACE_PRINT_CALLBACK)(const char * file, int line, int argc, const char * fmt, va_list arglist);
+typedef void (JNICALL *DTRACE_PRINT_CALLBACK)(const char * file, int line, int argc, const char * fmt, va_list arglist);
 
 extern void DTrace_EnableAll(dbool_t enabled);
 extern void DTrace_EnableFile(const char * file, dbool_t enabled);
--- a/src/java.desktop/share/native/libawt/awt/image/gif/gifdecoder.c	Tue Apr 02 11:05:08 2019 +0800
+++ b/src/java.desktop/share/native/libawt/awt/image/gif/gifdecoder.c	Tue Apr 02 10:57:57 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -117,7 +117,7 @@
                                               jobject this,
                                               jint relx, jint rely,
                                               jint width, jint height,
-                                              jint interlace,
+                                              jboolean interlace,
                                               jint initCodeSize,
                                               jbyteArray blockh,
                                               jbyteArray raslineh,
--- a/src/java.desktop/share/native/libsplashscreen/giflib/dgif_lib.c	Tue Apr 02 11:05:08 2019 +0800
+++ b/src/java.desktop/share/native/libsplashscreen/giflib/dgif_lib.c	Tue Apr 02 10:57:57 2019 +0530
@@ -36,13 +36,16 @@
 #include <limits.h>
 #include <stdint.h>
 #include <fcntl.h>
+/** Begin JDK modifications to support building on Windows **/
+#ifndef _WIN32
+#include <unistd.h>
+#endif
+/** End JDK modifications to support building on Windows **/
 #include <stdio.h>
 #include <string.h>
 
 #ifdef _WIN32
 #include <io.h>
-#else
-#include <unistd.h>
 #endif /* _WIN32 */
 
 #include "gif_lib.h"
@@ -52,10 +55,14 @@
 #define UNSIGNED_LITTLE_ENDIAN(lo, hi) ((lo) | ((hi) << 8))
 
 /* avoid extra function call in case we use fread (TVT) */
-#define READ(_gif,_buf,_len)                                     \
-  (((GifFilePrivateType*)_gif->Private)->Read ?                   \
-    ((GifFilePrivateType*)_gif->Private)->Read(_gif,_buf,_len) : \
-    fread(_buf,1,_len,((GifFilePrivateType*)_gif->Private)->File))
+/** JDK modification "inline" is dropped to support c89 **/
+static /**inline**/ int InternalRead(GifFileType *gif, GifByteType *buf, int len) {
+    //fprintf(stderr, "### Read: %d\n", len);
+    return
+    (((GifFilePrivateType*)gif->Private)->Read ?
+     ((GifFilePrivateType*)gif->Private)->Read(gif,buf,len) :
+     fread(buf,1,len,((GifFilePrivateType*)gif->Private)->File));
+}
 
 static int DGifGetWord(GifFileType *GifFile, GifWord *Word);
 static int DGifSetupDecompress(GifFileType *GifFile);
@@ -142,7 +149,7 @@
 
     /* Let's see if this is a GIF file: */
     /* coverity[check_return] */
-    if (READ(GifFile, (unsigned char *)Buf, GIF_STAMP_LEN) != GIF_STAMP_LEN) {
+    if (InternalRead(GifFile, (unsigned char *)Buf, GIF_STAMP_LEN) != GIF_STAMP_LEN) {
         if (Error != NULL)
             *Error = D_GIF_ERR_READ_FAILED;
         (void)fclose(f);
@@ -219,7 +226,7 @@
 
     /* Lets see if this is a GIF file: */
     /* coverity[check_return] */
-    if (READ(GifFile, (unsigned char *)Buf, GIF_STAMP_LEN) != GIF_STAMP_LEN) {
+    if (InternalRead(GifFile, (unsigned char *)Buf, GIF_STAMP_LEN) != GIF_STAMP_LEN) {
         if (Error != NULL)
             *Error = D_GIF_ERR_READ_FAILED;
         free((char *)Private);
@@ -276,7 +283,7 @@
         DGifGetWord(GifFile, &GifFile->SHeight) == GIF_ERROR)
         return GIF_ERROR;
 
-    if (READ(GifFile, Buf, 3) != 3) {
+    if (InternalRead(GifFile, Buf, 3) != 3) {
         GifFile->Error = D_GIF_ERR_READ_FAILED;
         GifFreeMapObject(GifFile->SColorMap);
         GifFile->SColorMap = NULL;
@@ -300,7 +307,7 @@
         GifFile->SColorMap->SortFlag = SortFlag;
         for (i = 0; i < GifFile->SColorMap->ColorCount; i++) {
             /* coverity[check_return] */
-            if (READ(GifFile, Buf, 3) != 3) {
+            if (InternalRead(GifFile, Buf, 3) != 3) {
                 GifFreeMapObject(GifFile->SColorMap);
                 GifFile->SColorMap = NULL;
                 GifFile->Error = D_GIF_ERR_READ_FAILED;
@@ -314,9 +321,25 @@
         GifFile->SColorMap = NULL;
     }
 
+    /*
+     * No check here for whether the background color is in range for the
+     * screen color map.  Possibly there should be.
+     */
+
     return GIF_OK;
 }
 
+const char *
+DGifGetGifVersion(GifFileType *GifFile)
+{
+    GifFilePrivateType *Private = (GifFilePrivateType *) GifFile->Private;
+
+    if (Private->gif89)
+        return GIF89_STAMP;
+    else
+        return GIF87_STAMP;
+}
+
 /******************************************************************************
  This routine should be called before any attempt to read an image.
 ******************************************************************************/
@@ -333,11 +356,12 @@
     }
 
     /* coverity[check_return] */
-    if (READ(GifFile, &Buf, 1) != 1) {
+    if (InternalRead(GifFile, &Buf, 1) != 1) {
         GifFile->Error = D_GIF_ERR_READ_FAILED;
         return GIF_ERROR;
     }
 
+    //fprintf(stderr, "### DGifGetRecordType: %02x\n", Buf);
     switch (Buf) {
       case DESCRIPTOR_INTRODUCER:
           *Type = IMAGE_DESC_RECORD_TYPE;
@@ -357,17 +381,12 @@
     return GIF_OK;
 }
 
-/******************************************************************************
- This routine should be called before any attempt to read an image.
- Note it is assumed the Image desc. header has been read.
-******************************************************************************/
 int
-DGifGetImageDesc(GifFileType *GifFile)
+DGifGetImageHeader(GifFileType *GifFile)
 {
     unsigned int BitsPerPixel;
     GifByteType Buf[3];
     GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
-    SavedImage *sp;
 
     if (!IS_READABLE(Private)) {
         /* This file was NOT open for reading: */
@@ -380,7 +399,7 @@
         DGifGetWord(GifFile, &GifFile->Image.Width) == GIF_ERROR ||
         DGifGetWord(GifFile, &GifFile->Image.Height) == GIF_ERROR)
         return GIF_ERROR;
-    if (READ(GifFile, Buf, 1) != 1) {
+    if (InternalRead(GifFile, Buf, 1) != 1) {
         GifFile->Error = D_GIF_ERR_READ_FAILED;
         GifFreeMapObject(GifFile->Image.ColorMap);
         GifFile->Image.ColorMap = NULL;
@@ -407,7 +426,7 @@
         /* Get the image local color map: */
         for (i = 0; i < GifFile->Image.ColorMap->ColorCount; i++) {
             /* coverity[check_return] */
-            if (READ(GifFile, Buf, 3) != 3) {
+            if (InternalRead(GifFile, Buf, 3) != 3) {
                 GifFreeMapObject(GifFile->Image.ColorMap);
                 GifFile->Error = D_GIF_ERR_READ_FAILED;
                 GifFile->Image.ColorMap = NULL;
@@ -419,6 +438,33 @@
         }
     }
 
+    Private->PixelCount = (long)GifFile->Image.Width *
+       (long)GifFile->Image.Height;
+
+    /* Reset decompress algorithm parameters. */
+    return DGifSetupDecompress(GifFile);
+}
+
+/******************************************************************************
+ This routine should be called before any attempt to read an image.
+ Note it is assumed the Image desc. header has been read.
+******************************************************************************/
+int
+DGifGetImageDesc(GifFileType *GifFile)
+{
+    GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
+    SavedImage *sp;
+
+    if (!IS_READABLE(Private)) {
+        /* This file was NOT open for reading: */
+        GifFile->Error = D_GIF_ERR_NOT_READABLE;
+        return GIF_ERROR;
+    }
+
+    if (DGifGetImageHeader(GifFile) == GIF_ERROR) {
+        return GIF_ERROR;
+    }
+
     if (GifFile->SavedImages) {
         SavedImage* new_saved_images =
             (SavedImage *)reallocarray(GifFile->SavedImages,
@@ -453,11 +499,7 @@
 
     GifFile->ImageCount++;
 
-    Private->PixelCount = (long)GifFile->Image.Width *
-       (long)GifFile->Image.Height;
-
-    /* Reset decompress algorithm parameters. */
-    return DGifSetupDecompress(GifFile);
+    return GIF_OK;
 }
 
 /******************************************************************************
@@ -550,6 +592,7 @@
     GifByteType Buf;
     GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
 
+    //fprintf(stderr, "### -> DGifGetExtension:\n");
     if (!IS_READABLE(Private)) {
         /* This file was NOT open for reading: */
         GifFile->Error = D_GIF_ERR_NOT_READABLE;
@@ -557,11 +600,12 @@
     }
 
     /* coverity[check_return] */
-    if (READ(GifFile, &Buf, 1) != 1) {
+    if (InternalRead(GifFile, &Buf, 1) != 1) {
         GifFile->Error = D_GIF_ERR_READ_FAILED;
         return GIF_ERROR;
     }
     *ExtCode = Buf;
+    //fprintf(stderr, "### <- DGifGetExtension: %02x, about to call next\n", Buf);
 
     return DGifGetExtensionNext(GifFile, Extension);
 }
@@ -577,20 +621,24 @@
     GifByteType Buf;
     GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
 
-    if (READ(GifFile, &Buf, 1) != 1) {
+    //fprintf(stderr, "### -> DGifGetExtensionNext\n");
+    if (InternalRead(GifFile, &Buf, 1) != 1) {
         GifFile->Error = D_GIF_ERR_READ_FAILED;
         return GIF_ERROR;
     }
+    //fprintf(stderr, "### DGifGetExtensionNext sees %d\n", Buf);
+
     if (Buf > 0) {
         *Extension = Private->Buf;    /* Use private unused buffer. */
         (*Extension)[0] = Buf;  /* Pascal strings notation (pos. 0 is len.). */
         /* coverity[tainted_data,check_return] */
-        if (READ(GifFile, &((*Extension)[1]), Buf) != Buf) {
+        if (InternalRead(GifFile, &((*Extension)[1]), Buf) != Buf) {
             GifFile->Error = D_GIF_ERR_READ_FAILED;
             return GIF_ERROR;
         }
     } else
         *Extension = NULL;
+    //fprintf(stderr, "### <- DGifGetExtensionNext: %p\n", Extension);
 
     return GIF_OK;
 }
@@ -707,7 +755,7 @@
     unsigned char c[2];
 
     /* coverity[check_return] */
-    if (READ(GifFile, c, 2) != 2) {
+    if (InternalRead(GifFile, c, 2) != 2) {
         GifFile->Error = D_GIF_ERR_READ_FAILED;
         return GIF_ERROR;
     }
@@ -752,7 +800,7 @@
 
     /* coverity[tainted_data_argument] */
     /* coverity[check_return] */
-    if (READ(GifFile, &Buf, 1) != 1) {
+    if (InternalRead(GifFile, &Buf, 1) != 1) {
         GifFile->Error = D_GIF_ERR_READ_FAILED;
         return GIF_ERROR;
     }
@@ -762,7 +810,7 @@
         *CodeBlock = Private->Buf;    /* Use private unused buffer. */
         (*CodeBlock)[0] = Buf;  /* Pascal strings notation (pos. 0 is len.). */
         /* coverity[tainted_data] */
-        if (READ(GifFile, &((*CodeBlock)[1]), Buf) != Buf) {
+        if (InternalRead(GifFile, &((*CodeBlock)[1]), Buf) != Buf) {
             GifFile->Error = D_GIF_ERR_READ_FAILED;
             return GIF_ERROR;
         }
@@ -787,7 +835,7 @@
     GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
 
     /* coverity[check_return] */
-    if (READ(GifFile, &CodeSize, 1) < 1) {    /* Read Code size from file. */
+    if (InternalRead(GifFile, &CodeSize, 1) < 1) {    /* Read Code size from file. */
         return GIF_ERROR;    /* Failed to read Code size. */
     }
     BitsPerPixel = CodeSize;
@@ -921,7 +969,7 @@
                 while (StackPtr != 0 && i < LineLen)
                     Line[i++] = Stack[--StackPtr];
             }
-            if (LastCode != NO_SUCH_CODE && Prefix[Private->RunningCode - 2] == NO_SUCH_CODE) {
+            if (LastCode != NO_SUCH_CODE && Private->RunningCode - 2 < LZ_MAX_CODE && Prefix[Private->RunningCode - 2] == NO_SUCH_CODE) {
                 Prefix[Private->RunningCode - 2] = LastCode;
 
                 if (CrntCode == Private->RunningCode - 2) {
@@ -1069,7 +1117,7 @@
     if (Buf[0] == 0) {
         /* Needs to read the next buffer - this one is empty: */
         /* coverity[check_return] */
-        if (READ(GifFile, Buf, 1) != 1) {
+        if (InternalRead(GifFile, Buf, 1) != 1) {
             GifFile->Error = D_GIF_ERR_READ_FAILED;
             return GIF_ERROR;
         }
@@ -1081,7 +1129,7 @@
             GifFile->Error = D_GIF_ERR_IMAGE_DEFECT;
             return GIF_ERROR;
         }
-        if (READ(GifFile, &Buf[1], Buf[0]) != Buf[0]) {
+        if (InternalRead(GifFile, &Buf[1], Buf[0]) != Buf[0]) {
             GifFile->Error = D_GIF_ERR_READ_FAILED;
             return GIF_ERROR;
         }
@@ -1124,7 +1172,7 @@
 
               sp = &GifFile->SavedImages[GifFile->ImageCount - 1];
               /* Allocate memory for the image */
-              if (sp->ImageDesc.Width < 0 && sp->ImageDesc.Height < 0 &&
+              if (sp->ImageDesc.Width <= 0 || sp->ImageDesc.Height <= 0 ||
                       sp->ImageDesc.Width > (INT_MAX / sp->ImageDesc.Height)) {
                   return GIF_ERROR;
               }
@@ -1184,9 +1232,11 @@
                       == GIF_ERROR)
                       return (GIF_ERROR);
               }
-              while (ExtData != NULL) {
+              for (;;) {
                   if (DGifGetExtensionNext(GifFile, &ExtData) == GIF_ERROR)
                       return (GIF_ERROR);
+                  if (ExtData == NULL)
+                      break;
                   /* Continue the extension block */
                   if (ExtData != NULL)
                       if (GifAddExtensionBlock(&GifFile->ExtensionBlockCount,
--- a/src/java.desktop/share/native/libsplashscreen/giflib/gif_hash.h	Tue Apr 02 11:05:08 2019 +0800
+++ b/src/java.desktop/share/native/libsplashscreen/giflib/gif_hash.h	Tue Apr 02 10:57:57 2019 +0530
@@ -31,6 +31,11 @@
 #ifndef _GIF_HASH_H_
 #define _GIF_HASH_H_
 
+/** Begin JDK modifications to support building on Windows **/
+#ifndef _WIN32
+#include <unistd.h>
+#endif
+/** End JDK modifications to support building on Windows **/
 #include <stdint.h>
 
 #define HT_SIZE         8192    /* 12bits = 4096 or twice as big! */
--- a/src/java.desktop/share/native/libsplashscreen/giflib/gif_lib.h	Tue Apr 02 11:05:08 2019 +0800
+++ b/src/java.desktop/share/native/libsplashscreen/giflib/gif_lib.h	Tue Apr 02 10:57:57 2019 +0530
@@ -37,19 +37,21 @@
 
 #define GIFLIB_MAJOR 5
 #define GIFLIB_MINOR 1
-#define GIFLIB_RELEASE 4
+#define GIFLIB_RELEASE 8
 
 #define GIF_ERROR   0
 #define GIF_OK      1
 
 #include <stddef.h>
-
+/** Begin JDK modifications to support building using old compilers**/
+//#include <stdbool.h>
 #ifdef bool
 #undef bool
 #endif
 typedef int bool;
 #define false 0
 #define true 1
+/** End JDK modifications to support building using old compilers**/
 
 #define GIF_STAMP "GIFVER"          /* First chars in file - GIF stamp.  */
 #define GIF_STAMP_LEN sizeof(GIF_STAMP) - 1
@@ -88,7 +90,7 @@
 #define COMMENT_EXT_FUNC_CODE     0xfe    /* comment */
 #define GRAPHICS_EXT_FUNC_CODE    0xf9    /* graphics control (GIF89) */
 #define PLAINTEXT_EXT_FUNC_CODE   0x01    /* plaintext */
-#define APPLICATION_EXT_FUNC_CODE 0xff    /* application block */
+#define APPLICATION_EXT_FUNC_CODE 0xff    /* application block (GIF89) */
 } ExtensionBlock;
 
 typedef struct SavedImage {
@@ -230,10 +232,10 @@
 /* These are legacy.  You probably do not want to call them directly */
 int DGifGetScreenDesc(GifFileType *GifFile);
 int DGifGetRecordType(GifFileType *GifFile, GifRecordType *GifType);
+int DGifGetImageHeader(GifFileType *GifFile);
 int DGifGetImageDesc(GifFileType *GifFile);
 int DGifGetLine(GifFileType *GifFile, GifPixelType *GifLine, int GifLineLen);
 int DGifGetPixel(GifFileType *GifFile, GifPixelType GifPixel);
-int DGifGetComment(GifFileType *GifFile, char *GifComment);
 int DGifGetExtension(GifFileType *GifFile, int *GifExtCode,
                      GifByteType **GifExtension);
 int DGifGetExtensionNext(GifFileType *GifFile, GifByteType **GifExtension);
@@ -241,6 +243,7 @@
                 GifByteType **GifCodeBlock);
 int DGifGetCodeNext(GifFileType *GifFile, GifByteType **GifCodeBlock);
 int DGifGetLZCodes(GifFileType *GifFile, int *GifCode);
+const char *DGifGetGifVersion(GifFileType *GifFile);
 
 
 /******************************************************************************
@@ -274,9 +277,6 @@
                                      GifPixelType ColorTransIn2[]);
 extern int GifBitSize(int n);
 
-extern void * reallocarray(void *optr, size_t nmemb, size_t size);
-
-
 /******************************************************************************
  Support for the in-core structures allocation (slurp mode).
 ******************************************************************************/
--- a/src/java.desktop/share/native/libsplashscreen/giflib/gif_lib_private.h	Tue Apr 02 11:05:08 2019 +0800
+++ b/src/java.desktop/share/native/libsplashscreen/giflib/gif_lib_private.h	Tue Apr 02 10:57:57 2019 +0530
@@ -34,6 +34,10 @@
 #include "gif_lib.h"
 #include "gif_hash.h"
 
+#ifndef SIZE_MAX
+    #define SIZE_MAX     UINTPTR_MAX
+#endif
+
 #define EXTENSION_INTRODUCER      0x21
 #define DESCRIPTOR_INTRODUCER     0x2c
 #define TERMINATOR_INTRODUCER     0x3b
@@ -78,6 +82,11 @@
     bool gif89;
 } GifFilePrivateType;
 
+#ifndef HAVE_REALLOCARRAY
+extern void *openbsd_reallocarray(void *optr, size_t nmemb, size_t size);
+#define reallocarray openbsd_reallocarray
+#endif
+
 #endif /* _GIF_LIB_PRIVATE_H */
 
 /* end */
--- a/src/java.desktop/share/native/libsplashscreen/giflib/gifalloc.c	Tue Apr 02 11:05:08 2019 +0800
+++ b/src/java.desktop/share/native/libsplashscreen/giflib/gifalloc.c	Tue Apr 02 10:57:57 2019 +0530
@@ -33,6 +33,7 @@
 #include <string.h>
 
 #include "gif_lib.h"
+#include "gif_lib_private.h"
 
 #define MAX(x, y)    (((x) > (y)) ? (x) : (y))
 
@@ -348,15 +349,17 @@
 {
     if (GifFile->SavedImages == NULL)
         GifFile->SavedImages = (SavedImage *)malloc(sizeof(SavedImage));
-    else
-        GifFile->SavedImages = (SavedImage *)reallocarray(GifFile->SavedImages,
+    else {
+        SavedImage* newSavedImages = (SavedImage *)reallocarray(GifFile->SavedImages,
                                (GifFile->ImageCount + 1), sizeof(SavedImage));
-
+        if( newSavedImages == NULL)
+            return ((SavedImage *)NULL);
+        GifFile->SavedImages = newSavedImages;
+    }
     if (GifFile->SavedImages == NULL)
         return ((SavedImage *)NULL);
     else {
         SavedImage *sp = &GifFile->SavedImages[GifFile->ImageCount++];
-        memset((char *)sp, '\0', sizeof(SavedImage));
 
         if (CopyFrom != NULL) {
             memcpy((char *)sp, CopyFrom, sizeof(SavedImage));
@@ -368,7 +371,7 @@
              */
 
             /* first, the local color map */
-            if (sp->ImageDesc.ColorMap != NULL) {
+            if (CopyFrom->ImageDesc.ColorMap != NULL) {
                 sp->ImageDesc.ColorMap = GifMakeMapObject(
                                          CopyFrom->ImageDesc.ColorMap->ColorCount,
                                          CopyFrom->ImageDesc.ColorMap->Colors);
@@ -392,7 +395,7 @@
                    CopyFrom->ImageDesc.Width);
 
             /* finally, the extension blocks */
-            if (sp->ExtensionBlocks != NULL) {
+            if (CopyFrom->ExtensionBlocks != NULL) {
                 sp->ExtensionBlocks = (ExtensionBlock *)reallocarray(NULL,
                                       CopyFrom->ExtensionBlockCount,
                                       sizeof(ExtensionBlock));
@@ -404,6 +407,9 @@
                        sizeof(ExtensionBlock) * CopyFrom->ExtensionBlockCount);
             }
         }
+        else {
+            memset((char *)sp, '\0', sizeof(SavedImage));
+        }
 
         return (sp);
     }
--- a/src/java.desktop/share/native/libsplashscreen/giflib/openbsd-reallocarray.c	Tue Apr 02 11:05:08 2019 +0800
+++ b/src/java.desktop/share/native/libsplashscreen/giflib/openbsd-reallocarray.c	Tue Apr 02 10:57:57 2019 +0530
@@ -44,6 +44,10 @@
 #include <stdint.h>
 #include <stdlib.h>
 
+#ifndef SIZE_MAX
+    #define SIZE_MAX     UINTPTR_MAX
+#endif
+
 /*
  * This is sqrt(SIZE_MAX+1), as s1*s2 <= SIZE_MAX
  * if both s1 < MUL_NO_OVERFLOW and s2 < MUL_NO_OVERFLOW
@@ -51,7 +55,7 @@
 #define MUL_NO_OVERFLOW    ((size_t)1 << (sizeof(size_t) * 4))
 
 void *
-reallocarray(void *optr, size_t nmemb, size_t size)
+openbsd_reallocarray(void *optr, size_t nmemb, size_t size)
 {
     if ((nmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) &&
         nmemb > 0 && SIZE_MAX / nmemb < size) {
--- a/src/java.desktop/share/native/libsplashscreen/splashscreen_impl.c	Tue Apr 02 11:05:08 2019 +0800
+++ b/src/java.desktop/share/native/libsplashscreen/splashscreen_impl.c	Tue Apr 02 10:57:57 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -46,7 +46,7 @@
     return &splash;
 }
 
-JNIEXPORT void JNICALL
+JNIEXPORT void
 SplashSetFileJarName(const char* fileName, const char* jarName) {
     Splash *splash = SplashGetInstance();
 
@@ -57,7 +57,7 @@
     splash->jarName = SplashConvertStringAlloc(jarName, &splash->jarNameLen);
 }
 
-JNIEXPORT void JNICALL
+JNIEXPORT void
 SplashInit()
 {
     Splash *splash = SplashGetInstance();
@@ -70,7 +70,7 @@
     SplashInitPlatform(splash);
 }
 
-JNIEXPORT void JNICALL
+JNIEXPORT void
 SplashClose()
 {
     Splash *splash = SplashGetInstance();
@@ -107,7 +107,7 @@
     SplashSetFileJarName(NULL, NULL);
 }
 
-JNIEXPORT void JNICALL
+JNIEXPORT void
 SplashSetScaleFactor(float scaleFactor)
 {
     Splash *splash = SplashGetInstance();
@@ -302,7 +302,7 @@
     return success;
 }
 
-JNIEXPORT int JNICALL
+JNIEXPORT int
 SplashLoadFile(const char *filename)
 {
     SplashStream stream;
@@ -310,7 +310,7 @@
                 SplashLoadStream(&stream);
 }
 
-JNIEXPORT int JNICALL
+JNIEXPORT int
 SplashLoadMemory(void *data, int size)
 {
     SplashStream stream;
@@ -395,7 +395,7 @@
     return 1;
 }
 
-JNIEXPORT int JNICALL
+JNIEXPORT int
 SplashGetScaledImgNameMaxPstfixLen(const char *fileName){
     return strlen(fileName) + strlen("@100pct") + 1;
 }
--- a/src/java.desktop/share/native/libsplashscreen/splashscreen_impl.h	Tue Apr 02 11:05:08 2019 +0800
+++ b/src/java.desktop/share/native/libsplashscreen/splashscreen_impl.h	Tue Apr 02 10:57:57 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,29 +30,29 @@
 #include "splashscreen_gfx.h"
 #include "jni.h"
 
-JNIEXPORT int JNICALL
+JNIEXPORT int
 SplashLoadMemory(void *pdata, int size); /* requires preloading the file */
 
-JNIEXPORT int JNICALL
+JNIEXPORT int
 SplashLoadFile(const char *filename);  // FIXME: range checking for SplashLoadMemory
 
-JNIEXPORT void JNICALL
+JNIEXPORT void
 SplashInit(void);
 
-JNIEXPORT void JNICALL
+JNIEXPORT void
 SplashClose(void);
 
-JNIEXPORT void JNICALL
+JNIEXPORT void
 SplashSetScaleFactor(float);
 
-JNIEXPORT jboolean JNICALL
+JNIEXPORT jboolean
 SplashGetScaledImageName(const char*, const char*,
                               float*, char*, const size_t scaledImageNameLength);
 
-JNIEXPORT void JNICALL
+JNIEXPORT void
 SplashSetFileJarName(const char* fileName, const char* jarName);
 
-JNIEXPORT int JNICALL
+JNIEXPORT int
 SplashGetScaledImgNameMaxPstfixLen(const char*);
 typedef struct SplashImage
 {
--- a/src/java.desktop/unix/classes/sun/awt/X11/XAWTLookAndFeel.java	Tue Apr 02 11:05:08 2019 +0800
+++ b/src/java.desktop/unix/classes/sun/awt/X11/XAWTLookAndFeel.java	Tue Apr 02 10:57:57 2019 +0530
@@ -38,7 +38,7 @@
 import com.sun.java.swing.plaf.motif.*;
 import sun.awt.X11.XComponentPeer;
 
-@SuppressWarnings("serial") // JDK-implementation class
+@SuppressWarnings({"serial", "removal"}) // JDK-implementation class
 class XAWTLookAndFeel extends MotifLookAndFeel {
 
     /**
--- a/src/java.desktop/unix/classes/sun/awt/X11GraphicsDevice.java	Tue Apr 02 11:05:08 2019 +0800
+++ b/src/java.desktop/unix/classes/sun/awt/X11GraphicsDevice.java	Tue Apr 02 10:57:57 2019 +0530
@@ -69,12 +69,6 @@
         this.scale = initScaleFactor();
     }
 
-    /*
-     * Initialize JNI field and method IDs for fields that may be
-     * accessed from C.
-     */
-    private static native void initIDs();
-
     /**
      * Returns the X11 screen of the device.
      */
--- a/src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c	Tue Apr 02 11:05:08 2019 +0800
+++ b/src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c	Tue Apr 02 10:57:57 2019 +0530
@@ -54,11 +54,6 @@
 #include <dlfcn.h>
 #include "Trace.h"
 
-#ifdef NETSCAPE
-#include <signal.h>
-extern int awt_init_xt;
-#endif
-
 #ifndef HEADLESS
 
 int awt_numScreens;     /* Xinerama-aware number of screens */
@@ -151,13 +146,6 @@
     CHECK_NULL(x11GraphicsConfigIDs.aData);
     x11GraphicsConfigIDs.bitsPerPixel = (*env)->GetFieldID (env, cls, "bitsPerPixel", "I");
     CHECK_NULL(x11GraphicsConfigIDs.bitsPerPixel);
-
-    if (x11GraphicsConfigIDs.aData == NULL ||
-            x11GraphicsConfigIDs.bitsPerPixel == NULL) {
-
-            JNU_ThrowNoSuchFieldError(env, "Can't find a field");
-            return;
-        }
 }
 
 #ifndef HEADLESS
@@ -727,26 +715,11 @@
     Display *dpy;
     char errmsg[128];
     int i;
-#ifdef NETSCAPE
-    sigset_t alarm_set, oldset;
-#endif
 
     if (awt_display) {
         return awt_display;
     }
 
-#ifdef NETSCAPE
-    /* Disable interrupts during XtOpenDisplay to avoid bugs in unix os select
-       code: some unix systems don't implement SA_RESTART properly and
-       because of this, select returns with EINTR. Most implementations of
-       gethostbyname don't cope with EINTR properly and as a result we get
-       stuck (forever) in the gethostbyname code
-    */
-    sigemptyset(&alarm_set);
-    sigaddset(&alarm_set, SIGALRM);
-    sigprocmask(SIG_BLOCK, &alarm_set, &oldset);
-#endif
-
     /* Load AWT lock-related methods in SunToolkit */
     klass = (*env)->FindClass(env, "sun/awt/SunToolkit");
     if (klass == NULL) return NULL;
@@ -766,9 +739,6 @@
     }
 
     dpy = awt_display = XOpenDisplay(NULL);
-#ifdef NETSCAPE
-    sigprocmask(SIG_SETMASK, &oldset, NULL);
-#endif
     if (!dpy) {
         jio_snprintf(errmsg,
                      sizeof(errmsg),
--- a/src/java.desktop/unix/native/libsplashscreen/splashscreen_sys.c	Tue Apr 02 11:05:08 2019 +0800
+++ b/src/java.desktop/unix/native/libsplashscreen/splashscreen_sys.c	Tue Apr 02 10:57:57 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -801,7 +801,7 @@
     sendctl(splash, SPLASHCTL_RECONFIGURE);
 }
 
-JNIEXPORT jboolean JNICALL
+JNIEXPORT jboolean
 SplashGetScaledImageName(const char* jarName, const char* fileName,
                            float *scaleFactor, char *scaledImgName,
                            const size_t scaledImageNameLength)
--- a/src/java.desktop/windows/classes/sun/print/PrintServiceLookupProvider.java	Tue Apr 02 11:05:08 2019 +0800
+++ b/src/java.desktop/windows/classes/sun/print/PrintServiceLookupProvider.java	Tue Apr 02 10:57:57 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,8 @@
 
 package sun.print;
 
-import java.io.BufferedReader;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.IOException;
+import java.security.AccessController;
 import java.util.ArrayList;
-import java.security.AccessController;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
 import javax.print.DocFlavor;
 import javax.print.MultiDocPrintService;
 import javax.print.PrintService;
@@ -81,8 +75,9 @@
 
         if (refreshTimeStr != null) {
             try {
-                minRefreshTime = (Integer.valueOf(refreshTimeStr)).intValue();
+                minRefreshTime = Integer.parseInt(refreshTimeStr);
             } catch (NumberFormatException e) {
+                // ignore
             }
             if (minRefreshTime < DEFAULT_MINREFRESH) {
                 minRefreshTime = DEFAULT_MINREFRESH;
@@ -139,7 +134,7 @@
             if (pollServices) {
                 // start the remote printer listener thread
                 Thread remThr = new Thread(null, new RemotePrinterChangeListener(),
-                                        "RemotePrinterListener", 0, false);
+                                           "RemotePrinterListener", 0, false);
                 remThr.setDaemon(true);
                 remThr.start();
             }
@@ -358,6 +353,7 @@
         }
         return defaultPrintService;
     }
+
     class PrinterChangeListener implements Runnable {
         long chgObj;
         PrinterChangeListener() {
@@ -387,10 +383,10 @@
     /* Windows provides *PrinterChangeNotification* functions that provides
        information about printer status changes of the local printers but not
        network printers.
-       Alternatively, Windows provides a way thro' which one can get the
+       Alternatively, Windows provides a way through which one can get the
        network printer status changes by using WMI, RegistryKeyChange combination,
        which is a slightly complex mechanism.
-       The Windows WMI offers an async and sync method to read thro' registry
+       The Windows WMI offers an async and sync method to read through registry
        via the WQL query. The async method is considered dangerous as it leaves
        open a channel until we close it. But the async method has the advantage of
        being notified of a change in registry by calling callback without polling for it.
@@ -398,18 +394,17 @@
        RegistryValueChange cannot be used in combination with WMI to get registry
        value change notification because of an error that may be generated because the
        scope of the query would be too big to handle(at times).
-       Hence an alternative mechanism is choosen via the EnumPrinters by polling for the
+       Hence an alternative mechanism is chosen via the EnumPrinters by polling for the
        count of printer status changes(add\remove) and based on it update the printers
        list.
     */
     class RemotePrinterChangeListener implements Runnable {
-        private String[] prevRemotePrinters = null;
+        private String[] prevRemotePrinters;
 
         RemotePrinterChangeListener() {
-            prevRemotePrinters = getRemotePrintersNames();
         }
 
-        boolean doCompare(String[] str1, String[] str2) {
+        private boolean doCompare(String[] str1, String[] str2) {
             if (str1 == null && str2 == null) {
                 return false;
             } else if (str1 == null || str2 == null) {
@@ -419,8 +414,8 @@
             if (str1.length != str2.length) {
                 return true;
             } else {
-                for (int i = 0;i < str1.length;i++) {
-                    for (int j = 0;j < str2.length;j++) {
+                for (int i = 0; i < str1.length; i++) {
+                    for (int j = 0; j < str2.length; j++) {
                         // skip if both are nulls
                         if (str1[i] == null && str2[j] == null) {
                             continue;
@@ -445,27 +440,26 @@
 
         @Override
         public void run() {
-            while (true) {
-                if (prevRemotePrinters != null && prevRemotePrinters.length > 0) {
-                    String[] currentRemotePrinters = getRemotePrintersNames();
-                    if (doCompare(prevRemotePrinters, currentRemotePrinters)) {
+            // Init the list of remote printers
+            prevRemotePrinters = getRemotePrintersNames();
 
-                        // updated the printers data
-                        // printers list now contains both local and network printer data
-                        refreshServices();
-
-                        // store the current data for next comparison
-                        prevRemotePrinters = currentRemotePrinters;
-                    }
-                } else {
-                    prevRemotePrinters = getRemotePrintersNames();
-                }
-
+            while (true) {
                 try {
                     Thread.sleep(minRefreshTime * 1000);
                 } catch (InterruptedException e) {
                     break;
                 }
+
+                String[] currentRemotePrinters = getRemotePrintersNames();
+                if (doCompare(prevRemotePrinters, currentRemotePrinters)) {
+                    // The list of remote printers got updated,
+                    // so update the cached list printers which
+                    // includes both local and network printers
+                    refreshServices();
+
+                    // store the current data for next comparison
+                    prevRemotePrinters = currentRemotePrinters;
+                }
             }
         }
     }
--- a/src/java.desktop/windows/native/libawt/windows/WPrinterJob.cpp	Tue Apr 02 11:05:08 2019 +0800
+++ b/src/java.desktop/windows/native/libawt/windows/WPrinterJob.cpp	Tue Apr 02 10:57:57 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -118,10 +118,7 @@
 }
 
 
-JNIEXPORT jobjectArray JNICALL
-Java_sun_print_PrintServiceLookupProvider_getAllPrinterNames(JNIEnv *env,
-                                                          jobject peer)
-{
+static jobjectArray getPrinterNames(JNIEnv *env, DWORD flags) {
     TRY;
 
     DWORD cbNeeded = 0;
@@ -136,10 +133,10 @@
     jobjectArray nameArray;
 
     try {
-        ::EnumPrinters(PRINTER_ENUM_LOCAL | PRINTER_ENUM_CONNECTIONS,
+        ::EnumPrinters(flags,
                        NULL, 4, NULL, 0, &cbNeeded, &cReturned);
         pPrinterEnum = new BYTE[cbNeeded];
-        ::EnumPrinters(PRINTER_ENUM_LOCAL | PRINTER_ENUM_CONNECTIONS,
+        ::EnumPrinters(flags,
                        NULL, 4, pPrinterEnum, cbNeeded, &cbNeeded,
                        &cReturned);
 
@@ -174,6 +171,20 @@
     CATCH_BAD_ALLOC_RET(NULL);
 }
 
+JNIEXPORT jobjectArray JNICALL
+Java_sun_print_PrintServiceLookupProvider_getAllPrinterNames(JNIEnv *env,
+                                                             jobject peer)
+{
+    return getPrinterNames(env, PRINTER_ENUM_LOCAL | PRINTER_ENUM_CONNECTIONS);
+}
+
+JNIEXPORT jobjectArray JNICALL
+Java_sun_print_PrintServiceLookupProvider_getRemotePrintersNames(JNIEnv *env,
+                                                                 jobject peer)
+{
+    return getPrinterNames(env, PRINTER_ENUM_CONNECTIONS);
+}
+
 
 JNIEXPORT jlong JNICALL
 Java_sun_print_PrintServiceLookupProvider_notifyFirstPrinterChange(JNIEnv *env,
@@ -232,82 +243,6 @@
     }
 }
 
-JNIEXPORT jobjectArray JNICALL
-Java_sun_print_PrintServiceLookupProvider_getRemotePrintersNames(JNIEnv *env,
-                                                           jobject peer)
-{
-    TRY;
-
-    int remotePrintersCount = 0;
-    DWORD cbNeeded = 0;
-    DWORD cReturned = 0;
-    LPBYTE pPrinterEnum = NULL;
-    LPBYTE pNetworkPrinterLoc = NULL;
-
-    jstring utf_str;
-    jclass clazz = env->FindClass("java/lang/String");
-    if (clazz == NULL) {
-        return NULL;
-    }
-    jobjectArray nameArray = NULL;
-
-    try {
-        ::EnumPrinters(PRINTER_ENUM_LOCAL | PRINTER_ENUM_CONNECTIONS,
-                       NULL, 4, NULL, 0, &cbNeeded, &cReturned);
-        pPrinterEnum = new BYTE[cbNeeded];
-        pNetworkPrinterLoc = new BYTE[cbNeeded/sizeof(PRINTER_INFO_4)];
-        ::EnumPrinters(PRINTER_ENUM_LOCAL | PRINTER_ENUM_CONNECTIONS,
-                       NULL, 4, pPrinterEnum, cbNeeded, &cbNeeded,
-                       &cReturned);
-
-        if (cReturned > 0) {
-            for (DWORD i = 0; i < cReturned; i++) {
-                PRINTER_INFO_4 *info4 = (PRINTER_INFO_4 *) (pPrinterEnum + i * sizeof(PRINTER_INFO_4));
-
-                // Store the network printers indexes
-                if (info4->Attributes & PRINTER_ATTRIBUTE_NETWORK) {
-                    pNetworkPrinterLoc[remotePrintersCount++] = i;
-                }
-            }
-
-            // return remote printers only if the list contains it.
-            if (remotePrintersCount > 0) {
-                // Allocate space only for the network type printers
-                nameArray = env->NewObjectArray(remotePrintersCount, clazz, NULL);
-                if (nameArray == NULL) {
-                    throw std::bad_alloc();
-                }
-            }
-        }
-
-        // Loop thro' network printers list only
-        for (int i = 0; i < remotePrintersCount; i++) {
-            PRINTER_INFO_4 *info4 = (PRINTER_INFO_4 *)
-                (pPrinterEnum + pNetworkPrinterLoc[i] * sizeof(PRINTER_INFO_4));
-            utf_str = JNU_NewStringPlatform(env, info4->pPrinterName);
-            if (utf_str == NULL) {
-                throw std::bad_alloc();
-            }
-            env->SetObjectArrayElement(nameArray, i, utf_str);
-            env->DeleteLocalRef(utf_str);
-        }
-    } catch (std::bad_alloc&) {
-        delete [] pPrinterEnum;
-        delete [] pNetworkPrinterLoc;
-        throw;
-    }
-
-    delete [] pPrinterEnum;
-    delete [] pNetworkPrinterLoc;
-
-    if (nameArray != NULL) {
-      return nameArray;
-    } else {
-      return env->NewObjectArray(0, clazz, NULL);
-    }
-
-    CATCH_BAD_ALLOC_RET(NULL);
-}
 
 JNIEXPORT jfloatArray JNICALL
 Java_sun_print_Win32PrintService_getMediaPrintableArea(JNIEnv *env,
--- a/src/java.desktop/windows/native/libsplashscreen/splashscreen_sys.c	Tue Apr 02 11:05:08 2019 +0800
+++ b/src/java.desktop/windows/native/libsplashscreen/splashscreen_sys.c	Tue Apr 02 10:57:57 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -574,7 +574,7 @@
     PostMessage(splash->hWnd, WM_SPLASHRECONFIGURE, 0, 0);
 }
 
-JNIEXPORT jboolean JNICALL
+JNIEXPORT jboolean
 SplashGetScaledImageName(const char* jarName, const char* fileName,
                            float *scaleFactor, char *scaleImageName,
                            const size_t scaledImageLength)
--- a/test/jdk/ProblemList.txt	Tue Apr 02 11:05:08 2019 +0800
+++ b/test/jdk/ProblemList.txt	Tue Apr 02 10:57:57 2019 +0530
@@ -219,6 +219,7 @@
 java/awt/font/TextLayout/TextLayoutBounds.java 8169188 generic-all
 java/awt/font/StyledMetrics/BoldSpace.java 8198422 linux-all
 java/awt/FontMetrics/FontCrash.java 8198336 windows-all
+java/awt/FontMetrics/MaxAdvanceIsMax.java 8221305 solaris-all,macosx-all
 java/awt/image/DrawImage/IncorrectAlphaSurface2SW.java 8056077 generic-all
 java/awt/image/DrawImage/IncorrectClipXorModeSW2Surface.java 8196025 windows-all
 java/awt/image/DrawImage/IncorrectClipXorModeSurface2Surface.java 8196025 windows-all
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/awt/Robot/CheckCommonColors/CheckCommonColors.java	Tue Apr 02 10:57:57 2019 +0530
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Color;
+import java.awt.Frame;
+import java.awt.Point;
+import java.awt.Robot;
+import java.util.List;
+
+/**
+ * @test
+ * @key headful
+ * @bug 8215105
+ * @summary tests that Robot can capture the common colors without artifacts
+ */
+public final class CheckCommonColors {
+
+    private static final Frame frame = new Frame();
+    private static Robot robot;
+
+    public static void main(final String[] args) throws Exception {
+        robot = new Robot();
+        try {
+            test();
+        } finally {
+            frame.dispose();
+        }
+    }
+
+    private static void test() {
+        frame.setSize(400, 400);
+        frame.setLocationRelativeTo(null);
+        frame.setUndecorated(true);
+        for (final Color color : List.of(Color.WHITE, Color.LIGHT_GRAY,
+                                         Color.GRAY, Color.DARK_GRAY,
+                                         Color.BLACK, Color.RED, Color.PINK,
+                                         Color.ORANGE, Color.YELLOW,
+                                         Color.GREEN, Color.MAGENTA, Color.CYAN,
+                                         Color.BLUE)) {
+            frame.dispose();
+            frame.setBackground(color);
+            frame.setVisible(true);
+            checkPixels(color);
+        }
+    }
+
+    private static void checkPixels(final Color color) {
+        int attempt = 0;
+        while (true) {
+            Point p = frame.getLocationOnScreen();
+            Color pixel = robot.getPixelColor(p.x + frame.getWidth() / 2,
+                                              p.y + frame.getHeight() / 2);
+            if (color.equals(pixel)) {
+                return;
+            }
+            if (attempt > 10) {
+                System.err.println("Expected: " + color);
+                System.err.println("Actual: " + pixel);
+                throw new RuntimeException("Too many attempts: " + attempt);
+            }
+            // skip Robot.waitForIdle to speedup the common case, but also take
+            // care about slow systems
+            robot.delay((int) Math.pow(2.2, attempt++));
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/beans/Introspector/Test8221244.java	Tue Apr 02 10:57:57 2019 +0530
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8221244
+ * @summary Unexpected behavior of PropertyDescription.getReadMethod for boolean properties
+ */
+
+import java.beans.PropertyDescriptor;
+
+public class Test8221244 {
+
+    public static void main(String[] args) {
+        test("bv", "isBv"); // boolean value
+        test("bo", "getBo"); // Boolean object
+        test("io", "getIo"); // Integer object
+    }
+
+    private static void test(String propertyName, String expectedGetterName) {
+        PropertyDescriptor pd = BeanUtils.getPropertyDescriptor(TestBean.class, propertyName);
+        String getterName = pd.getReadMethod().getName();
+        if (!getterName.equals(expectedGetterName)) {
+            throw new Error("unexpected getter: " + getterName);
+        }
+    }
+}
+
+/*
+ * Bean class with multiple properties (each property has "is"/"get" getters)
+ *
+ * For boolean properties, the "is" getter should be used
+ */
+class TestBean {
+
+    // boolean value
+    private boolean bv;
+
+    public boolean isBv() {
+        return bv;
+    }
+
+    public boolean getBv() {
+        return bv;
+    }
+
+    // Boolean object
+    private Boolean bo;
+    public Boolean isBo() {
+        return bo;
+    }
+    public Boolean getBo() {
+        return bo;
+    }
+
+    // Integer object
+    private Integer io;
+    public Integer isIo() {
+        return io;
+    }
+    public Integer getIo() {
+        return io;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/javax/sound/sampled/Lines/ToString.java	Tue Apr 02 10:57:57 2019 +0530
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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 bug.javax.sound.sampled;
+
+import javax.sound.sampled.Clip;
+import javax.sound.sampled.DataLine;
+import javax.sound.sampled.Line;
+import javax.sound.sampled.Mixer;
+import javax.sound.sampled.Port;
+import javax.sound.sampled.SourceDataLine;
+import javax.sound.sampled.TargetDataLine;
+
+/**
+ * @test
+ * @bug 8221436
+ * @run main/othervm bug.javax.sound.sampled.ToString
+ */
+public final class ToString {
+
+    public static void main(final String[] args) {
+
+        // Behavior of toString() methods is not specified, the checks in
+        // this test just defends against accidental changes.
+
+        String custom = new Line.Info(ToString.class).toString();
+        if (!custom.contains("bug.javax.sound.sampled")) {
+            throw new RuntimeException("Package is missing: " + custom);
+        }
+        String ints = new Line.Info(int.class).toString();
+        if (ints.contains("javax.sound.sampled")) {
+            throw new RuntimeException("Package is present: " + ints);
+        }
+        String array = new Line.Info(int[].class).toString();
+        if (array.contains("javax.sound.sampled")) {
+            throw new RuntimeException("Package is present: " + array);
+        }
+
+        String line = new Line.Info(Line.class).toString();
+        if (!line.equals("interface Line")) {
+            throw new RuntimeException("Wrong string: " + line);
+        }
+        String target = new Line.Info(TargetDataLine.class).toString();
+        if (!target.equals("interface TargetDataLine")) {
+            throw new RuntimeException("Wrong string: " + target);
+        }
+        String source = new Line.Info(SourceDataLine.class).toString();
+        if (!source.equals("interface SourceDataLine")) {
+            throw new RuntimeException("Wrong string: " + source);
+        }
+        String port = new Line.Info(Port.class).toString();
+        if (!port.equals("interface Port")) {
+            throw new RuntimeException("Wrong string: " + port);
+        }
+        String data = new Line.Info(DataLine.class).toString();
+        if (!data.equals("interface DataLine")) {
+            throw new RuntimeException("Wrong string: " + data);
+        }
+        String mixer = new Line.Info(Mixer.class).toString();
+        if (!mixer.equals("interface Mixer")) {
+            throw new RuntimeException("Wrong string: " + mixer);
+        }
+        String clip = new Line.Info(Clip.class).toString();
+        if (!clip.equals("interface Clip")) {
+            throw new RuntimeException("Wrong string: " + clip);
+        }
+
+        String dataLine = new DataLine.Info(DataLine.class, null, 0).toString();
+        if (!dataLine.contains("interface DataLine")) {
+            throw new RuntimeException("Wrong string: " + dataLine);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/javax/swing/JMenuItem/8216971/DoubleActionTest.java	Tue Apr 02 10:57:57 2019 +0530
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @key headful
+ * @bug 8216971
+ * @summary For JCheckBoxMenuItem actionPerformed() is called twice, when
+ *  apple.laf.useScreenMenuBar=true and modifier is InputEvent.META_DOWN_MASK
+ * @library /test/lib
+ * @run main DoubleActionTest
+ */
+
+import javax.swing.JFrame;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JCheckBoxMenuItem;
+import javax.swing.SwingUtilities;
+import javax.swing.AbstractAction;
+import javax.swing.Action;
+import javax.swing.KeyStroke;
+import java.awt.event.ActionEvent;
+import java.awt.event.InputEvent;
+import java.awt.event.KeyEvent;
+import java.awt.Robot;
+import jdk.test.lib.Platform;
+
+public class DoubleActionTest {
+
+    private static int metaDownCount = 0;
+    private static JFrame frame;
+    private static final int ORIGIN_X = 200;
+    private static final int ORIGIN_Y = 200;
+
+    public static void main(String[] args) throws Exception {
+        if (!System.getProperty("os.name").startsWith("Mac")) {
+            System.out.println("This test is only for Mac OS, passed " +
+            "automatically on other platforms.");
+            return;
+        }
+
+        try {
+            System.setProperty("apple.laf.useScreenMenuBar", "true");
+
+            SwingUtilities.invokeAndWait(DoubleActionTest::createAndShowGUI);
+
+            Robot robot = new Robot();
+            robot.setAutoDelay(100);
+            testKeyPress(robot);
+            robot.delay(1000);
+
+        } finally {
+            SwingUtilities.invokeAndWait(()->frame.dispose());
+            if (metaDownCount != 1) {
+                throw new RuntimeException("Test Failed: actionPerformed is called twice");
+            }
+        }
+    }
+
+    private static void createAndShowGUI() {
+        frame = new JFrame();
+        final JMenuBar menubar = new JMenuBar();
+        final JMenu fileMenu = new JMenu("OPEN ME");
+        final MyAction myAction = new MyAction();
+        final JCheckBoxMenuItem menuItem = new JCheckBoxMenuItem(myAction);
+
+        fileMenu.add(menuItem);
+        menubar.add(fileMenu);
+        frame.setJMenuBar(menubar);
+        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        frame.setBounds(ORIGIN_X, ORIGIN_X, 200, 200);
+        frame.setVisible(true);
+    }
+
+    private static class MyAction extends AbstractAction {
+
+        MyAction() {
+            putValue(Action.NAME, "HIT MY ACCELERATOR KEY");
+            putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_E, InputEvent.META_DOWN_MASK));
+        }
+
+        @Override
+        public void actionPerformed(final ActionEvent e) {
+            System.out.println("Action! called with modifiers: " + e.getModifiers() + "\n" + e);
+            metaDownCount++;
+        }
+    }
+
+    private static void testKeyPress(Robot robot) throws Exception {
+        robot.mouseMove(ORIGIN_X + 50, ORIGIN_Y + 50);
+        robot.waitForIdle();
+        robot.keyPress(KeyEvent.VK_META);
+        robot.keyPress(KeyEvent.VK_E);
+        robot.keyRelease(KeyEvent.VK_E);
+        robot.keyRelease(KeyEvent.VK_META);
+        robot.waitForIdle();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/javax/swing/JTextArea/JTextAreaWordWrapTest.java	Tue Apr 02 10:57:57 2019 +0530
@@ -0,0 +1,116 @@
+/*
+ * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* @test
+ * @key headful
+ * @bug 8212904
+ * @summary Verifies JTextArea line wrapping using UI scale
+ * @run main JTextAreaWordWrapTest
+ */
+import java.awt.BorderLayout;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.io.IOException;
+import java.net.URISyntaxException;
+import javax.swing.JFrame;
+import javax.swing.JScrollPane;
+import javax.swing.JTextArea;
+import javax.swing.ScrollPaneConstants;
+import javax.swing.SwingUtilities;
+
+public class JTextAreaWordWrapTest {
+
+    static JFrame frame;
+    static JFrame frame1;
+    static JTextArea textArea;
+    static JTextArea textArea1;
+
+    public static void doWrapOnTest() {
+
+        frame = new JFrame();
+        frame.setSize( 720, 300 );
+        frame.setLayout( new BorderLayout() );
+
+        textArea = new JTextArea();
+        textArea.setLineWrap( true );
+        textArea.setWrapStyleWord( true );
+
+        StringBuffer sb = new StringBuffer();
+        for (int i = 0; i < 100; i++) {
+            sb.append( "zz zzz zzzz zz zz zz zzz xzzzz zzzzzzzzzzzzzzzzx yyyyyyy tttttttttt sssss hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh\n" );
+        }
+        textArea.setText( sb.toString() );
+        JScrollPane pane = new JScrollPane( textArea,
+                                            ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
+                                            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED );
+        frame.add( pane, BorderLayout.CENTER );
+        frame.setVisible( true );
+
+    }
+
+    public static void doWrapOffTest() {
+        frame1 = new JFrame();
+        frame1.setSize( 720, 300 );
+        frame1.setLayout( new BorderLayout() );
+
+        textArea1 = new JTextArea();
+
+        StringBuffer sb1 = new StringBuffer();
+        for (int i = 0; i < 100; i++) {
+            sb1.append( "zz zzz zzzz zz zz zz zzz xzzzz zzzzzzzzzzzzzzzzx yyyyyyy tttttttttt sssss hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh\n" );
+        }
+        textArea1.setText( sb1.toString() );
+        JScrollPane pane1 = new JScrollPane( textArea1,
+                                             ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
+                                             ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED );
+        frame1.add( pane1, BorderLayout.CENTER );
+        frame1.setLocationRelativeTo(null);
+        frame1.setVisible( true );
+    }
+
+    public static void main( String[] args ) throws Exception {
+        System.setProperty( "sun.java2d.uiScale", "1.25" );
+        try {
+            SwingUtilities.invokeAndWait(() -> doWrapOnTest());
+            Thread.sleep(500);
+            SwingUtilities.invokeAndWait(() -> doWrapOffTest());
+            Thread.sleep(500);
+
+            SwingUtilities.invokeAndWait(() -> {
+
+                int wraponHeight = textArea.getHeight();
+                System.out.println("wraponheight " + wraponHeight);
+                int wrapoffHeight = textArea1.getHeight();
+                System.out.println("wrapoffheight " + wrapoffHeight);
+
+                if (wraponHeight == wrapoffHeight) {
+                    throw new RuntimeException("JTextArea line wrapping incorrect when using UI scale");
+                }
+            });
+
+        } finally {
+            SwingUtilities.invokeAndWait(() -> frame.dispose());
+            SwingUtilities.invokeAndWait(() -> frame1.dispose());
+        }
+    }
+}