Merge
authorprr
Tue, 20 Feb 2018 13:30:49 -0800
changeset 49093 ca29679eafe5
parent 49092 6dc5e0cdb44c (diff)
parent 48923 b75c9e2e3b1f (current diff)
child 49094 ca51cc708843
Merge
make/devkit/createSolarisDevkit.sh
--- a/src/java.desktop/share/classes/javax/swing/JList.java	Tue Feb 20 21:47:54 2018 +0100
+++ b/src/java.desktop/share/classes/javax/swing/JList.java	Tue Feb 20 13:30:49 2018 -0800
@@ -2359,6 +2359,7 @@
 
     /**
      * Selects the specified object from the list.
+     * If the object passed is {@code null}, the selection is cleared.
      *
      * @param anObject      the object to select
      * @param shouldScroll  {@code true} if the list should scroll to display
@@ -2366,7 +2367,7 @@
      */
     public void setSelectedValue(Object anObject,boolean shouldScroll) {
         if(anObject == null)
-            setSelectedIndex(-1);
+            clearSelection();
         else if(!anObject.equals(getSelectedValue())) {
             int i,c;
             ListModel<E> dm = getModel();
--- a/src/java.desktop/share/classes/javax/swing/RepaintManager.java	Tue Feb 20 21:47:54 2018 +0100
+++ b/src/java.desktop/share/classes/javax/swing/RepaintManager.java	Tue Feb 20 13:30:49 2018 -0800
@@ -110,6 +110,8 @@
 
     private Dimension doubleBufferMaxSize;
 
+    private boolean isCustomMaxBufferSizeSet = false;
+
     // Support for both the standard and volatile offscreen buffers exists to
     // provide backwards compatibility for the [rare] programs which may be
     // calling getOffScreenBuffer() and not expecting to get a VolatileImage.
@@ -335,7 +337,13 @@
     }
 
     private void displayChanged() {
-        clearImages();
+        if (isCustomMaxBufferSizeSet) {
+            clearImages();
+        } else {
+            // Reset buffer maximum size to get valid size from updated graphics
+            // environment in getDoubleBufferMaximumSize()
+            setDoubleBufferMaximumSize(null);
+        }
     }
 
     /**
@@ -1156,8 +1164,10 @@
     public void setDoubleBufferMaximumSize(Dimension d) {
         doubleBufferMaxSize = d;
         if (doubleBufferMaxSize == null) {
+            isCustomMaxBufferSizeSet = false;
             clearImages();
         } else {
+            isCustomMaxBufferSizeSet = true;
             clearImages(d.width, d.height);
         }
     }
--- a/src/java.desktop/unix/classes/sun/java2d/xr/XRBackendNative.java	Tue Feb 20 21:47:54 2018 +0100
+++ b/src/java.desktop/unix/classes/sun/java2d/xr/XRBackendNative.java	Tue Feb 20 13:30:49 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 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
@@ -149,7 +149,7 @@
 
         XRColor c = new XRColor();
         for (int i = 0; i < pixels.length; i++) {
-            c.setColorValues(pixels[i], true);
+            c.setColorValues(pixels[i]);
             renderColors[i * 4 + 0] = (short) c.alpha;
             renderColors[i * 4 + 1] = (short) c.red;
             renderColors[i * 4 + 2] = (short) c.green;
--- a/src/java.desktop/unix/classes/sun/java2d/xr/XRColor.java	Tue Feb 20 21:47:54 2018 +0100
+++ b/src/java.desktop/unix/classes/sun/java2d/xr/XRColor.java	Tue Feb 20 13:30:49 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 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
@@ -73,7 +73,7 @@
         XRColor c = new XRColor();
 
         for (int i = 0; i < pixels.length; i++) {
-            c.setColorValues(pixels[i], true);
+            c.setColorValues(pixels[i]);
             colorValues[i * 4 + 0] = c.alpha;
             colorValues[i * 4 + 1] = c.red;
             colorValues[i * 4 + 2] = c.green;
@@ -83,7 +83,7 @@
         return colorValues;
     }
 
-    public void setColorValues(int pixel, boolean pre) {
+    public void setColorValues(int pixel) {
         long pix = XRUtils.intToULong(pixel);
         alpha = (int) (((pix & 0xFF000000) >> 16) + 255);
         red = (int) (((pix & 0x00FF0000) >> 8) + 255);
@@ -93,13 +93,6 @@
         if (alpha == 255) {
             alpha = 0;
         }
-
-        if (!pre) {
-            double alphaMult = XRUtils.XFixedToDouble(alpha);
-            this.red = (int) (red * alphaMult);
-            this.green = (int) (green * alphaMult);
-            this.blue = (int) (blue * alphaMult);
-        }
     }
 
     public static int byteToXRColorValue(int byteValue) {
--- a/src/java.desktop/unix/classes/sun/java2d/xr/XRCompositeManager.java	Tue Feb 20 21:47:54 2018 +0100
+++ b/src/java.desktop/unix/classes/sun/java2d/xr/XRCompositeManager.java	Tue Feb 20 13:30:49 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 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
@@ -131,7 +131,7 @@
     }
 
     public void setForeground(int pixel) {
-        solidColor.setColorValues(pixel, true);
+        solidColor.setColorValues(pixel);
     }
 
     public void setGradientPaint(XRSurfaceData gradient) {
--- a/src/java.desktop/unix/classes/sun/java2d/xr/XRSolidSrcPict.java	Tue Feb 20 21:47:54 2018 +0100
+++ b/src/java.desktop/unix/classes/sun/java2d/xr/XRSolidSrcPict.java	Tue Feb 20 13:30:49 2018 -0800
@@ -47,7 +47,7 @@
 
     public XRSurfaceData prepareSrcPict(int pixelVal) {
         if(pixelVal != curPixVal) {
-            xrCol.setColorValues(pixelVal, true);
+            xrCol.setColorValues(pixelVal);
             con.renderRectangle(srcPict.picture, XRUtils.PictOpSrc, xrCol, 0, 0, 1, 1);
             this.curPixVal = pixelVal;
         }
--- a/src/java.desktop/unix/native/libawt_xawt/awt/multiVis.c	Tue Feb 20 21:47:54 2018 +0100
+++ b/src/java.desktop/unix/native/libawt_xawt/awt/multiVis.c	Tue Feb 20 13:30:49 2018 -0800
@@ -394,77 +394,50 @@
 XRectangle      bbox;           /* bounding box of grabbed area */
 list_ptr regions;/* list of regions to read from */
 {
-    image_region_type   *reg;
-    int32_t                     dst_x, dst_y;   /* where in pixmap to write (UL) */
-    int32_t                     diff;
-
-    XImage              *reg_image,*ximage ;
-    int32_t             srcRect_x,srcRect_y,srcRect_width,srcRect_height ;
-    int32_t     rem ;
-    int32_t     bytes_per_line;
-    int32_t     bitmap_unit;
-
-    bitmap_unit = sizeof (long);
-    if (format == ZPixmap)
-       bytes_per_line = width*depth/8;
-    else
-       bytes_per_line = width/8;
-
-
-    /* Find out how many more bytes are required for padding so that
-    ** bytes per scan line will be multiples of bitmap_unit bits */
-    if (format == ZPixmap) {
-       rem = (bytes_per_line*8)%bitmap_unit;
-    if (rem)
-       bytes_per_line += (rem/8 + 1);
-    }
+    XImage              *ximage ;
+    image_region_type* reg;
+    int32_t rect;
 
     ximage = XCreateImage(disp,fakeVis,(uint32_t) depth,format,0,NULL,
                           (uint32_t)width,(uint32_t)height,8,0);
 
-    bytes_per_line = ximage->bytes_per_line;
-
-    if (format == ZPixmap)
-          ximage->data = malloc(height*bytes_per_line);
-    else
-        ximage->data = malloc(height*bytes_per_line*depth);
-
+    ximage->data = calloc(ximage->bytes_per_line*height*((format==ZPixmap)? 1 : depth), sizeof(char));
     ximage->bits_per_pixel = depth; /** Valid only if format is ZPixmap ***/
 
     for (reg = (image_region_type *) first_in_list( regions); reg;
          reg = (image_region_type *) next_in_list( regions))
     {
-                int32_t rect;
-                struct my_XRegion *vis_reg;
-                vis_reg = (struct my_XRegion *)(reg->visible_region);
-                for (rect = 0;
-                     rect < vis_reg->numRects;
-                     rect++)
+                struct my_XRegion *vis_reg = (struct my_XRegion *)(reg->visible_region);
+                for (rect = 0; rect < vis_reg->numRects; rect++)
                 {
-                /** ------------------------------------------------------------------------
-                        Intersect bbox with visible part of region giving src rect & output
-                        location.  Width is the min right side minus the max left side.
-                        Similar for height.  Offset src rect so x,y are relative to
-                        origin of win, not the root-relative visible rect of win.
-                    ------------------------------------------------------------------------ **/
-                    srcRect_width  = MIN( vis_reg->rects[rect].x2, bbox.width + bbox.x)
-             - MAX( vis_reg->rects[rect].x1, bbox.x);
+                    /** ------------------------------------------------------------------------
+                            Intersect bbox with visible part of region giving src rect & output
+                            location.  Width is the min right side minus the max left side.
+                            Similar for height.  Offset src rect so x,y are relative to
+                            origin of win, not the root-relative visible rect of win.
+                        ------------------------------------------------------------------------ **/
+                        int32_t srcRect_width  = MIN( vis_reg->rects[rect].x2, bbox.width + bbox.x)
+                                         - MAX( vis_reg->rects[rect].x1, bbox.x);
+
+                        int32_t srcRect_height = MIN( vis_reg->rects[rect].y2, bbox.height + bbox.y)
+                                         - MAX( vis_reg->rects[rect].y1, bbox.y);
 
-                    srcRect_height = MIN( vis_reg->rects[rect].y2, bbox.height + bbox.y)
-             - MAX( vis_reg->rects[rect].y1, bbox.y);
+                        int32_t diff = bbox.x - vis_reg->rects[rect].x1;
+                        int32_t srcRect_x = MAX( 0, diff)  + (vis_reg->rects[rect].x1 - reg->x_rootrel - reg->border);
+                        int32_t dst_x     = MAX( 0, -diff) ;
 
-                    diff = bbox.x - vis_reg->rects[rect].x1;
-                    srcRect_x = MAX( 0, diff)  + (vis_reg->rects[rect].x1 - reg->x_rootrel - reg->border);
-                    dst_x     = MAX( 0, -diff) ;
-                    diff = bbox.y - vis_reg->rects[rect].y1;
-                    srcRect_y = MAX( 0, diff)  + (vis_reg->rects[rect].y1 - reg->y_rootrel - reg->border);
-                    dst_y     = MAX( 0, -diff) ;
-            reg_image = XGetImage(disp,reg->win,srcRect_x,srcRect_y,
-             (uint32_t) srcRect_width, (uint32_t) srcRect_height,AllPlanes,format) ;
-                    TransferImage(disp,reg_image,srcRect_width,
-                                 srcRect_height,reg,ximage,dst_x,dst_y) ;
-            XDestroyImage(reg_image);
-            }
+                        diff = bbox.y - vis_reg->rects[rect].y1;
+                        int32_t srcRect_y = MAX( 0, diff)  + (vis_reg->rects[rect].y1 - reg->y_rootrel - reg->border);
+                        int32_t dst_y     = MAX( 0, -diff) ;
+                        XImage* reg_image = XGetImage(disp,reg->win,srcRect_x,srcRect_y,
+                                            (uint32_t) srcRect_width, (uint32_t) srcRect_height,AllPlanes,format) ;
+
+                        if (reg_image) {
+                            TransferImage(disp,reg_image,srcRect_width,
+                                            srcRect_height,reg,ximage,dst_x,dst_y) ;
+                            XDestroyImage(reg_image);
+                        }
+                }
     }
     return ximage ;
 }
--- a/src/jdk.jshell/share/classes/jdk/jshell/TaskFactory.java	Tue Feb 20 21:47:54 2018 +0100
+++ b/src/jdk.jshell/share/classes/jdk/jshell/TaskFactory.java	Tue Feb 20 13:30:49 2018 -0800
@@ -311,15 +311,18 @@
             return fm.createSourceFileObject(w, w.classFullName(), w.wrapped());
         }
 
+        /**
+         * Get the source information from the wrap.  If this is external, or
+         * otherwise does not have wrap info, just use source code.
+         * @param d the Diagnostic from the compiler
+         * @return the corresponding Diag
+         */
         @Override
         public Diag diag(Diagnostic<? extends JavaFileObject> d) {
-            SourceMemoryJavaFileObject smjfo = (SourceMemoryJavaFileObject) d.getSource();
-            if (smjfo == null) {
-                // Handle failure that doesn't preserve mapping
-                return new StringSourceHandler().diag(d);
-            }
-            OuterWrap w = (OuterWrap) smjfo.getOrigin();
-            return w.wrapDiag(d);
+            JavaFileObject jfo = d.getSource();
+            return jfo instanceof SourceMemoryJavaFileObject
+                    ? ((OuterWrap) ((SourceMemoryJavaFileObject) jfo).getOrigin()).wrapDiag(d)
+                    : new StringSourceHandler().diag(d);
         }
     }
 
--- a/test/jdk/java/awt/Color/XRenderTranslucentColorDrawTest.java	Tue Feb 20 21:47:54 2018 +0100
+++ b/test/jdk/java/awt/Color/XRenderTranslucentColorDrawTest.java	Tue Feb 20 13:30:49 2018 -0800
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug      8176795
  * @summary  Test verifies that we get proper color when we draw translucent
  *           color over an opaque color using X Render extension in Linux.
--- a/test/jdk/java/awt/FileDialog/FileDialogMemoryLeak/FileDialogLeakTest.java	Tue Feb 20 21:47:54 2018 +0100
+++ b/test/jdk/java/awt/FileDialog/FileDialogMemoryLeak/FileDialogLeakTest.java	Tue Feb 20 13:30:49 2018 -0800
@@ -27,6 +27,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 8177758
  * @requires os.family == "windows"
  * @summary Regression in java.awt.FileDialog
--- a/test/jdk/java/awt/FileDialog/MoveToTrashTest.java	Tue Feb 20 21:47:54 2018 +0100
+++ b/test/jdk/java/awt/FileDialog/MoveToTrashTest.java	Tue Feb 20 13:30:49 2018 -0800
@@ -23,6 +23,7 @@
 
 /*
   @test
+  @key headful
   @bug 8190515 8193468
   @summary java.awt.Desktop.moveToTrash(File) prompts on Windows 7 but not on Mac.
   @run main MoveToTrashTest
--- a/test/jdk/java/awt/Gtk/GtkVersionTest/GtkVersionTest.java	Tue Feb 20 21:47:54 2018 +0100
+++ b/test/jdk/java/awt/Gtk/GtkVersionTest/GtkVersionTest.java	Tue Feb 20 13:30:49 2018 -0800
@@ -22,6 +22,7 @@
  */
 
 /* @test
+ * @key headful
  * @bug 8156121
  * @summary "Fail forward" fails for GTK3 if no GTK2 available
  * @modules java.desktop/sun.awt
--- a/test/jdk/java/awt/JAWT/JAWT.sh	Tue Feb 20 21:47:54 2018 +0100
+++ b/test/jdk/java/awt/JAWT/JAWT.sh	Tue Feb 20 13:30:49 2018 -0800
@@ -22,6 +22,7 @@
 # questions.
 
 # @test JAWT.sh
+# @key headful
 # @bug 7190587
 # @summary Tests Java AWT native interface library
 # @author kshefov
@@ -111,7 +112,7 @@
     else
         ARCH="i386"
     fi
-	SYST="cygwin"	
+	SYST="cygwin"
 	MAKE="make"
     ;;
   Darwin )
--- a/test/jdk/java/awt/Toolkit/BadDisplayTest/BadDisplayTest.java	Tue Feb 20 21:47:54 2018 +0100
+++ b/test/jdk/java/awt/Toolkit/BadDisplayTest/BadDisplayTest.java	Tue Feb 20 13:30:49 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -24,18 +24,23 @@
 
 /*
  * @test
+ * @key headful
  * @summary Test that Toolkit.getDefaultToolkit throws AWTError exception if bad DISPLAY variable was set
  * @bug 6818083
  *
  * @run shell/timeout=240 BadDisplayTest.sh
  */
 
-import java.awt.*;
+import java.awt.AWTError;
+import java.awt.Toolkit;
 
 public class BadDisplayTest{
    public static void main(String[] args) {
+       if (Boolean.getBoolean("java.awt.headless")) {
+           return;
+       }
 
-        Throwable th = null;
+       Throwable th = null;
         try {
             Toolkit.getDefaultToolkit();
         } catch (Throwable x) {
--- a/test/jdk/java/awt/Toolkit/DesktopProperties/rfe4758438.java	Tue Feb 20 21:47:54 2018 +0100
+++ b/test/jdk/java/awt/Toolkit/DesktopProperties/rfe4758438.java	Tue Feb 20 13:30:49 2018 -0800
@@ -28,6 +28,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 4758438
  * @summary Testcase to check the implementation of RFE 4758438
  *          The RFE suggests that the GNOME desktop properties
--- a/test/jdk/java/awt/TrayIcon/SystemTrayInstance/SystemTrayInstanceTest.java	Tue Feb 20 21:47:54 2018 +0100
+++ b/test/jdk/java/awt/TrayIcon/SystemTrayInstance/SystemTrayInstanceTest.java	Tue Feb 20 13:30:49 2018 -0800
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @summary Check the getSystemTray method of the SystemTray. Checks if
  *          a proper instance is returned in supported platforms and a proper
  *          exception is thrown in unsupported platforms
--- a/test/jdk/java/awt/dnd/BadSerializaionTest/BadSerializationTest.java	Tue Feb 20 21:47:54 2018 +0100
+++ b/test/jdk/java/awt/dnd/BadSerializaionTest/BadSerializationTest.java	Tue Feb 20 13:30:49 2018 -0800
@@ -23,6 +23,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 8030050
  * @summary Validate fields on DnD class deserialization
  * @author petr.pchelko@oracle.com
--- a/test/jdk/java/awt/print/PrinterJob/PrintCrashTest.java	Tue Feb 20 21:47:54 2018 +0100
+++ b/test/jdk/java/awt/print/PrinterJob/PrintCrashTest.java	Tue Feb 20 13:30:49 2018 -0800
@@ -23,7 +23,7 @@
 
 /**
  * @test
- * @key printer
+ * @key printer headful
  * @bug 8163889
  * @summary Printing crashes on OSX.
  * @run main PrintCrashTest
--- a/test/jdk/javax/accessibility/AccessibilityProvider/basic.sh	Tue Feb 20 21:47:54 2018 +0100
+++ b/test/jdk/javax/accessibility/AccessibilityProvider/basic.sh	Tue Feb 20 13:30:49 2018 -0800
@@ -21,6 +21,7 @@
 # questions.
 #
 # @test
+# @key headful
 # @bug 8055160
 # @summary Unit test for javax.accessibility.AccessibilitySPI
 #
--- a/test/jdk/javax/swing/ClientProperty/UIClientPropertyKeyTest/UIClientPropertyKeyTest.java	Tue Feb 20 21:47:54 2018 +0100
+++ b/test/jdk/javax/swing/ClientProperty/UIClientPropertyKeyTest/UIClientPropertyKeyTest.java	Tue Feb 20 13:30:49 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -92,8 +92,10 @@
         try {
             UIManager.setLookAndFeel(laf.getClassName());
             System.out.println("LookAndFeel: " + laf.getClassName());
+        } catch (final UnsupportedLookAndFeelException ignored){
+            System.out.println("Unsupported LookAndFeel: " + laf.getClassName());
         } catch (ClassNotFoundException | InstantiationException |
-                UnsupportedLookAndFeelException | IllegalAccessException e) {
+                IllegalAccessException e) {
             throw new RuntimeException(e);
         }
     }
--- a/test/jdk/javax/swing/GroupLayout/7071166/bug7071166.java	Tue Feb 20 21:47:54 2018 +0100
+++ b/test/jdk/javax/swing/GroupLayout/7071166/bug7071166.java	Tue Feb 20 13:30:49 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -28,9 +28,22 @@
  * @author Pavel Porvatov
  */
 
-import javax.swing.*;
-import static javax.swing.SwingConstants.*;
-import java.awt.*;
+import java.awt.Container;
+
+import javax.swing.JButton;
+import javax.swing.LayoutStyle;
+import javax.swing.SwingUtilities;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+
+import static javax.swing.SwingConstants.EAST;
+import static javax.swing.SwingConstants.NORTH;
+import static javax.swing.SwingConstants.NORTH_EAST;
+import static javax.swing.SwingConstants.NORTH_WEST;
+import static javax.swing.SwingConstants.SOUTH;
+import static javax.swing.SwingConstants.SOUTH_EAST;
+import static javax.swing.SwingConstants.SOUTH_WEST;
+import static javax.swing.SwingConstants.WEST;
 
 public class bug7071166 {
     private static final int[] POSITIONS = {NORTH, EAST, SOUTH, WEST, // valid positions
@@ -38,8 +51,11 @@
 
     public static void main(String[] args) throws Exception {
         for (UIManager.LookAndFeelInfo lookAndFeelInfo : UIManager.getInstalledLookAndFeels()) {
-            UIManager.setLookAndFeel(lookAndFeelInfo.getClassName());
-
+            try {
+                UIManager.setLookAndFeel(lookAndFeelInfo.getClassName());
+            } catch (final UnsupportedLookAndFeelException ignored) {
+                continue;
+            }
             System.out.println("LookAndFeel: " + lookAndFeelInfo.getName());
 
             SwingUtilities.invokeAndWait(new Runnable() {
--- a/test/jdk/javax/swing/JComboBox/6632953/bug6632953.java	Tue Feb 20 21:47:54 2018 +0100
+++ b/test/jdk/javax/swing/JComboBox/6632953/bug6632953.java	Tue Feb 20 13:30:49 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 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
@@ -29,6 +29,7 @@
 import javax.swing.JComboBox;
 import javax.swing.SwingUtilities;
 import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
 import javax.swing.plaf.metal.MetalComboBoxUI;
 
 public class bug6632953 {
@@ -43,6 +44,8 @@
                         : UIManager.getInstalledLookAndFeels()) {
                     try {
                         UIManager.setLookAndFeel(lafInfo.getClassName());
+                    } catch (UnsupportedLookAndFeelException ignored) {
+                        continue;
                     } catch (Exception e) {
                         throw new RuntimeException(e);
                     }
--- a/test/jdk/javax/swing/JComboBox/7082443/bug7082443.java	Tue Feb 20 21:47:54 2018 +0100
+++ b/test/jdk/javax/swing/JComboBox/7082443/bug7082443.java	Tue Feb 20 13:30:49 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -36,8 +36,11 @@
     public static void main(String[] args) throws Exception {
         for (UIManager.LookAndFeelInfo lookAndFeelInfo : UIManager.getInstalledLookAndFeels()) {
             if (lookAndFeelInfo.getClassName().contains(GTK_LAF_CLASS)) {
-                UIManager.setLookAndFeel(lookAndFeelInfo.getClassName());
-
+                try {
+                    UIManager.setLookAndFeel(lookAndFeelInfo.getClassName());
+                } catch (final UnsupportedLookAndFeelException ignored) {
+                    continue;
+                }
                 SwingUtilities.invokeAndWait(new Runnable() {
                     @Override
                     public void run() {
--- a/test/jdk/javax/swing/JFileChooser/6489130/bug6489130.java	Tue Feb 20 21:47:54 2018 +0100
+++ b/test/jdk/javax/swing/JFileChooser/6489130/bug6489130.java	Tue Feb 20 13:30:49 2018 -0800
@@ -22,6 +22,7 @@
  */
 
 /* @test
+ * @key headful
  * @bug 6489130
  * @summary FileChooserDemo hung by keeping pressing Enter key
  * @author Pavel Porvatov
--- a/test/jdk/javax/swing/JFileChooser/8080628/bug8080628.java	Tue Feb 20 21:47:54 2018 +0100
+++ b/test/jdk/javax/swing/JFileChooser/8080628/bug8080628.java	Tue Feb 20 13:30:49 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -25,6 +25,7 @@
 import javax.swing.SwingUtilities;
 import javax.swing.UIManager;
 import javax.swing.UIManager.LookAndFeelInfo;
+import javax.swing.UnsupportedLookAndFeelException;
 
 import sun.swing.SwingUtilities2;
 
@@ -77,7 +78,11 @@
         try {
             LookAndFeelInfo[] lafInfo = UIManager.getInstalledLookAndFeels();
             for (LookAndFeelInfo info : lafInfo) {
-                UIManager.setLookAndFeel(info.getClassName());
+                try {
+                    UIManager.setLookAndFeel(info.getClassName());
+                } catch (final UnsupportedLookAndFeelException ignored) {
+                    continue;
+                }
 
                 for (Locale locale : LOCALES) {
                     for (String key : MNEMONIC_KEYS) {
--- a/test/jdk/javax/swing/JFrame/Serialization/JFrameMenuSerializationTest.java	Tue Feb 20 21:47:54 2018 +0100
+++ b/test/jdk/javax/swing/JFrame/Serialization/JFrameMenuSerializationTest.java	Tue Feb 20 13:30:49 2018 -0800
@@ -23,6 +23,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 8189201
  * @summary [macosx] NotSerializableException during JFrame with MenuBar
  *          serialization
--- a/test/jdk/javax/swing/JLayer/8041982/bug8041982.java	Tue Feb 20 21:47:54 2018 +0100
+++ b/test/jdk/javax/swing/JLayer/8041982/bug8041982.java	Tue Feb 20 13:30:49 2018 -0800
@@ -22,6 +22,7 @@
  */
 
 /* @test
+ * @key headful
  * @bug 8041982
  * @summary Use of animated icon in JLayer causes CPU spin
  * @author Alexander Potochkin
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/javax/swing/JList/SetSelectedValueTest.java	Tue Feb 20 13:30:49 2018 -0800
@@ -0,0 +1,77 @@
+/*
+ * 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.
+ */
+/*
+ * @test
+ * @key headful
+ * @bug 5076761
+ * @summary Verifies that the selection is cleared when setSelectedValue is
+ *          called with null
+ * @run main SetSelectedValueTest
+ */
+
+import javax.swing.SwingUtilities;
+import javax.swing.DefaultListModel;
+import javax.swing.JList;
+import javax.swing.ListSelectionModel;
+import java.util.Collections;
+import java.util.List;
+
+public class SetSelectedValueTest {
+    public static void main(String[] args) throws Exception {
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                // Create a JList with 2 elements
+                DefaultListModel dlm = new DefaultListModel();
+                JList list = new JList<String>(dlm);
+                list.setSelectionMode(
+                        ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
+                dlm.addElement("1");
+                dlm.addElement("2");
+
+                // Select both the elements added in list
+                list.setSelectionInterval(0, 1);
+                checkSelectionByList(list, List.of("1", "2"));
+
+                // Set the selected value as null. This should clear the
+                // selection
+                list.setSelectedValue(null, true);
+                checkSelectionByList(list, Collections.emptyList());
+
+                // Select both the elements added in list
+                list.setSelectionInterval(0, 1);
+                checkSelectionByList(list, List.of("1", "2"));
+            }
+        });
+    }
+
+    static void checkSelectionByList(JList list, List<String> selectionList)
+            throws RuntimeException {
+        List<String> listSelection = list.getSelectedValuesList();
+        if (!listSelection.equals(selectionList)) {
+            System.out.println("Expected: " + selectionList);
+            System.out.println("Actual: " + listSelection);
+            throw new RuntimeException("Wrong selection");
+        }
+    }
+}
--- a/test/jdk/javax/swing/JTableHeader/8020039/TableHeaderRendererExceptionTest.java	Tue Feb 20 21:47:54 2018 +0100
+++ b/test/jdk/javax/swing/JTableHeader/8020039/TableHeaderRendererExceptionTest.java	Tue Feb 20 13:30:49 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -22,6 +22,7 @@
  */
 
 import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
 import javax.swing.table.JTableHeader;
 
 /**
@@ -40,8 +41,11 @@
 
         for (UIManager.LookAndFeelInfo lookAndFeelItem : lookAndFeelArray) {
             String lookAndFeelString = lookAndFeelItem.getClassName();
-
-            UIManager.setLookAndFeel(lookAndFeelString);
+            try{
+                UIManager.setLookAndFeel(lookAndFeelString);
+            } catch (final UnsupportedLookAndFeelException ignored) {
+                continue;
+            }
 
             // Test getTableCellRendererComponent method by passing null table
             JTableHeader header = new JTableHeader();
--- a/test/jdk/javax/swing/Security/6657138/bug6657138.java	Tue Feb 20 21:47:54 2018 +0100
+++ b/test/jdk/javax/swing/Security/6657138/bug6657138.java	Tue Feb 20 13:30:49 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -68,7 +68,11 @@
                     continue;
                 }
                 String className = laf.getClassName();
-                UIManager.setLookAndFeel(className);
+                try {
+                    UIManager.setLookAndFeel(className);
+                } catch (final UnsupportedLookAndFeelException ignored) {
+                    continue;
+                }
                 ComponentUI ui = UIManager.getUI(c);
                 if (ui == null) {
                     throw new RuntimeException("UI is null for " + c);
--- a/test/jdk/javax/swing/UIDefaults/6302464/bug6302464.java	Tue Feb 20 21:47:54 2018 +0100
+++ b/test/jdk/javax/swing/UIDefaults/6302464/bug6302464.java	Tue Feb 20 13:30:49 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -33,6 +33,7 @@
 import javax.swing.UIManager;
 import javax.swing.UIDefaults;
 import javax.swing.UIManager.LookAndFeelInfo;
+import javax.swing.UnsupportedLookAndFeelException;
 import javax.swing.plaf.basic.BasicLookAndFeel;
 import static java.awt.RenderingHints.KEY_TEXT_ANTIALIASING;
 import static java.awt.RenderingHints.KEY_TEXT_LCD_CONTRAST;
@@ -178,6 +179,7 @@
     private static void setLookAndFeel(String lafClass) {
         try {
             UIManager.setLookAndFeel(lafClass);
+        } catch (final UnsupportedLookAndFeelException ignored) {
         } catch (Exception e) {
             throw new RuntimeException(e);
         }
--- a/test/jdk/javax/swing/UIDefaults/8133926/InternalFrameIcon.java	Tue Feb 20 21:47:54 2018 +0100
+++ b/test/jdk/javax/swing/UIDefaults/8133926/InternalFrameIcon.java	Tue Feb 20 13:30:49 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -45,9 +45,10 @@
         try {
             UIManager.setLookAndFeel(laf.getClassName());
             System.out.println("LookAndFeel: " + laf.getClassName());
-        } catch (ClassNotFoundException | InstantiationException |
-                UnsupportedLookAndFeelException | IllegalAccessException e) {
+        } catch (ClassNotFoundException | IllegalAccessException |
+                InstantiationException e) {
             throw new RuntimeException(e);
+        } catch (final UnsupportedLookAndFeelException ignored) {
         }
     }
 
--- a/test/jdk/javax/swing/plaf/metal/MetalUtils/bug6190373.java	Tue Feb 20 21:47:54 2018 +0100
+++ b/test/jdk/javax/swing/plaf/metal/MetalUtils/bug6190373.java	Tue Feb 20 13:30:49 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -102,8 +102,10 @@
         try {
             UIManager.setLookAndFeel(laf.getClassName());
             System.out.println("LookAndFeel: " + laf.getClassName());
+        } catch (final UnsupportedLookAndFeelException ignored){
+            System.out.println("Unsupported LookAndFeel: " + laf.getClassName());
         } catch (ClassNotFoundException | InstantiationException |
-                UnsupportedLookAndFeelException | IllegalAccessException e) {
+                IllegalAccessException e) {
             throw new RuntimeException(e);
         }
     }
--- a/test/jdk/sanity/client/SwingSet/src/TextFieldDemoTest.java	Tue Feb 20 21:47:54 2018 +0100
+++ b/test/jdk/sanity/client/SwingSet/src/TextFieldDemoTest.java	Tue Feb 20 13:30:49 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 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
@@ -101,6 +101,7 @@
         JButtonOperator jbo = new JButtonOperator(containerOperator, GO);
         JLabelOperator dowLabel = new JLabelOperator(containerOperator);
         Calendar calendar = Calendar.getInstance(Locale.ENGLISH);
+        calendar.setTime((Date) getUIValue(jtfo, jtf -> ((JFormattedTextField)jtf).getValue()));
 
         // Check default date Day of the Week
         jbo.push();
--- a/test/jdk/sanity/client/lib/jemmy/src/org/netbeans/jemmy/ComponentChooser.java	Tue Feb 20 21:47:54 2018 +0100
+++ b/test/jdk/sanity/client/lib/jemmy/src/org/netbeans/jemmy/ComponentChooser.java	Tue Feb 20 13:30:49 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -50,5 +50,7 @@
      *
      * @return a String representing the description value
      */
-    public String getDescription();
+    public default String getDescription() {
+        return toString();
+    }
 }
--- a/test/jdk/sanity/client/lib/jemmy/src/org/netbeans/jemmy/operators/Operator.java	Tue Feb 20 21:47:54 2018 +0100
+++ b/test/jdk/sanity/client/lib/jemmy/src/org/netbeans/jemmy/operators/Operator.java	Tue Feb 20 13:30:49 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -718,6 +718,25 @@
         }
     }
 
+    /**
+     * Waits a state specified by a ComponentChooser instance on EDT queue.
+     *
+     * @param state a ComponentChooser defining the state criteria.
+     * @throws TimeoutExpiredException if the state has not achieved in a value
+     * defined by {@code "ComponentOperator.WaitStateTimeout"}
+     */
+    public void waitStateOnQueue(final ComponentChooser state) {
+        waitState((comp) -> {
+            return (boolean) (queueTool.invokeSmoothly(
+                    new QueueTool.QueueAction<Object>("checkComponent") {
+                @Override
+                public final Object launch() throws Exception {
+                    return state.checkComponent(comp);
+                }
+            }));
+        });
+    }
+
     ////////////////////////////////////////////////////////
     //Mapping                                             //
     ////////////////////////////////////////////////////////
--- a/test/langtools/jdk/jshell/ToolBasicTest.java	Tue Feb 20 21:47:54 2018 +0100
+++ b/test/langtools/jdk/jshell/ToolBasicTest.java	Tue Feb 20 13:30:49 2018 -0800
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8143037 8142447 8144095 8140265 8144906 8146138 8147887 8147886 8148316 8148317 8143955 8157953 8080347 8154714 8166649 8167643 8170162 8172102 8165405 8174796 8174797 8175304 8167554 8180508
+ * @bug 8143037 8142447 8144095 8140265 8144906 8146138 8147887 8147886 8148316 8148317 8143955 8157953 8080347 8154714 8166649 8167643 8170162 8172102 8165405 8174796 8174797 8175304 8167554 8180508 8196133
  * @summary Tests for Basic tests for REPL tool
  * @modules jdk.compiler/com.sun.tools.javac.api
  *          jdk.compiler/com.sun.tools.javac.main
@@ -350,6 +350,34 @@
         );
     }
 
+    private String makeBadSourceJar() {
+        Compiler compiler = new Compiler();
+        Path outDir = Paths.get("testClasspathJar");
+        Path src = compiler.getPath(outDir.resolve("pkg/A.java"));
+        compiler.writeToFile(src, "package pkg; /** \u0086 */public class A { public String toString() { return \"A\"; } }");
+        String jarName = "test.jar";
+        compiler.jar(outDir, jarName, "pkg/A.java");
+        return compiler.getPath(outDir).resolve(jarName).toString();
+    }
+
+    public void testBadSourceJarClasspath() {
+        String jarPath = makeBadSourceJar();
+        test(
+                (a) -> assertCommand(a, "/env --class-path " + jarPath,
+                        "|  Setting new options and restoring state."),
+                (a) -> assertCommandOutputStartsWith(a, "new pkg.A();",
+                        "|  Error:\n"
+                        + "|  cannot find symbol\n"
+                        + "|    symbol:   class A")
+        );
+        test(new String[]{"--class-path", jarPath},
+                (a) -> assertCommandOutputStartsWith(a, "new pkg.A();",
+                        "|  Error:\n"
+                        + "|  cannot find symbol\n"
+                        + "|    symbol:   class A")
+        );
+    }
+
     public void testModulePath() {
         Compiler compiler = new Compiler();
         Path modsDir = Paths.get("mods");