Merge
authoramurillo
Mon, 08 Aug 2016 08:12:20 -0700
changeset 40205 12384fff105a
parent 40204 2781da09d28f (current diff)
parent 40177 e2a7079bd50a (diff)
child 40206 8870e08b50bc
Merge
jdk/make/lib/Awt2dLibraries.gmk
jdk/src/java.desktop/share/native/libawt/java2d/ShaderList.c
jdk/src/java.desktop/share/native/libawt/java2d/ShaderList.h
jdk/src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c
jdk/test/ProblemList.txt
--- a/jdk/make/lib/Awt2dLibraries.gmk	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/make/lib/Awt2dLibraries.gmk	Mon Aug 08 08:12:20 2016 -0700
@@ -56,9 +56,6 @@
     OPTIMIZATION := HIGHEST, \
     CFLAGS := $(CFLAGS_JDKLIB) \
         $(BUILD_LIBMLIB_CFLAGS), \
-    DISABLED_WARNINGS_gcc := parentheses array-bounds, \
-    DISABLED_WARNINGS_clang := parentheses, \
-    DISABLED_WARNINGS_solstudio := E_STATEMENT_NOT_REACHED, \
     MAPFILE := $(BUILD_LIBMLIB_IMAGE_MAPFILE), \
     LDFLAGS := $(LDFLAGS_JDKLIB) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
@@ -119,7 +116,6 @@
       CFLAGS := -xarch=sparcvis \
           $(LIBMLIB_IMAGE_V_CFLAGS) \
           $(CFLAGS_JDKLIB), \
-      DISABLED_WARNINGS_solstudio := E_STATEMENT_NOT_REACHED, \
       MAPFILE := $(BUILD_LIBMLIB_IMAGE_MAPFILE), \
       LDFLAGS := $(LDFLAGS_JDKLIB) \
           $(call SET_SHARED_LIBRARY_ORIGIN), \
@@ -147,8 +143,6 @@
 
 ifeq ($(OPENJDK_TARGET_OS), windows)
   LIBAWT_DIRS += $(JDK_TOPDIR)/src/java.desktop/share/native/common/awt/utility
-else
-  LIBAWT_EXFILES := java2d/ShaderList.c
 endif
 
 ifneq ($(filter $(OPENJDK_TARGET_OS), solaris linux macosx aix), )
@@ -496,9 +490,7 @@
     CFLAGS := $(CFLAGS_JDKLIB) $(BUILD_LIBJAVAJPEG_HEADERS) \
         $(LIBJAVA_HEADER_FLAGS) \
         -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop, \
-    DISABLED_WARNINGS_gcc := clobbered parentheses array-bounds shift-negative-value, \
-    DISABLED_WARNINGS_clang := logical-op-parentheses, \
-    DISABLED_WARNINGS_microsoft := 4267, \
+    DISABLED_WARNINGS_gcc := clobbered, \
     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjpeg/mapfile-vers, \
     LDFLAGS := $(LDFLAGS_JDKLIB) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
--- a/jdk/src/java.base/share/classes/java/lang/Class.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.base/share/classes/java/lang/Class.java	Mon Aug 08 08:12:20 2016 -0700
@@ -70,6 +70,7 @@
 import jdk.internal.reflect.ConstantPool;
 import jdk.internal.reflect.Reflection;
 import jdk.internal.reflect.ReflectionFactory;
+import jdk.internal.vm.annotation.ForceInline;
 import sun.reflect.generics.factory.CoreReflectionFactory;
 import sun.reflect.generics.factory.GenericsFactory;
 import sun.reflect.generics.repository.ClassRepository;
@@ -802,6 +803,7 @@
      * @see java.lang.RuntimePermission
      */
     @CallerSensitive
+    @ForceInline // to ensure Reflection.getCallerClass optimization
     public ClassLoader getClassLoader() {
         ClassLoader cl = getClassLoader0();
         if (cl == null)
--- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java	Mon Aug 08 08:12:20 2016 -0700
@@ -30,6 +30,7 @@
 import jdk.internal.org.objectweb.asm.MethodVisitor;
 import jdk.internal.reflect.CallerSensitive;
 import jdk.internal.reflect.Reflection;
+import jdk.internal.vm.annotation.ForceInline;
 import jdk.internal.vm.annotation.Stable;
 import sun.invoke.empty.Empty;
 import sun.invoke.util.ValueConversions;
@@ -44,7 +45,6 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.function.Function;
-import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
 import static java.lang.invoke.LambdaForm.*;
@@ -1246,6 +1246,7 @@
         }
 
         @CallerSensitive
+        @ForceInline // to ensure Reflection.getCallerClass optimization
         private static boolean checkCallerClass(Class<?> expected) {
             // This method is called via MH_checkCallerClass and so it's correct to ask for the immediate caller here.
             Class<?> actual = Reflection.getCallerClass();
--- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java	Mon Aug 08 08:12:20 2016 -0700
@@ -29,6 +29,7 @@
 import jdk.internal.org.objectweb.asm.Opcodes;
 import jdk.internal.reflect.CallerSensitive;
 import jdk.internal.reflect.Reflection;
+import jdk.internal.vm.annotation.ForceInline;
 import sun.invoke.util.ValueConversions;
 import sun.invoke.util.VerifyAccess;
 import sun.invoke.util.Wrapper;
@@ -104,6 +105,7 @@
      * @return a lookup object for the caller of this method, with private access
      */
     @CallerSensitive
+    @ForceInline // to ensure Reflection.getCallerClass optimization
     public static Lookup lookup() {
         return new Lookup(Reflection.getCallerClass());
     }
--- a/jdk/src/java.base/share/classes/java/lang/reflect/Constructor.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.base/share/classes/java/lang/reflect/Constructor.java	Mon Aug 08 08:12:20 2016 -0700
@@ -29,6 +29,7 @@
 import jdk.internal.reflect.CallerSensitive;
 import jdk.internal.reflect.ConstructorAccessor;
 import jdk.internal.reflect.Reflection;
+import jdk.internal.vm.annotation.ForceInline;
 import sun.reflect.annotation.TypeAnnotation;
 import sun.reflect.annotation.TypeAnnotationParser;
 import sun.reflect.generics.repository.ConstructorRepository;
@@ -435,6 +436,7 @@
      *              by this method fails.
      */
     @CallerSensitive
+    @ForceInline // to ensure Reflection.getCallerClass optimization
     public T newInstance(Object ... initargs)
         throws InstantiationException, IllegalAccessException,
                IllegalArgumentException, InvocationTargetException
--- a/jdk/src/java.base/share/classes/java/lang/reflect/Field.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.base/share/classes/java/lang/reflect/Field.java	Mon Aug 08 08:12:20 2016 -0700
@@ -29,6 +29,7 @@
 import jdk.internal.reflect.CallerSensitive;
 import jdk.internal.reflect.FieldAccessor;
 import jdk.internal.reflect.Reflection;
+import jdk.internal.vm.annotation.ForceInline;
 import sun.reflect.generics.repository.FieldRepository;
 import sun.reflect.generics.factory.CoreReflectionFactory;
 import sun.reflect.generics.factory.GenericsFactory;
@@ -396,6 +397,7 @@
      *              by this method fails.
      */
     @CallerSensitive
+    @ForceInline // to ensure Reflection.getCallerClass optimization
     public Object get(Object obj)
         throws IllegalArgumentException, IllegalAccessException
     {
@@ -429,6 +431,7 @@
      * @see       Field#get
      */
     @CallerSensitive
+    @ForceInline // to ensure Reflection.getCallerClass optimization
     public boolean getBoolean(Object obj)
         throws IllegalArgumentException, IllegalAccessException
     {
@@ -462,6 +465,7 @@
      * @see       Field#get
      */
     @CallerSensitive
+    @ForceInline // to ensure Reflection.getCallerClass optimization
     public byte getByte(Object obj)
         throws IllegalArgumentException, IllegalAccessException
     {
@@ -497,6 +501,7 @@
      * @see Field#get
      */
     @CallerSensitive
+    @ForceInline // to ensure Reflection.getCallerClass optimization
     public char getChar(Object obj)
         throws IllegalArgumentException, IllegalAccessException
     {
@@ -532,6 +537,7 @@
      * @see       Field#get
      */
     @CallerSensitive
+    @ForceInline // to ensure Reflection.getCallerClass optimization
     public short getShort(Object obj)
         throws IllegalArgumentException, IllegalAccessException
     {
@@ -567,6 +573,7 @@
      * @see       Field#get
      */
     @CallerSensitive
+    @ForceInline // to ensure Reflection.getCallerClass optimization
     public int getInt(Object obj)
         throws IllegalArgumentException, IllegalAccessException
     {
@@ -602,6 +609,7 @@
      * @see       Field#get
      */
     @CallerSensitive
+    @ForceInline // to ensure Reflection.getCallerClass optimization
     public long getLong(Object obj)
         throws IllegalArgumentException, IllegalAccessException
     {
@@ -637,6 +645,7 @@
      * @see Field#get
      */
     @CallerSensitive
+    @ForceInline // to ensure Reflection.getCallerClass optimization
     public float getFloat(Object obj)
         throws IllegalArgumentException, IllegalAccessException
     {
@@ -672,6 +681,7 @@
      * @see       Field#get
      */
     @CallerSensitive
+    @ForceInline // to ensure Reflection.getCallerClass optimization
     public double getDouble(Object obj)
         throws IllegalArgumentException, IllegalAccessException
     {
@@ -749,6 +759,7 @@
      *              by this method fails.
      */
     @CallerSensitive
+    @ForceInline // to ensure Reflection.getCallerClass optimization
     public void set(Object obj, Object value)
         throws IllegalArgumentException, IllegalAccessException
     {
@@ -784,6 +795,7 @@
      * @see       Field#set
      */
     @CallerSensitive
+    @ForceInline // to ensure Reflection.getCallerClass optimization
     public void setBoolean(Object obj, boolean z)
         throws IllegalArgumentException, IllegalAccessException
     {
@@ -819,6 +831,7 @@
      * @see       Field#set
      */
     @CallerSensitive
+    @ForceInline // to ensure Reflection.getCallerClass optimization
     public void setByte(Object obj, byte b)
         throws IllegalArgumentException, IllegalAccessException
     {
@@ -854,6 +867,7 @@
      * @see       Field#set
      */
     @CallerSensitive
+    @ForceInline // to ensure Reflection.getCallerClass optimization
     public void setChar(Object obj, char c)
         throws IllegalArgumentException, IllegalAccessException
     {
@@ -889,6 +903,7 @@
      * @see       Field#set
      */
     @CallerSensitive
+    @ForceInline // to ensure Reflection.getCallerClass optimization
     public void setShort(Object obj, short s)
         throws IllegalArgumentException, IllegalAccessException
     {
@@ -924,6 +939,7 @@
      * @see       Field#set
      */
     @CallerSensitive
+    @ForceInline // to ensure Reflection.getCallerClass optimization
     public void setInt(Object obj, int i)
         throws IllegalArgumentException, IllegalAccessException
     {
@@ -959,6 +975,7 @@
      * @see       Field#set
      */
     @CallerSensitive
+    @ForceInline // to ensure Reflection.getCallerClass optimization
     public void setLong(Object obj, long l)
         throws IllegalArgumentException, IllegalAccessException
     {
@@ -994,6 +1011,7 @@
      * @see       Field#set
      */
     @CallerSensitive
+    @ForceInline // to ensure Reflection.getCallerClass optimization
     public void setFloat(Object obj, float f)
         throws IllegalArgumentException, IllegalAccessException
     {
@@ -1029,6 +1047,7 @@
      * @see       Field#set
      */
     @CallerSensitive
+    @ForceInline // to ensure Reflection.getCallerClass optimization
     public void setDouble(Object obj, double d)
         throws IllegalArgumentException, IllegalAccessException
     {
--- a/jdk/src/java.base/share/classes/java/lang/reflect/Method.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.base/share/classes/java/lang/reflect/Method.java	Mon Aug 08 08:12:20 2016 -0700
@@ -30,6 +30,7 @@
 import jdk.internal.reflect.CallerSensitive;
 import jdk.internal.reflect.MethodAccessor;
 import jdk.internal.reflect.Reflection;
+import jdk.internal.vm.annotation.ForceInline;
 import sun.reflect.annotation.ExceptionProxy;
 import sun.reflect.annotation.TypeNotPresentExceptionProxy;
 import sun.reflect.generics.repository.MethodRepository;
@@ -517,6 +518,7 @@
      * provoked by this method fails.
      */
     @CallerSensitive
+    @ForceInline // to ensure Reflection.getCallerClass optimization
     @HotSpotIntrinsicCandidate
     public Object invoke(Object obj, Object... args)
         throws IllegalAccessException, IllegalArgumentException,
--- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java	Mon Aug 08 08:12:20 2016 -0700
@@ -561,6 +561,7 @@
                         throw new IOException("skipImage : Found extra SOI"
                                 + " marker before getting to EOI");
                     case 0:
+                    case 255:
                     // markers which doesn't contain length data
                     case JPEG.RST0:
                     case JPEG.RST1:
--- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageWriter.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageWriter.java	Mon Aug 08 08:12:20 2016 -0700
@@ -263,15 +263,15 @@
     }
 
     public void setOutput(Object output) {
-        super.setOutput(output);
-
         if (output != null) {
-            reset();
-
             if (!(output instanceof ImageOutputStream)) {
                 throw new IllegalArgumentException
                     ("output not an ImageOutputStream!");
             }
+
+            // reset() must precede setOutput() as it sets output to null
+            reset();
+
             this.stream = (ImageOutputStream)output;
 
             //
@@ -312,6 +312,8 @@
         } else {
             this.stream = null;
         }
+
+        super.setOutput(output);
     }
 
     public IIOMetadata
--- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFJPEGCompressor.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFJPEGCompressor.java	Mon Aug 08 08:12:20 2016 -0700
@@ -79,10 +79,8 @@
 
         try {
             IIORegistry registry = IIORegistry.getDefaultInstance();
-            Class<?> imageReaderClass =
-                Class.forName("javax.imageio.spi.ImageReaderSpi");
             Iterator<?> readerSPIs =
-                registry.getServiceProviders(imageReaderClass,
+                registry.getServiceProviders(ImageReaderSpi.class,
                                              new JPEGSPIFilter(),
                                              true);
             if(readerSPIs.hasNext()) {
--- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKGraphicsUtils.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKGraphicsUtils.java	Mon Aug 08 08:12:20 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -49,16 +49,18 @@
         int componentState = context.getComponentState();
         if ((componentState & SynthConstants.DISABLED) ==
                               SynthConstants.DISABLED){
-            Color orgColor = g.getColor();
-            g.setColor(context.getStyle().getColor(context,
-                                                   GTKColorType.WHITE));
-            x += 1;
-            y += 1;
-            super.paintText(context, g, text, x, y, mnemonicIndex);
+            if (!GTKLookAndFeel.is3()) {
+                Color orgColor = g.getColor();
+                g.setColor(context.getStyle().getColor(context,
+                        GTKColorType.WHITE));
+                x += 1;
+                y += 1;
+                super.paintText(context, g, text, x, y, mnemonicIndex);
 
-            g.setColor(orgColor);
-            x -= 1;
-            y -= 1;
+                g.setColor(orgColor);
+                x -= 1;
+                y -= 1;
+            }
             super.paintText(context, g, text, x, y, mnemonicIndex);
         }
         else {
--- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKIconFactory.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKIconFactory.java	Mon Aug 08 08:12:20 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -214,6 +214,18 @@
 
             Region region = context.getRegion();
             GTKStyle style = (GTKStyle) context.getStyle();
+            if (GTKLookAndFeel.is3() && region == Region.MENU) {
+                Object value = style.getClassSpecificValue("arrow-scaling");
+                if (value instanceof Number) {
+                    iconDimension = (int)(((Number) value).floatValue() *
+                            (style.getFont(context).getSize2D() +
+                            2 * style.getClassSpecificIntValue(context,
+                            "indicator-spacing", DEFAULT_ICON_SPACING)));
+                    if (iconDimension > 0) {
+                        return iconDimension;
+                    }
+                }
+            }
             iconDimension = style.getClassSpecificIntValue(context,
                     "indicator-size",
                     (region == Region.CHECK_BOX_MENU_ITEM ||
--- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java	Mon Aug 08 08:12:20 2016 -0700
@@ -65,12 +65,6 @@
      */
     static Map<Object, Object> aaTextInfo;
 
-    /**
-     * Solaris, or Linux with Sun JDS in a CJK Locale.
-     * Used to determine if Sun's high quality CJK fonts are present.
-     */
-    private static boolean isSunCJK;
-
     /*
      * Used to override if system (desktop) text anti-aliasing settings should
      * be used. The reasons for this are are is that currently its "off"
@@ -107,36 +101,6 @@
      */
     private static String gtkThemeName = "Default";
 
-    static {
-        String language = Locale.getDefault().getLanguage();
-        boolean cjkLocale =
-            (Locale.CHINESE.getLanguage().equals(language) ||
-             Locale.JAPANESE.getLanguage().equals(language) ||
-             Locale.KOREAN.getLanguage().equals(language));
-
-        if (cjkLocale) {
-            boolean isSunDesktop = false;
-            switch (OSInfo.getOSType()) {
-                case SOLARIS:
-                    isSunDesktop = true;
-                    break;
-
-                case LINUX:
-                    Boolean val = AccessController.doPrivileged(
-                                    new PrivilegedAction<Boolean>() {
-                                        public Boolean run() {
-                                            File f = new File("/etc/sun-release");
-                                            return Boolean.valueOf(f.exists());
-                                        }
-                                    });
-                    isSunDesktop = val.booleanValue();
-            }
-            if (isSunDesktop && !sun.java2d.SunGraphicsEnvironment.isOpenSolaris) {
-                isSunCJK = true;
-            }
-        }
-    }
-
     /**
      * Returns true if running on system containing at least 2.2.
      */
@@ -1474,19 +1438,10 @@
 
         /*
          * Check if system AA font settings should be used.
-         * Sun's JDS (for Linux and Solaris) ships with high quality CJK
-         * fonts and specifies via fontconfig that these be rendered in
-         * B&W to take advantage of the embedded bitmaps.
-         * If is a Sun CJK locale or remote display, indicate by the condition
-         * variable that in this case the L&F recommends ignoring desktop
-         * settings. On other Unixes (eg Linux) this doesn't apply.
-         * REMIND 1: The isSunCJK test is really just a place holder
-         * until we can properly query fontconfig and use the properties
-         * set for specific fonts.
-         * REMIND 2: See comment on isLocalDisplay() definition regarding
+         * REMIND: See comment on isLocalDisplay() definition regarding
          * XRender.
          */
-        gtkAAFontSettingsCond = !isSunCJK && SwingUtilities2.isLocalDisplay();
+        gtkAAFontSettingsCond = SwingUtilities2.isLocalDisplay();
         aaTextInfo = new HashMap<>(2);
         SwingUtilities2.putAATextInfo(gtkAAFontSettingsCond, aaTextInfo);
     }
--- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKPainter.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKPainter.java	Mon Aug 08 08:12:20 2016 -0700
@@ -649,10 +649,19 @@
             y += insets.top;
             if (orientation == JSeparator.HORIZONTAL) {
                 w -= (insets.left + insets.right);
-                detail = "hseparator";
             } else {
                 h -= (insets.top + insets.bottom);
-                detail = "vseparator";
+            }
+            if (GTKLookAndFeel.is3()) {
+                if (id == Region.POPUP_MENU_SEPARATOR) {
+                    detail = "menuitem";
+                    h -= (insets.top + insets.bottom);
+                } else {
+                    detail = "separator";
+                }
+            } else {
+                detail = orientation == JSeparator.HORIZONTAL ?
+                                                    "hseparator" : "vseparator";
             }
             synchronized (UNIXToolkit.GTK_LOCK) {
                 if (! ENGINE.paintCachedImage(g, x, y, w, h, id, state,
@@ -1381,8 +1390,13 @@
         if (gtkState == SynthConstants.MOUSE_OVER) {
             shadow = ShadowType.IN;
         }
+        if (!GTKLookAndFeel.is3()) {
+            x += 3;
+            y += 3;
+            w = h = 7;
+        }
         ENGINE.paintArrow(g, context, Region.MENU_ITEM, gtkState, shadow,
-                dir, "menuitem", x + 3, y + 3, 7, 7);
+                dir, "menuitem", x, y, w, h);
     }
 
     public void paintCheckBoxMenuItemCheckIcon(SynthContext context,
--- a/jdk/src/java.desktop/share/classes/java/awt/HeadlessException.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/java/awt/HeadlessException.java	Mon Aug 08 08:12:20 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
  * 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,10 +28,14 @@
 /**
  * Thrown when code that is dependent on a keyboard, display, or mouse
  * is called in an environment that does not support a keyboard, display,
- * or mouse.
+ * or mouse. Any code that depends on any of those devices should firstly
+ * ensure their availability using the {@code GraphicsEnvironment.isHeadless()}
+ * method and throw {@code HeadlessException} if the latter returns
+ * {@code true}.
  *
  * @since 1.4
  * @author  Michael Martak
+ * @see GraphicsEnvironment#isHeadless
  */
 public class HeadlessException extends UnsupportedOperationException {
     /*
@@ -40,12 +44,24 @@
     private static final long serialVersionUID = 167183644944358563L;
 
     /**
-     * Constructs new {@code HeadlessException}
+     * Constructs new {@code HeadlessException} with empty message.
+     * For such {@code HeadlessException} the default headless error message
+     * may be auto-generated for some platforms.
+     * The text of the default headless message may depend on
+     * whether the GraphicsEnvironment is in fact headless.
+     * That is, the default headless message is both system and environmentally
+     * dependent.
      */
     public HeadlessException() {}
 
     /**
      * Create a new instance with the specified detailed error message.
+     * For some platforms the default headless error message may be
+     * added at the end of the specified message.
+     * The text of the default headless message may depend on
+     * whether the GraphicsEnvironment is in fact headless.
+     * That is, the default headless message is both system and environmentally
+     * dependent.
      *
      * @param  msg the error message
      */
@@ -54,7 +70,16 @@
     }
 
     /**
-     * {@inheritDoc}
+     * Returns the detail message string of this {@code HeadlessException}.
+     * Depending on the platform the message specified in the constructor may
+     * be followed by the default headless error message.
+     * The text of the default headless message may depend on
+     * whether the GraphicsEnvironment is in fact headless.
+     * That is, the default headless message is both system and environmentally
+     * dependent.
+     *
+     * @return  the detail message string of this {@code HeadlessException}
+     *          instance (which may be {@code null}).
      */
     public String getMessage() {
         String superMessage = super.getMessage();
--- a/jdk/src/java.desktop/share/classes/java/awt/TrayIcon.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/java/awt/TrayIcon.java	Mon Aug 08 08:12:20 2016 -0700
@@ -47,7 +47,8 @@
  * of the events by itself.  For example, by default, when the
  * right-mouse click is performed on the {@code TrayIcon} it
  * displays the specified popup menu.  When the mouse hovers
- * over the {@code TrayIcon} the tooltip is displayed.
+ * over the {@code TrayIcon} the tooltip is displayed (this behaviour is
+ * platform dependent).
  *
  * <p><strong>Note:</strong> When the {@code MouseEvent} is
  * dispatched to its registered listeners its {@code component}
@@ -174,7 +175,7 @@
 
     /**
      * Creates a {@code TrayIcon} with the specified image and
-     * tooltip text.
+     * tooltip text. Tooltip may be not visible on some platforms.
      *
      * @param image the {@code Image} to be used
      * @param tooltip the string to be used as tooltip text; if the
@@ -200,7 +201,7 @@
 
     /**
      * Creates a {@code TrayIcon} with the specified image,
-     * tooltip and popup menu.
+     * tooltip and popup menu. Tooltip may be not visible on some platforms.
      *
      * @param image the {@code Image} to be used
      * @param tooltip the string to be used as tooltip text; if the
@@ -330,8 +331,8 @@
     /**
      * Sets the tooltip string for this {@code TrayIcon}. The
      * tooltip is displayed automatically when the mouse hovers over
-     * the icon.  Setting the tooltip to {@code null} removes any
-     * tooltip text.
+     * the icon.  Tooltip may be not visible on some platforms.
+     * Setting the tooltip to {@code null} removes any tooltip text.
      *
      * When displayed, the tooltip string may be truncated on some platforms;
      * the number of characters that may be displayed is platform-dependent.
--- a/jdk/src/java.desktop/share/classes/java/awt/image/LookupOp.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/java/awt/image/LookupOp.java	Mon Aug 08 08:12:20 2016 -0700
@@ -1,6 +1,6 @@
 
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -253,7 +253,6 @@
      */
     public final WritableRaster filter (Raster src, WritableRaster dst) {
         int numBands  = src.getNumBands();
-        int dstLength = dst.getNumBands();
         int height    = src.getHeight();
         int width     = src.getWidth();
         int srcPix[]  = new int[numBands];
@@ -268,7 +267,7 @@
                 IllegalArgumentException ("Width or height of Rasters do not "+
                                           "match");
         }
-        dstLength = dst.getNumBands();
+        int dstLength = dst.getNumBands();
 
         if (numBands != dstLength) {
             throw new
--- a/jdk/src/java.desktop/share/classes/javax/imageio/metadata/IIOMetadata.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/imageio/metadata/IIOMetadata.java	Mon Aug 08 08:12:20 2016 -0700
@@ -414,14 +414,23 @@
         }
     }
 
+    // If updating this method also see the same in ImageReaderWriterSpi.java
     private Class<?> getMetadataFormatClass(String formatClassName) {
         Module thisModule = IIOMetadata.class.getModule();
         Module targetModule = this.getClass().getModule();
-        Class<?> c = Class.forName(targetModule, formatClassName);
+        Class<?> c = null;
+        try {
+            ClassLoader cl = this.getClass().getClassLoader();
+            c = Class.forName(formatClassName, false, cl);
+            if (!IIOMetadataFormat.class.isAssignableFrom(c)) {
+                return null;
+            }
+        } catch (ClassNotFoundException e) {
+        }
         if (thisModule.equals(targetModule) || c == null) {
             return c;
         }
-        if (thisModule.isNamed()) {
+        if (targetModule.isNamed()) {
             int i = formatClassName.lastIndexOf(".");
             String pn = i > 0 ? formatClassName.substring(0, i) : "";
             if (!targetModule.isExported(pn, thisModule)) {
--- a/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFField.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFField.java	Mon Aug 08 08:12:20 2016 -0700
@@ -517,18 +517,18 @@
      * @param count The number of data values.
      * @param data The actual data content of the field.
      *
-     * @throws NullPointerException if {@code tag&nbsp;==&nbsp;null}.
+     * @throws NullPointerException if {@code tag == null}.
      * @throws IllegalArgumentException if {@code type} is not
      * one of the {@code TIFFTag.TIFF_*} data type constants.
      * @throws IllegalArgumentException if {@code type} is an unacceptable
      * data type for the supplied {@code TIFFTag}.
-     * @throws IllegalArgumentException if {@code count&nbsp;&lt;&nbsp;0}.
-     * @throws IllegalArgumentException if {@code count&nbsp;&lt;&nbsp;1}
+     * @throws IllegalArgumentException if {@code count < 0}.
+     * @throws IllegalArgumentException if {@code count < 1}
      * and {@code type} is {@code TIFF_RATIONAL} or
      * {@code TIFF_SRATIONAL}.
-     * @throws IllegalArgumentException if {@code count&nbsp;&ne;&nbsp;1}
+     * @throws IllegalArgumentException if {@code count != 1}
      * and {@code type} is {@code TIFF_IFD_POINTER}.
-     * @throws NullPointerException if {@code data&nbsp;==&nbsp;null}.
+     * @throws NullPointerException if {@code data == null}.
      * @throws IllegalArgumentException if {@code data} is an instance of
      * a class incompatible with the specified type.
      * @throws IllegalArgumentException if the size of the data array is wrong.
@@ -632,12 +632,12 @@
      * @param type One of the {@code TIFFTag.TIFF_*} constants
      * indicating the data type of the field as written to the TIFF stream.
      * @param count The number of data values.
-     * @throws NullPointerException if {@code tag&nbsp;==&nbsp;null}.
+     * @throws NullPointerException if {@code tag == null}.
      * @throws IllegalArgumentException if {@code type} is not
      * one of the {@code TIFFTag.TIFF_*} data type constants.
      * @throws IllegalArgumentException if {@code type} is an unacceptable
      * data type for the supplied {@code TIFFTag}.
-     * @throws IllegalArgumentException if {@code count&nbsp;&lt;&nbsp;0}.
+     * @throws IllegalArgumentException if {@code count < 0}.
      * @see #TIFFField(TIFFTag,int,int,Object)
      */
     public TIFFField(TIFFTag tag, int type, int count) {
@@ -649,16 +649,16 @@
      * value.
      * The field will have type
      * {@link TIFFTag#TIFF_SHORT  TIFF_SHORT} if
-     * {@code val&nbsp;&lt;&nbsp;65536} and type
+     * {@code val < 65536} and type
      * {@link TIFFTag#TIFF_LONG TIFF_LONG} otherwise.  The count
      * of the field will be unity.
      *
      * @param tag The tag to associate with this field.
      * @param value The value to associate with this field.
-     * @throws NullPointerException if {@code tag&nbsp;==&nbsp;null}.
+     * @throws NullPointerException if {@code tag == null}.
      * @throws IllegalArgumentException if the derived type is unacceptable
      * for the supplied {@code TIFFTag}.
-     * @throws IllegalArgumentException if {@code value&nbsp;&lt;&nbsp;0}.
+     * @throws IllegalArgumentException if {@code value < 0}.
      */
     public TIFFField(TIFFTag tag, int value) {
         if(tag == null) {
@@ -705,19 +705,26 @@
      * @param offset The IFD offset.
      * @param dir The directory.
      *
-     * @throws NullPointerException if {@code tag&nbsp;==&nbsp;null}.
+     * @throws NullPointerException if {@code tag == null}.
+     * @throws IllegalArgumentException if {@code type} is an unacceptable
+     * data type for the supplied {@code TIFFTag}.
      * @throws IllegalArgumentException if {@code type} is neither
      * {@code TIFFTag.TIFF_LONG} nor {@code TIFFTag.TIFF_IFD_POINTER}.
-     * @throws IllegalArgumentException if {@code type} is an unacceptable
-     * data type for the supplied {@code TIFFTag}.
-     * @throws IllegalArgumentException if {@code offset} is non-positive.
-     * @throws NullPointerException if {@code dir&nbsp;==&nbsp;null}.
+     * @throws IllegalArgumentException if {@code offset <= 0}.
+     * @throws NullPointerException if {@code dir == null}.
      *
      * @see #TIFFField(TIFFTag,int,int,Object)
      */
     public TIFFField(TIFFTag tag, int type, long offset, TIFFDirectory dir) {
-        this(tag, type, 1, new long[] {offset});
-        if (type != TIFFTag.TIFF_LONG && type != TIFFTag.TIFF_IFD_POINTER) {
+        if (tag == null) {
+            throw new NullPointerException("tag == null!");
+        } else if (type < TIFFTag.MIN_DATATYPE || type > TIFFTag.MAX_DATATYPE) {
+            throw new IllegalArgumentException("Unknown data type "+type);
+        } else if (!tag.isDataTypeOK(type)) {
+            throw new IllegalArgumentException("Illegal data type " + type
+                + " for " + tag.getName() + " tag");
+        } else if (type != TIFFTag.TIFF_LONG
+                   && type != TIFFTag.TIFF_IFD_POINTER) {
             throw new IllegalArgumentException("type " + type
                 + " is neither TIFFTag.TIFF_LONG nor TIFFTag.TIFF_IFD_POINTER");
         } else if (offset <= 0) {
@@ -726,6 +733,13 @@
         } else if (dir == null) {
             throw new NullPointerException("dir == null");
         }
+
+        this.tag = tag;
+        this.tagNumber = tag.getNumber();
+        this.type = type;
+        this.count = 1;
+        this.data = new long[] {offset};
+
         this.dir = dir;
     }
 
@@ -739,7 +753,7 @@
     }
 
     /**
-     * Retrieves the tag number in the range {@code [0,&nbsp;65535]}.
+     * Retrieves the tag number in the range {@code [0,65535]}.
      *
      * @return The tag number.
      */
@@ -804,7 +818,7 @@
      *
      * @throws IllegalArgumentException if {@code dataType} is not
      * one of the {@code TIFFTag.TIFF_*} data type constants.
-     * @throws IllegalArgumentException if {@code count&nbsp;&lt;&nbsp;0}.
+     * @throws IllegalArgumentException if {@code count < 0}.
      */
     public static Object createArrayForType(int dataType, int count) {
         if(count < 0) {
--- a/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFTag.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFTag.java	Mon Aug 08 08:12:20 2016 -0700
@@ -334,8 +334,8 @@
      * an IFD pointer if and only if its {@code TIFFTagSet} is
      * non-{@code null} or the data type {@code TIFF_IFD_POINTER} is
      * legal. This condition will be satisfied if and only if either
-     * {@code getTagSet()&nbsp;!=&nbsp;null} or
-     * {@code isDataTypeOK(TIFF_IFD_POINTER)&nbsp;==&nbsp;true}.
+     * {@code getTagSet() != null} or
+     * {@code isDataTypeOK(TIFF_IFD_POINTER) == true}.
      *
      * <p>Many TIFF extensions use the IFD mechanism in order to limit the
      * number of new tags that may appear in the root IFD.</p>
--- a/jdk/src/java.desktop/share/classes/javax/imageio/spi/ImageReaderWriterSpi.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/imageio/spi/ImageReaderWriterSpi.java	Mon Aug 08 08:12:20 2016 -0700
@@ -604,14 +604,23 @@
         }
     }
 
+    // If updating this method also see the same in IIOMetadata.java
     private Class<?> getMetadataFormatClass(String formatClassName) {
         Module thisModule = ImageReaderWriterSpi.class.getModule();
         Module targetModule = this.getClass().getModule();
-        Class<?> c = Class.forName(targetModule, formatClassName);
+        Class<?> c = null;
+        try {
+            ClassLoader cl = this.getClass().getClassLoader();
+            c = Class.forName(formatClassName, false, cl);
+            if (!IIOMetadataFormat.class.isAssignableFrom(c)) {
+                return null;
+            }
+        } catch (ClassNotFoundException e) {
+        }
         if (thisModule.equals(targetModule) || c == null) {
             return c;
         }
-        if (thisModule.isNamed()) {
+        if (targetModule.isNamed()) {
             int i = formatClassName.lastIndexOf(".");
             String pn = i > 0 ? formatClassName.substring(0, i) : "";
             if (!targetModule.isExported(pn, thisModule)) {
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicButtonListener.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicButtonListener.java	Mon Aug 08 08:12:20 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -229,10 +229,13 @@
           AbstractButton b = (AbstractButton) e.getSource();
 
           if(b.contains(e.getX(), e.getY())) {
-              long multiClickThreshhold = b.getMultiClickThreshhold();
               long lastTime = lastPressedTimestamp;
-              long currentTime = lastPressedTimestamp = e.getWhen();
-              if (lastTime != -1 && currentTime - lastTime < multiClickThreshhold) {
+              lastPressedTimestamp = e.getWhen();
+              long timeSinceLastClick = lastPressedTimestamp - lastTime;
+              if (lastTime != -1 &&
+                  timeSinceLastClick > 0 &&
+                  timeSinceLastClick < b.getMultiClickThreshhold()) {
+
                   shouldDiscardRelease = true;
                   return;
               }
@@ -325,4 +328,4 @@
                     !((AbstractButton)sender).getModel().isEnabled());
         }
     }
-}
\ No newline at end of file
+}
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextUI.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextUI.java	Mon Aug 08 08:12:20 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -940,9 +940,10 @@
                 rootView.setSize(d.width - i.left - i.right -
                         caretMargin, d.height - i.top - i.bottom);
             }
-            else if (d.width <= 0 || d.height <= 0) {
+            else if (!rootViewInitialized && (d.width <= 0 || d.height <= 0)) {
                 // Probably haven't been layed out yet, force some sort of
                 // initial sizing.
+                rootViewInitialized = true;
                 rootView.setSize(Integer.MAX_VALUE, Integer.MAX_VALUE);
             }
             d.width = (int) Math.min((long) rootView.getPreferredSpan(View.X_AXIS) +
@@ -1346,6 +1347,7 @@
     private static final Position.Bias[] discardBias = new Position.Bias[1];
     private DefaultCaret dropCaret;
     private int caretMargin;
+    private boolean rootViewInitialized;
 
     /**
      * Root view that acts as a gateway between the component
--- a/jdk/src/java.desktop/share/classes/sun/awt/FontConfiguration.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/sun/awt/FontConfiguration.java	Mon Aug 08 08:12:20 2016 -0700
@@ -251,12 +251,24 @@
 
     private File findImpl(String fname) {
         File f = new File(fname + ".properties");
+        if (FontUtilities.debugFonts()) {
+            logger.info("Looking for text fontconfig file : " + f);
+        }
         if (f.canRead()) {
+            if (FontUtilities.debugFonts()) {
+                logger.info("Found file : " + f);
+            }
             isProperties = true;
             return f;
         }
         f = new File(fname + ".bfc");
+        if (FontUtilities.debugFonts()) {
+            logger.info("Looking for binary fontconfig file : " + f);
+        }
         if (f.canRead()) {
+            if (FontUtilities.debugFonts()) {
+                logger.info("Found file : " + f);
+            }
             isProperties = false;
             return f;
         }
@@ -305,6 +317,9 @@
         if (configFile != null) {
             return configFile;
         }
+        if (FontUtilities.debugFonts()) {
+            logger.info("Did not find a fontconfig file.");
+        }
         return null;
     }
 
--- a/jdk/src/java.desktop/share/classes/sun/awt/IconInfo.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/sun/awt/IconInfo.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,10 +25,12 @@
 package sun.awt;
 import java.awt.*;
 import java.awt.color.*;
+import java.awt.geom.AffineTransform;
 import java.awt.image.*;
 import sun.awt.image.ToolkitImage;
 import sun.awt.image.ImageRepresentation;
 import java.util.Arrays;
+import sun.java2d.pipe.Region;
 
 public class IconInfo {
     /**
@@ -101,7 +103,7 @@
         }
         this.scaledWidth = width;
         this.scaledHeight = height;
-        this.rawLength = width * height + 2;
+        this.rawLength = getScaledRawLength();
     }
 
     /*
@@ -110,7 +112,27 @@
     public void setScaledSize(int width, int height) {
         this.scaledWidth = width;
         this.scaledHeight = height;
-        this.rawLength = width * height + 2;
+        this.rawLength = getScaledRawLength();
+    }
+
+    /*
+    * returns scaled raw length.
+     */
+    private int getScaledRawLength() {
+        int scaledWidthAndHeight[] = getScaledWidthAndHeight(width, height);
+        return scaledWidthAndHeight[0] * scaledWidthAndHeight[1] + 2;
+    }
+
+    /*
+    * returns the scaled width and height.
+     */
+    private static int[] getScaledWidthAndHeight(int width, int height) {
+        AffineTransform tx = GraphicsEnvironment.getLocalGraphicsEnvironment().
+                getDefaultScreenDevice().getDefaultConfiguration().
+                getDefaultTransform();
+        int w = Region.clipScale(width, tx.getScaleX());
+        int h = Region.clipScale(height, tx.getScaleY());
+        return new int[]{w, h};
     }
 
     public boolean isValid() {
@@ -215,6 +237,9 @@
             new DirectColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB), 32,
                                  0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000,
                                  false, DataBuffer.TYPE_INT);
+        int scaledWidthAndHeight[] = getScaledWidthAndHeight(width, height);
+        width = scaledWidthAndHeight[0];
+        height = scaledWidthAndHeight[1];
         DataBufferInt buffer = new DataBufferInt(width * height);
         WritableRaster raster =
             Raster.createPackedRaster(buffer, width, height,
--- a/jdk/src/java.desktop/share/classes/sun/awt/RequestFocusController.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/sun/awt/RequestFocusController.java	Mon Aug 08 08:12:20 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2016 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/jdk/src/java.desktop/share/classes/sun/font/FontUtilities.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/sun/font/FontUtilities.java	Mon Aug 08 08:12:20 2016 -0700
@@ -50,12 +50,6 @@
 
     public static boolean isMacOSX;
 
-    public static boolean isSolaris8;
-
-    public static boolean isSolaris9;
-
-    public static boolean isOpenSolaris;
-
     public static boolean useT2K;
 
     public static boolean isWindows;
@@ -88,37 +82,6 @@
                 } else {
                     useT2K = false;
                 }
-                if (isSolaris) {
-                    String version = System.getProperty("os.version", "0.0");
-                    isSolaris8 = version.startsWith("5.8");
-                    isSolaris9 = version.startsWith("5.9");
-                    float ver = Float.parseFloat(version);
-                    if (ver > 5.10f) {
-                        File f = new File("/etc/release");
-                        String line = null;
-                        try {
-                            FileInputStream fis = new FileInputStream(f);
-                            InputStreamReader isr = new InputStreamReader(
-                                                            fis, "ISO-8859-1");
-                            BufferedReader br = new BufferedReader(isr);
-                            line = br.readLine();
-                            fis.close();
-                        } catch (Exception ex) {
-                            // Nothing to do here.
-                        }
-                        if (line != null && line.indexOf("OpenSolaris") >= 0) {
-                            isOpenSolaris = true;
-                        } else {
-                            isOpenSolaris = false;
-                        }
-                    } else {
-                        isOpenSolaris = false;
-                    }
-                } else {
-                    isSolaris8 = false;
-                    isSolaris9 = false;
-                    isOpenSolaris = false;
-                }
                 isWindows = osName.startsWith("Windows");
                 String jreLibDirName = System.getProperty("java.home", "")
                                                       + File.separator + "lib";
--- a/jdk/src/java.desktop/share/classes/sun/font/TrueTypeGlyphMapper.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/sun/font/TrueTypeGlyphMapper.java	Mon Aug 08 08:12:20 2016 -0700
@@ -32,8 +32,6 @@
 
     static final char REVERSE_SOLIDUS = 0x005c; // the backslash char.
     static final char JA_YEN = 0x00a5;
-    static final char JA_FULLWIDTH_TILDE_CHAR = 0xff5e;
-    static final char JA_WAVE_DASH_CHAR = 0x301c;
 
     /* if running on Solaris and default Locale is ja_JP then
      * we map need to remap reverse solidus (backslash) to Yen as
@@ -41,7 +39,6 @@
      */
     static final boolean isJAlocale = Locale.JAPAN.equals(Locale.getDefault());
     private final boolean needsJAremapping;
-    private boolean remapJAWaveDash;
 
     TrueTypeFont font;
     CMap cmap;
@@ -66,10 +63,6 @@
         }
         if (FontUtilities.isSolaris && isJAlocale && font.supportsJA()) {
             needsJAremapping = true;
-            if (FontUtilities.isSolaris8 &&
-                getGlyphFromCMAP(JA_WAVE_DASH_CHAR) == missingGlyph) {
-                remapJAWaveDash = true;
-            }
         } else {
             needsJAremapping = false;
         }
@@ -113,35 +106,12 @@
         cmap = CMap.theNullCmap;
     }
 
-    @SuppressWarnings("fallthrough")
     private final char remapJAChar(char unicode) {
-        switch (unicode) {
-        case REVERSE_SOLIDUS:
-            return JA_YEN;
-            /* This is a workaround for bug 4533422.
-             * Japanese wave dash missing from Solaris JA TrueType fonts.
-             */
-        case JA_WAVE_DASH_CHAR:
-            if (remapJAWaveDash) {
-                return JA_FULLWIDTH_TILDE_CHAR;
-            }
-        default: return unicode;
-        }
+        return (unicode == REVERSE_SOLIDUS) ? JA_YEN : unicode;
     }
-    @SuppressWarnings("fallthrough")
+
     private final int remapJAIntChar(int unicode) {
-        switch (unicode) {
-        case REVERSE_SOLIDUS:
-            return JA_YEN;
-            /* This is a workaround for bug 4533422.
-             * Japanese wave dash missing from Solaris JA TrueType fonts.
-             */
-        case JA_WAVE_DASH_CHAR:
-            if (remapJAWaveDash) {
-                return JA_FULLWIDTH_TILDE_CHAR;
-            }
-        default: return unicode;
-        }
+        return (unicode == REVERSE_SOLIDUS) ? JA_YEN : unicode;
     }
 
     public int charToGlyph(char unicode) {
--- a/jdk/src/java.desktop/share/classes/sun/print/PSPrinterJob.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/sun/print/PSPrinterJob.java	Mon Aug 08 08:12:20 2016 -0700
@@ -105,6 +105,7 @@
 
 //REMIND: Remove use of this class when IPPPrintService is moved to share directory.
 import java.lang.reflect.Method;
+import javax.print.attribute.standard.JobSheets;
 
 /**
  * A class which initiates and executes a PostScript printer job.
@@ -1573,10 +1574,10 @@
 
     private String[] printExecCmd(String printer, String options,
                                   boolean noJobSheet,
-                                  String banner, int copies, String spoolFile) {
+                                  String jobTitle, int copies, String spoolFile) {
         int PRINTER = 0x1;
         int OPTIONS = 0x2;
-        int BANNER  = 0x4;
+        int JOBTITLE  = 0x4;
         int COPIES  = 0x8;
         int NOSHEET = 0x10;
         int pFlags = 0;
@@ -1592,8 +1593,8 @@
             pFlags |= OPTIONS;
             ncomps+=1;
         }
-        if (banner != null && !banner.equals("")) {
-            pFlags |= BANNER;
+        if (jobTitle != null && !jobTitle.equals("")) {
+            pFlags |= JOBTITLE;
             ncomps+=1;
         }
         if (copies > 1) {
@@ -1603,23 +1604,29 @@
         if (noJobSheet) {
             pFlags |= NOSHEET;
             ncomps+=1;
+        } else if (getPrintService().
+                        isAttributeCategorySupported(JobSheets.class)) {
+            ncomps+=1; // for jobsheet
         }
 
-       String osname = System.getProperty("os.name");
-       if (osname.equals("Linux") || osname.contains("OS X")) {
+        String osname = System.getProperty("os.name");
+        if (osname.equals("Linux") || osname.contains("OS X")) {
             execCmd = new String[ncomps];
             execCmd[n++] = "/usr/bin/lpr";
             if ((pFlags & PRINTER) != 0) {
                 execCmd[n++] = "-P" + printer;
             }
-            if ((pFlags & BANNER) != 0) {
-                execCmd[n++] = "-J"  + banner;
+            if ((pFlags & JOBTITLE) != 0) {
+                execCmd[n++] = "-J"  + jobTitle;
             }
             if ((pFlags & COPIES) != 0) {
                 execCmd[n++] = "-#" + copies;
             }
             if ((pFlags & NOSHEET) != 0) {
                 execCmd[n++] = "-h";
+            } else if (getPrintService().
+                        isAttributeCategorySupported(JobSheets.class)) {
+                execCmd[n++] = "-o job-sheets=standard";
             }
             if ((pFlags & OPTIONS) != 0) {
                 execCmd[n++] = new String(options);
@@ -1632,14 +1639,17 @@
             if ((pFlags & PRINTER) != 0) {
                 execCmd[n++] = "-d" + printer;
             }
-            if ((pFlags & BANNER) != 0) {
-                execCmd[n++] = "-t"  + banner;
+            if ((pFlags & JOBTITLE) != 0) {
+                execCmd[n++] = "-t"  + jobTitle;
             }
             if ((pFlags & COPIES) != 0) {
                 execCmd[n++] = "-n" + copies;
             }
             if ((pFlags & NOSHEET) != 0) {
                 execCmd[n++] = "-o nobanner";
+            } else if (getPrintService().
+                        isAttributeCategorySupported(JobSheets.class)) {
+                execCmd[n++] = "-o job-sheets=standard";
             }
             if ((pFlags & OPTIONS) != 0) {
                 execCmd[n++] = "-o" + options;
--- a/jdk/src/java.desktop/share/classes/sun/print/PSStreamPrintService.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/sun/print/PSStreamPrintService.java	Mon Aug 08 08:12:20 2016 -0700
@@ -283,7 +283,16 @@
         } else if (category == OrientationRequested.class) {
             if (flavor == null ||
                 flavor.equals(DocFlavor.SERVICE_FORMATTED.PAGEABLE) ||
-                flavor.equals(DocFlavor.SERVICE_FORMATTED.PRINTABLE)) {
+                flavor.equals(DocFlavor.SERVICE_FORMATTED.PRINTABLE) ||
+                flavor.equals(DocFlavor.INPUT_STREAM.GIF) ||
+                flavor.equals(DocFlavor.INPUT_STREAM.JPEG) ||
+                flavor.equals(DocFlavor.INPUT_STREAM.PNG) ||
+                flavor.equals(DocFlavor.BYTE_ARRAY.GIF) ||
+                flavor.equals(DocFlavor.BYTE_ARRAY.JPEG) ||
+                flavor.equals(DocFlavor.BYTE_ARRAY.PNG) ||
+                flavor.equals(DocFlavor.URL.GIF) ||
+                flavor.equals(DocFlavor.URL.JPEG) ||
+                flavor.equals(DocFlavor.URL.PNG)) {
                 OrientationRequested []arr = new OrientationRequested[3];
                 arr[0] = OrientationRequested.PORTRAIT;
                 arr[1] = OrientationRequested.LANDSCAPE;
--- a/jdk/src/java.desktop/share/classes/sun/print/RasterPrinterJob.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/sun/print/RasterPrinterJob.java	Mon Aug 08 08:12:20 2016 -0700
@@ -1271,6 +1271,12 @@
         JobSheets jobSheets = (JobSheets)attributes.get(JobSheets.class);
         if (jobSheets != null) {
             noJobSheet = jobSheets == JobSheets.NONE;
+        } else {
+            JobSheets js = (JobSheets)getPrintService().
+                                      getDefaultAttributeValue(JobSheets.class);
+            if (js != null && js.equals(JobSheets.NONE)) {
+                noJobSheet = true;
+            }
         }
 
         JobName jobName = (JobName)attributes.get(JobName.class);
--- a/jdk/src/java.desktop/share/classes/sun/print/ServiceDialog.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/sun/print/ServiceDialog.java	Mon Aug 08 08:12:20 2016 -0700
@@ -2759,10 +2759,10 @@
             if (js == null) {
                 js = (JobSheets)psCurrent.getDefaultAttributeValue(jsCategory);
                 if (js == null) {
-                    js = JobSheets.NONE;
+                    js = JobSheets.STANDARD;
                 }
             }
-            cbJobSheets.setSelected(js != JobSheets.NONE);
+            cbJobSheets.setSelected(js != JobSheets.NONE && jsSupported);
             cbJobSheets.setEnabled(jsSupported);
 
             // setup JobPriority spinner
--- a/jdk/src/java.desktop/share/native/libawt/java2d/ShaderList.c	Fri Aug 05 09:50:29 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,143 +0,0 @@
-/*
- * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#include <malloc.h>
-#include <string.h>
-
-#include "ShaderList.h"
-#include "Trace.h"
-
-/**
- * Creates a new ShaderInfo that wraps the given fragment program handle
- * and related data and stores it at the front of the provided ShaderList.
- * If the addition causes the ShaderList to outgrow its defined capacity,
- * the least-recently used item in the list (including its fragment program
- * object) will be disposed.
- */
-void
-ShaderList_AddProgram(ShaderList *programList,
-                      jlong programID,
-                      jint compType, jint compMode, jint flags)
-{
-    ShaderInfo *info;
-
-    J2dTraceLn(J2D_TRACE_INFO, "ShaderList_AddProgram");
-
-    // create new ShaderInfo
-    info = (ShaderInfo *)malloc(sizeof(ShaderInfo));
-    if (info == NULL) {
-        J2dTraceLn(J2D_TRACE_ERROR,
-                   "OGLContext_AddProgram: could not allocate ShaderInfo");
-        return;
-    }
-
-    // fill in the information
-    info->next = programList->head;
-    info->programID = programID;
-    info->compType = compType;
-    info->compMode = compMode;
-    info->flags = flags;
-
-    // insert it at the head of the list
-    programList->head = info;
-
-    // run through the list and see if we need to delete the least
-    // recently used item
-    {
-        int i = 1;
-        ShaderInfo *prev = NULL;
-        ShaderInfo *curr = info->next;
-        while (curr != NULL) {
-            if (i >= programList->maxItems) {
-                prev->next = NULL;
-                programList->dispose(curr->programID);
-                free(curr);
-                break;
-            }
-            i++;
-            prev = curr;
-            curr = curr->next;
-        }
-    }
-}
-
-/**
- * Locates a fragment program handle given a list of shader programs
- * (ShaderInfos), using the provided composite state and flags as search
- * parameters.  The "flags" parameter is a bitwise-or'd value that helps
- * differentiate one program for another; the interpretation of this value
- * varies depending on the type of shader (BufImgOp, Paint, etc) but here
- * it is only used to find another ShaderInfo with that same "flags" value.
- * If no matching program can be located, this method returns 0.
- */
-jlong
-ShaderList_FindProgram(ShaderList *programList,
-                       jint compType, jint compMode, jint flags)
-{
-    ShaderInfo *prev = NULL;
-    ShaderInfo *info = programList->head;
-
-    J2dTraceLn(J2D_TRACE_INFO, "ShaderList_FindProgram");
-
-    while (info != NULL) {
-        if (compType == info->compType &&
-            compMode == info->compMode &&
-            flags == info->flags)
-        {
-            // it's a match: move it to the front of the list (if it's not
-            // there already) and patch up the links
-            if (info != programList->head) {
-                prev->next = info->next;
-                info->next = programList->head;
-                programList->head = info;
-            }
-            return info->programID;
-        }
-        prev = info;
-        info = info->next;
-    }
-    return 0;
-}
-
-/**
- * Disposes all entries (and their associated shader program objects)
- * contained in the given ShaderList.
- */
-void
-ShaderList_Dispose(ShaderList *programList)
-{
-    ShaderInfo *info = programList->head;
-
-    J2dTraceLn(J2D_TRACE_INFO, "ShaderList_Dispose");
-
-    while (info != NULL) {
-        ShaderInfo *tmp = info->next;
-        programList->dispose(info->programID);
-        free(info);
-        info = tmp;
-    }
-
-    programList->head = NULL;
-}
--- a/jdk/src/java.desktop/share/native/libawt/java2d/ShaderList.h	Fri Aug 05 09:50:29 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-/*
- * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#ifndef ShaderList_h_Included
-#define ShaderList_h_Included
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "jni.h"
-#include "jlong.h"
-
-typedef void (ShaderDisposeFunc)(jlong programID);
-
-/**
- * The following structures are used to maintain a list of fragment program
- * objects and their associated attributes.  Each logical shader (e.g.
- * RadialGradientPaint shader, ConvolveOp shader) can have a number of
- * different variants depending on a number of factors, such as whether
- * antialiasing is enabled or the current composite mode.  Since the number
- * of possible combinations of these factors is in the hundreds, we need
- * some way to create fragment programs on an as-needed basis, and also
- * keep them in a limited sized cache to avoid creating too many objects.
- *
- * The ShaderInfo structure keeps a reference to the fragment program's
- * handle, as well as some other values that help differentiate one ShaderInfo
- * from another.  ShaderInfos can be chained together to form a linked list.
- *
- * The ShaderList structure acts as a cache for ShaderInfos, placing
- * most-recently used items at the front, and removing items from the
- * cache when its size exceeds the "maxItems" limit.
- */
-typedef struct _ShaderInfo ShaderInfo;
-
-typedef struct {
-    ShaderInfo        *head;
-    ShaderDisposeFunc *dispose;
-    jint              maxItems;
-} ShaderList;
-
-struct _ShaderInfo {
-    ShaderInfo  *next;
-    jlong       programID;
-    jint        compType;
-    jint        compMode;
-    jint        flags;
-};
-
-void ShaderList_AddProgram(ShaderList *programList,
-                           jlong programID,
-                           jint compType, jint compMode,
-                           jint flags);
-jlong ShaderList_FindProgram(ShaderList *programList,
-                             jint compType, jint compMode,
-                             jint flags);
-void ShaderList_Dispose(ShaderList *programList);
-
-#ifdef __cplusplus
-};
-#endif
-
-#endif /* ShaderList_h_Included */
--- a/jdk/src/java.desktop/share/native/libawt/java2d/loops/GraphicsPrimitiveMgr.c	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/native/libawt/java2d/loops/GraphicsPrimitiveMgr.c	Mon Aug 08 08:12:20 2016 -0700
@@ -104,40 +104,47 @@
     {
         return;
     }
-    RegisterID = (*env)->GetStaticMethodID(env, GPMgr,
-                                           RegisterName, RegisterSig);
-    pNativePrimID = (*env)->GetFieldID(env, GP, "pNativePrim", "J");
-    pixelID = (*env)->GetFieldID(env, SG2D, "pixel", "I");
-    eargbID = (*env)->GetFieldID(env, SG2D, "eargb", "I");
-    clipRegionID = (*env)->GetFieldID(env, SG2D, "clipRegion",
-                                      "Lsun/java2d/pipe/Region;");
-    compositeID = (*env)->GetFieldID(env, SG2D, "composite",
-                                     "Ljava/awt/Composite;");
-    lcdTextContrastID =
-        (*env)->GetFieldID(env, SG2D, "lcdTextContrast", "I");
-    getRgbID = (*env)->GetMethodID(env, Color, "getRGB", "()I");
-    xorPixelID = (*env)->GetFieldID(env, XORComp, "xorPixel", "I");
-    xorColorID = (*env)->GetFieldID(env, XORComp, "xorColor",
-                                    "Ljava/awt/Color;");
-    alphaMaskID = (*env)->GetFieldID(env, XORComp, "alphaMask", "I");
-    ruleID = (*env)->GetFieldID(env, AlphaComp, "rule", "I");
-    extraAlphaID = (*env)->GetFieldID(env, AlphaComp, "extraAlpha", "F");
+    CHECK_NULL(RegisterID =
+        (*env)->GetStaticMethodID(env, GPMgr, RegisterName, RegisterSig));
+    CHECK_NULL(pNativePrimID = (*env)->GetFieldID(env, GP, "pNativePrim", "J"));
+    CHECK_NULL(pixelID = (*env)->GetFieldID(env, SG2D, "pixel", "I"));
+    CHECK_NULL(eargbID = (*env)->GetFieldID(env, SG2D, "eargb", "I"));
+    CHECK_NULL(clipRegionID =
+        (*env)->GetFieldID(env, SG2D, "clipRegion", "Lsun/java2d/pipe/Region;"));
+    CHECK_NULL(compositeID =
+        (*env)->GetFieldID(env, SG2D, "composite", "Ljava/awt/Composite;"));
+    CHECK_NULL(lcdTextContrastID =
+        (*env)->GetFieldID(env, SG2D, "lcdTextContrast", "I"));
+    CHECK_NULL(getRgbID = (*env)->GetMethodID(env, Color, "getRGB", "()I"));
+    CHECK_NULL(xorPixelID = (*env)->GetFieldID(env, XORComp, "xorPixel", "I"));
+    CHECK_NULL(xorColorID =
+        (*env)->GetFieldID(env, XORComp, "xorColor", "Ljava/awt/Color;"));
+    CHECK_NULL(alphaMaskID =
+        (*env)->GetFieldID(env, XORComp, "alphaMask", "I"));
+    CHECK_NULL(ruleID = (*env)->GetFieldID(env, AlphaComp, "rule", "I"));
+    CHECK_NULL(extraAlphaID =
+        (*env)->GetFieldID(env, AlphaComp, "extraAlpha", "F"));
 
 
-    m00ID = (*env)->GetFieldID(env, AT, "m00", "D");
-    m01ID = (*env)->GetFieldID(env, AT, "m01", "D");
-    m02ID = (*env)->GetFieldID(env, AT, "m02", "D");
-    m10ID = (*env)->GetFieldID(env, AT, "m10", "D");
-    m11ID = (*env)->GetFieldID(env, AT, "m11", "D");
-    m12ID = (*env)->GetFieldID(env, AT, "m12", "D");
+    CHECK_NULL(m00ID = (*env)->GetFieldID(env, AT, "m00", "D"));
+    CHECK_NULL(m01ID = (*env)->GetFieldID(env, AT, "m01", "D"));
+    CHECK_NULL(m02ID = (*env)->GetFieldID(env, AT, "m02", "D"));
+    CHECK_NULL(m10ID = (*env)->GetFieldID(env, AT, "m10", "D"));
+    CHECK_NULL(m11ID = (*env)->GetFieldID(env, AT, "m11", "D"));
+    CHECK_NULL(m12ID = (*env)->GetFieldID(env, AT, "m12", "D"));
 
-    path2DTypesID = (*env)->GetFieldID(env, Path2D, "pointTypes", "[B");
-    path2DNumTypesID = (*env)->GetFieldID(env, Path2D, "numTypes", "I");
-    path2DWindingRuleID = (*env)->GetFieldID(env, Path2D, "windingRule", "I");
-    path2DFloatCoordsID = (*env)->GetFieldID(env, Path2DFloat,
-                                             "floatCoords", "[F");
-    sg2dStrokeHintID = (*env)->GetFieldID(env, SG2D, "strokeHint", "I");
-    fid = (*env)->GetStaticFieldID(env, SHints, "INTVAL_STROKE_PURE", "I");
+    CHECK_NULL(path2DTypesID =
+        (*env)->GetFieldID(env, Path2D, "pointTypes", "[B"));
+    CHECK_NULL(path2DNumTypesID =
+        (*env)->GetFieldID(env, Path2D, "numTypes", "I"));
+    CHECK_NULL(path2DWindingRuleID =
+        (*env)->GetFieldID(env, Path2D, "windingRule", "I"));
+    CHECK_NULL(path2DFloatCoordsID =
+        (*env)->GetFieldID(env, Path2DFloat, "floatCoords", "[F"));
+    CHECK_NULL(sg2dStrokeHintID =
+        (*env)->GetFieldID(env, SG2D, "strokeHint", "I"));
+    CHECK_NULL(fid =
+        (*env)->GetStaticFieldID(env, SHints, "INTVAL_STROKE_PURE", "I"));
     sunHints_INTVAL_STROKE_PURE = (*env)->GetStaticIntField(env, SHints, fid);
 }
 
--- a/jdk/src/java.desktop/share/native/libfontmanager/HBShaper.c	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/native/libfontmanager/HBShaper.c	Mon Aug 08 08:12:20 2016 -0700
@@ -278,6 +278,12 @@
      hb_buffer_set_direction(buffer, direction);
 
      chars = (*env)->GetCharArrayElements(env, text, NULL);
+     if ((*env)->ExceptionCheck(env)) {
+         hb_buffer_destroy(buffer);
+         hb_font_destroy(hbfont);
+         free((void*)jdkFontInfo);
+         return JNI_FALSE;
+     }
      len = (*env)->GetArrayLength(env, text);
 
      hb_buffer_add_utf16(buffer, chars, len, offset, limit-offset);
@@ -309,6 +315,7 @@
      hb_font_destroy(hbfont);
      free((void*)jdkFontInfo);
      if (features != NULL) free(features);
+     (*env)->ReleaseCharArrayElements(env, text, chars, JNI_ABORT);
 
      return JNI_TRUE;
 }
--- a/jdk/src/java.desktop/share/native/libjavajpeg/imageioJPEG.c	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/native/libjavajpeg/imageioJPEG.c	Mon Aug 08 08:12:20 2016 -0700
@@ -952,7 +952,7 @@
                                 sb->hstreamBuffer, 0,
                                 sb->bufferLength);
     if ((ret > 0) && ((unsigned int)ret > sb->bufferLength)) {
-         ret = sb->bufferLength;
+         ret = (int)sb->bufferLength;
     }
     if ((*env)->ExceptionOccurred(env)
         || !GET_ARRAYS(env, data, &(src->next_input_byte))) {
@@ -1050,7 +1050,7 @@
                                 JPEGImageReader_readInputDataID,
                                 sb->hstreamBuffer,
                                 offset, buflen);
-    if ((ret > 0) && ((unsigned int)ret > buflen)) ret = buflen;
+    if ((ret > 0) && ((unsigned int)ret > buflen)) ret = (int)buflen;
     if ((*env)->ExceptionOccurred(env)
         || !GET_ARRAYS(env, data, &(src->next_input_byte))) {
         cinfo->err->error_exit((j_common_ptr) cinfo);
@@ -1774,8 +1774,8 @@
             v_samp1 = cinfo->comp_info[1].v_samp_factor;
             v_samp2 = cinfo->comp_info[2].v_samp_factor;
 
-            if ((h_samp1 > h_samp0) && (h_samp2 > h_samp0) ||
-                (v_samp1 > v_samp0) && (v_samp2 > v_samp0))
+            if (((h_samp1 > h_samp0) && (h_samp2 > h_samp0)) ||
+                ((v_samp1 > v_samp0) && (v_samp2 > v_samp0)))
             {
                 cinfo->jpeg_color_space = JCS_YCCK;
                 /* Leave the output space as CMYK */
@@ -1866,7 +1866,6 @@
     pixelBufferPtr pb;
     sun_jpeg_error_ptr jerr;
     boolean done;
-    boolean mustScale = FALSE;
     boolean progressive = FALSE;
     boolean orderedBands = TRUE;
     imageIODataPtr data = (imageIODataPtr)jlong_to_ptr(ptr);
@@ -2634,6 +2633,18 @@
     RELEASE_ARRAYS(env, data, NULL);
 }
 
+static void freeArray(UINT8** arr, jint size) {
+    int i;
+    if (arr != NULL) {
+        for (i = 0; i < size; i++) {
+            if (arr[i] != NULL) {
+                free(arr[i]);
+            }
+        }
+        free(arr);
+    }
+}
+
 JNIEXPORT jboolean JNICALL
 Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_writeImage
     (JNIEnv *env,
@@ -2742,6 +2753,8 @@
                 scale = (UINT8**) calloc(numBands, sizeof(UINT8*));
 
                 if (scale == NULL) {
+                    (*env)->ReleaseIntArrayElements(env, bandSizes,
+                                                    bandSize, JNI_ABORT);
                     JNU_ThrowByName( env, "java/lang/OutOfMemoryError",
                                      "Writing JPEG Stream");
                     return JNI_FALSE;
@@ -2758,6 +2771,8 @@
                     free(scale[j]);
                 }
                 free(scale);
+                (*env)->ReleaseIntArrayElements(env, bandSizes,
+                                                bandSize, JNI_ABORT);
                 JNU_ThrowByName( env, "java/lang/OutOfMemoryError",
                                  "Writing JPEG Stream");
                 return JNI_FALSE;
@@ -2782,21 +2797,14 @@
     pb = &data->pixelBuf;
 
     if (setPixelBuffer(env, pb, buffer) == NOT_OK) {
-        if (scale != NULL) {
-            for (i = 0; i < numBands; i++) {
-                if (scale[i] != NULL) {
-                    free(scale[i]);
-                }
-            }
-            free(scale);
-        }
+        freeArray(scale, numBands);
         return data->abortFlag;  // We already threw an out of memory exception
     }
 
     // Allocate a 1-scanline buffer
     scanLinePtr = (JSAMPROW)malloc(scanLineSize);
     if (scanLinePtr == NULL) {
-        RELEASE_ARRAYS(env, data, (const JOCTET *)(dest->next_output_byte));
+        freeArray(scale, numBands);
         JNU_ThrowByName( env,
                          "java/lang/OutOfMemoryError",
                          "Writing JPEG Stream");
@@ -2818,15 +2826,7 @@
             JNU_ThrowByName(env, "javax/imageio/IIOException", buffer);
         }
 
-        if (scale != NULL) {
-            for (i = 0; i < numBands; i++) {
-                if (scale[i] != NULL) {
-                    free(scale[i]);
-                }
-            }
-            free(scale);
-        }
-
+        freeArray(scale, numBands);
         free(scanLinePtr);
         return data->abortFlag;
     }
@@ -2874,7 +2874,11 @@
     if (qsels) {
         (*env)->ReleaseIntArrayElements(env, QtableSelectors, qsels, JNI_ABORT);
     }
-    if (!success) return data->abortFlag;
+    if (!success) {
+        freeArray(scale, numBands);
+        free(scanLinePtr);
+        return data->abortFlag;
+    }
 
     jpeg_suppress_tables(cinfo, TRUE);  // Disable writing any current
 
@@ -2892,6 +2896,8 @@
     if (GET_ARRAYS(env, data,
                    (const JOCTET **)(&dest->next_output_byte)) == NOT_OK) {
         (*env)->ExceptionClear(env);
+        freeArray(scale, numBands);
+        free(scanLinePtr);
         JNU_ThrowByName(env,
                         "javax/imageio/IIOException",
                         "Array pin failed");
@@ -2926,7 +2932,12 @@
             cinfo->scan_info = cinfo->script_space;
             scanptr = (int *) cinfo->script_space;
             scanData = (*env)->GetIntArrayElements(env, scanInfo, NULL);
-            CHECK_NULL_RETURN(scanData, data->abortFlag);
+            if (scanData == NULL) {
+                RELEASE_ARRAYS(env, data, (const JOCTET *)(dest->next_output_byte));
+                freeArray(scale, numBands);
+                free(scanLinePtr);
+                return data->abortFlag;
+            }
             // number of jints per scan is 9
             // We avoid a memcpy to handle different size ints
             for (i = 0; i < numScans*9; i++) {
@@ -3022,15 +3033,7 @@
         jpeg_abort((j_common_ptr)cinfo);
     }
 
-    if (scale != NULL) {
-        for (i = 0; i < numBands; i++) {
-            if (scale[i] != NULL) {
-                free(scale[i]);
-            }
-        }
-        free(scale);
-    }
-
+    freeArray(scale, numBands);
     free(scanLinePtr);
     RELEASE_ARRAYS(env, data, NULL);
     return data->abortFlag;
--- a/jdk/src/java.desktop/share/native/libjavajpeg/jpegdecoder.c	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/native/libjavajpeg/jpegdecoder.c	Mon Aug 08 08:12:20 2016 -0700
@@ -358,7 +358,7 @@
     }
     ret = (*env)->CallIntMethod(env, src->hInputStream, InputStream_readID,
                                 src->hInputBuffer, offset, buflen);
-    if ((ret > 0) && ((unsigned int)ret > buflen)) ret = buflen;
+    if ((ret > 0) && ((unsigned int)ret > buflen)) ret = (int)buflen;
     if ((*env)->ExceptionOccurred(env) || !GET_ARRAYS(env, src)) {
         cinfo->err->error_exit((struct jpeg_common_struct *) cinfo);
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.desktop/share/native/liblcms/cmsalpha.c	Mon Aug 08 08:12:20 2016 -0700
@@ -0,0 +1,547 @@
+/*
+ * 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.
+ */
+
+// This file is available under and governed by the GNU General Public
+// License version 2 only, as published by the Free Software Foundation.
+// However, the following notice accompanied the original version of this
+// file:
+//
+//---------------------------------------------------------------------------------
+//
+//  Little Color Management System
+//  Copyright (c) 1998-2016 Marti Maria Saguer
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the Software
+// is furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
+// THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+//---------------------------------------------------------------------------------
+//
+
+#include "lcms2_internal.h"
+
+
+// Alpha copy ------------------------------------------------------------------------------------------------------------------
+
+// Floor to byte, taking care of saturation
+cmsINLINE cmsUInt8Number _cmsQuickSaturateByte(cmsFloat64Number d)
+{
+       d += 0.5;
+       if (d <= 0) return 0;
+       if (d >= 255.0) return 255;
+
+       return (cmsUInt8Number) _cmsQuickFloorWord(d);
+}
+
+
+// Return the size in bytes of a given formatter
+static
+int trueBytesSize(cmsUInt32Number Format)
+{
+       int fmt_bytes = T_BYTES(Format);
+
+       // For double, the T_BYTES field returns zero
+       if (fmt_bytes == 0)
+              return sizeof(double);
+
+       // Otherwise, it is already correct for all formats
+       return fmt_bytes;
+}
+
+
+// Several format converters
+
+typedef void(*cmsFormatterAlphaFn)(void* dst, const void* src);
+
+
+// From 8
+
+static
+void copy8(void* dst, const void* src)
+{
+       memmove(dst, src, 1);
+}
+
+static
+void from8to16(void* dst, const void* src)
+{
+       cmsUInt8Number n = *(cmsUInt8Number*)src;
+       *(cmsUInt16Number*) dst = FROM_8_TO_16(n);
+}
+
+static
+void from8toFLT(void* dst, const void* src)
+{
+       *(cmsFloat32Number*)dst = (*(cmsUInt8Number*)src) / 255.0f;
+}
+
+static
+void from8toDBL(void* dst, const void* src)
+{
+       *(cmsFloat64Number*)dst = (*(cmsUInt8Number*)src) / 255.0;
+}
+
+static
+void from8toHLF(void* dst, const void* src)
+{
+       cmsFloat32Number n = (*(cmsUInt8Number*)src) / 255.0f;
+       *(cmsUInt16Number*)dst = _cmsFloat2Half(n);
+}
+
+// From 16
+
+static
+void from16to8(void* dst, const void* src)
+{
+       cmsUInt16Number n = *(cmsUInt16Number*)src;
+       *(cmsUInt8Number*) dst = FROM_16_TO_8(n);
+}
+
+static
+void copy16(void* dst, const void* src)
+{
+       memmove(dst, src, 2);
+}
+
+void from16toFLT(void* dst, const void* src)
+{
+       *(cmsFloat32Number*)dst = (*(cmsUInt16Number*)src) / 65535.0f;
+}
+
+void from16toDBL(void* dst, const void* src)
+{
+       *(cmsFloat64Number*)dst = (*(cmsUInt16Number*)src) / 65535.0f;
+}
+
+static
+void from16toHLF(void* dst, const void* src)
+{
+       cmsFloat32Number n = (*(cmsUInt16Number*)src) / 65535.0f;
+       *(cmsUInt16Number*)dst = _cmsFloat2Half(n);
+}
+
+// From Float
+
+static
+void fromFLTto8(void* dst, const void* src)
+{
+       cmsFloat32Number n = *(cmsFloat32Number*)src;
+       *(cmsUInt8Number*)dst = _cmsQuickSaturateByte(n * 255.0f);
+}
+
+static
+void fromFLTto16(void* dst, const void* src)
+{
+       cmsFloat32Number n = *(cmsFloat32Number*)src;
+       *(cmsUInt16Number*)dst = _cmsQuickSaturateWord(n * 65535.0f);
+}
+
+static
+void copy32(void* dst, const void* src)
+{
+       memmove(dst, src, sizeof(cmsFloat32Number));
+}
+
+static
+void fromFLTtoDBL(void* dst, const void* src)
+{
+       cmsFloat32Number n = *(cmsFloat32Number*)src;
+       *(cmsFloat64Number*)dst = (cmsFloat64Number)n;
+}
+
+static
+void fromFLTtoHLF(void* dst, const void* src)
+{
+       cmsFloat32Number n = *(cmsFloat32Number*)src;
+       *(cmsUInt16Number*)dst = _cmsFloat2Half(n);
+}
+
+
+// From HALF
+
+static
+void fromHLFto8(void* dst, const void* src)
+{
+       cmsFloat32Number n = _cmsHalf2Float(*(cmsUInt16Number*)src);
+       *(cmsUInt8Number*)dst = _cmsQuickSaturateByte(n * 255.0f);
+}
+
+static
+void fromHLFto16(void* dst, const void* src)
+{
+       cmsFloat32Number n = _cmsHalf2Float(*(cmsUInt16Number*)src);
+       *(cmsUInt16Number*)dst = _cmsQuickSaturateWord(n * 65535.0f);
+}
+
+static
+void fromHLFtoFLT(void* dst, const void* src)
+{
+       *(cmsFloat32Number*)dst = _cmsHalf2Float(*(cmsUInt16Number*)src);
+}
+
+static
+void fromHLFtoDBL(void* dst, const void* src)
+{
+       *(cmsFloat64Number*)dst = (cmsFloat64Number)_cmsHalf2Float(*(cmsUInt16Number*)src);
+}
+
+// From double
+static
+void fromDBLto8(void* dst, const void* src)
+{
+       cmsFloat64Number n = *(cmsFloat64Number*)src;
+       *(cmsUInt8Number*)dst = _cmsQuickSaturateByte(n * 255.0);
+}
+
+static
+void fromDBLto16(void* dst, const void* src)
+{
+       cmsFloat64Number n = *(cmsFloat64Number*)src;
+       *(cmsUInt16Number*)dst = _cmsQuickSaturateWord(n * 65535.0f);
+}
+
+static
+void fromDBLtoFLT(void* dst, const void* src)
+{
+       cmsFloat64Number n = *(cmsFloat64Number*)src;
+       *(cmsFloat32Number*)dst = (cmsFloat32Number) n;
+}
+
+static
+void fromDBLtoHLF(void* dst, const void* src)
+{
+       cmsFloat32Number n = (cmsFloat32Number) *(cmsFloat64Number*)src;
+       *(cmsUInt16Number*)dst = _cmsFloat2Half(n);
+}
+
+static
+void copy64(void* dst, const void* src)
+{
+       memmove(dst, src, sizeof(cmsFloat64Number));
+}
+
+
+// Returns the position (x or y) of the formatter in the table of functions
+static
+int FormatterPos(cmsUInt32Number frm)
+{
+       int  b = T_BYTES(frm);
+
+       if (b == 0 && T_FLOAT(frm))
+              return 4; // DBL
+       if (b == 2 && T_FLOAT(frm))
+              return 2; // HLF
+       if (b == 4 && T_FLOAT(frm))
+              return 3; // FLT
+       if (b == 2 && !T_FLOAT(frm))
+              return 1; // 16
+       if (b == 1 && !T_FLOAT(frm))
+              return 0; // 8
+
+       return -1; // not recognized
+
+}
+
+// Obtains a alpha-to-alpha funmction formatter
+static
+cmsFormatterAlphaFn _cmsGetFormatterAlpha(cmsContext id, cmsUInt32Number in, cmsUInt32Number out)
+{
+static cmsFormatterAlphaFn FormattersAlpha[5][5] = {
+
+       /* from 8 */  { copy8,      from8to16,   from8toHLF,   from8toFLT,   from8toDBL   },
+       /* from 16*/  { from16to8,  copy16,      from16toHLF,  from16toFLT,  from16toDBL  },
+       /* from HLF*/ { fromHLFto8, fromHLFto16, copy16,       fromHLFtoFLT, fromHLFtoDBL },
+       /* from FLT*/ { fromFLTto8, fromFLTto16, fromFLTtoHLF, copy32,       fromFLTtoDBL },
+       /* from DBL*/ { fromDBLto8, fromDBLto16, fromDBLtoHLF, fromDBLtoFLT, copy64 }};
+
+        int in_n  = FormatterPos(in);
+        int out_n = FormatterPos(out);
+
+        if (in_n < 0 || out_n < 0 || in_n > 4 || out_n > 4) {
+
+               cmsSignalError(id, cmsERROR_UNKNOWN_EXTENSION, "Unrecognized alpha channel width");
+               return NULL;
+        }
+
+        return FormattersAlpha[in_n][out_n];
+}
+
+
+
+// This function computes the distance from each component to the next one in bytes.
+static
+void ComputeIncrementsForChunky(cmsUInt32Number Format,
+                                cmsUInt32Number ComponentStartingOrder[],
+                                cmsUInt32Number ComponentPointerIncrements[])
+{
+       cmsUInt32Number channels[cmsMAXCHANNELS];
+       int extra = T_EXTRA(Format);
+       int nchannels = T_CHANNELS(Format);
+       int total_chans = nchannels + extra;
+       int i;
+       int channelSize = trueBytesSize(Format);
+       int pixelSize = channelSize * total_chans;
+
+           // Sanity check
+           if (total_chans <= 0 || total_chans >= cmsMAXCHANNELS)
+                   return;
+
+        memset(channels, 0, sizeof(channels));
+
+       // Separation is independent of starting point and only depends on channel size
+       for (i = 0; i < extra; i++)
+              ComponentPointerIncrements[i] = pixelSize;
+
+       // Handle do swap
+       for (i = 0; i < total_chans; i++)
+       {
+              if (T_DOSWAP(Format)) {
+                     channels[i] = total_chans - i - 1;
+              }
+              else {
+                     channels[i] = i;
+              }
+       }
+
+       // Handle swap first (ROL of positions), example CMYK -> KCMY | 0123 -> 3012
+       if (T_SWAPFIRST(Format) && total_chans > 1) {
+
+              cmsUInt32Number tmp = channels[0];
+              for (i = 0; i < total_chans-1; i++)
+                     channels[i] = channels[i + 1];
+
+              channels[total_chans - 1] = tmp;
+       }
+
+       // Handle size
+       if (channelSize > 1)
+              for (i = 0; i < total_chans; i++) {
+                     channels[i] *= channelSize;
+              }
+
+       for (i = 0; i < extra; i++)
+              ComponentStartingOrder[i] = channels[i + nchannels];
+}
+
+
+
+//  On planar configurations, the distance is the stride added to any non-negative
+static
+void ComputeIncrementsForPlanar(cmsUInt32Number Format,
+                                cmsUInt32Number BytesPerPlane,
+                                cmsUInt32Number ComponentStartingOrder[],
+                                cmsUInt32Number ComponentPointerIncrements[])
+{
+       cmsUInt32Number channels[cmsMAXCHANNELS];
+       int extra = T_EXTRA(Format);
+       int nchannels = T_CHANNELS(Format);
+       int total_chans = nchannels + extra;
+       int i;
+       int channelSize = trueBytesSize(Format);
+
+       // Sanity check
+       if (total_chans <= 0 || total_chans >= cmsMAXCHANNELS)
+           return;
+
+       memset(channels, 0, sizeof(channels));
+
+       // Separation is independent of starting point and only depends on channel size
+       for (i = 0; i < extra; i++)
+              ComponentPointerIncrements[i] = channelSize;
+
+       // Handle do swap
+       for (i = 0; i < total_chans; i++)
+       {
+              if (T_DOSWAP(Format)) {
+                     channels[i] = total_chans - i - 1;
+              }
+              else {
+                     channels[i] = i;
+              }
+       }
+
+       // Handle swap first (ROL of positions), example CMYK -> KCMY | 0123 -> 3012
+       if (T_SWAPFIRST(Format) && total_chans > 0) {
+
+              cmsUInt32Number tmp = channels[0];
+              for (i = 0; i < total_chans - 1; i++)
+                     channels[i] = channels[i + 1];
+
+              channels[total_chans - 1] = tmp;
+       }
+
+       // Handle size
+       for (i = 0; i < total_chans; i++) {
+              channels[i] *= BytesPerPlane;
+       }
+
+       for (i = 0; i < extra; i++)
+              ComponentStartingOrder[i] = channels[i + nchannels];
+}
+
+
+
+// Dispatcher por chunky and planar RGB
+static
+void  ComputeComponentIncrements(cmsUInt32Number Format,
+                                 cmsUInt32Number BytesPerPlane,
+                                 cmsUInt32Number ComponentStartingOrder[],
+                                 cmsUInt32Number ComponentPointerIncrements[])
+{
+       if (T_PLANAR(Format)) {
+
+              ComputeIncrementsForPlanar(Format,  BytesPerPlane, ComponentStartingOrder, ComponentPointerIncrements);
+       }
+       else {
+              ComputeIncrementsForChunky(Format,  ComponentStartingOrder, ComponentPointerIncrements);
+       }
+
+}
+
+
+
+// Handles extra channels copying alpha if requested by the flags
+void _cmsHandleExtraChannels(_cmsTRANSFORM* p, const void* in,
+                                               void* out,
+                                               cmsUInt32Number PixelsPerLine,
+                                               cmsUInt32Number LineCount,
+                                               const cmsStride* Stride)
+{
+    cmsUInt32Number i, j, k;
+    cmsUInt32Number nExtra;
+    cmsUInt32Number SourceStartingOrder[cmsMAXCHANNELS];
+    cmsUInt32Number SourceIncrements[cmsMAXCHANNELS];
+    cmsUInt32Number DestStartingOrder[cmsMAXCHANNELS];
+    cmsUInt32Number DestIncrements[cmsMAXCHANNELS];
+
+    cmsFormatterAlphaFn copyValueFn;
+
+    // Make sure we need some copy
+    if (!(p->dwOriginalFlags & cmsFLAGS_COPY_ALPHA))
+        return;
+
+    // Exit early if in-place color-management is occurring - no need to copy extra channels to themselves.
+    if (p->InputFormat == p->OutputFormat && in == out)
+        return;
+
+    // Make sure we have same number of alpha channels. If not, just return as this should be checked at transform creation time.
+    nExtra = T_EXTRA(p->InputFormat);
+    if (nExtra != T_EXTRA(p->OutputFormat))
+        return;
+
+    // Anything to do?
+    if (nExtra == 0)
+        return;
+
+    // Compute the increments
+    ComputeComponentIncrements(p->InputFormat, Stride->BytesPerPlaneIn, SourceStartingOrder, SourceIncrements);
+    ComputeComponentIncrements(p->OutputFormat, Stride->BytesPerPlaneOut, DestStartingOrder, DestIncrements);
+
+    // Check for conversions 8, 16, half, float, dbl
+    copyValueFn = _cmsGetFormatterAlpha(p->ContextID, p->InputFormat, p->OutputFormat);
+
+    if (nExtra == 1) { // Optimized routine for copying a single extra channel quickly
+
+        cmsUInt8Number* SourcePtr;
+        cmsUInt8Number* DestPtr;
+
+        cmsUInt32Number SourceStrideIncrement = 0;
+        cmsUInt32Number DestStrideIncrement = 0;
+
+        // The loop itself
+        for (i = 0; i < LineCount; i++) {
+
+            // Prepare pointers for the loop
+            SourcePtr = (cmsUInt8Number*)in + SourceStartingOrder[0] + SourceStrideIncrement;
+            DestPtr = (cmsUInt8Number*)out + DestStartingOrder[0] + DestStrideIncrement;
+
+            for (j = 0; j < PixelsPerLine; j++) {
+
+                copyValueFn(DestPtr, SourcePtr);
+
+                SourcePtr += SourceIncrements[0];
+                DestPtr += DestIncrements[0];
+            }
+
+            SourceStrideIncrement += Stride->BytesPerLineIn;
+            DestStrideIncrement += Stride->BytesPerLineOut;
+        }
+
+    }
+    else { // General case with more than one extra channel
+
+        cmsUInt8Number* SourcePtr[cmsMAXCHANNELS];
+        cmsUInt8Number* DestPtr[cmsMAXCHANNELS];
+
+        cmsUInt32Number SourceStrideIncrements[cmsMAXCHANNELS];
+        cmsUInt32Number DestStrideIncrements[cmsMAXCHANNELS];
+
+        memset(SourceStrideIncrements, 0, sizeof(SourceStrideIncrements));
+        memset(DestStrideIncrements, 0, sizeof(DestStrideIncrements));
+
+        // The loop itself
+        for (i = 0; i < LineCount; i++) {
+
+            // Prepare pointers for the loop
+            for (j = 0; j < nExtra; j++) {
+
+                SourcePtr[j] = (cmsUInt8Number*)in + SourceStartingOrder[j] + SourceStrideIncrements[j];
+                DestPtr[j] = (cmsUInt8Number*)out + DestStartingOrder[j] + DestStrideIncrements[j];
+            }
+
+            for (j = 0; j < PixelsPerLine; j++) {
+
+                for (k = 0; k < nExtra; k++) {
+
+                    copyValueFn(DestPtr[k], SourcePtr[k]);
+
+                    SourcePtr[k] += SourceIncrements[k];
+                    DestPtr[k] += DestIncrements[k];
+                }
+            }
+
+            for (j = 0; j < nExtra; j++) {
+
+                SourceStrideIncrements[j] += Stride->BytesPerLineIn;
+                DestStrideIncrements[j] += Stride->BytesPerLineOut;
+            }
+        }
+    }
+}
+
+
--- a/jdk/src/java.desktop/share/native/liblcms/cmscam02.c	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/native/liblcms/cmscam02.c	Mon Aug 08 08:12:20 2016 -0700
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2012 Marti Maria Saguer
+//  Copyright (c) 1998-2016 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
--- a/jdk/src/java.desktop/share/native/liblcms/cmscgats.c	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/native/liblcms/cmscgats.c	Mon Aug 08 08:12:20 2016 -0700
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2012 Marti Maria Saguer
+//  Copyright (c) 1998-2016 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
@@ -625,7 +625,7 @@
 }
 
 // Parses a float number
-// This can not call directly atof because it uses locale dependant
+// This can not call directly atof because it uses locale dependent
 // parsing, while CCMX files always use . as decimal separator
 static
 cmsFloat64Number ParseFloatNumber(const char *Buffer)
@@ -830,11 +830,11 @@
 
                     if (it8 ->sy == SINUM) {
 
-                        sprintf(it8->id, "%d", it8->inum);
+                        snprintf(it8->id, 127, "%d", it8->inum);
                     }
                     else {
 
-                        sprintf(it8->id, it8 ->DoubleFormatter, it8->dnum);
+                        snprintf(it8->id, 127, it8 ->DoubleFormatter, it8->dnum);
                     }
 
                     k = (int) strlen(it8 ->id);
@@ -1392,7 +1392,7 @@
     cmsIT8* it8 = (cmsIT8*) hIT8;
     char Buffer[1024];
 
-    sprintf(Buffer, it8->DoubleFormatter, Val);
+    snprintf(Buffer, 1023, it8->DoubleFormatter, Val);
 
     return AddToList(it8, &GetTable(it8)->HeaderList, cProp, NULL, Buffer, WRITE_UNCOOKED) != NULL;
 }
@@ -1402,7 +1402,7 @@
     cmsIT8* it8 = (cmsIT8*) hIT8;
     char Buffer[1024];
 
-    sprintf(Buffer, "%u", Val);
+    snprintf(Buffer, 1023, "%u", Val);
 
     return AddToList(it8, &GetTable(it8)->HeaderList, cProp, NULL, Buffer, WRITE_HEXADECIMAL) != NULL;
 }
@@ -1846,7 +1846,7 @@
 }
 
 
-// -------------------------------------------------------------- Higer level parsing
+// -------------------------------------------------------------- Higher level parsing
 
 static
 cmsBool DataFormatSection(cmsIT8* it8)
@@ -2149,7 +2149,7 @@
 
 
 
-// Init usefull pointers
+// Init useful pointers
 
 static
 void CookPointers(cmsIT8* it8)
@@ -2546,9 +2546,9 @@
 
         fld = GetDataFormat(it8, i);
         if (fld != NULL) {
-        if (cmsstrcasecmp(fld, cSample) == 0)
-            return i;
-    }
+            if (cmsstrcasecmp(fld, cSample) == 0)
+                return i;
+        }
     }
 
     return -1;
@@ -2606,7 +2606,7 @@
 
     _cmsAssert(hIT8 != NULL);
 
-    sprintf(Buff, it8->DoubleFormatter, Val);
+    snprintf(Buff, 255, it8->DoubleFormatter, Val);
 
     return SetData(it8, row, col, Buff);
 }
--- a/jdk/src/java.desktop/share/native/liblcms/cmscnvrt.c	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/native/liblcms/cmscnvrt.c	Mon Aug 08 08:12:20 2016 -0700
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2012 Marti Maria Saguer
+//  Copyright (c) 1998-2016 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
@@ -136,7 +136,7 @@
 };
 
 
-// A pointer to the begining of the list
+// A pointer to the beginning of the list
 _cmsIntentsPluginChunkType _cmsIntentsPluginChunk = { NULL };
 
 // Duplicates the zone of memory used by the plug-in in the new context
@@ -299,6 +299,7 @@
     cmsMAT3 Scale, m1, m2, m3, m4;
 
     // TODO: Follow Marc Mahy's recommendation to check if CHAD is same by using M1*M2 == M2*M1. If so, do nothing.
+    // TODO: Add support for ArgyllArts tag
 
     // Adaptation state
     if (AdaptationState == 1.0) {
@@ -917,7 +918,7 @@
         return TRUE;
     }
 
-    // Make sure to pass thru K (which now is fixed)
+    // Make sure to pass through K (which now is fixed)
     Outf[3] = LabK[3];
 
     // Apply TAC if needed
@@ -985,7 +986,7 @@
     memset(&bp, 0, sizeof(bp));
 
     // We need the input LUT of the last profile, assuming this one is responsible of
-    // black generation. This LUT will be seached in inverse order.
+    // black generation. This LUT will be searched in inverse order.
     bp.LabK2cmyk = _cmsReadInputLUT(hProfiles[nProfiles-1], INTENT_RELATIVE_COLORIMETRIC);
     if (bp.LabK2cmyk == NULL) goto Cleanup;
 
--- a/jdk/src/java.desktop/share/native/liblcms/cmserr.c	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/native/liblcms/cmserr.c	Mon Aug 08 08:12:20 2016 -0700
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2015 Marti Maria Saguer
+//  Copyright (c) 1998-2016 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
@@ -227,7 +227,7 @@
     }
 }
 
-// Auxiliar to fill memory management functions from plugin (or context 0 defaults)
+// Auxiliary to fill memory management functions from plugin (or context 0 defaults)
 void _cmsInstallAllocFunctions(cmsPluginMemHandler* Plugin, _cmsMemPluginChunkType* ptr)
 {
     if (Plugin == NULL) {
@@ -459,14 +459,14 @@
 
 // Error logging ******************************************************************
 
-// There is no error handling at all. When a funtion fails, it returns proper value.
+// There is no error handling at all. When a function fails, it returns proper value.
 // For example, all create functions does return NULL on failure. Other return FALSE
 // It may be interesting, for the developer, to know why the function is failing.
 // for that reason, lcms2 does offer a logging function. This function does recive
 // a ENGLISH string with some clues on what is going wrong. You can show this
 // info to the end user, or just create some sort of log.
 // The logging function should NOT terminate the program, as this obviously can leave
-// resources. It is the programmer's responsability to check each function return code
+// resources. It is the programmer's responsibility to check each function return code
 // to make sure it didn't fail.
 
 // Error messages are limited to MAX_ERROR_MESSAGE_LEN
--- a/jdk/src/java.desktop/share/native/liblcms/cmsgamma.c	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/native/liblcms/cmsgamma.c	Mon Aug 08 08:12:20 2016 -0700
@@ -596,7 +596,7 @@
     return Val;
 }
 
-// Evaluate a segmented funtion for a single value. Return -1 if no valid segment found .
+// Evaluate a segmented function for a single value. Return -1 if no valid segment found .
 // If fn type is 0, perform an interpolation on the table
 static
 cmsFloat64Number EvalSegmentedFn(const cmsToneCurve *g, cmsFloat64Number R)
--- a/jdk/src/java.desktop/share/native/liblcms/cmsgmt.c	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/native/liblcms/cmsgmt.c	Mon Aug 08 08:12:20 2016 -0700
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2012 Marti Maria Saguer
+//  Copyright (c) 1998-2016 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
@@ -56,7 +56,7 @@
 #include "lcms2_internal.h"
 
 
-// Auxiliar: append a Lab identity after the given sequence of profiles
+// Auxiliary: append a Lab identity after the given sequence of profiles
 // and return the transform. Lab profile is closed, rest of profiles are kept open.
 cmsHTRANSFORM _cmsChain2Lab(cmsContext            ContextID,
                             cmsUInt32Number        nProfiles,
@@ -201,7 +201,7 @@
     }
 
     // Build the relationship. This effectively limits the maximum accuracy to 16 bits, but
-    // since this is used on black-preserving LUTs, we are not loosing  accuracy in any case
+    // since this is used on black-preserving LUTs, we are not losing  accuracy in any case
     KTone = cmsJoinToneCurve(ContextID, in, out, nPoints);
 
     // Get rid of components
@@ -307,7 +307,7 @@
 }
 
 // Does compute a gamut LUT going back and forth across pcs -> relativ. colorimetric intent -> pcs
-// the dE obtained is then annotated on the LUT. Values truely out of gamut are clipped to dE = 0xFFFE
+// the dE obtained is then annotated on the LUT. Values truly out of gamut are clipped to dE = 0xFFFE
 // and values changed are supposed to be handled by any gamut remapping, so, are out of gamut as well.
 //
 // **WARNING: This algorithm does assume that gamut remapping algorithms does NOT move in-gamut colors,
--- a/jdk/src/java.desktop/share/native/liblcms/cmshalf.c	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/native/liblcms/cmshalf.c	Mon Aug 08 08:12:20 2016 -0700
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2012 Marti Maria Saguer
+//  Copyright (c) 1998-2016 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
--- a/jdk/src/java.desktop/share/native/liblcms/cmsintrp.c	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/native/liblcms/cmsintrp.c	Mon Aug 08 08:12:20 2016 -0700
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2012 Marti Maria Saguer
+//  Copyright (c) 1998-2016 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
@@ -185,7 +185,7 @@
     int i;
     cmsUInt32Number Samples[MAX_INPUT_DIMENSIONS];
 
-    // Fill the auxiliar array
+    // Fill the auxiliary array
     for (i=0; i < MAX_INPUT_DIMENSIONS; i++)
         Samples[i] = nSamples;
 
--- a/jdk/src/java.desktop/share/native/liblcms/cmsio0.c	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/native/liblcms/cmsio0.c	Mon Aug 08 08:12:20 2016 -0700
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2012 Marti Maria Saguer
+//  Copyright (c) 1998-2016 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
@@ -353,7 +353,7 @@
     return nReaded;
 }
 
-// Postion file pointer in the file
+// Position file pointer in the file
 static
 cmsBool  FileSeek(cmsIOHANDLER* iohandler, cmsUInt32Number offset)
 {
@@ -397,6 +397,7 @@
 {
     cmsIOHANDLER* iohandler = NULL;
     FILE* fm = NULL;
+    cmsInt32Number fileLen;
 
     _cmsAssert(FileName != NULL);
     _cmsAssert(AccessMode != NULL);
@@ -413,7 +414,16 @@
              cmsSignalError(ContextID, cmsERROR_FILE, "File '%s' not found", FileName);
             return NULL;
         }
-        iohandler -> ReportedSize = (cmsUInt32Number) cmsfilelength(fm);
+        fileLen = cmsfilelength(fm);
+        if (fileLen < 0)
+        {
+            fclose(fm);
+            _cmsFree(ContextID, iohandler);
+            cmsSignalError(ContextID, cmsERROR_FILE, "Cannot get size of file '%s'", FileName);
+            return NULL;
+        }
+
+        iohandler -> ReportedSize = (cmsUInt32Number) fileLen;
         break;
 
     case 'w':
@@ -453,6 +463,14 @@
 cmsIOHANDLER* CMSEXPORT cmsOpenIOhandlerFromStream(cmsContext ContextID, FILE* Stream)
 {
     cmsIOHANDLER* iohandler = NULL;
+    cmsInt32Number fileSize;
+
+    fileSize = cmsfilelength(Stream);
+    if (fileSize < 0)
+    {
+        cmsSignalError(ContextID, cmsERROR_FILE, "Cannot get size of stream");
+        return NULL;
+    }
 
     iohandler = (cmsIOHANDLER*) _cmsMallocZero(ContextID, sizeof(cmsIOHANDLER));
     if (iohandler == NULL) return NULL;
@@ -460,7 +478,7 @@
     iohandler -> ContextID = ContextID;
     iohandler -> stream = (void*) Stream;
     iohandler -> UsedSpace = 0;
-    iohandler -> ReportedSize = (cmsUInt32Number) cmsfilelength(Stream);
+    iohandler -> ReportedSize = (cmsUInt32Number) fileSize;
     iohandler -> PhysicalFile[0] = 0;
 
     iohandler ->Read    = FileRead;
@@ -652,7 +670,7 @@
 }
 
 
-// Check existance
+// Check existence
 cmsBool CMSEXPORT cmsIsTag(cmsHPROFILE hProfile, cmsTagSignature sig)
 {
        _cmsICCPROFILE*  Icc = (_cmsICCPROFILE*) (void*) hProfile;
@@ -708,7 +726,7 @@
         return FALSE;
     }
 
-    // Adjust endianess of the used parameters
+    // Adjust endianness of the used parameters
     Icc -> DeviceClass     = (cmsProfileClassSignature) _cmsAdjustEndianess32(Header.deviceClass);
     Icc -> ColorSpace      = (cmsColorSpaceSignature)   _cmsAdjustEndianess32(Header.colorSpace);
     Icc -> PCS             = (cmsColorSpaceSignature)   _cmsAdjustEndianess32(Header.pcs);
@@ -826,7 +844,7 @@
 
     memset(&Header.reserved, 0, sizeof(Header.reserved));
 
-    // Set profile ID. Endianess is always big endian
+    // Set profile ID. Endianness is always big endian
     memmove(&Header.profileID, &Icc ->ProfileID, 16);
 
     // Dump the header
@@ -836,7 +854,7 @@
 
     // Get true count
     for (i=0;  i < Icc -> TagCount; i++) {
-        if (Icc ->TagNames[i] != 0)
+        if (Icc ->TagNames[i] != (cmsTagSignature) 0)
             Count++;
     }
 
@@ -845,7 +863,7 @@
 
     for (i=0; i < Icc -> TagCount; i++) {
 
-        if (Icc ->TagNames[i] == 0) continue;   // It is just a placeholder
+        if (Icc ->TagNames[i] == (cmsTagSignature) 0) continue;   // It is just a placeholder
 
         Tag.sig    = (cmsTagSignature) _cmsAdjustEndianess32((cmsInt32Number) Icc -> TagNames[i]);
         Tag.offset = _cmsAdjustEndianess32((cmsInt32Number) Icc -> TagOffsets[i]);
@@ -1195,7 +1213,7 @@
 
     for (i=0; i < Icc -> TagCount; i++) {
 
-        if (Icc ->TagNames[i] == 0) continue;
+        if (Icc ->TagNames[i] == (cmsTagSignature) 0) continue;
 
         // Linked tags are not written
         if (Icc ->TagLinked[i] != (cmsTagSignature) 0) continue;
@@ -1329,11 +1347,15 @@
 
     _cmsAssert(hProfile != NULL);
 
+    if (!_cmsLockMutex(Icc->ContextID, Icc->UsrMutex)) return 0;
     memmove(&Keep, Icc, sizeof(_cmsICCPROFILE));
 
     ContextID = cmsGetProfileContextID(hProfile);
     PrevIO = Icc ->IOhandler = cmsOpenIOhandlerFromNULL(ContextID);
-    if (PrevIO == NULL) return 0;
+    if (PrevIO == NULL) {
+        _cmsUnlockMutex(Icc->ContextID, Icc->UsrMutex);
+        return 0;
+    }
 
     // Pass #1 does compute offsets
 
@@ -1353,7 +1375,10 @@
     }
 
     memmove(Icc, &Keep, sizeof(_cmsICCPROFILE));
-    if (!cmsCloseIOhandler(PrevIO)) return 0;
+    if (!cmsCloseIOhandler(PrevIO))
+        UsedSpace = 0; // As a error marker
+
+    _cmsUnlockMutex(Icc->ContextID, Icc->UsrMutex);
 
     return UsedSpace;
 
@@ -1361,6 +1386,8 @@
 Error:
     cmsCloseIOhandler(PrevIO);
     memmove(Icc, &Keep, sizeof(_cmsICCPROFILE));
+    _cmsUnlockMutex(Icc->ContextID, Icc->UsrMutex);
+
     return 0;
 }
 
@@ -1564,7 +1591,7 @@
     LocalTypeHandler.ICCVersion = Icc ->Version;
     Icc -> TagPtrs[n] = LocalTypeHandler.ReadPtr(&LocalTypeHandler, io, &ElemCount, TagSize);
 
-    // The tag type is supported, but something wrong happend and we cannot read the tag.
+    // The tag type is supported, but something wrong happened and we cannot read the tag.
     // let know the user about this (although it is just a warning)
     if (Icc -> TagPtrs[n] == NULL) {
 
@@ -1883,7 +1910,7 @@
     _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex);
 
     if (Icc->TagPtrs[i] == NULL) {
-           Icc->TagNames[i] = 0;
+           Icc->TagNames[i] = (cmsTagSignature) 0;
            return FALSE;
     }
     return TRUE;
--- a/jdk/src/java.desktop/share/native/liblcms/cmsio1.c	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/native/liblcms/cmsio1.c	Mon Aug 08 08:12:20 2016 -0700
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2012 Marti Maria Saguer
+//  Copyright (c) 1998-2016 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
@@ -157,7 +157,7 @@
 }
 
 
-// Auxiliar, read colorants as a MAT3 structure. Used by any function that needs a matrix-shaper
+// Auxiliary, read colorants as a MAT3 structure. Used by any function that needs a matrix-shaper
 static
 cmsBool ReadICCMatrixRGB2XYZ(cmsMAT3* r, cmsHPROFILE hProfile)
 {
@@ -343,7 +343,7 @@
     cmsTagSignature tagFloat;
     cmsContext ContextID = cmsGetProfileContextID(hProfile);
 
-    // On named color, take the appropiate tag
+    // On named color, take the appropriate tag
     if (cmsGetDeviceClass(hProfile) == cmsSigNamedColorClass) {
 
         cmsPipeline* Lut;
@@ -365,9 +365,9 @@
         return Lut;
     }
 
-    // This is an attempt to reuse this funtion to retrieve the matrix-shaper as pipeline no
+    // This is an attempt to reuse this function to retrieve the matrix-shaper as pipeline no
     // matter other LUT are present and have precedence. Intent = -1 means just this.
-    if (Intent != -1) {
+    if (Intent >= INTENT_PERCEPTUAL && Intent <= INTENT_ABSOLUTE_COLORIMETRIC) {
 
         tag16 = Device2PCS16[Intent];
         tagFloat = Device2PCSFloat[Intent];
@@ -423,7 +423,7 @@
     // Check if this is a grayscale profile.
     if (cmsGetColorSpace(hProfile) == cmsSigGrayData) {
 
-        // if so, build appropiate conversion tables.
+        // if so, build appropriate conversion tables.
         // The tables are the PCS iluminant, scaled across GrayTRC
         return BuildGrayInputMatrixPipeline(hProfile);
     }
@@ -578,7 +578,7 @@
     if (Lut == NULL) return NULL;
 
     // If PCS is Lab or XYZ, the floating point tag is accepting data in the space encoding,
-    // and since the formatter has already accomodated to 0..1.0, we should undo this change
+    // and since the formatter has already accommodated to 0..1.0, we should undo this change
     if ( PCS == cmsSigLabData)
     {
         if (!cmsPipelineInsertStage(Lut, cmsAT_BEGIN, _cmsStageNormalizeToLabFloat(ContextID)))
@@ -619,7 +619,7 @@
     cmsContext ContextID  = cmsGetProfileContextID(hProfile);
 
 
-    if (Intent != -1) {
+    if (Intent >= INTENT_PERCEPTUAL && Intent <= INTENT_ABSOLUTE_COLORIMETRIC) {
 
         tag16 = PCS2Device16[Intent];
         tagFloat = PCS2DeviceFloat[Intent];
@@ -680,7 +680,7 @@
     // Check if this is a grayscale profile.
     if (cmsGetColorSpace(hProfile) == cmsSigGrayData) {
 
-        // if so, build appropiate conversion tables.
+        // if so, build appropriate conversion tables.
         // The tables are the PCS iluminant, scaled across GrayTRC
         return BuildGrayOutputPipeline(hProfile);
     }
@@ -738,15 +738,21 @@
 {
     cmsPipeline* Lut;
     cmsTagTypeSignature OriginalType;
-    cmsTagSignature tag16    = Device2PCS16[Intent];
-    cmsTagSignature tagFloat = Device2PCSFloat[Intent];
+    cmsTagSignature tag16;
+    cmsTagSignature tagFloat;
     cmsContext ContextID = cmsGetProfileContextID(hProfile);
 
 
-    // On named color, take the appropiate tag
+    if (Intent < INTENT_PERCEPTUAL || Intent > INTENT_ABSOLUTE_COLORIMETRIC)
+        return NULL;
+
+    tag16 = Device2PCS16[Intent];
+    tagFloat = Device2PCSFloat[Intent];
+
+    // On named color, take the appropriate tag
     if (cmsGetDeviceClass(hProfile) == cmsSigNamedColorClass) {
 
-        cmsNAMEDCOLORLIST* nc = (cmsNAMEDCOLORLIST*) cmsReadTag(hProfile, cmsSigNamedColor2Tag);
+        cmsNAMEDCOLORLIST* nc = (cmsNAMEDCOLORLIST*)cmsReadTag(hProfile, cmsSigNamedColor2Tag);
 
         if (nc == NULL) return NULL;
 
@@ -762,12 +768,13 @@
                 goto Error;
 
         return Lut;
-Error:
+    Error:
         cmsPipelineFree(Lut);
         cmsFreeNamedColorList(nc);
         return NULL;
     }
 
+
     if (cmsIsTag(hProfile, tagFloat)) {  // Float tag takes precedence
 
         // Floating point LUT are always V
@@ -777,19 +784,19 @@
     tagFloat = Device2PCSFloat[0];
     if (cmsIsTag(hProfile, tagFloat)) {
 
-        return cmsPipelineDup((cmsPipeline*) cmsReadTag(hProfile, tagFloat));
+        return cmsPipelineDup((cmsPipeline*)cmsReadTag(hProfile, tagFloat));
     }
 
     if (!cmsIsTag(hProfile, tag16)) {  // Is there any LUT-Based table?
 
-        tag16    = Device2PCS16[0];
+        tag16 = Device2PCS16[0];
         if (!cmsIsTag(hProfile, tag16)) return NULL;
     }
 
     // Check profile version and LUT type. Do the necessary adjustments if needed
 
     // Read the tag
-    Lut = (cmsPipeline*) cmsReadTag(hProfile, tag16);
+    Lut = (cmsPipeline*)cmsReadTag(hProfile, tag16);
     if (Lut == NULL) return NULL;
 
     // The profile owns the Lut, so we need to copy it
@@ -802,7 +809,7 @@
         ChangeInterpolationToTrilinear(Lut);
 
     // After reading it, we have info about the original type
-    OriginalType =  _cmsGetTagTrueType(hProfile, tag16);
+    OriginalType = _cmsGetTagTrueType(hProfile, tag16);
 
     // We need to adjust data for Lab16 on output
     if (OriginalType != cmsSigLut16Type) return Lut;
@@ -810,12 +817,12 @@
     // Here it is possible to get Lab on both sides
 
     if (cmsGetColorSpace(hProfile) == cmsSigLabData) {
-        if(!cmsPipelineInsertStage(Lut, cmsAT_BEGIN, _cmsStageAllocLabV4ToV2(ContextID)))
+        if (!cmsPipelineInsertStage(Lut, cmsAT_BEGIN, _cmsStageAllocLabV4ToV2(ContextID)))
             goto Error2;
     }
 
     if (cmsGetPCS(hProfile) == cmsSigLabData) {
-        if(!cmsPipelineInsertStage(Lut, cmsAT_END, _cmsStageAllocLabV2ToV4(ContextID)))
+        if (!cmsPipelineInsertStage(Lut, cmsAT_END, _cmsStageAllocLabV2ToV4(ContextID)))
             goto Error2;
     }
 
@@ -950,7 +957,7 @@
 }
 
 
-// Auxiliar, read and duplicate a MLU if found.
+// Auxiliary, read and duplicate a MLU if found.
 static
 cmsMLU* GetMLUFromProfile(cmsHPROFILE h, cmsTagSignature sig)
 {
--- a/jdk/src/java.desktop/share/native/liblcms/cmslut.c	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/native/liblcms/cmslut.c	Mon Aug 08 08:12:20 2016 -0700
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2012 Marti Maria Saguer
+//  Copyright (c) 1998-2016 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
@@ -534,7 +534,7 @@
                 goto Error;
         } else {
             NewElem ->Tab.T = (cmsUInt16Number*) _cmsDupMem(mpe ->ContextID, Data ->Tab.T, Data ->nEntries * sizeof (cmsUInt16Number));
-            if (NewElem ->Tab.TFloat == NULL)
+            if (NewElem ->Tab.T == NULL)
                 goto Error;
         }
     }
@@ -1482,7 +1482,8 @@
                  First = FALSE;
              }
              else {
-                Anterior ->Next = NewMPE;
+                if (Anterior != NULL)
+                    Anterior ->Next = NewMPE;
              }
 
             Anterior = NewMPE;
@@ -1836,3 +1837,5 @@
 
     return TRUE;
 }
+
+
--- a/jdk/src/java.desktop/share/native/liblcms/cmsmd5.c	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/native/liblcms/cmsmd5.c	Mon Aug 08 08:12:20 2016 -0700
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2012 Marti Maria Saguer
+//  Copyright (c) 1998-2016 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
--- a/jdk/src/java.desktop/share/native/liblcms/cmsmtrx.c	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/native/liblcms/cmsmtrx.c	Mon Aug 08 08:12:20 2016 -0700
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2012 Marti Maria Saguer
+//  Copyright (c) 1998-2016 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
@@ -67,7 +67,7 @@
     r -> n[VZ] = z;
 }
 
-// Vector substraction
+// Vector subtraction
 void CMSEXPORT _cmsVEC3minus(cmsVEC3* r, const cmsVEC3* a, const cmsVEC3* b)
 {
   r -> n[VX] = a -> n[VX] - b -> n[VX];
@@ -201,3 +201,5 @@
     r->n[VY] = a->v[1].n[VX]*v->n[VX] + a->v[1].n[VY]*v->n[VY] + a->v[1].n[VZ]*v->n[VZ];
     r->n[VZ] = a->v[2].n[VX]*v->n[VX] + a->v[2].n[VY]*v->n[VY] + a->v[2].n[VZ]*v->n[VZ];
 }
+
+
--- a/jdk/src/java.desktop/share/native/liblcms/cmsnamed.c	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/native/liblcms/cmsnamed.c	Mon Aug 08 08:12:20 2016 -0700
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2012 Marti Maria Saguer
+//  Copyright (c) 1998-2016 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
@@ -121,7 +121,7 @@
 static
 cmsBool GrowMLUtable(cmsMLU* mlu)
 {
-    int AllocatedEntries;
+    cmsUInt32Number AllocatedEntries;
     _cmsMLUentry *NewPtr;
 
     // Sanity check
@@ -147,7 +147,7 @@
 static
 int SearchMLUEntry(cmsMLU* mlu, cmsUInt16Number LanguageCode, cmsUInt16Number CountryCode)
 {
-    int i;
+    cmsUInt32Number i;
 
     // Sanity check
     if (mlu == NULL) return -1;
@@ -207,15 +207,42 @@
     return TRUE;
 }
 
+// Convert from a 3-char code to a cmsUInt16Number. It is done inthis way because some
+// compilers don't properly align beginning of strings
 
-// Add an ASCII entry.
+static
+cmsUInt16Number strTo16(const char str[3])
+{
+    cmsUInt16Number n = ((cmsUInt16Number) str[0] << 8) | str[1];
+
+    return n;  // Always big endian in this case
+}
+
+static
+void strFrom16(char str[3], cmsUInt16Number n)
+{
+    // Assiming this would be aligned
+    union {
+
+       cmsUInt16Number n;
+       char str[2];
+
+    } c;
+
+    c.n = n;  // Always big endian in this case
+
+    str[0] = c.str[0]; str[1] = c.str[1]; str[2] = 0;
+
+}
+
+// Add an ASCII entry. Do not add any \0 termination (ICC1v43_2010-12.pdf page 61)
 cmsBool CMSEXPORT cmsMLUsetASCII(cmsMLU* mlu, const char LanguageCode[3], const char CountryCode[3], const char* ASCIIString)
 {
-    cmsUInt32Number i, len = (cmsUInt32Number) strlen(ASCIIString)+1;
+    cmsUInt32Number i, len = (cmsUInt32Number) strlen(ASCIIString);
     wchar_t* WStr;
     cmsBool  rc;
-    cmsUInt16Number Lang  = _cmsAdjustEndianess16(*(cmsUInt16Number*) LanguageCode);
-    cmsUInt16Number Cntry = _cmsAdjustEndianess16(*(cmsUInt16Number*) CountryCode);
+    cmsUInt16Number Lang  = strTo16(LanguageCode);
+    cmsUInt16Number Cntry = strTo16(CountryCode);
 
     if (mlu == NULL) return FALSE;
 
@@ -245,18 +272,17 @@
     return (cmsUInt32Number)(p - s);
 }
 
-
-// Add a wide entry
+// Add a wide entry. Do not add any \0 terminator (ICC1v43_2010-12.pdf page 61)
 cmsBool  CMSEXPORT cmsMLUsetWide(cmsMLU* mlu, const char Language[3], const char Country[3], const wchar_t* WideString)
 {
-    cmsUInt16Number Lang  = _cmsAdjustEndianess16(*(cmsUInt16Number*) Language);
-    cmsUInt16Number Cntry = _cmsAdjustEndianess16(*(cmsUInt16Number*) Country);
+    cmsUInt16Number Lang  = strTo16(Language);
+    cmsUInt16Number Cntry = strTo16(Country);
     cmsUInt32Number len;
 
     if (mlu == NULL) return FALSE;
     if (WideString == NULL) return FALSE;
 
-    len = (cmsUInt32Number) (mywcslen(WideString) + 1) * sizeof(wchar_t);
+    len = (cmsUInt32Number) (mywcslen(WideString)) * sizeof(wchar_t);
     return AddMLUBlock(mlu, len, WideString, Lang, Cntry);
 }
 
@@ -327,8 +353,8 @@
                               cmsUInt16Number LanguageCode, cmsUInt16Number CountryCode,
                               cmsUInt16Number* UsedLanguageCode, cmsUInt16Number* UsedCountryCode)
 {
-    int i;
-    int Best = -1;
+    cmsUInt32Number i;
+    cmsInt32Number Best = -1;
     _cmsMLUentry* v;
 
     if (mlu == NULL) return NULL;
@@ -379,8 +405,8 @@
     cmsUInt32Number  StrLen = 0;
     cmsUInt32Number ASCIIlen, i;
 
-    cmsUInt16Number Lang  = _cmsAdjustEndianess16(*(cmsUInt16Number*) LanguageCode);
-    cmsUInt16Number Cntry = _cmsAdjustEndianess16(*(cmsUInt16Number*) CountryCode);
+    cmsUInt16Number Lang  = strTo16(LanguageCode);
+    cmsUInt16Number Cntry = strTo16(CountryCode);
 
     // Sanitize
     if (mlu == NULL) return 0;
@@ -423,8 +449,8 @@
     const wchar_t *Wide;
     cmsUInt32Number  StrLen = 0;
 
-    cmsUInt16Number Lang  = _cmsAdjustEndianess16(*(cmsUInt16Number*) LanguageCode);
-    cmsUInt16Number Cntry = _cmsAdjustEndianess16(*(cmsUInt16Number*) CountryCode);
+    cmsUInt16Number Lang  = strTo16(LanguageCode);
+    cmsUInt16Number Cntry = strTo16(CountryCode);
 
     // Sanitize
     if (mlu == NULL) return 0;
@@ -456,8 +482,8 @@
 {
     const wchar_t *Wide;
 
-    cmsUInt16Number Lang  = _cmsAdjustEndianess16(*(cmsUInt16Number*) LanguageCode);
-    cmsUInt16Number Cntry = _cmsAdjustEndianess16(*(cmsUInt16Number*) CountryCode);
+    cmsUInt16Number Lang  = strTo16(LanguageCode);
+    cmsUInt16Number Cntry = strTo16(CountryCode);
     cmsUInt16Number ObtLang, ObtCode;
 
     // Sanitize
@@ -467,10 +493,9 @@
     if (Wide == NULL) return FALSE;
 
     // Get used language and code
-    *(cmsUInt16Number *)ObtainedLanguage = _cmsAdjustEndianess16(ObtLang);
-    *(cmsUInt16Number *)ObtainedCountry  = _cmsAdjustEndianess16(ObtCode);
+    strFrom16(ObtainedLanguage, ObtLang);
+    strFrom16(ObtainedCountry, ObtCode);
 
-    ObtainedLanguage[2] = ObtainedCountry[2] = 0;
     return TRUE;
 }
 
@@ -493,12 +518,12 @@
 
     if (mlu == NULL) return FALSE;
 
-    if (idx >= (cmsUInt32Number) mlu->UsedEntries) return FALSE;
+    if (idx >= mlu->UsedEntries) return FALSE;
 
     entry = &mlu->Entries[idx];
 
-    *(cmsUInt16Number *)LanguageCode = _cmsAdjustEndianess16(entry->Language);
-    *(cmsUInt16Number *)CountryCode  = _cmsAdjustEndianess16(entry->Country);
+    strFrom16(LanguageCode, entry->Language);
+    strFrom16(CountryCode, entry->Country);
 
     return TRUE;
 }
--- a/jdk/src/java.desktop/share/native/liblcms/cmsopt.c	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/native/liblcms/cmsopt.c	Mon Aug 08 08:12:20 2016 -0700
@@ -27,11 +27,10 @@
 // However, the following notice accompanied the original version of this
 // file:
 //
-
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2011 Marti Maria Saguer
+//  Copyright (c) 1998-2016 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
@@ -258,11 +257,10 @@
 
                             // We can not get rid of full matrix
                             cmsStage* Multmat = cmsStageAllocMatrix(Lut->ContextID, 3, 3, (const cmsFloat64Number*) &res, NULL);
+                            if (Multmat == NULL) return FALSE;  // Should never happen
 
                             // Recover the chain
-                            if (Multmat != NULL) {
-                                Multmat->Next = chain;
-                            }
+                            Multmat->Next = chain;
                             *pt1 = Multmat;
                      }
 
@@ -560,7 +558,7 @@
             return TRUE;
 }
 
-// Auxiliar, to see if two values are equal or very different
+// Auxiliary, to see if two values are equal or very different
 static
 cmsBool WhitesAreEqual(int n, cmsUInt16Number White1[], cmsUInt16Number White2[] )
 {
@@ -568,7 +566,7 @@
 
     for (i=0; i < n; i++) {
 
-        if (abs(White1[i] - White2[i]) > 0xf000) return TRUE;  // Values are so extremly different that the fixup should be avoided
+        if (abs(White1[i] - White2[i]) > 0xf000) return TRUE;  // Values are so extremely different that the fixup should be avoided
         if (White1[i] != White2[i]) return FALSE;
     }
     return TRUE;
@@ -706,7 +704,7 @@
         cmsStage* PreLin = cmsPipelineGetPtrToFirstStage(Src);
 
         // Check if suitable
-        if (PreLin ->Type == cmsSigCurveSetElemType) {
+        if (PreLin && PreLin ->Type == cmsSigCurveSetElemType) {
 
             // Maybe this is a linear tram, so we can avoid the whole stuff
             if (!AllCurvesAreLinear(PreLin)) {
@@ -739,7 +737,7 @@
         cmsStage* PostLin = cmsPipelineGetPtrToLastStage(Src);
 
         // Check if suitable
-        if (cmsStageType(PostLin) == cmsSigCurveSetElemType) {
+        if (PostLin && cmsStageType(PostLin) == cmsSigCurveSetElemType) {
 
             // Maybe this is a linear tram, so we can avoid the whole stuff
             if (!AllCurvesAreLinear(PostLin)) {
@@ -1041,8 +1039,8 @@
     }
 
     if (Zeros == 1 && Poles == 1) return FALSE;  // For linear tables
-    if (Zeros > (nEntries / 4)) return TRUE;  // Degenerated, mostly zeros
-    if (Poles > (nEntries / 4)) return TRUE;  // Degenerated, mostly poles
+    if (Zeros > (nEntries / 20)) return TRUE;  // Degenerated, many zeros
+    if (Poles > (nEntries / 20)) return TRUE;  // Degenerated, many poles
 
     return FALSE;
 }
@@ -1064,17 +1062,19 @@
     cmsColorSpaceSignature ColorSpace, OutputColorSpace;
     cmsStage* OptimizedPrelinMpe;
     cmsStage* mpe;
-    cmsToneCurve**   OptimizedPrelinCurves;
-    _cmsStageCLutData*     OptimizedPrelinCLUT;
+    cmsToneCurve** OptimizedPrelinCurves;
+    _cmsStageCLutData* OptimizedPrelinCLUT;
 
 
     // This is a loosy optimization! does not apply in floating-point cases
     if (_cmsFormatterIsFloat(*InputFormat) || _cmsFormatterIsFloat(*OutputFormat)) return FALSE;
 
-    // Only on RGB
+    // Only on chunky RGB
     if (T_COLORSPACE(*InputFormat)  != PT_RGB) return FALSE;
+    if (T_PLANAR(*InputFormat)) return FALSE;
+
     if (T_COLORSPACE(*OutputFormat) != PT_RGB) return FALSE;
-
+    if (T_PLANAR(*OutputFormat)) return FALSE;
 
     // On 16 bits, user has to specify the feature
     if (!_cmsFormatterIs8bit(*InputFormat)) {
@@ -1098,6 +1098,22 @@
     memset(Trans, 0, sizeof(Trans));
     memset(TransReverse, 0, sizeof(TransReverse));
 
+    // If the last stage of the original lut are curves, and those curves are
+    // degenerated, it is likely the transform is squeezing and clipping
+    // the output from previous CLUT. We cannot optimize this case
+    {
+        cmsStage* last = cmsPipelineGetPtrToLastStage(OriginalLut);
+
+        if (cmsStageType(last) == cmsSigCurveSetElemType) {
+
+            _cmsStageToneCurvesData* Data = (_cmsStageToneCurvesData*)cmsStageData(last);
+            for (i = 0; i < Data->nCurves; i++) {
+                if (IsDegenerated(Data->TheCurves[i]))
+                    goto Error;
+            }
+        }
+    }
+
     for (t = 0; t < OriginalLut ->InputChannels; t++) {
         Trans[t] = cmsBuildTabulatedToneCurve16(OriginalLut ->ContextID, PRELINEARIZATION_POINTS, NULL);
         if (Trans[t] == NULL) goto Error;
@@ -1431,7 +1447,10 @@
         GammaTables[i] = NULL;
     }
 
-    if (GammaTables != NULL) _cmsFree(Src ->ContextID, GammaTables);
+    if (GammaTables != NULL) {
+        _cmsFree(Src->ContextID, GammaTables);
+        GammaTables = NULL;
+    }
 
     // Maybe the curves are linear at the end
     if (!AllCurvesAreLinear(ObtainedCurves)) {
--- a/jdk/src/java.desktop/share/native/liblcms/cmspack.c	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/native/liblcms/cmspack.c	Mon Aug 08 08:12:20 2016 -0700
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2010 Marti Maria Saguer
+//  Copyright (c) 1998-2016 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
@@ -110,7 +110,7 @@
 #define ANYFLAVOR       FLAVOR_SH(1)
 
 
-// Supress waning about info never being used
+// Suppress waning about info never being used
 
 #ifdef _MSC_VER
 #pragma warning(disable : 4100)
@@ -3188,6 +3188,8 @@
     cmsUInt32Number i;
     cmsFormatter fr;
 
+    // Optimization is only a hint
+    dwInput &= ~OPTIMIZED_SH(1);
 
     switch (dwFlags)
     {
--- a/jdk/src/java.desktop/share/native/liblcms/cmspcs.c	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/native/liblcms/cmspcs.c	Mon Aug 08 08:12:20 2016 -0700
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2010 Marti Maria Saguer
+//  Copyright (c) 1998-2016 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
@@ -337,7 +337,7 @@
     wLab[2] = ab2Fix4(Lab.b);
 }
 
-// Auxiliar: convert to Radians
+// Auxiliary: convert to Radians
 static
 cmsFloat64Number RADIANS(cmsFloat64Number deg)
 {
@@ -345,7 +345,7 @@
 }
 
 
-// Auxiliar: atan2 but operating in degrees and returning 0 if a==b==0
+// Auxiliary: atan2 but operating in degrees and returning 0 if a==b==0
 static
 cmsFloat64Number atan2deg(cmsFloat64Number a, cmsFloat64Number b)
 {
@@ -368,7 +368,7 @@
 }
 
 
-// Auxiliar: Square
+// Auxiliary: Square
 static
 cmsFloat64Number Sqr(cmsFloat64Number v)
 {
--- a/jdk/src/java.desktop/share/native/liblcms/cmsplugin.c	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/native/liblcms/cmsplugin.c	Mon Aug 08 08:12:20 2016 -0700
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2010 Marti Maria Saguer
+//  Copyright (c) 1998-2016 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
@@ -136,7 +136,7 @@
 #endif
 }
 
-// Auxiliar -- read 8, 16 and 32-bit numbers
+// Auxiliary -- read 8, 16 and 32-bit numbers
 cmsBool CMSEXPORT  _cmsReadUInt8Number(cmsIOHANDLER* io, cmsUInt8Number* n)
 {
     cmsUInt8Number tmp;
@@ -201,13 +201,13 @@
 
     _cmsAssert(io != NULL);
 
-    if (io -> Read(io, &tmp, sizeof(cmsFloat32Number), 1) != 1)
+    if (io -> Read(io, &tmp, sizeof(cmsUInt32Number), 1) != 1)
             return FALSE;
 
     if (n != NULL) {
 
         tmp = _cmsAdjustEndianess32(tmp);
-        *n = *(cmsFloat32Number*) &tmp;
+        *n = *(cmsFloat32Number*) (void*) &tmp;
     }
     return TRUE;
 }
@@ -244,22 +244,6 @@
 }
 
 
-// Jun-21-2000: Some profiles (those that comes with W2K) comes
-// with the media white (media black?) x 100. Add a sanity check
-
-static
-void NormalizeXYZ(cmsCIEXYZ* Dest)
-{
-    while (Dest -> X > 2. &&
-           Dest -> Y > 2. &&
-           Dest -> Z > 2.) {
-
-               Dest -> X /= 10.;
-               Dest -> Y /= 10.;
-               Dest -> Z /= 10.;
-       }
-}
-
 cmsBool CMSEXPORT  _cmsReadXYZNumber(cmsIOHANDLER* io, cmsCIEXYZ* XYZ)
 {
     cmsEncodedXYZNumber xyz;
@@ -273,8 +257,6 @@
         XYZ->X = _cms15Fixed16toDouble(_cmsAdjustEndianess32(xyz.X));
         XYZ->Y = _cms15Fixed16toDouble(_cmsAdjustEndianess32(xyz.Y));
         XYZ->Z = _cms15Fixed16toDouble(_cmsAdjustEndianess32(xyz.Z));
-
-        NormalizeXYZ(XYZ);
     }
     return TRUE;
 }
@@ -336,7 +318,7 @@
 
     _cmsAssert(io != NULL);
 
-    tmp = *(cmsUInt32Number*) &n;
+    tmp = *(cmsUInt32Number*) (void*) &n;
     tmp = _cmsAdjustEndianess32(tmp);
     if (io -> Write(io, sizeof(cmsUInt32Number), &tmp) != 1)
             return FALSE;
@@ -532,7 +514,10 @@
     va_start(args, frm);
 
     len = vsnprintf((char*) Buffer, 2047, frm, args);
-    if (len < 0) return FALSE;   // Truncated, which is a fatal error for us
+    if (len < 0) {
+        va_end(args);
+        return FALSE;   // Truncated, which is a fatal error for us
+    }
 
     rc = io ->Write(io, len, Buffer);
 
@@ -554,6 +539,7 @@
         if (ContextID == NULL) {
 
             ctx->MemPool = _cmsCreateSubAlloc(0, 2*1024);
+            if (ctx->MemPool == NULL) return NULL;
         }
         else {
             cmsSignalError(ContextID, cmsERROR_CORRUPTION_DETECTED, "NULL memory pool on context");
@@ -989,3 +975,5 @@
 {
     return _cmsContextGetClientChunk(ContextID, UserPtr);
 }
+
+
--- a/jdk/src/java.desktop/share/native/liblcms/cmsps2.c	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/native/liblcms/cmsps2.c	Mon Aug 08 08:12:20 2016 -0700
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2011 Marti Maria Saguer
+//  Copyright (c) 1998-2016 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
@@ -608,7 +608,7 @@
 //
 //  Each row contains Pipeline values for all but first component. So, I
 //  detect row changing by keeping a copy of last value of first
-//  component. -1 is used to mark begining of whole block.
+//  component. -1 is used to mark beginning of whole block.
 
 static
 int OutputValueSampler(register const cmsUInt16Number In[], register cmsUInt16Number Out[], register void* Cargo)
@@ -1422,14 +1422,15 @@
     if (nColorant > cmsMAXCHANNELS)
         nColorant = cmsMAXCHANNELS;
 
-    for (j=0; j < nColorant; j++) {
+    for (j = 0; j < nColorant; j++) {
 
-                sprintf(Buff, "%.3f", Out[j] / 65535.0);
-                strcat(Colorant, Buff);
-                if (j < nColorant -1)
-                        strcat(Colorant, " ");
+        snprintf(Buff, 31, "%.3f", Out[j] / 65535.0);
+        Buff[31] = 0;
+        strcat(Colorant, Buff);
+        if (j < nColorant - 1)
+            strcat(Colorant, " ");
 
-        }
+    }
 }
 
 
--- a/jdk/src/java.desktop/share/native/liblcms/cmssamp.c	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/native/liblcms/cmssamp.c	Mon Aug 08 08:12:20 2016 -0700
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2014 Marti Maria Saguer
+//  Copyright (c) 1998-2016 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
--- a/jdk/src/java.desktop/share/native/liblcms/cmssm.c	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/native/liblcms/cmssm.c	Mon Aug 08 08:12:20 2016 -0700
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2011 Marti Maria Saguer
+//  Copyright (c) 1998-2016 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
@@ -247,7 +247,8 @@
 {
     cmsFloat64Number a, b, c, d, e, D;
     cmsFloat64Number sc, sN, sD;
-    cmsFloat64Number tc, tN, tD;
+    //cmsFloat64Number tc; // left for future use
+    cmsFloat64Number tN, tD;
     cmsVEC3 w0;
 
     _cmsVEC3minus(&w0, &line1 ->a, &line2 ->a);
@@ -315,7 +316,7 @@
     }
     // finally do the division to get sc and tc
     sc = (fabs(sN) < MATRIX_DET_TOLERANCE ? 0.0 : sN / sD);
-    tc = (fabs(tN) < MATRIX_DET_TOLERANCE ? 0.0 : tN / tD);
+    //tc = (fabs(tN) < MATRIX_DET_TOLERANCE ? 0.0 : tN / tD); // left for future use.
 
     GetPointOfLine(r, line1, sc);
     return TRUE;
@@ -346,7 +347,7 @@
 }
 
 
-// Auxiliar to retrieve a pointer to the segmentr containing the Lab value
+// Auxiliary to retrieve a pointer to the segmentr containing the Lab value
 static
 cmsGDBPoint* GetPoint(cmsGDB* gbd, const cmsCIELab* Lab, cmsSpherical* sp)
 {
@@ -358,7 +359,7 @@
     _cmsAssert(Lab != NULL);
     _cmsAssert(sp != NULL);
 
-    // Center L* by substracting half of its domain, that's 50
+    // Center L* by subtracting half of its domain, that's 50
     _cmsVEC3init(&v, Lab ->L - 50.0, Lab ->a, Lab ->b);
 
     // Convert to spherical coordinates
--- a/jdk/src/java.desktop/share/native/liblcms/cmstypes.c	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/native/liblcms/cmstypes.c	Mon Aug 08 08:12:20 2016 -0700
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2014 Marti Maria Saguer
+//  Copyright (c) 1998-2016 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
@@ -59,7 +59,7 @@
 // This file implements every single tag and tag type as described in the ICC spec. Some types
 // have been deprecated, like ncl and Data. There is no implementation for those types as there
 // are no profiles holding them. The programmer can also extend this list by defining his own types
-// by using the appropiate plug-in. There are three types of plug ins regarding that. First type
+// by using the appropriate plug-in. There are three types of plug ins regarding that. First type
 // allows to define new tags using any existing type. Next plug-in type allows to define new types
 // and the third one is very specific: allows to extend the number of elements in the multiprocessing
 // elements special type.
@@ -142,7 +142,7 @@
 }
 
 
-// Auxiliar to convert UTF-32 to UTF-16 in some cases
+// Auxiliary to convert UTF-32 to UTF-16 in some cases
 static
 cmsBool _cmsWriteWCharArray(cmsIOHANDLER* io, cmsUInt32Number n, const wchar_t* Array)
 {
@@ -158,7 +158,7 @@
     return TRUE;
 }
 
-// Auxiliar to read an array of wchar_t
+// Auxiliary to read an array of wchar_t
 static
 cmsBool _cmsReadWCharArray(cmsIOHANDLER* io, cmsUInt32Number n, wchar_t* Array)
 {
@@ -189,7 +189,7 @@
                                              cmsUInt32Number n,
                                              cmsUInt32Number SizeOfTag);
 
-// Helper function to deal with position tables as decribed in ICC spec 4.3
+// Helper function to deal with position tables as described in ICC spec 4.3
 // A table of n elements is readed, where first comes n records containing offsets and sizes and
 // then a block containing the data itself. This allows to reuse same data in more than one entry
 static
@@ -980,7 +980,7 @@
     cmsMLU* mlu = (cmsMLU*) Ptr;
     char *Text = NULL;
     wchar_t *Wide = NULL;
-    cmsUInt32Number len, len_aligned, len_filler_alignment;
+    cmsUInt32Number len, len_text, len_tag_requirement, len_aligned;
     cmsBool  rc = FALSE;
     char Filler[68];
 
@@ -990,17 +990,18 @@
     // Get the len of string
     len = cmsMLUgetASCII(mlu, cmsNoLanguage, cmsNoCountry, NULL, 0);
 
-    // From ICC3.4: It has been found that textDescriptionType can contain misaligned data
+    // Specification ICC.1:2001-04 (v2.4.0): It has been found that textDescriptionType can contain misaligned data
     //(see clause 4.1 for the definition of “aligned”). Because the Unicode language
     // code and Unicode count immediately follow the ASCII description, their
     // alignment is not correct if the ASCII count is not a multiple of four. The
     // ScriptCode code is misaligned when the ASCII count is odd. Profile reading and
     // writing software must be written carefully in order to handle these alignment
     // problems.
-
-    // Compute an aligned size
-    len_aligned = _cmsALIGNLONG(len);
-    len_filler_alignment = len_aligned - len;
+    //
+    // The above last sentence suggest to handle alignment issues in the
+    // parser. The provided example (Table 69 on Page 60) makes this clear.
+    // The padding only in the ASCII count is not sufficient for a aligned tag
+    // size, with the same text size in ASCII and Unicode.
 
     // Null strings
     if (len <= 0) {
@@ -1021,6 +1022,12 @@
         cmsMLUgetWide(mlu,  cmsNoLanguage, cmsNoCountry,  Wide, len * sizeof(wchar_t));
     }
 
+    // Tell the real text len including the null terminator and padding
+    len_text = (cmsUInt32Number) strlen(Text) + 1;
+    // Compute an total tag size requirement
+    len_tag_requirement = (8+4+len_text+4+4+2*len_text+2+1+67);
+    len_aligned = _cmsALIGNLONG(len_tag_requirement);
+
   // * cmsUInt32Number       count;          * Description length
   // * cmsInt8Number         desc[count]     * NULL terminated ascii string
   // * cmsUInt32Number       ucLangCode;     * UniCode language code
@@ -1030,20 +1037,14 @@
   // * cmsUInt8Number        scCount;        * ScriptCode count
   // * cmsInt8Number         scDesc[67];     * ScriptCode Description
 
-    if (!_cmsWriteUInt32Number(io, len_aligned)) goto Error;
-    if (!io ->Write(io, len, Text)) goto Error;
-    if (!io ->Write(io, len_filler_alignment, Filler)) goto Error;
+    if (!_cmsWriteUInt32Number(io, len_text)) goto Error;
+    if (!io ->Write(io, len_text, Text)) goto Error;
 
     if (!_cmsWriteUInt32Number(io, 0)) goto Error;  // ucLanguageCode
 
-    // This part is tricky: we need an aligned tag size, and the ScriptCode part
-    // takes 70 bytes, so we need 2 extra bytes to do the alignment
-
-    if (!_cmsWriteUInt32Number(io, len_aligned+1)) goto Error;
-
+    if (!_cmsWriteUInt32Number(io, len_text)) goto Error;
     // Note that in some compilers sizeof(cmsUInt16Number) != sizeof(wchar_t)
-    if (!_cmsWriteWCharArray(io, len, Wide)) goto Error;
-    if (!_cmsWriteUInt16Array(io, len_filler_alignment+1, (cmsUInt16Number*) Filler)) goto Error;
+    if (!_cmsWriteWCharArray(io, len_text, Wide)) goto Error;
 
     // ScriptCode Code & count (unused)
     if (!_cmsWriteUInt16Number(io, 0)) goto Error;
@@ -1051,6 +1052,10 @@
 
     if (!io ->Write(io, 67, Filler)) goto Error;
 
+    // possibly add pad at the end of tag
+    if(len_aligned - len_tag_requirement > 0)
+      if (!io ->Write(io, len_aligned - len_tag_requirement, Filler)) goto Error;
+
     rc = TRUE;
 
 Error:
@@ -1498,7 +1503,7 @@
             LargestPosition = EndOfThisString;
     }
 
-    // Now read the remaining of tag and fill all strings. Substract the directory
+    // Now read the remaining of tag and fill all strings. Subtract the directory
     SizeOfTag   = (LargestPosition * sizeof(wchar_t)) / sizeof(cmsUInt16Number);
     if (SizeOfTag == 0)
     {
@@ -1532,7 +1537,7 @@
     cmsMLU* mlu =(cmsMLU*) Ptr;
     cmsUInt32Number HeaderSize;
     cmsUInt32Number  Len, Offset;
-    int i;
+    cmsUInt32Number i;
 
     if (Ptr == NULL) {
 
@@ -3133,6 +3138,8 @@
 
         memset(Colorant, 0, sizeof(Colorant));
         if (io -> Read(io, Root, 32, 1) != 1) return NULL;
+        Root[32] = 0;  // To prevent exploits
+
         if (!_cmsReadUInt16Array(io, 3, PCS)) goto Error;
         if (!_cmsReadUInt16Array(io, nDeviceCoords, Colorant)) goto Error;
 
@@ -3155,8 +3162,8 @@
 cmsBool Type_NamedColor_Write(struct _cms_typehandler_struct* self, cmsIOHANDLER* io, void* Ptr, cmsUInt32Number nItems)
 {
     cmsNAMEDCOLORLIST* NamedColorList = (cmsNAMEDCOLORLIST*) Ptr;
-    char                prefix[32];     // Prefix for each color name
-    char                suffix[32];     // Suffix for each color name
+    char                prefix[33];     // Prefix for each color name
+    char                suffix[33];     // Suffix for each color name
     int i, nColors;
 
     nColors = cmsNamedColorCount(NamedColorList);
@@ -3168,7 +3175,7 @@
     strncpy(prefix, (const char*) NamedColorList->Prefix, 32);
     strncpy(suffix, (const char*) NamedColorList->Suffix, 32);
 
-    suffix[31] = prefix[31] = 0;
+    suffix[32] = prefix[32] = 0;
 
     if (!io ->Write(io, 32, prefix)) return FALSE;
     if (!io ->Write(io, 32, suffix)) return FALSE;
@@ -3180,6 +3187,7 @@
        char Root[33];
 
         if (!cmsNamedColorInfo(NamedColorList, i, Root, NULL, NULL, PCS, Colorant)) return 0;
+        Root[32] = 0;
         if (!io ->Write(io, 32 , Root)) return FALSE;
         if (!_cmsWriteUInt16Array(io, 3, PCS)) return FALSE;
         if (!_cmsWriteUInt16Array(io, NamedColorList ->ColorantCount, Colorant)) return FALSE;
@@ -3630,7 +3638,7 @@
 
 
 
-// Auxiliar, read an string specified as count + string
+// Auxiliary, read an string specified as count + string
 static
 cmsBool  ReadCountAndSting(struct _cms_typehandler_struct* self, cmsIOHANDLER* io, cmsMLU* mlu, cmsUInt32Number* SizeOfTag, const char* Section)
 {
@@ -3879,7 +3887,7 @@
 static
 void* Type_ViewingConditions_Dup(struct _cms_typehandler_struct* self, const void *Ptr, cmsUInt32Number n)
 {
-   return _cmsDupMem(self ->ContextID, Ptr, sizeof(cmsScreening));
+   return _cmsDupMem(self->ContextID, Ptr, sizeof(cmsICCViewingConditions));
 
    cmsUNUSED_PARAMETER(n);
 }
@@ -4333,13 +4341,13 @@
 static
 cmsBool  Type_MPEclut_Write(struct _cms_typehandler_struct* self, cmsIOHANDLER* io, void* Ptr, cmsUInt32Number nItems)
 {
-    cmsUInt8Number Dimensions8[16];
+    cmsUInt8Number Dimensions8[16];  // 16 because the spec says 16 and not max number of channels
     cmsUInt32Number i;
     cmsStage* mpe = (cmsStage*) Ptr;
     _cmsStageCLutData* clut = (_cmsStageCLutData*) mpe ->Data;
 
-    // Check for maximum number of channels
-    if (mpe -> InputChannels > 15) return FALSE;
+    // Check for maximum number of channels supported by lcms
+    if (mpe -> InputChannels > MAX_INPUT_DIMENSIONS) return FALSE;
 
     // Only floats are supported in MPE
     if (clut ->HasFloatValues == FALSE) return FALSE;
@@ -5477,8 +5485,9 @@
     { cmsSigScreeningTag,           { 1, 1, { cmsSigScreeningType},          NULL }, &SupportedTags[59]},
     { cmsSigVcgtTag,                { 1, 1, { cmsSigVcgtType},               NULL }, &SupportedTags[60]},
     { cmsSigMetaTag,                { 1, 1, { cmsSigDictType},               NULL }, &SupportedTags[61]},
-    { cmsSigProfileSequenceIdTag,   { 1, 1, { cmsSigProfileSequenceIdType},  NULL },  &SupportedTags[62]},
-    { cmsSigProfileDescriptionMLTag,{ 1, 1, { cmsSigMultiLocalizedUnicodeType}, NULL}, NULL}
+    { cmsSigProfileSequenceIdTag,   { 1, 1, { cmsSigProfileSequenceIdType},  NULL }, &SupportedTags[62]},
+    { cmsSigProfileDescriptionMLTag,{ 1, 1, { cmsSigMultiLocalizedUnicodeType}, NULL}, &SupportedTags[63]},
+    { cmsSigArgyllArtsTag,          { 9, 1, { cmsSigS15Fixed16ArrayType},    NULL}, NULL}
 
 
 };
--- a/jdk/src/java.desktop/share/native/liblcms/cmsvirt.c	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/native/liblcms/cmsvirt.c	Mon Aug 08 08:12:20 2016 -0700
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2014 Marti Maria Saguer
+//  Copyright (c) 1998-2016 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
@@ -1167,15 +1167,20 @@
     // If no way, then force CLUT that for sure can be written
     if (AllowedLUT == NULL) {
 
+        cmsStage* FirstStage;
+        cmsStage* LastStage;
+
         dwFlags |= cmsFLAGS_FORCE_CLUT;
         _cmsOptimizePipeline(ContextID, &LUT, xform ->RenderingIntent, &FrmIn, &FrmOut, &dwFlags);
 
         // Put identity curves if needed
-        if (cmsPipelineGetPtrToFirstStage(LUT) ->Type != cmsSigCurveSetElemType)
+        FirstStage = cmsPipelineGetPtrToFirstStage(LUT);
+        if (FirstStage != NULL && FirstStage ->Type != cmsSigCurveSetElemType)
              if (!cmsPipelineInsertStage(LUT, cmsAT_BEGIN, _cmsStageAllocIdentityCurves(ContextID, ChansIn)))
                  goto Error;
 
-        if (cmsPipelineGetPtrToLastStage(LUT) ->Type != cmsSigCurveSetElemType)
+        LastStage = cmsPipelineGetPtrToLastStage(LUT);
+        if (LastStage != NULL && LastStage ->Type != cmsSigCurveSetElemType)
              if (!cmsPipelineInsertStage(LUT, cmsAT_END,   _cmsStageAllocIdentityCurves(ContextID, ChansOut)))
                  goto Error;
 
--- a/jdk/src/java.desktop/share/native/liblcms/cmswtpnt.c	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/native/liblcms/cmswtpnt.c	Mon Aug 08 08:12:20 2016 -0700
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2014 Marti Maria Saguer
+//  Copyright (c) 1998-2016 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
@@ -376,3 +376,5 @@
 
     return TRUE;
 }
+
+
--- a/jdk/src/java.desktop/share/native/liblcms/cmsxform.c	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/native/liblcms/cmsxform.c	Mon Aug 08 08:12:20 2016 -0700
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2014 Marti Maria Saguer
+//  Copyright (c) 1998-2016 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
@@ -208,12 +208,18 @@
 
 {
     _cmsTRANSFORM* p = (_cmsTRANSFORM*) Transform;
+    cmsStride stride;
 
-    p -> xform(p, InputBuffer, OutputBuffer, Size, Size);
+    stride.BytesPerLineIn = 0;  // Not used
+    stride.BytesPerLineOut = 0;
+    stride.BytesPerPlaneIn = Size;
+    stride.BytesPerPlaneOut = Size;
+
+    p -> xform(p, InputBuffer, OutputBuffer, Size, 1, &stride);
 }
 
 
-// Apply transform.
+// This is a legacy stride for planar
 void CMSEXPORT cmsDoTransformStride(cmsHTRANSFORM  Transform,
                               const void* InputBuffer,
                               void* OutputBuffer,
@@ -221,10 +227,40 @@
 
 {
     _cmsTRANSFORM* p = (_cmsTRANSFORM*) Transform;
+    cmsStride stride;
 
-    p -> xform(p, InputBuffer, OutputBuffer, Size, Stride);
+    stride.BytesPerLineIn = 0;
+    stride.BytesPerLineOut = 0;
+    stride.BytesPerPlaneIn = Stride;
+    stride.BytesPerPlaneOut = Stride;
+
+    p -> xform(p, InputBuffer, OutputBuffer, Size, 1, &stride);
 }
 
+// This is the "fast" function for plugins
+void CMSEXPORT cmsDoTransformLineStride(cmsHTRANSFORM  Transform,
+                              const void* InputBuffer,
+                              void* OutputBuffer,
+                              cmsUInt32Number PixelsPerLine,
+                              cmsUInt32Number LineCount,
+                              cmsUInt32Number BytesPerLineIn,
+                              cmsUInt32Number BytesPerLineOut,
+                              cmsUInt32Number BytesPerPlaneIn,
+                              cmsUInt32Number BytesPerPlaneOut)
+
+{
+    _cmsTRANSFORM* p = (_cmsTRANSFORM*) Transform;
+    cmsStride stride;
+
+    stride.BytesPerLineIn = BytesPerLineIn;
+    stride.BytesPerLineOut = BytesPerLineOut;
+    stride.BytesPerPlaneIn = BytesPerPlaneIn;
+    stride.BytesPerPlaneOut = BytesPerPlaneOut;
+
+    p->xform(p, InputBuffer, OutputBuffer, PixelsPerLine, LineCount, &stride);
+}
+
+
 
 // Transform routines ----------------------------------------------------------------------------------------------------------
 
@@ -233,49 +269,64 @@
 static
 void FloatXFORM(_cmsTRANSFORM* p,
                 const void* in,
-                void* out, cmsUInt32Number Size, cmsUInt32Number Stride)
+                void* out,
+                cmsUInt32Number PixelsPerLine,
+                cmsUInt32Number LineCount,
+                const cmsStride* Stride)
 {
     cmsUInt8Number* accum;
     cmsUInt8Number* output;
     cmsFloat32Number fIn[cmsMAXCHANNELS], fOut[cmsMAXCHANNELS];
     cmsFloat32Number OutOfGamut;
-    cmsUInt32Number i, j;
+    cmsUInt32Number i, j, c, strideIn, strideOut;
+
+    _cmsHandleExtraChannels(p, in, out, PixelsPerLine, LineCount, Stride);
+
+    strideIn = 0;
+    strideOut = 0;
 
-    accum  = (cmsUInt8Number*)  in;
-    output = (cmsUInt8Number*)  out;
+    for (i = 0; i < LineCount; i++) {
 
-    for (i=0; i < Size; i++) {
+        accum = (cmsUInt8Number*)in + strideIn;
+        output = (cmsUInt8Number*)out + strideOut;
 
-        accum = p -> FromInputFloat(p, fIn, accum, Stride);
+        for (j = 0; j < PixelsPerLine; j++) {
+
+            accum = p->FromInputFloat(p, fIn, accum, Stride->BytesPerPlaneIn);
 
-        // Any gamut chack to do?
-        if (p ->GamutCheck != NULL) {
+            // Any gamut chack to do?
+            if (p->GamutCheck != NULL) {
 
-            // Evaluate gamut marker.
-            cmsPipelineEvalFloat( fIn, &OutOfGamut, p ->GamutCheck);
+                // Evaluate gamut marker.
+                cmsPipelineEvalFloat(fIn, &OutOfGamut, p->GamutCheck);
+
+                // Is current color out of gamut?
+                if (OutOfGamut > 0.0) {
 
-            // Is current color out of gamut?
-            if (OutOfGamut > 0.0) {
+                    // Certainly, out of gamut
+                    for (c = 0; c < cmsMAXCHANNELS; c++)
+                        fOut[c] = -1.0;
 
-                // Certainly, out of gamut
-                for (j=0; j < cmsMAXCHANNELS; j++)
-                    fOut[j] = -1.0;
-
+                }
+                else {
+                    // No, proceed normally
+                    cmsPipelineEvalFloat(fIn, fOut, p->Lut);
+                }
             }
             else {
-                // No, proceed normally
-                cmsPipelineEvalFloat(fIn, fOut, p -> Lut);
+
+                // No gamut check at all
+                cmsPipelineEvalFloat(fIn, fOut, p->Lut);
             }
-        }
-        else {
+
 
-            // No gamut check at all
-            cmsPipelineEvalFloat(fIn, fOut, p -> Lut);
+            output = p->ToOutputFloat(p, fOut, output, Stride->BytesPerPlaneOut);
         }
 
-        // Back to asked representation
-        output = p -> ToOutputFloat(p, fOut, output, Stride);
+        strideIn += Stride->BytesPerLineIn;
+        strideOut += Stride->BytesPerLineOut;
     }
+
 }
 
 
@@ -283,22 +334,34 @@
 void NullFloatXFORM(_cmsTRANSFORM* p,
                     const void* in,
                     void* out,
-                    cmsUInt32Number Size,
-                    cmsUInt32Number Stride)
+                    cmsUInt32Number PixelsPerLine,
+                    cmsUInt32Number LineCount,
+                    const cmsStride* Stride)
+
 {
     cmsUInt8Number* accum;
     cmsUInt8Number* output;
     cmsFloat32Number fIn[cmsMAXCHANNELS];
-    cmsUInt32Number i, n;
+    cmsUInt32Number i, j, strideIn, strideOut;
+
+    _cmsHandleExtraChannels(p, in, out, PixelsPerLine, LineCount, Stride);
+
+    strideIn = 0;
+    strideOut = 0;
+
+    for (i = 0; i < LineCount; i++) {
 
-    accum  = (cmsUInt8Number*)  in;
-    output = (cmsUInt8Number*)  out;
-    n = Size;
+           accum = (cmsUInt8Number*) in + strideIn;
+           output = (cmsUInt8Number*) out + strideOut;
+
+           for (j = 0; j < PixelsPerLine; j++) {
 
-    for (i=0; i < n; i++) {
+                  accum = p->FromInputFloat(p, fIn, accum, Stride ->BytesPerPlaneIn);
+                  output = p->ToOutputFloat(p, fIn, output, Stride->BytesPerPlaneOut);
+           }
 
-        accum  = p -> FromInputFloat(p, fIn, accum, Stride);
-        output = p -> ToOutputFloat(p, fIn, output, Stride);
+           strideIn += Stride->BytesPerLineIn;
+           strideOut += Stride->BytesPerLineOut;
     }
 }
 
@@ -308,23 +371,36 @@
 static
 void NullXFORM(_cmsTRANSFORM* p,
                const void* in,
-               void* out, cmsUInt32Number Size,
-               cmsUInt32Number Stride)
+               void* out,
+               cmsUInt32Number PixelsPerLine,
+               cmsUInt32Number LineCount,
+               const cmsStride* Stride)
 {
     cmsUInt8Number* accum;
     cmsUInt8Number* output;
     cmsUInt16Number wIn[cmsMAXCHANNELS];
-    cmsUInt32Number i, n;
+    cmsUInt32Number i, j, strideIn, strideOut;
+
+    _cmsHandleExtraChannels(p, in, out, PixelsPerLine, LineCount, Stride);
 
-    accum  = (cmsUInt8Number*)  in;
-    output = (cmsUInt8Number*)  out;
-    n = Size;                    // Buffer len
+    strideIn = 0;
+    strideOut = 0;
+
+    for (i = 0; i < LineCount; i++) {
 
-    for (i=0; i < n; i++) {
+           accum = (cmsUInt8Number*)in + strideIn;
+           output = (cmsUInt8Number*)out + strideOut;
+
+           for (j = 0; j < PixelsPerLine; j++) {
 
-        accum  = p -> FromInput(p, wIn, accum, Stride);
-        output = p -> ToOutput(p, wIn, output, Stride);
+                  accum = p->FromInput(p, wIn, accum, Stride->BytesPerPlaneIn);
+                  output = p->ToOutput(p, wIn, output, Stride->BytesPerPlaneOut);
     }
+
+           strideIn += Stride->BytesPerLineIn;
+           strideOut += Stride->BytesPerLineOut;
+    }
+
 }
 
 
@@ -332,27 +408,41 @@
 static
 void PrecalculatedXFORM(_cmsTRANSFORM* p,
                         const void* in,
-                        void* out, cmsUInt32Number Size, cmsUInt32Number Stride)
+                        void* out,
+                        cmsUInt32Number PixelsPerLine,
+                        cmsUInt32Number LineCount,
+                        const cmsStride* Stride)
 {
     register cmsUInt8Number* accum;
     register cmsUInt8Number* output;
     cmsUInt16Number wIn[cmsMAXCHANNELS], wOut[cmsMAXCHANNELS];
-    cmsUInt32Number i, n;
+    cmsUInt32Number i, j, strideIn, strideOut;
+
+    _cmsHandleExtraChannels(p, in, out, PixelsPerLine, LineCount, Stride);
 
-    accum  = (cmsUInt8Number*)  in;
-    output = (cmsUInt8Number*)  out;
-    n = Size;
+    strideIn = 0;
+    strideOut = 0;
+
+    for (i = 0; i < LineCount; i++) {
+
+        accum = (cmsUInt8Number*)in + strideIn;
+        output = (cmsUInt8Number*)out + strideOut;
 
-    for (i=0; i < n; i++) {
+        for (j = 0; j < PixelsPerLine; j++) {
 
-        accum = p -> FromInput(p, wIn, accum, Stride);
-        p ->Lut ->Eval16Fn(wIn, wOut, p -> Lut->Data);
-        output = p -> ToOutput(p, wOut, output, Stride);
+            accum = p->FromInput(p, wIn, accum, Stride->BytesPerPlaneIn);
+            p->Lut->Eval16Fn(wIn, wOut, p->Lut->Data);
+            output = p->ToOutput(p, wOut, output, Stride->BytesPerPlaneOut);
+        }
+
+        strideIn += Stride->BytesPerLineIn;
+        strideOut += Stride->BytesPerLineOut;
     }
+
 }
 
 
-// Auxiliar: Handle precalculated gamut check. The retrieval of context may be alittle bit slow, but this function is not critical.
+// Auxiliary: Handle precalculated gamut check. The retrieval of context may be alittle bit slow, but this function is not critical.
 static
 void TransformOnePixelWithGamutCheck(_cmsTRANSFORM* p,
                                      const cmsUInt16Number wIn[],
@@ -379,22 +469,35 @@
 static
 void PrecalculatedXFORMGamutCheck(_cmsTRANSFORM* p,
                                   const void* in,
-                                  void* out, cmsUInt32Number Size, cmsUInt32Number Stride)
+                                  void* out,
+                                  cmsUInt32Number PixelsPerLine,
+                                  cmsUInt32Number LineCount,
+                                  const cmsStride* Stride)
 {
     cmsUInt8Number* accum;
     cmsUInt8Number* output;
     cmsUInt16Number wIn[cmsMAXCHANNELS], wOut[cmsMAXCHANNELS];
-    cmsUInt32Number i, n;
+    cmsUInt32Number i, j, strideIn, strideOut;
+
+    _cmsHandleExtraChannels(p, in, out, PixelsPerLine, LineCount, Stride);
 
-    accum  = (cmsUInt8Number*)  in;
-    output = (cmsUInt8Number*)  out;
-    n = Size;                    // Buffer len
+    strideIn = 0;
+    strideOut = 0;
+
+    for (i = 0; i < LineCount; i++) {
 
-    for (i=0; i < n; i++) {
+           accum = (cmsUInt8Number*)in + strideIn;
+           output = (cmsUInt8Number*)out + strideOut;
+
+           for (j = 0; j < PixelsPerLine; j++) {
 
-        accum = p -> FromInput(p, wIn, accum, Stride);
-        TransformOnePixelWithGamutCheck(p, wIn, wOut);
-        output = p -> ToOutput(p, wOut, output, Stride);
+                  accum = p->FromInput(p, wIn, accum, Stride->BytesPerPlaneIn);
+                  TransformOnePixelWithGamutCheck(p, wIn, wOut);
+                  output = p->ToOutput(p, wOut, output, Stride->BytesPerPlaneOut);
+           }
+
+           strideIn += Stride->BytesPerLineIn;
+           strideOut += Stride->BytesPerLineOut;
     }
 }
 
@@ -403,94 +506,120 @@
 static
 void CachedXFORM(_cmsTRANSFORM* p,
                  const void* in,
-                 void* out, cmsUInt32Number Size, cmsUInt32Number Stride)
+                 void* out,
+                 cmsUInt32Number PixelsPerLine,
+                 cmsUInt32Number LineCount,
+                 const cmsStride* Stride)
 {
     cmsUInt8Number* accum;
     cmsUInt8Number* output;
     cmsUInt16Number wIn[cmsMAXCHANNELS], wOut[cmsMAXCHANNELS];
-    cmsUInt32Number i, n;
     _cmsCACHE Cache;
+    cmsUInt32Number i, j, strideIn, strideOut;
 
-    accum  = (cmsUInt8Number*)  in;
-    output = (cmsUInt8Number*)  out;
-    n = Size;                    // Buffer len
+    _cmsHandleExtraChannels(p, in, out, PixelsPerLine, LineCount, Stride);
 
     // Empty buffers for quick memcmp
-    memset(wIn,  0, sizeof(wIn));
+    memset(wIn, 0, sizeof(wIn));
     memset(wOut, 0, sizeof(wOut));
 
     // Get copy of zero cache
-    memcpy(&Cache, &p ->Cache, sizeof(Cache));
+    memcpy(&Cache, &p->Cache, sizeof(Cache));
 
-    for (i=0; i < n; i++) {
+    strideIn = 0;
+    strideOut = 0;
 
-        accum = p -> FromInput(p, wIn, accum, Stride);
+    for (i = 0; i < LineCount; i++) {
 
-        if (memcmp(wIn, Cache.CacheIn, sizeof(Cache.CacheIn)) == 0) {
+        accum = (cmsUInt8Number*)in + strideIn;
+        output = (cmsUInt8Number*)out + strideOut;
+
+        for (j = 0; j < PixelsPerLine; j++) {
 
-            memcpy(wOut, Cache.CacheOut, sizeof(Cache.CacheOut));
-        }
-        else {
+            accum = p->FromInput(p, wIn, accum, Stride->BytesPerPlaneIn);
+
+            if (memcmp(wIn, Cache.CacheIn, sizeof(Cache.CacheIn)) == 0) {
 
-            p ->Lut ->Eval16Fn(wIn, wOut, p -> Lut->Data);
+                memcpy(wOut, Cache.CacheOut, sizeof(Cache.CacheOut));
+            }
+            else {
+                p->Lut->Eval16Fn(wIn, wOut, p->Lut->Data);
 
-            memcpy(Cache.CacheIn,  wIn,  sizeof(Cache.CacheIn));
-            memcpy(Cache.CacheOut, wOut, sizeof(Cache.CacheOut));
+                memcpy(Cache.CacheIn, wIn, sizeof(Cache.CacheIn));
+                memcpy(Cache.CacheOut, wOut, sizeof(Cache.CacheOut));
+            }
+
+            output = p->ToOutput(p, wOut, output, Stride->BytesPerPlaneOut);
         }
 
-        output = p -> ToOutput(p, wOut, output, Stride);
+        strideIn += Stride->BytesPerLineIn;
+        strideOut += Stride->BytesPerLineOut;
     }
-
 }
 
-
 // All those nice features together
 static
 void CachedXFORMGamutCheck(_cmsTRANSFORM* p,
                            const void* in,
-                           void* out, cmsUInt32Number Size, cmsUInt32Number Stride)
+                           void* out,
+                           cmsUInt32Number PixelsPerLine,
+                           cmsUInt32Number LineCount,
+                           const cmsStride* Stride)
 {
-       cmsUInt8Number* accum;
-       cmsUInt8Number* output;
-       cmsUInt16Number wIn[cmsMAXCHANNELS], wOut[cmsMAXCHANNELS];
-       cmsUInt32Number i, n;
-       _cmsCACHE Cache;
+    cmsUInt8Number* accum;
+    cmsUInt8Number* output;
+    cmsUInt16Number wIn[cmsMAXCHANNELS], wOut[cmsMAXCHANNELS];
+    _cmsCACHE Cache;
+    cmsUInt32Number i, j, strideIn, strideOut;
+
+    _cmsHandleExtraChannels(p, in, out, PixelsPerLine, LineCount, Stride);
 
-       accum  = (cmsUInt8Number*)  in;
-       output = (cmsUInt8Number*)  out;
-       n = Size;                    // Buffer len
+    // Empty buffers for quick memcmp
+    memset(wIn, 0, sizeof(wIn));
+    memset(wOut, 0, sizeof(wOut));
+
+    // Get copy of zero cache
+    memcpy(&Cache, &p->Cache, sizeof(Cache));
 
-       // Empty buffers for quick memcmp
-       memset(wIn,  0, sizeof(cmsUInt16Number) * cmsMAXCHANNELS);
-       memset(wOut, 0, sizeof(cmsUInt16Number) * cmsMAXCHANNELS);
+    strideIn = 0;
+    strideOut = 0;
+
+    for (i = 0; i < LineCount; i++) {
 
-       // Get copy of zero cache
-       memcpy(&Cache, &p ->Cache, sizeof(Cache));
+        accum = (cmsUInt8Number*)in + strideIn;
+        output = (cmsUInt8Number*)out + strideOut;
 
-       for (i=0; i < n; i++) {
+        for (j = 0; j < PixelsPerLine; j++) {
 
-            accum = p -> FromInput(p, wIn, accum, Stride);
+            accum = p->FromInput(p, wIn, accum, Stride->BytesPerPlaneIn);
 
             if (memcmp(wIn, Cache.CacheIn, sizeof(Cache.CacheIn)) == 0) {
-                    memcpy(wOut, Cache.CacheOut, sizeof(Cache.CacheOut));
+
+                memcpy(wOut, Cache.CacheOut, sizeof(Cache.CacheOut));
             }
             else {
-                    TransformOnePixelWithGamutCheck(p, wIn, wOut);
-                    memcpy(Cache.CacheIn, wIn, sizeof(Cache.CacheIn));
-                    memcpy(Cache.CacheOut, wOut, sizeof(Cache.CacheOut));
+                TransformOnePixelWithGamutCheck(p, wIn, wOut);
+
+                memcpy(Cache.CacheIn, wIn, sizeof(Cache.CacheIn));
+                memcpy(Cache.CacheOut, wOut, sizeof(Cache.CacheOut));
             }
 
-            output = p -> ToOutput(p, wOut, output, Stride);
-       }
+            output = p->ToOutput(p, wOut, output, Stride->BytesPerPlaneOut);
+        }
 
+        strideIn += Stride->BytesPerLineIn;
+        strideOut += Stride->BytesPerLineOut;
+    }
 }
 
-// -------------------------------------------------------------------------------------------------------------
+// Transform plug-ins ----------------------------------------------------------------------------------------------------
 
 // List of used-defined transform factories
 typedef struct _cmsTransformCollection_st {
 
-    _cmsTransformFactory  Factory;
+    _cmsTransform2Factory  Factory;
+    cmsBool                OldXform;   // Factory returns xform function in the old style
+
     struct _cmsTransformCollection_st *Next;
 
 } _cmsTransformCollection;
@@ -533,6 +662,7 @@
   ctx ->chunks[TransformPlugin] = _cmsSubAllocDup(ctx->MemPool, &newHead, sizeof(_cmsTransformPluginChunkType));
 }
 
+// Allocates memory for transform plugin factory
 void _cmsAllocTransformPluginChunk(struct _cmsContext_struct* ctx,
                                         const struct _cmsContext_struct* src)
 {
@@ -547,6 +677,35 @@
     }
 }
 
+// Adaptor for old versions of plug-in
+static
+void _cmsTransform2toTransformAdaptor(struct _cmstransform_struct *CMMcargo,
+                                      const void* InputBuffer,
+                                      void* OutputBuffer,
+                                      cmsUInt32Number PixelsPerLine,
+                                      cmsUInt32Number LineCount,
+                                      const cmsStride* Stride)
+{
+
+       cmsUInt32Number i, strideIn, strideOut;
+
+       _cmsHandleExtraChannels(CMMcargo, InputBuffer, OutputBuffer, PixelsPerLine, LineCount, Stride);
+
+       strideIn = 0;
+       strideOut = 0;
+
+       for (i = 0; i < LineCount; i++) {
+
+              void *accum = (cmsUInt8Number*)InputBuffer + strideIn;
+              void *output = (cmsUInt8Number*)OutputBuffer + strideOut;
+
+              CMMcargo->OldXform(CMMcargo, accum, output, PixelsPerLine, Stride->BytesPerPlaneIn);
+
+              strideIn += Stride->BytesPerLineIn;
+              strideOut += Stride->BytesPerLineOut;
+       }
+}
+
 
 
 // Register new ways to transform
@@ -564,14 +723,22 @@
     }
 
     // Factory callback is required
-    if (Plugin ->Factory == NULL) return FALSE;
+    if (Plugin->factories.xform == NULL) return FALSE;
 
 
     fl = (_cmsTransformCollection*) _cmsPluginMalloc(ContextID, sizeof(_cmsTransformCollection));
     if (fl == NULL) return FALSE;
 
+    // Check for full xform plug-ins previous to 2.8, we would need an adapter in that case
+    if (Plugin->base.ExpectedVersion < 2080) {
+
+           fl->OldXform = TRUE;
+    }
+    else
+           fl->OldXform = FALSE;
+
     // Copy the parameters
-    fl ->Factory = Plugin ->Factory;
+    fl->Factory = Plugin->factories.xform;
 
     // Keep linked list
     fl ->Next = ctx->TransformCollection;
@@ -656,6 +823,12 @@
                             p->FromInputFloat = _cmsGetFormatter(ContextID, *InputFormat, cmsFormatterInput, CMS_PACK_FLAGS_FLOAT).FmtFloat;
                             p->ToOutputFloat = _cmsGetFormatter(ContextID, *OutputFormat, cmsFormatterOutput, CMS_PACK_FLAGS_FLOAT).FmtFloat;
 
+                            // Save the day?
+                            if (Plugin->OldXform) {
+                                   p->OldXform = (_cmsTransformFn) p->xform;
+                                   p->xform = _cmsTransform2toTransformAdaptor;
+                            }
+
                             return p;
                      }
               }
@@ -816,6 +989,22 @@
 
 // ----------------------------------------------------------------------------------------------------------------
 
+// Jun-21-2000: Some profiles (those that comes with W2K) comes
+// with the media white (media black?) x 100. Add a sanity check
+
+static
+void NormalizeXYZ(cmsCIEXYZ* Dest)
+{
+    while (Dest -> X > 2. &&
+           Dest -> Y > 2. &&
+           Dest -> Z > 2.) {
+
+               Dest -> X /= 10.;
+               Dest -> Y /= 10.;
+               Dest -> Z /= 10.;
+       }
+}
+
 static
 void SetWhitePoint(cmsCIEXYZ* wtPt, const cmsCIEXYZ* src)
 {
@@ -828,6 +1017,8 @@
         wtPt ->X = src->X;
         wtPt ->Y = src->Y;
         wtPt ->Z = src->Z;
+
+        NormalizeXYZ(wtPt);
     }
 
 }
@@ -1138,7 +1329,6 @@
                                          cmsUInt32Number InputFormat,
                                          cmsUInt32Number OutputFormat)
 {
-
     _cmsTRANSFORM* xform = (_cmsTRANSFORM*) hTransform;
     cmsFormatter16 FromInput, ToOutput;
 
--- a/jdk/src/java.desktop/share/native/liblcms/lcms2.h	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/native/liblcms/lcms2.h	Mon Aug 08 08:12:20 2016 -0700
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2014 Marti Maria Saguer
+//  Copyright (c) 1998-2016 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
@@ -52,7 +52,7 @@
 //
 //---------------------------------------------------------------------------------
 //
-// Version 2.7
+// Version 2.8
 //
 
 #ifndef _lcms2_H
@@ -104,7 +104,7 @@
 #endif
 
 // Version/release
-#define LCMS_VERSION        2070
+#define LCMS_VERSION        2080
 
 // I will give the chance of redefining basic types for compilers that are not fully C99 compliant
 #ifndef CMS_BASIC_TYPES_ALREADY_DEFINED
@@ -202,43 +202,44 @@
 #  define CMS_IS_WINDOWS_ 1
 #endif
 
-// Try to detect big endian platforms. This list can be endless, so only some checks are performed over here.
-// you can pass this toggle to the compiler by using -DCMS_USE_BIG_ENDIAN or something similar
+// Try to detect big endian platforms. This list can be endless, so primarily rely on the configure script
+// on Unix-like systems, and allow it to be set on the compiler command line using
+// -DCMS_USE_BIG_ENDIAN or something similar
+#ifdef CMS_USE_BIG_ENDIAN // set at compiler command line takes overall precedence
+
+#  if CMS_USE_BIG_ENDIAN == 0
+#    undef CMS_USE_BIG_ENDIAN
+#  endif
 
-#if defined(__sgi__) || defined(__sgi) || defined(sparc)
-#   define CMS_USE_BIG_ENDIAN      1
-#endif
+#else // CMS_USE_BIG_ENDIAN
 
-#if defined(__s390__) || defined(__s390x__)
-#   define CMS_USE_BIG_ENDIAN   1
-#endif
-
+#  ifdef WORDS_BIGENDIAN // set by configure (or explicitly on compiler command line)
+#    define CMS_USE_BIG_ENDIAN 1
+#  else // WORDS_BIGENDIAN
+// Fall back to platform/compiler specific tests
+#    if defined(__sgi__) || defined(__sgi) || defined(sparc)
+#      define CMS_USE_BIG_ENDIAN      1
+#    endif
 
-#if defined(__powerpc__) || defined(__ppc__) || defined(TARGET_CPU_PPC)
-#  if __powerpc__ || __ppc__ || TARGET_CPU_PPC
-#   define CMS_USE_BIG_ENDIAN   1
-#   if defined (__GNUC__) && defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__)
-#       if __BYTE_ORDER__  == __ORDER_LITTLE_ENDIAN__
-                // Don't use big endian for PowerPC little endian mode
-#                undef CMS_USE_BIG_ENDIAN
-#       endif
-#     endif
-#   endif
-#endif
+#    if defined(__s390__) || defined(__s390x__)
+#      define CMS_USE_BIG_ENDIAN   1
+#    endif
 
-#ifdef macintosh
-# ifdef __BIG_ENDIAN__
-#   define CMS_USE_BIG_ENDIAN      1
-# endif
-# ifdef __LITTLE_ENDIAN__
-#   undef CMS_USE_BIG_ENDIAN
-# endif
-#endif
+#    ifdef macintosh
+#      ifdef __BIG_ENDIAN__
+#        define CMS_USE_BIG_ENDIAN      1
+#      endif
+#      ifdef __LITTLE_ENDIAN__
+#        undef CMS_USE_BIG_ENDIAN
+#      endif
+#    endif
+#  endif  // WORDS_BIGENDIAN
 
-// WORDS_BIGENDIAN takes precedence
-#if defined(_HOST_BIG_ENDIAN) || defined(__BIG_ENDIAN__) || defined(WORDS_BIGENDIAN)
-#   define CMS_USE_BIG_ENDIAN      1
-#endif
+#  if defined(_HOST_BIG_ENDIAN) || defined(__BIG_ENDIAN__)
+#    define CMS_USE_BIG_ENDIAN      1
+#  endif
+
+#endif  // CMS_USE_BIG_ENDIAN
 
 
 // Calling convention -- this is hardly platform and compiler dependent
@@ -248,7 +249,7 @@
 #        define CMSEXPORT       __stdcall _export
 #        define CMSAPI
 #     else
-#        define CMSEXPORT      _stdcall
+#        define CMSEXPORT      __stdcall
 #        ifdef CMS_DLL_BUILD
 #            define CMSAPI    __declspec(dllexport)
 #        else
@@ -410,7 +411,8 @@
     cmsSigViewingCondDescTag                = 0x76756564,  // 'vued'
     cmsSigViewingConditionsTag              = 0x76696577,  // 'view'
     cmsSigVcgtTag                           = 0x76636774,  // 'vcgt'
-    cmsSigMetaTag                           = 0x6D657461   // 'meta'
+    cmsSigMetaTag                           = 0x6D657461,  // 'meta'
+    cmsSigArgyllArtsTag                     = 0x61727473   // 'arts'
 
 } cmsTagSignature;
 
@@ -683,7 +685,7 @@
 //            T: Pixeltype
 //            F: Flavor  0=MinIsBlack(Chocolate) 1=MinIsWhite(Vanilla)
 //            P: Planar? 0=Chunky, 1=Planar
-//            X: swap 16 bps endianess?
+//            X: swap 16 bps endianness?
 //            S: Do swap? ie, BGR, KYMC
 //            E: Extra samples
 //            C: Channels (Samples per pixel)
@@ -926,7 +928,7 @@
 #define TYPE_ARGB_FLT         (FLOAT_SH(1)|COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(4)|SWAPFIRST_SH(1))
 #define TYPE_BGR_FLT          (FLOAT_SH(1)|COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(4)|DOSWAP_SH(1))
 #define TYPE_BGRA_FLT         (FLOAT_SH(1)|COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(4)|DOSWAP_SH(1)|SWAPFIRST_SH(1))
-#define TYPE_ABGR_FLT         (FLOAT_SH(1)|COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(4)|DOSWAP_SH(1))
+#define TYPE_ABGR_FLT         (FLOAT_SH(1)|COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(4)|DOSWAP_SH(1))
 
 #define TYPE_CMYK_FLT         (FLOAT_SH(1)|COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(4))
 
@@ -1043,7 +1045,7 @@
 // Context handling --------------------------------------------------------------------------------------------------------
 
 // Each context holds its owns globals and its own plug-ins. There is a global context with the id = 0 for lecacy compatibility
-// though using the global context is not recomended. Proper context handling makes lcms more thread-safe.
+// though using the global context is not recommended. Proper context handling makes lcms more thread-safe.
 
 typedef struct _cmsContext_struct* cmsContext;
 
@@ -1412,7 +1414,7 @@
 typedef struct {
 
     cmsUInt32Number n;
-    cmsContext     ContextID;
+    cmsContext      ContextID;
     cmsPSEQDESC*    seq;
 
 } cmsSEQ;
@@ -1679,6 +1681,8 @@
 // Specific to unbounded mode
 #define cmsFLAGS_NONEGATIVES              0x8000    // Prevent negative numbers in floating point transforms
 
+// Copy alpha channels when transforming
+#define cmsFLAGS_COPY_ALPHA               0x04000000 // Alpha channels are copied on cmsDoTransform()
 
 // Fine-tune control over number of gridpoints
 #define cmsFLAGS_GRIDPOINTS(n)           (((n) & 0xFF) << 16)
@@ -1757,12 +1761,22 @@
                                                  void * OutputBuffer,
                                                  cmsUInt32Number Size);
 
-CMSAPI void             CMSEXPORT cmsDoTransformStride(cmsHTRANSFORM Transform,
+CMSAPI void             CMSEXPORT cmsDoTransformStride(cmsHTRANSFORM Transform,   // Deprecated
                                                  const void * InputBuffer,
                                                  void * OutputBuffer,
                                                  cmsUInt32Number Size,
                                                  cmsUInt32Number Stride);
 
+CMSAPI void             CMSEXPORT cmsDoTransformLineStride(cmsHTRANSFORM  Transform,
+                                                 const void* InputBuffer,
+                                                 void* OutputBuffer,
+                                                 cmsUInt32Number PixelsPerLine,
+                                                 cmsUInt32Number LineCount,
+                                                 cmsUInt32Number BytesPerLineIn,
+                                                 cmsUInt32Number BytesPerLineOut,
+                                                 cmsUInt32Number BytesPerPlaneIn,
+                                                 cmsUInt32Number BytesPerPlaneOut);
+
 
 CMSAPI void             CMSEXPORT cmsSetAlarmCodes(const cmsUInt16Number NewAlarm[cmsMAXCHANNELS]);
 CMSAPI void             CMSEXPORT cmsGetAlarmCodes(cmsUInt16Number NewAlarm[cmsMAXCHANNELS]);
--- a/jdk/src/java.desktop/share/native/liblcms/lcms2_internal.h	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/native/liblcms/lcms2_internal.h	Mon Aug 08 08:12:20 2016 -0700
@@ -30,7 +30,7 @@
 
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2014 Marti Maria Saguer
+//  Copyright (c) 1998-2016 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
@@ -86,7 +86,15 @@
 #define _cmsALIGNLONG(x) (((x)+(sizeof(cmsUInt32Number)-1)) & ~(sizeof(cmsUInt32Number)-1))
 
 // Alignment to memory pointer
-#define _cmsALIGNMEM(x)  (((x)+(sizeof(void *) - 1)) & ~(sizeof(void *) - 1))
+
+// (Ultra)SPARC with gcc requires ptr alignment of 8 bytes
+// even though sizeof(void *) is only four: for greatest flexibility
+// allow the build to specify ptr alignment.
+#ifndef CMS_PTR_ALIGNMENT
+# define CMS_PTR_ALIGNMENT sizeof(void *)
+#endif
+
+#define _cmsALIGNMEM(x)  (((x)+(CMS_PTR_ALIGNMENT - 1)) & ~(CMS_PTR_ALIGNMENT - 1))
 
 // Maximum encodeable values in floating point
 #define MAX_ENCODEABLE_XYZ  (1.0 + 32767.0/32768.0)
@@ -122,7 +130,7 @@
 
 // A fast way to convert from/to 16 <-> 8 bits
 #define FROM_8_TO_16(rgb) (cmsUInt16Number) ((((cmsUInt16Number) (rgb)) << 8)|(rgb))
-#define FROM_16_TO_8(rgb) (cmsUInt8Number) ((((rgb) * 65281 + 8388608) >> 24) & 0xFF)
+#define FROM_16_TO_8(rgb) (cmsUInt8Number) ((((cmsUInt32Number)(rgb) * 65281U + 8388608U) >> 24) & 0xFFU)
 
 // Code analysis is broken on asserts
 #ifdef _MSC_VER
@@ -691,8 +699,8 @@
     cmsContext ContextID;
 
     // The directory
-    int AllocatedEntries;
-    int UsedEntries;
+    cmsUInt32Number  AllocatedEntries;
+    cmsUInt32Number  UsedEntries;
     _cmsMLUentry* Entries;     // Array of pointers to strings allocated in MemPool
 
     // The Pool
@@ -760,7 +768,7 @@
     // Dictionary
     cmsUInt32Number          TagCount;
     cmsTagSignature          TagNames[MAX_TABLE_TAG];
-    cmsTagSignature          TagLinked[MAX_TABLE_TAG];           // The tag to wich is linked (0=none)
+    cmsTagSignature          TagLinked[MAX_TABLE_TAG];           // The tag to which is linked (0=none)
     cmsUInt32Number          TagSizes[MAX_TABLE_TAG];            // Size on disk
     cmsUInt32Number          TagOffsets[MAX_TABLE_TAG];
     cmsBool                  TagSaveAsRaw[MAX_TABLE_TAG];        // True to write uncooked
@@ -988,7 +996,7 @@
     cmsUInt32Number InputFormat, OutputFormat; // Keep formats for further reference
 
     // Points to transform code
-    _cmsTransformFn xform;
+    _cmsTransform2Fn xform;
 
     // Formatters, cannot be embedded into LUT because cache
     cmsFormatter16 FromInput;
@@ -1034,9 +1042,20 @@
     void* UserData;
     _cmsFreeUserDataFn FreeUserData;
 
+    // A way to provide backwards compatibility with full xform plugins
+    _cmsTransformFn OldXform;
+
 } _cmsTRANSFORM;
 
-// --------------------------------------------------------------------------------------------------
+// Copies extra channels from input to output if the original flags in the transform structure
+// instructs to do so. This function is called on all standard transform functions.
+void _cmsHandleExtraChannels(_cmsTRANSFORM* p, const void* in,
+                             void* out,
+                             cmsUInt32Number PixelsPerLine,
+                             cmsUInt32Number LineCount,
+                             const cmsStride* Stride);
+
+// -----------------------------------------------------------------------------------------------------------------------
 
 cmsHTRANSFORM _cmsChain2Lab(cmsContext             ContextID,
                             cmsUInt32Number        nProfiles,
--- a/jdk/src/java.desktop/share/native/liblcms/lcms2_plugin.h	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/native/liblcms/lcms2_plugin.h	Mon Aug 08 08:12:20 2016 -0700
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2011 Marti Maria Saguer
+//  Copyright (c) 1998-2016 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
@@ -157,7 +157,7 @@
                                                                    const void* Buffer);
 };
 
-// Endianess adjust functions
+// Endianness adjust functions
 CMSAPI cmsUInt16Number   CMSEXPORT  _cmsAdjustEndianess16(cmsUInt16Number Word);
 CMSAPI cmsUInt32Number   CMSEXPORT  _cmsAdjustEndianess32(cmsUInt32Number Value);
 CMSAPI void              CMSEXPORT  _cmsAdjustEndianess64(cmsUInt64Number* Result, cmsUInt64Number* QWord);
@@ -371,8 +371,8 @@
 
 typedef cmsUInt8Number* (* cmsFormatter16)(register struct _cmstransform_struct* CMMcargo,
                                            register cmsUInt16Number Values[],
-                                           register cmsUInt8Number*  Buffer,
-                                           register cmsUInt32Number  Stride);
+                                           register cmsUInt8Number* Buffer,
+                                           register cmsUInt32Number Stride);
 
 typedef cmsUInt8Number* (* cmsFormatterFloat)(struct _cmstransform_struct* CMMcargo,
                                               cmsFloat32Number Values[],
@@ -600,11 +600,28 @@
 
 //----------------------------------------------------------------------------------------------------------
 // Full xform
-typedef void     (* _cmsTransformFn)(struct _cmstransform_struct *CMMcargo,
+
+typedef struct {
+       cmsUInt32Number BytesPerLineIn;
+       cmsUInt32Number BytesPerLineOut;
+       cmsUInt32Number BytesPerPlaneIn;
+       cmsUInt32Number BytesPerPlaneOut;
+
+} cmsStride;
+
+typedef void     (* _cmsTransformFn)(struct _cmstransform_struct *CMMcargo,   // Legacy function, handles just ONE scanline.
                                      const void* InputBuffer,
                                      void* OutputBuffer,
                                      cmsUInt32Number Size,
-                                     cmsUInt32Number Stride);
+                                     cmsUInt32Number Stride);                 // Stride in bytes to the next plana in planar formats
+
+
+typedef void     (*_cmsTransform2Fn)(struct _cmstransform_struct *CMMcargo,
+                                     const void* InputBuffer,
+                                     void* OutputBuffer,
+                                     cmsUInt32Number PixelsPerLine,
+                                     cmsUInt32Number LineCount,
+                                     const cmsStride* Stride);
 
 typedef cmsBool  (* _cmsTransformFactory)(_cmsTransformFn* xform,
                                          void** UserData,
@@ -614,6 +631,14 @@
                                          cmsUInt32Number* OutputFormat,
                                          cmsUInt32Number* dwFlags);
 
+typedef cmsBool  (* _cmsTransform2Factory)(_cmsTransform2Fn* xform,
+                                         void** UserData,
+                                         _cmsFreeUserDataFn* FreePrivateDataFn,
+                                         cmsPipeline** Lut,
+                                         cmsUInt32Number* InputFormat,
+                                         cmsUInt32Number* OutputFormat,
+                                         cmsUInt32Number* dwFlags);
+
 
 // Retrieve user data as specified by the factory
 CMSAPI void   CMSEXPORT _cmsSetTransformUserData(struct _cmstransform_struct *CMMcargo, void* ptr, _cmsFreeUserDataFn FreePrivateDataFn);
@@ -628,7 +653,10 @@
       cmsPluginBase     base;
 
       // Transform entry point
-      _cmsTransformFactory  Factory;
+      union {
+             _cmsTransformFactory        legacy_xform;
+             _cmsTransform2Factory       xform;
+      } factories;
 
 }  cmsPluginTransform;
 
--- a/jdk/src/java.desktop/share/native/libmlib_image/mlib_ImageAffine_NN_Bit.c	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/native/libmlib_image/mlib_ImageAffine_NN_Bit.c	Mon Aug 08 08:12:20 2016 -0700
@@ -84,8 +84,7 @@
         ySrc = MLIB_POINTER_SHIFT(Y);
         srcPixelPtr = MLIB_POINTER_GET(lineAddr, ySrc);
 
-        res = (res & ~(1 << bit)) | (((srcPixelPtr[X >> (MLIB_SHIFT + 3)] >> (7 - (X >> MLIB_SHIFT) & 7)) & 1) <<
-           bit);
+        res = (res & ~(1 << bit)) | (((srcPixelPtr[X >> (MLIB_SHIFT + 3)] >> (7 - ((X >> MLIB_SHIFT) & 7))) & 1) << bit);
 
         X += dX;
         Y += dY;
@@ -150,7 +149,7 @@
         ySrc = MLIB_POINTER_SHIFT(Y);
         srcPixelPtr = MLIB_POINTER_GET(lineAddr, ySrc);
 
-        res = (res & ~(1 << bit)) | (((srcPixelPtr[X >> (MLIB_SHIFT + 3)] >> (7 - (X >> MLIB_SHIFT) & 7)) & 1) << bit);
+        res = (res & ~(1 << bit)) | (((srcPixelPtr[X >> (MLIB_SHIFT + 3)] >> (7 - ((X >> MLIB_SHIFT) & 7))) & 1) << bit);
 
         X += dX;
         Y += dY;
--- a/jdk/src/java.desktop/share/native/libmlib_image/mlib_ImageConv.h	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/native/libmlib_image/mlib_ImageConv.h	Mon Aug 08 08:12:20 2016 -0700
@@ -34,11 +34,9 @@
 // Shared macro defined for cleanup of allocated memory.
 #ifndef FREE_AND_RETURN_STATUS
 #define FREE_AND_RETURN_STATUS \
-{ \
 if (pbuff != buff) mlib_free(pbuff); \
 if (k != akernel) mlib_free(k); \
-return status; \
-}
+return status
 #endif /* FREE_AND_RETURN_STATUS */
 
 mlib_status mlib_convMxNext_s32(mlib_image       *dst,
--- a/jdk/src/java.desktop/share/native/libmlib_image/mlib_c_ImageConv.h	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/native/libmlib_image/mlib_c_ImageConv.h	Mon Aug 08 08:12:20 2016 -0700
@@ -34,11 +34,9 @@
 // Shared macro defined for cleanup of allocated memory.
 #ifndef FREE_AND_RETURN_STATUS
 #define FREE_AND_RETURN_STATUS \
-{ \
 if (pbuff != buff) mlib_free(pbuff); \
 if (k != akernel) mlib_free(k); \
-return status; \
-}
+return status
 #endif /* FREE_AND_RETURN_STATUS */
 
 mlib_status mlib_c_convMxNnw_u8(mlib_image       *dst,
--- a/jdk/src/java.desktop/share/native/libmlib_image/mlib_c_ImageCopy.c	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/share/native/libmlib_image/mlib_c_ImageCopy.c	Mon Aug 08 08:12:20 2016 -0700
@@ -182,7 +182,7 @@
 #define STRIP(pd, ps, w, h, data_type) {                        \
   data_type s0, s1;                                             \
   for ( i = 0; i < h; i++ ) {                                   \
-    if (j = w & 1)                                              \
+    if ((j = (w & 1)))                                          \
       pd[i * dst_stride] = ps[i * src_stride];                  \
     for (; j < w; j += 2) {                                     \
       s0 = ps[i * src_stride + j];                              \
@@ -546,7 +546,8 @@
     mlib_u32 *psrc_row = psrc + i * src_stride, *pdst_row = pdst + i * dst_stride;
 
     if (!(((mlib_addr) psrc_row ^ (mlib_addr) pdst_row) & 7)) {
-      if (j = ((mlib_s32) ((mlib_addr) psrc_row & 4) >> 2)) {
+      j = (mlib_s32) ((mlib_addr) psrc_row & 4) >> 2;
+      if (j != 0) {
         pdst_row[0] = psrc_row[0];
       }
 
@@ -575,8 +576,10 @@
       {
         mlib_u64 *ps, src0, src1;
 
-        if (j = ((mlib_s32) ((mlib_addr) pdst_row & 4) >> 2))
+        j = (mlib_s32) ((mlib_addr) pdst_row & 4) >> 2;
+        if (j != 0) {
           pdst_row[0] = psrc_row[0];
+        }
         ps = (mlib_u64 *) (psrc_row + j - 1);
         src1 = ps[0];
 #ifdef __SUNPRO_C
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XDecoratedPeer.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XDecoratedPeer.java	Mon Aug 08 08:12:20 2016 -0700
@@ -266,6 +266,12 @@
         return new Insets(i.top, i.left, i.bottom, i.right);
     }
 
+    private Insets copyAndScaleDown(Insets i) {
+        return new Insets(scaleDown(i.top), scaleDown(i.left),
+                          scaleDown(i.bottom), scaleDown(i.right));
+    }
+
+
     // insets which we get from WM (e.g from _NET_FRAME_EXTENTS)
     private Insets wm_set_insets;
 
@@ -289,7 +295,7 @@
         }
 
         if (wm_set_insets != null) {
-            wm_set_insets = copy(wm_set_insets);
+            wm_set_insets = copyAndScaleDown(wm_set_insets);
         }
         return wm_set_insets;
     }
@@ -386,6 +392,9 @@
                     }
                 } else {
                     correctWM = XWM.getWM().getInsets(this, xe.get_window(), xe.get_parent());
+                    if (correctWM != null) {
+                        correctWM = copyAndScaleDown(correctWM);
+                    }
 
                     if (insLog.isLoggable(PlatformLogger.Level.FINER)) {
                         if (correctWM != null) {
@@ -470,6 +479,9 @@
                 Insets res = getWMSetInsets(null);
                 if (res == null) {
                     res = XWM.getWM().guessInsets(this);
+                    if (res != null) {
+                        res = copyAndScaleDown(res);
+                    }
                 }
                 return res;
             }
@@ -756,7 +768,7 @@
                 }
             }
             if (correctWM != null) {
-                handleCorrectInsets(correctWM);
+                handleCorrectInsets(copyAndScaleDown(correctWM));
             } else {
                 //Only one attempt to correct insets is made (to lower risk)
                 //if insets are still not available we simply set the flag
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XDesktopPeer.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XDesktopPeer.java	Mon Aug 08 08:12:20 2016 -0700
@@ -60,7 +60,7 @@
         try {
             if (!initExecuted) {
                 nativeLibraryLoaded = init(UNIXToolkit.getEnabledGtkVersion()
-                        .ordinal(), UNIXToolkit.isGtkVerbose());
+                        .getNumber(), UNIXToolkit.isGtkVerbose());
             }
         } finally {
             initExecuted = true;
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11FontManager.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11FontManager.java	Mon Aug 08 08:12:20 2016 -0700
@@ -742,28 +742,20 @@
     protected FontConfiguration createFontConfiguration() {
         /* The logic here decides whether to use a preconfigured
          * fontconfig.properties file, or synthesise one using platform APIs.
-         * On Solaris (as opposed to OpenSolaris) we try to use the
+         * On Solaris we try to use the
          * pre-configured ones, but if the files it specifies are missing
          * we fail-safe to synthesising one. This might happen if Solaris
          * changes its fonts.
-         * For OpenSolaris I don't expect us to ever create fontconfig files,
-         * so it will always synthesise. Note that if we misidentify
-         * OpenSolaris as Solaris, then the test for the presence of
-         * Solaris-only font files will correct this.
          * For Linux we require an exact match of distro and version to
-         * use the preconfigured file, and also that it points to
-         * existent fonts.
+         * use the preconfigured file.
          * If synthesising fails, we fall back to any preconfigured file
          * and do the best we can. For the commercial JDK this will be
          * fine as it includes the Lucida fonts. OpenJDK should not hit
          * this as the synthesis should always work on its platforms.
          */
         FontConfiguration mFontConfig = new MFontConfiguration(this);
-        if (FontUtilities.isOpenSolaris ||
-            (FontUtilities.isLinux &&
-             (!mFontConfig.foundOsSpecificFile() ||
-              !mFontConfig.fontFilesArePresent()) ||
-             (FontUtilities.isSolaris && !mFontConfig.fontFilesArePresent()))) {
+        if ((FontUtilities.isLinux && !mFontConfig.foundOsSpecificFile()) ||
+            (FontUtilities.isSolaris && !mFontConfig.fontFilesArePresent())) {
             FcFontConfiguration fcFontConfig =
                 new FcFontConfiguration(this);
             if (fcFontConfig.init()) {
@@ -773,6 +765,7 @@
         mFontConfig.init();
         return mFontConfig;
     }
+
     public FontConfiguration
         createFontConfiguration(boolean preferLocaleFonts,
                                 boolean preferPropFonts) {
--- a/jdk/src/java.desktop/unix/classes/sun/font/MFontConfiguration.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/unix/classes/sun/font/MFontConfiguration.java	Mon Aug 08 08:12:20 2016 -0700
@@ -88,21 +88,13 @@
         reorderMap.put("UTF-8.th", "thai");
         reorderMap.put("UTF-8.zh.TW", "chinese-big5");
         reorderMap.put("UTF-8.zh.HK", split("chinese-big5,chinese-hkscs"));
-        if (FontUtilities.isSolaris8) {
-            reorderMap.put("UTF-8.zh.CN", split("chinese-gb2312,chinese-big5"));
-        } else {
-            reorderMap.put("UTF-8.zh.CN",
-                           split("chinese-gb18030-0,chinese-gb18030-1"));
-        }
+        reorderMap.put("UTF-8.zh.CN",
+                       split("chinese-gb18030-0,chinese-gb18030-1"));
         reorderMap.put("UTF-8.zh",
                        split("chinese-big5,chinese-hkscs,chinese-gb18030-0,chinese-gb18030-1"));
         reorderMap.put("Big5", "chinese-big5");
         reorderMap.put("Big5-HKSCS", split("chinese-big5,chinese-hkscs"));
-        if (! FontUtilities.isSolaris8 && ! FontUtilities.isSolaris9) {
-            reorderMap.put("GB2312", split("chinese-gbk,chinese-gb2312"));
-        } else {
-            reorderMap.put("GB2312","chinese-gb2312");
-        }
+        reorderMap.put("GB2312", split("chinese-gbk,chinese-gb2312"));
         reorderMap.put("x-EUC-TW",
             split("chinese-cns11643-1,chinese-cns11643-2,chinese-cns11643-3"));
         reorderMap.put("GBK", "chinese-gbk");
--- a/jdk/src/java.desktop/unix/classes/sun/java2d/xr/XRPMBlitLoops.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/unix/classes/sun/java2d/xr/XRPMBlitLoops.java	Mon Aug 08 08:12:20 2016 -0700
@@ -127,7 +127,11 @@
             vImgSurfaceType = SurfaceType.IntArgbPre;
         }
 
-        if (vImg == null || vImg.getWidth() < w || vImg.getHeight() < h) {
+        if (vImg == null || vImg.getWidth() < w || vImg.getHeight() < h ||
+            // Sometimes we get volatile image of wrong dest surface type,
+            // so recreating it
+            !(vImg.getDestSurface() instanceof XRSurfaceData))
+        {
             if (vImg != null) {
                 vImg.flush();
             }
@@ -142,6 +146,11 @@
         }
 
         Blit swToSurfaceBlit = Blit.getFromCache(src.getSurfaceType(), CompositeType.SrcNoEa, vImgSurfaceType);
+
+        if (!(vImg.getDestSurface() instanceof XRSurfaceData)) {
+            throw new InvalidPipeException("wrong surface data type: " + vImg.getDestSurface());
+        }
+
         XRSurfaceData vImgSurface = (XRSurfaceData) vImg.getDestSurface();
         swToSurfaceBlit.Blit(src, vImgSurface, AlphaComposite.Src, null,
                              sx, sy, 0, 0, w, h);
--- a/jdk/src/java.desktop/unix/classes/sun/print/IPPPrintService.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/unix/classes/sun/print/IPPPrintService.java	Mon Aug 08 08:12:20 2016 -0700
@@ -1684,7 +1684,6 @@
         }
         connection = (HttpURLConnection)urlc;
         connection.setUseCaches(false);
-        connection.setDefaultUseCaches(false);
         connection.setDoInput(true);
         connection.setDoOutput(true);
         connection.setRequestProperty("Content-type", "application/ipp");
--- a/jdk/src/java.desktop/unix/classes/sun/print/UnixPrintJob.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/unix/classes/sun/print/UnixPrintJob.java	Mon Aug 08 08:12:20 2016 -0700
@@ -126,6 +126,11 @@
             mDestination = ((IPPPrintService)service).getDest();
         }
         mDestType = UnixPrintJob.DESTPRINTER;
+        JobSheets js = (JobSheets)(service.
+                                      getDefaultAttributeValue(JobSheets.class));
+        if (js != null && js.equals(JobSheets.NONE)) {
+            mNoJobSheet = true;
+        }
     }
 
     public PrintService getPrintService() {
@@ -848,10 +853,10 @@
 
     private String[] printExecCmd(String printer, String options,
                                  boolean noJobSheet,
-                                 String banner, int copies, String spoolFile) {
+                                 String jobTitle, int copies, String spoolFile) {
         int PRINTER = 0x1;
         int OPTIONS = 0x2;
-        int BANNER  = 0x4;
+        int JOBTITLE  = 0x4;
         int COPIES  = 0x8;
         int NOSHEET  = 0x10;
         int pFlags = 0;
@@ -868,8 +873,8 @@
             pFlags |= OPTIONS;
             ncomps+=1;
         }
-        if (banner != null && !banner.equals("")) {
-            pFlags |= BANNER;
+        if (jobTitle != null && !jobTitle.equals("")) {
+            pFlags |= JOBTITLE;
             ncomps+=1;
         }
         if (copies > 1) {
@@ -879,6 +884,9 @@
         if (noJobSheet) {
             pFlags |= NOSHEET;
             ncomps+=1;
+        } else if (getPrintService().
+                        isAttributeCategorySupported(JobSheets.class)) {
+            ncomps+=1;
         }
         if (PrintServiceLookupProvider.osname.equals("SunOS")) {
             ncomps+=1; // lp uses 1 more arg than lpr (make a copy)
@@ -888,15 +896,18 @@
             if ((pFlags & PRINTER) != 0) {
                 execCmd[n++] = "-d" + printer;
             }
-            if ((pFlags & BANNER) != 0) {
+            if ((pFlags & JOBTITLE) != 0) {
                 String quoteChar = "\"";
-                execCmd[n++] = "-t "  + quoteChar+banner+quoteChar;
+                execCmd[n++] = "-t "  + quoteChar+jobTitle+quoteChar;
             }
             if ((pFlags & COPIES) != 0) {
                 execCmd[n++] = "-n " + copies;
             }
             if ((pFlags & NOSHEET) != 0) {
                 execCmd[n++] = "-o nobanner";
+            } else if (getPrintService().
+                        isAttributeCategorySupported(JobSheets.class)) {
+                execCmd[n++] = "-o job-sheets=standard";
             }
             if ((pFlags & OPTIONS) != 0) {
                 execCmd[n++] = "-o " + options;
@@ -907,14 +918,17 @@
             if ((pFlags & PRINTER) != 0) {
                 execCmd[n++] = "-P" + printer;
             }
-            if ((pFlags & BANNER) != 0) {
-                execCmd[n++] = "-J "  + banner;
+            if ((pFlags & JOBTITLE) != 0) {
+                execCmd[n++] = "-J "  + jobTitle;
             }
             if ((pFlags & COPIES) != 0) {
                 execCmd[n++] = "-#" + copies;
             }
             if ((pFlags & NOSHEET) != 0) {
                 execCmd[n++] = "-h";
+            } else if (getPrintService().
+                        isAttributeCategorySupported(JobSheets.class)) {
+                execCmd[n++] = "-o job-sheets=standard";
             }
             if ((pFlags & OPTIONS) != 0) {
                 execCmd[n++] = "-o" + options;
--- a/jdk/src/java.desktop/unix/native/common/awt/fontpath.c	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/unix/native/common/awt/fontpath.c	Mon Aug 08 08:12:20 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -805,30 +805,36 @@
     pattern = (*FcPatternBuild)(NULL, FC_OUTLINE, FcTypeBool, FcTrue, NULL);
     objset = (*FcObjectSetBuild)(FC_FILE, NULL);
     fontSet = (*FcFontList)(NULL, pattern, objset);
-    fontdirs = (char**)calloc(fontSet->nfont+1, sizeof(char*));
-    for (f=0; f < fontSet->nfont; f++) {
-        FcChar8 *file;
-        FcChar8 *dir;
-        if ((*FcPatternGetString)(fontSet->fonts[f], FC_FILE, 0, &file) ==
-                                  FcResultMatch) {
-            dir = (*FcStrDirname)(file);
-            found = 0;
-            for (i=0;i<numdirs; i++) {
-                if (strcmp(fontdirs[i], (char*)dir) == 0) {
-                    found = 1;
-                    break;
+    if (fontSet == NULL) {
+        /* FcFontList() may return NULL if fonts are not installed. */
+        fontdirs = NULL;
+    } else {
+        fontdirs = (char**)calloc(fontSet->nfont+1, sizeof(char*));
+        for (f=0; f < fontSet->nfont; f++) {
+            FcChar8 *file;
+            FcChar8 *dir;
+            if ((*FcPatternGetString)(fontSet->fonts[f], FC_FILE, 0, &file) ==
+                                      FcResultMatch) {
+                dir = (*FcStrDirname)(file);
+                found = 0;
+                for (i=0;i<numdirs; i++) {
+                    if (strcmp(fontdirs[i], (char*)dir) == 0) {
+                        found = 1;
+                        break;
+                    }
+                }
+                if (!found) {
+                    fontdirs[numdirs++] = (char*)dir;
+                } else {
+                    free((char*)dir);
                 }
             }
-            if (!found) {
-                fontdirs[numdirs++] = (char*)dir;
-            } else {
-                free((char*)dir);
-            }
         }
+        /* Free fontset if one was returned */
+        (*FcFontSetDestroy)(fontSet);
     }
 
     /* Free memory and close the ".so" */
-    (*FcFontSetDestroy)(fontSet);
     (*FcPatternDestroy)(pattern);
     closeFontConfig(libfontconfig, JNI_TRUE);
     return fontdirs;
--- a/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c	Mon Aug 08 08:12:20 2016 -0700
@@ -100,9 +100,9 @@
 
     /* check if XTest is available */
     isXTestAvailable = XQueryExtension(awt_display, XTestExtensionName, &major_opcode, &first_event, &first_error);
-    DTRACE_PRINTLN3("RobotPeer: XQueryExtension(XTEST) returns major_opcode = %d, first_event = %d, first_error = %d",
-                    major_opcode, first_event, first_error);
     if (isXTestAvailable) {
+        DTRACE_PRINTLN3("RobotPeer: XQueryExtension(XTEST) returns major_opcode = %d, first_event = %d, first_error = %d",
+                        major_opcode, first_event, first_error);
         /* check if XTest version is OK */
         XTestQueryExtension(awt_display, &event_basep, &error_basep, &majorp, &minorp);
         DTRACE_PRINTLN4("RobotPeer: XTestQueryExtension returns event_basep = %d, error_basep = %d, majorp = %d, minorp = %d",
--- a/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_UNIXToolkit.c	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_UNIXToolkit.c	Mon Aug 08 08:12:20 2016 -0700
@@ -129,6 +129,7 @@
         return JNI_FALSE;
     }
     if (!init_method(env, this) ) {
+        free(filename_str);
         return JNI_FALSE;
     }
     (*env)->GetStringUTFRegion(env, filename, 0, len, filename_str);
--- a/jdk/src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c	Mon Aug 08 08:12:20 2016 -0700
@@ -1008,9 +1008,9 @@
      * before calling XTestFakeButtonEvent().
      */
     xinputAvailable = XQueryExtension(awt_display, INAME, &major_opcode, &first_event, &first_error);
-    DTRACE_PRINTLN3("RobotPeer: XQueryExtension(XINPUT) returns major_opcode = %d, first_event = %d, first_error = %d",
-                    major_opcode, first_event, first_error);
     if (xinputAvailable) {
+        DTRACE_PRINTLN3("RobotPeer: XQueryExtension(XINPUT) returns major_opcode = %d, first_event = %d, first_error = %d",
+                        major_opcode, first_event, first_error);
         devices = XListInputDevices(awt_display, &numDevices);
         for (devIdx = 0; devIdx < numDevices; devIdx++) {
             aDevice = &(devices[devIdx]);
--- a/jdk/src/java.desktop/unix/native/libawt_xawt/xawt/gnome_interface.h	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/unix/native/libawt_xawt/xawt/gnome_interface.h	Mon Aug 08 08:12:20 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.desktop/windows/native/libawt/java2d/d3d/ShaderList.c	Mon Aug 08 08:12:20 2016 -0700
@@ -0,0 +1,143 @@
+/*
+ * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#include <malloc.h>
+#include <string.h>
+
+#include "ShaderList.h"
+#include "Trace.h"
+
+/**
+ * Creates a new ShaderInfo that wraps the given fragment program handle
+ * and related data and stores it at the front of the provided ShaderList.
+ * If the addition causes the ShaderList to outgrow its defined capacity,
+ * the least-recently used item in the list (including its fragment program
+ * object) will be disposed.
+ */
+void
+ShaderList_AddProgram(ShaderList *programList,
+                      jlong programID,
+                      jint compType, jint compMode, jint flags)
+{
+    ShaderInfo *info;
+
+    J2dTraceLn(J2D_TRACE_INFO, "ShaderList_AddProgram");
+
+    // create new ShaderInfo
+    info = (ShaderInfo *)malloc(sizeof(ShaderInfo));
+    if (info == NULL) {
+        J2dTraceLn(J2D_TRACE_ERROR,
+                   "D3DContext_AddProgram: could not allocate ShaderInfo");
+        return;
+    }
+
+    // fill in the information
+    info->next = programList->head;
+    info->programID = programID;
+    info->compType = compType;
+    info->compMode = compMode;
+    info->flags = flags;
+
+    // insert it at the head of the list
+    programList->head = info;
+
+    // run through the list and see if we need to delete the least
+    // recently used item
+    {
+        int i = 1;
+        ShaderInfo *prev = NULL;
+        ShaderInfo *curr = info->next;
+        while (curr != NULL) {
+            if (i >= programList->maxItems) {
+                prev->next = NULL;
+                programList->dispose(curr->programID);
+                free(curr);
+                break;
+            }
+            i++;
+            prev = curr;
+            curr = curr->next;
+        }
+    }
+}
+
+/**
+ * Locates a fragment program handle given a list of shader programs
+ * (ShaderInfos), using the provided composite state and flags as search
+ * parameters.  The "flags" parameter is a bitwise-or'd value that helps
+ * differentiate one program for another; the interpretation of this value
+ * varies depending on the type of shader (BufImgOp, Paint, etc) but here
+ * it is only used to find another ShaderInfo with that same "flags" value.
+ * If no matching program can be located, this method returns 0.
+ */
+jlong
+ShaderList_FindProgram(ShaderList *programList,
+                       jint compType, jint compMode, jint flags)
+{
+    ShaderInfo *prev = NULL;
+    ShaderInfo *info = programList->head;
+
+    J2dTraceLn(J2D_TRACE_INFO, "ShaderList_FindProgram");
+
+    while (info != NULL) {
+        if (compType == info->compType &&
+            compMode == info->compMode &&
+            flags == info->flags)
+        {
+            // it's a match: move it to the front of the list (if it's not
+            // there already) and patch up the links
+            if (info != programList->head) {
+                prev->next = info->next;
+                info->next = programList->head;
+                programList->head = info;
+            }
+            return info->programID;
+        }
+        prev = info;
+        info = info->next;
+    }
+    return 0;
+}
+
+/**
+ * Disposes all entries (and their associated shader program objects)
+ * contained in the given ShaderList.
+ */
+void
+ShaderList_Dispose(ShaderList *programList)
+{
+    ShaderInfo *info = programList->head;
+
+    J2dTraceLn(J2D_TRACE_INFO, "ShaderList_Dispose");
+
+    while (info != NULL) {
+        ShaderInfo *tmp = info->next;
+        programList->dispose(info->programID);
+        free(info);
+        info = tmp;
+    }
+
+    programList->head = NULL;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.desktop/windows/native/libawt/java2d/d3d/ShaderList.h	Mon Aug 08 08:12:20 2016 -0700
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#ifndef ShaderList_h_Included
+#define ShaderList_h_Included
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "jni.h"
+#include "jlong.h"
+
+typedef void (ShaderDisposeFunc)(jlong programID);
+
+/**
+ * The following structures are used to maintain a list of fragment program
+ * objects and their associated attributes.  Each logical shader (e.g.
+ * RadialGradientPaint shader, ConvolveOp shader) can have a number of
+ * different variants depending on a number of factors, such as whether
+ * antialiasing is enabled or the current composite mode.  Since the number
+ * of possible combinations of these factors is in the hundreds, we need
+ * some way to create fragment programs on an as-needed basis, and also
+ * keep them in a limited sized cache to avoid creating too many objects.
+ *
+ * The ShaderInfo structure keeps a reference to the fragment program's
+ * handle, as well as some other values that help differentiate one ShaderInfo
+ * from another.  ShaderInfos can be chained together to form a linked list.
+ *
+ * The ShaderList structure acts as a cache for ShaderInfos, placing
+ * most-recently used items at the front, and removing items from the
+ * cache when its size exceeds the "maxItems" limit.
+ */
+typedef struct _ShaderInfo ShaderInfo;
+
+typedef struct {
+    ShaderInfo        *head;
+    ShaderDisposeFunc *dispose;
+    jint              maxItems;
+} ShaderList;
+
+struct _ShaderInfo {
+    ShaderInfo  *next;
+    jlong       programID;
+    jint        compType;
+    jint        compMode;
+    jint        flags;
+};
+
+void ShaderList_AddProgram(ShaderList *programList,
+                           jlong programID,
+                           jint compType, jint compMode,
+                           jint flags);
+jlong ShaderList_FindProgram(ShaderList *programList,
+                             jint compType, jint compMode,
+                             jint flags);
+void ShaderList_Dispose(ShaderList *programList);
+
+#ifdef __cplusplus
+};
+#endif
+
+#endif /* ShaderList_h_Included */
--- a/jdk/src/java.desktop/windows/native/libawt/windows/awt_Choice.cpp	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Choice.cpp	Mon Aug 08 08:12:20 2016 -0700
@@ -345,7 +345,7 @@
      * drop down item height.
      */
     env->SetIntField(dimension, AwtDimension::heightID,
-                       GetFontHeight(env));
+                       ScaleUpY(GetFontHeight(env)));
     return dimension;
 }
 
--- a/jdk/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp	Mon Aug 08 08:12:20 2016 -0700
@@ -3852,10 +3852,12 @@
     if (!m_useNativeCompWindow) {
         if (subMsg == IMN_OPENCANDIDATE) {
             m_bitsCandType = subMsg;
-        } else if (subMsg != IMN_SETCANDIDATEPOS) {
+            InquireCandidatePosition();
+        } else if (subMsg == IMN_OPENSTATUSWINDOW ||
+                   subMsg == WM_IME_STARTCOMPOSITION) {
             m_bitsCandType = 0;
+            InquireCandidatePosition();
         }
-        InquireCandidatePosition();
         return mrConsume;
     }
     return mrDoDefault;
--- a/jdk/src/java.desktop/windows/native/libawt/windows/awt_Font.cpp	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Font.cpp	Mon Aug 08 08:12:20 2016 -0700
@@ -1685,6 +1685,8 @@
 
 CSegTableManager g_segTableManager;
 
+#define KEYLEN 16
+
 class CCombinedSegTable : public CSegTableComponent
 {
 public:
@@ -1695,7 +1697,7 @@
 private:
     LPSTR GetCodePageSubkey();
     void GetEUDCFileName(LPWSTR lpszFileName, int cchFileName);
-    static char m_szCodePageSubkey[16];
+    static char m_szCodePageSubkey[KEYLEN];
     static WCHAR m_szDefaultEUDCFile[_MAX_PATH];
     static BOOL m_fEUDCSubKeyExist;
     static BOOL m_fTTEUDCFileExist;
@@ -1703,7 +1705,7 @@
     CEUDCSegTable* m_pEUDCSegTable;
 };
 
-char CCombinedSegTable::m_szCodePageSubkey[16] = "";
+char CCombinedSegTable::m_szCodePageSubkey[KEYLEN] = "";
 
 WCHAR CCombinedSegTable::m_szDefaultEUDCFile[_MAX_PATH] = L"";
 
@@ -1735,8 +1737,11 @@
     }
     lpszCP++; // cf lpszCP = "932"
 
-    char szSubKey[80];
+    char szSubKey[KEYLEN];
     strcpy(szSubKey, "EUDC\\");
+    if ((strlen(szSubKey) + strlen(lpszCP)) >= KEYLEN) {
+        return NULL;
+    }
     strcpy(&(szSubKey[strlen(szSubKey)]), lpszCP);
     strcpy(m_szCodePageSubkey, szSubKey);
     return m_szCodePageSubkey;
--- a/jdk/src/java.desktop/windows/native/libawt/windows/awt_Frame.cpp	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Frame.cpp	Mon Aug 08 08:12:20 2016 -0700
@@ -1374,7 +1374,6 @@
             } else { // zoom == iconify == FALSE
                 wp.showCmd = focusable ? SW_RESTORE : SW_SHOWNOACTIVATE;
             }
-            ::ShowWindow(hwnd, wp.showCmd);
             if (zoom && iconify) {
                 wp.flags |= WPF_RESTORETOMAXIMIZED;
             } else {
--- a/jdk/src/java.desktop/windows/native/libawt/windows/awt_Robot.cpp	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Robot.cpp	Mon Aug 08 08:12:20 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -335,7 +335,17 @@
     } else {
         // get the scancode from the virtual key
         scancode = ::MapVirtualKey(vkey, 0);
-        if (vkey == VK_RMENU) {
+        if (vkey == VK_RMENU ||
+            vkey == VK_DELETE ||
+            vkey == VK_INSERT ||
+            vkey == VK_NEXT ||
+            vkey == VK_PRIOR ||
+            vkey == VK_HOME ||
+            vkey == VK_END ||
+            vkey == VK_LEFT ||
+            vkey == VK_RIGHT ||
+            vkey == VK_UP ||
+            vkey == VK_DOWN) {
             dwFlags |= KEYEVENTF_EXTENDEDKEY;
         }
         keybd_event(vkey, scancode, dwFlags, 0);
--- a/jdk/src/java.httpclient/share/classes/java/net/http/AuthenticationFilter.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/java.httpclient/share/classes/java/net/http/AuthenticationFilter.java	Mon Aug 08 08:12:20 2016 -0700
@@ -189,7 +189,7 @@
         }
 
         boolean proxy = status == PROXY_UNAUTHORIZED;
-        String authname = proxy ? "Proxy-Authentication" : "WWW-Authenticate";
+        String authname = proxy ? "Proxy-Authenticate" : "WWW-Authenticate";
         String authval = hdrs.firstValue(authname).orElseThrow(() -> {
             return new IOException("Invalid auth header");
         });
--- a/jdk/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Main.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Main.java	Mon Aug 08 08:12:20 2016 -0700
@@ -70,7 +70,6 @@
  * @author Roland Schemers
  * @author Jan Luehe
  */
-@SuppressWarnings("deprecation")
 public class Main {
 
     // for i18n
@@ -98,7 +97,6 @@
     static final String VERSION = "1.0";
 
     static final int IN_KEYSTORE = 0x01;        // signer is in keystore
-    static final int IN_SCOPE = 0x02;
     static final int NOT_ALIAS = 0x04;          // alias list is NOT empty and
                                                 // signer is not in alias list
     static final int SIGNED_BY_ALIAS = 0x08;    // signer is in alias list
@@ -676,14 +674,13 @@
                     hasUnsignedEntry |= !je.isDirectory() && !isSigned
                                         && !signatureRelated(name);
 
-                    int inStoreOrScope = inKeyStore(signers);
+                    int inStoreWithAlias = inKeyStore(signers);
+
+                    boolean inStore = (inStoreWithAlias & IN_KEYSTORE) != 0;
 
-                    boolean inStore = (inStoreOrScope & IN_KEYSTORE) != 0;
-                    boolean inScope = (inStoreOrScope & IN_SCOPE) != 0;
-
-                    notSignedByAlias |= (inStoreOrScope & NOT_ALIAS) != 0;
+                    notSignedByAlias |= (inStoreWithAlias & NOT_ALIAS) != 0;
                     if (keystore != null) {
-                        aliasNotInStore |= isSigned && (!inStore && !inScope);
+                        aliasNotInStore |= isSigned && !inStore;
                     }
 
                     // Only used when -verbose provided
@@ -697,8 +694,7 @@
                         sb.append(isSigned ? rb.getString("s") : rb.getString("SPACE"))
                                 .append(inManifest ? rb.getString("m") : rb.getString("SPACE"))
                                 .append(inStore ? rb.getString("k") : rb.getString("SPACE"))
-                                .append(inScope ? rb.getString("i") : rb.getString("SPACE"))
-                                .append((inStoreOrScope & NOT_ALIAS) != 0 ? 'X' : ' ')
+                                .append((inStoreWithAlias & NOT_ALIAS) != 0 ? 'X' : ' ')
                                 .append(rb.getString("SPACE"));
                         sb.append('|');
                     }
@@ -800,8 +796,6 @@
                     ".m.entry.is.listed.in.manifest"));
                 System.out.println(rb.getString(
                     ".k.at.least.one.certificate.was.found.in.keystore"));
-                System.out.println(rb.getString(
-                    ".i.at.least.one.certificate.was.found.in.identity.scope"));
                 if (ckaliases.size() > 0) {
                     System.out.println(rb.getString(
                         ".X.not.signed.by.specified.alias.es."));
@@ -1076,8 +1070,6 @@
             if (alias != null) {
                 if (alias.startsWith("(")) {
                     result |= IN_KEYSTORE;
-                } else if (alias.startsWith("[")) {
-                    result |= IN_SCOPE;
                 }
                 if (ckaliases.contains(alias.substring(1, alias.length() - 1))) {
                     result |= SIGNED_BY_ALIAS;
--- a/jdk/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Resources.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Resources.java	Mon Aug 08 08:12:20 2016 -0700
@@ -130,7 +130,6 @@
         {"s", "s"},
         {"m", "m"},
         {"k", "k"},
-        {"i", "i"},
         {".and.d.more.", "(and %d more)"},
         {".s.signature.was.verified.",
                 "  s = signature was verified "},
@@ -138,8 +137,6 @@
                 "  m = entry is listed in manifest"},
         {".k.at.least.one.certificate.was.found.in.keystore",
                 "  k = at least one certificate was found in keystore"},
-        {".i.at.least.one.certificate.was.found.in.identity.scope",
-                "  i = at least one certificate was found in identity scope"},
         {".X.not.signed.by.specified.alias.es.",
                 "  X = not signed by specified alias(es)"},
         {"no.manifest.", "no manifest."},
--- a/jdk/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Resources_ja.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Resources_ja.java	Mon Aug 08 08:12:20 2016 -0700
@@ -123,7 +123,6 @@
         {"s", "s"},
         {"m", "m"},
         {"k", "k"},
-        {"i", "i"},
         {".and.d.more.", "(\u4ED6\u306B\u3082%d\u500B)"},
         {".s.signature.was.verified.",
                 "  s=\u7F72\u540D\u304C\u691C\u8A3C\u3055\u308C\u307E\u3057\u305F "},
@@ -131,8 +130,6 @@
                 "  m=\u30A8\u30F3\u30C8\u30EA\u304C\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u5185\u306B\u30EA\u30B9\u30C8\u3055\u308C\u307E\u3059"},
         {".k.at.least.one.certificate.was.found.in.keystore",
                 "  k=1\u3064\u4EE5\u4E0A\u306E\u8A3C\u660E\u66F8\u304C\u30AD\u30FC\u30B9\u30C8\u30A2\u3067\u691C\u51FA\u3055\u308C\u307E\u3057\u305F"},
-        {".i.at.least.one.certificate.was.found.in.identity.scope",
-                "  i=1\u3064\u4EE5\u4E0A\u306E\u8A3C\u660E\u66F8\u304C\u30A2\u30A4\u30C7\u30F3\u30C6\u30A3\u30C6\u30A3\u30FB\u30B9\u30B3\u30FC\u30D7\u3067\u691C\u51FA\u3055\u308C\u307E\u3057\u305F"},
         {".X.not.signed.by.specified.alias.es.",
                 "  X =\u6307\u5B9A\u3057\u305F\u5225\u540D\u3067\u7F72\u540D\u3055\u308C\u3066\u3044\u307E\u305B\u3093"},
         {"no.manifest.", "\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u306F\u5B58\u5728\u3057\u307E\u305B\u3093\u3002"},
--- a/jdk/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Resources_zh_CN.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Resources_zh_CN.java	Mon Aug 08 08:12:20 2016 -0700
@@ -123,7 +123,6 @@
         {"s", "s"},
         {"m", "m"},
         {"k", "k"},
-        {"i", "i"},
         {".and.d.more.", "(%d \u53CA\u4EE5\u4E0A)"},
         {".s.signature.was.verified.",
                 "  s = \u5DF2\u9A8C\u8BC1\u7B7E\u540D "},
@@ -131,8 +130,6 @@
                 "  m = \u5728\u6E05\u5355\u4E2D\u5217\u51FA\u6761\u76EE"},
         {".k.at.least.one.certificate.was.found.in.keystore",
                 "  k = \u5728\u5BC6\u94A5\u5E93\u4E2D\u81F3\u5C11\u627E\u5230\u4E86\u4E00\u4E2A\u8BC1\u4E66"},
-        {".i.at.least.one.certificate.was.found.in.identity.scope",
-                "  i = \u5728\u8EAB\u4EFD\u4F5C\u7528\u57DF\u5185\u81F3\u5C11\u627E\u5230\u4E86\u4E00\u4E2A\u8BC1\u4E66"},
         {".X.not.signed.by.specified.alias.es.",
                 "  X = \u672A\u7531\u6307\u5B9A\u522B\u540D\u7B7E\u540D"},
         {"no.manifest.", "\u6CA1\u6709\u6E05\u5355\u3002"},
--- a/jdk/src/jdk.jsobject/share/classes/netscape/javascript/JSObject.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/src/jdk.jsobject/share/classes/netscape/javascript/JSObject.java	Mon Aug 08 08:12:20 2016 -0700
@@ -149,7 +149,13 @@
      * {@code null} if we are not connected to a browser.
      * @throws JSException when an error is reported from the browser or
      * JavaScript engine or if applet is {@code null}
+     *
+     * @deprecated  The Applet API is deprecated. See the
+     * <a href="../../../../../../api/java/applet/package-summary.html">
+     * java.applet package documentation</a> for further information.
      */
+
+    @Deprecated(since = "9")
     public static JSObject getWindow(Applet applet) throws JSException {
         return ProviderLoader.callGetWindow(applet);
     }
--- a/jdk/test/ProblemList.txt	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/ProblemList.txt	Mon Aug 08 08:12:20 2016 -0700
@@ -297,9 +297,6 @@
 ############################################################################
 
 # jdk_imageio
-javax/imageio/plugins/shared/CanWriteSequence.java              8148454 generic-all
-javax/imageio/plugins/tiff/MultiPageTest/MultiPageTest.java     8148454 generic-all
-javax/imageio/plugins/tiff/WriteToSequenceAfterAbort.java       8148454 generic-all
 
 ############################################################################
 
--- a/jdk/test/com/sun/java/accessibility/util/8051626/Bug8051626.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/com/sun/java/accessibility/util/8051626/Bug8051626.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8051626
  * @summary Ensure no failure when using Java Accessibility Utility with security manager
  * @modules java.desktop jdk.accessibility
--- a/jdk/test/com/sun/java/swing/plaf/windows/8016551/bug8016551.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/com/sun/java/swing/plaf/windows/8016551/bug8016551.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,7 +21,9 @@
  * questions.
  */
 
-/* @test
+/*
+ * @test
+ * @key headful
  * @bug 8016551
  * @summary JMenuItem in WindowsLookAndFeel can't paint default icons
  * @author Leonid Romanov
--- a/jdk/test/java/awt/Checkbox/SetStateExcessEvent/SetStateExcessEvent.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Checkbox/SetStateExcessEvent/SetStateExcessEvent.java	Mon Aug 08 08:12:20 2016 -0700
@@ -29,6 +29,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 8074500
  * @summary Checkbox.setState() call should not post ItemEvent
  * @author Sergey Bylokhov
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Choice/ChoiceHiDpi/ChoiceTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * 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 8144594
+ * @summary HiDPI: awt.Choice looks improperly (Win 8)
+ * @run main ChoiceTest
+ */
+import java.awt.Frame;
+import java.awt.Choice;
+import java.awt.Font;
+import java.util.stream.Stream;
+
+public class ChoiceTest {
+
+    private static void UI() {
+        Frame frame = new Frame("Test frame");
+        Choice choice = new Choice();
+
+        Stream.of(new String[]{"item 1", "item 2", "item 3"}).forEach(choice::add);
+        frame.add(choice);
+        frame.setBounds(100, 100, 400, 200);
+
+        frame.setVisible(true);
+        Font font = choice.getFont();
+        int size = font.getSize();
+        int height = choice.getBounds().height;
+        try {
+            if (height < size) {
+                throw new RuntimeException("Test failed");
+            }
+        } finally {
+            frame.dispose();
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        ChoiceTest.UI();
+    }
+}
+
--- a/jdk/test/java/awt/Choice/ChoiceLocationTest/ChoiceLocationTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Choice/ChoiceLocationTest/ChoiceLocationTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -22,13 +22,14 @@
  */
 
 /*
- @test
-  @bug 7159566
-  @summary The choice positioned in the top of applet when clicking the choice.
-  @author Petr Pchelko
-  @library ../../regtesthelpers
-  @build Util
-  @run main ChoiceLocationTest
+ * @test
+ * @key headful
+ * @bug 7159566
+ * @summary The choice positioned in the top of applet when clicking the choice.
+ * @author Petr Pchelko
+ * @library ../../regtesthelpers
+ * @build Util
+ * @run main ChoiceLocationTest
  */
 
 import java.awt.*;
--- a/jdk/test/java/awt/Choice/DragMouseOutAndRelease/DragMouseOutAndRelease.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Choice/DragMouseOutAndRelease/DragMouseOutAndRelease.java	Mon Aug 08 08:12:20 2016 -0700
@@ -22,6 +22,7 @@
  */
 /*
   @test
+  @key headful
   @bug 6322625
   @summary REG:Choice does not trigger MouseReleased when dragging and releasing the mouse outside choice, XAWT
   @author andrei.dmitriev area=awt.choice
--- a/jdk/test/java/awt/Choice/GetSizeTest/GetSizeTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Choice/GetSizeTest/GetSizeTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -22,6 +22,7 @@
  */
 /*
   @test
+  @key headful
   @bug 4255631
   @summary Solaris: Size returned by Choice.getSize() does not match actual size
   @author Andrei Dmitriev : area=Choice
--- a/jdk/test/java/awt/Choice/ResizeAutoClosesChoice/ResizeAutoClosesChoice.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Choice/ResizeAutoClosesChoice/ResizeAutoClosesChoice.java	Mon Aug 08 08:12:20 2016 -0700
@@ -22,6 +22,7 @@
  */
 /*
   @test
+  @key headful
   @bug 6399679
   @summary Choice is not invalidated when the frame gets resized programmatically when the drop-down is visible
   @author andrei.dmitriev area=awt.choice
--- a/jdk/test/java/awt/Choice/UnfocusableCB_ERR/UnfocusableCB_ERR.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Choice/UnfocusableCB_ERR/UnfocusableCB_ERR.java	Mon Aug 08 08:12:20 2016 -0700
@@ -22,6 +22,7 @@
  */
 /*
   @test
+  @key headful
   @bug 6390103
   @summary Non-Focusable choice throws exception when selecting an item, Win32
   @author andrei.dmitriev area=awt.choice
--- a/jdk/test/java/awt/Choice/UnfocusableToplevel/UnfocusableToplevel.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Choice/UnfocusableToplevel/UnfocusableToplevel.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
   @test
+  @key headful
   @bug 6566434 8039467
   @library ../../regtesthelpers
   @build Util Sysout AbstractTest
--- a/jdk/test/java/awt/Component/DimensionEncapsulation/DimensionEncapsulation.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Component/DimensionEncapsulation/DimensionEncapsulation.java	Mon Aug 08 08:12:20 2016 -0700
@@ -90,6 +90,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 6459798
  * @author Sergey Bylokhov
  */
--- a/jdk/test/java/awt/Component/GetScreenLocTest/GetScreenLocTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Component/GetScreenLocTest/GetScreenLocTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -38,6 +38,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 4356202
  * @summary Tests that getLocationOnScreen returns valid value(WindowMaker
  *          only).
--- a/jdk/test/java/awt/Component/InsetsEncapsulation/InsetsEncapsulation.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Component/InsetsEncapsulation/InsetsEncapsulation.java	Mon Aug 08 08:12:20 2016 -0700
@@ -74,6 +74,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 6459800
  * @author Sergey Bylokhov
  */
--- a/jdk/test/java/awt/Component/PaintAll/PaintAll.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Component/PaintAll/PaintAll.java	Mon Aug 08 08:12:20 2016 -0700
@@ -43,6 +43,7 @@
 
 /*
   @test
+  @key headful
   @bug 6596915
   @summary Test Component.paintAll() method
   @author sergey.bylokhov@oracle.com: area=awt.component
--- a/jdk/test/java/awt/Component/Revalidate/Revalidate.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Component/Revalidate/Revalidate.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
   @test
+  @key headful
   @bug 7036669
   @summary Test Component.revalidate() method
   @author anthony.petrov@oracle.com: area=awt.component
--- a/jdk/test/java/awt/Component/SetEnabledPerformance/SetEnabledPerformance.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Component/SetEnabledPerformance/SetEnabledPerformance.java	Mon Aug 08 08:12:20 2016 -0700
@@ -31,6 +31,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 8071306
  * @author Sergey Bylokhov
  */
--- a/jdk/test/java/awt/Container/CheckZOrderChange/CheckZOrderChange.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Container/CheckZOrderChange/CheckZOrderChange.java	Mon Aug 08 08:12:20 2016 -0700
@@ -22,12 +22,14 @@
  */
 
 /*
-   @test %I% %E%
-   @bug 2161766
-   @summary Component is missing after changing the z-order of the component & focus is not transfered in
-   @author  Andrei Dmitriev : area=awt.container
-   @run main CheckZOrderChange
-*/
+ * @test %I% %E%
+ * @key headful
+ * @bug 2161766
+ * @summary Component is missing after changing the z-order of the component & focus is not transfered in
+ * @author  Andrei Dmitriev : area=awt.container
+ * @run main CheckZOrderChange
+ */
+
 import java.awt.*;
 import java.awt.event.*;
 
--- a/jdk/test/java/awt/Container/ValidateRoot/InvalidateMustRespectValidateRoots.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Container/ValidateRoot/InvalidateMustRespectValidateRoots.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
   @test
+  @key headful
   @bug 6852592
   @summary invalidate() must stop when it encounters a validate root
   @author anthony.petrov@sun.com
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Desktop/DesktopGtkLoadTest/DesktopGtkLoadTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * 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 8157827
+ * @summary AWT_Desktop/Automated/Exceptions/BasicTest loads incorrect GTK
+ * version when jdk.gtk.version=3
+ * @requires (os.family == "linux")
+ * @run main DesktopGtkLoadTest
+ */
+
+
+import java.awt.*;
+import java.io.*;
+
+public class DesktopGtkLoadTest {
+    public static class RunDesktop {
+        public static void main(String[] args) {
+            Desktop.getDesktop();
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        Process p = Runtime.getRuntime().exec(System.getProperty("java.home") +
+                "/bin/java -Djdk.gtk.version=3 -Djdk.gtk.verbose=true " +
+                "-cp " + System.getProperty("java.class.path", ".") +
+                " DesktopGtkLoadTest$RunDesktop");
+        p.waitFor();
+        try (BufferedReader br = new BufferedReader(
+                                   new InputStreamReader(p.getErrorStream()))) {
+            String line;
+            while ((line = br.readLine()) != null) {
+                System.out.println(line);
+                if (line.contains("Looking for GTK2 library")) {
+                    break;
+                }
+                if (line.contains("Looking for GTK3 library")) {
+                    return;
+                }
+            }
+            throw new RuntimeException("Wrong GTK library version: \n" + line);
+        }
+
+    }
+
+}
--- a/jdk/test/java/awt/Dialog/ChildProperties/ChildDialogProperties.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Dialog/ChildProperties/ChildDialogProperties.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,12 +21,14 @@
  * questions.
  */
 
- /*
- @test
- @bug 8057574
- @summary Verify that child Dialog does not inherit parent's Properties
- @run main ChildDialogProperties
+/*
+ * @test
+ * @key headful
+ * @bug 8057574
+ * @summary Verify that child Dialog does not inherit parent's Properties
+ * @run main ChildDialogProperties
  */
+
 import java.awt.Color;
 import java.awt.Dialog;
 import java.awt.Font;
--- a/jdk/test/java/awt/Dialog/MakeWindowAlwaysOnTop/MakeWindowAlwaysOnTop.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Dialog/MakeWindowAlwaysOnTop/MakeWindowAlwaysOnTop.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
   @test
+  @key headful
   @bug 6829546
   @summary tests that an always-on-top modal dialog doesn't make any windows always-on-top
   @author artem.ananiev: area=awt.modal
--- a/jdk/test/java/awt/Dialog/ValidateOnShow/ValidateOnShow.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Dialog/ValidateOnShow/ValidateOnShow.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
   @test
+  @key headful
   @bug 7027013
   @summary Dialog.show() should validate the window unconditionally
   @author anthony.petrov@oracle.com: area=awt.toplevel
--- a/jdk/test/java/awt/EventDispatchThread/LoopRobustness/LoopRobustness.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/EventDispatchThread/LoopRobustness/LoopRobustness.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,7 +24,8 @@
 /**
  *
  * @bug 4023283
- * @summary Checks that an Error which propogate up to the EventDispatch
+ * @key headful
+ * @summary Checks that an Error which propogates up to the EventDispatch
  * loop does not crash AWT.
  * @author Andrei Dmitriev: area=awt.event
  * @library ../../regtesthelpers
--- a/jdk/test/java/awt/Focus/6981400/Test1.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Focus/6981400/Test1.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug     6981400
  * @summary Tabbing between textfiled do not work properly when ALT+TAB
  * @author  anton.tarasov
--- a/jdk/test/java/awt/Focus/6981400/Test2.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Focus/6981400/Test2.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug     6981400
  * @summary Tabbing between textfiled do not work properly when ALT+TAB
  * @author  anton.tarasov
--- a/jdk/test/java/awt/Focus/6981400/Test3.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Focus/6981400/Test3.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug     6981400
  * @summary Tabbing between textfiled do not work properly when ALT+TAB
  * @author  anton.tarasov
--- a/jdk/test/java/awt/Focus/8013611/JDK8013611.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Focus/8013611/JDK8013611.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
   @test
+  @key headful
   @bug      8013611
   @summary  Tests showing a modal dialog with requesting focus in frame.
   @author   Anton.Tarasov: area=awt.focus
--- a/jdk/test/java/awt/Focus/8073453/AWTFocusTransitionTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Focus/8073453/AWTFocusTransitionTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,7 +21,9 @@
  * questions.
  */
 
-/* @test
+/*
+ * @test
+ * @key headful
  * @bug 8073453
  * @summary Focus doesn't move when pressing Shift + Tab keys
  * @author Dmitry Markov
--- a/jdk/test/java/awt/Focus/8073453/SwingFocusTransitionTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Focus/8073453/SwingFocusTransitionTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,7 +21,9 @@
  * questions.
  */
 
-/* @test
+/*
+ * @test
+ * @key headful
  * @bug 8073453
  * @summary Focus doesn't move when pressing Shift + Tab keys
  * @author Dmitry Markov
--- a/jdk/test/java/awt/Focus/ActualFocusedWindowTest/ActualFocusedWindowRetaining.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Focus/ActualFocusedWindowTest/ActualFocusedWindowRetaining.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
   @test
+  @key headful
   @bug      4823903
   @summary  Tests actual focused window retaining.
   @author   Anton.Tarasov: area=awt.focus
--- a/jdk/test/java/awt/Focus/AutoRequestFocusTest/AutoRequestFocusSetVisibleTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Focus/AutoRequestFocusTest/AutoRequestFocusSetVisibleTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
   @test
+  @key headful
   @bug       6187066
   @summary   Tests the Window.autoRequestFocus property for the Window.setVisible() method.
   @author    anton.tarasov: area=awt.focus
--- a/jdk/test/java/awt/Focus/AutoRequestFocusTest/AutoRequestFocusToFrontTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Focus/AutoRequestFocusTest/AutoRequestFocusToFrontTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
   @test
+  @key headful
   @bug       6187066
   @summary   Tests the Window.autoRequestFocus property for the Window.toFront() method.
   @author    anton.tarasov: area=awt.focus
--- a/jdk/test/java/awt/Focus/ClearGlobalFocusOwnerTest/ClearGlobalFocusOwnerTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Focus/ClearGlobalFocusOwnerTest/ClearGlobalFocusOwnerTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
   @test
+  @key headful
   @bug 4390555
   @summary Synopsis: clearGlobalFocusOwner() is not trigerring permanent FOCUS_LOST event
   @author son@sparc.spb.su, anton.tarasov: area=awt.focus
--- a/jdk/test/java/awt/Focus/KeyEventForBadFocusOwnerTest/KeyEventForBadFocusOwnerTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Focus/KeyEventForBadFocusOwnerTest/KeyEventForBadFocusOwnerTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -22,6 +22,7 @@
  */
 /*
   @test
+  @key headful
   @bug 4476629
   @library ../../../../javax/swing/regtesthelpers
   @build Util
--- a/jdk/test/java/awt/Focus/MouseClickRequestFocusRaceTest/MouseClickRequestFocusRaceTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Focus/MouseClickRequestFocusRaceTest/MouseClickRequestFocusRaceTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -42,6 +42,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 5028014
  * @summary Focus request & mouse click being performed nearly synchronously
  *          shouldn't break the focus subsystem
--- a/jdk/test/java/awt/Focus/RemoveAfterRequest/RemoveAfterRequest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Focus/RemoveAfterRequest/RemoveAfterRequest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
   @test
+  @key headful
   @bug 6411406
   @summary Components automatically transfer focus on removal, even if developer requests focus elsewhere first
   @author oleg.sukhodolsky, anton.tarasov: area=awt.focus
--- a/jdk/test/java/awt/Focus/RollbackFocusFromAnotherWindowTest/RollbackFocusFromAnotherWindowTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Focus/RollbackFocusFromAnotherWindowTest/RollbackFocusFromAnotherWindowTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
   @test
+  @key headful
   @bug       8139218
   @summary   Dialog that opens and closes quickly changes focus in original
              focusowner
--- a/jdk/test/java/awt/Focus/SimpleWindowActivationTest/SimpleWindowActivationTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Focus/SimpleWindowActivationTest/SimpleWindowActivationTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug       6385277
  * @summary   Tests that override redirect window gets activated on click.
  * @author    anton.tarasov@sun.com: area=awt.focus
--- a/jdk/test/java/awt/Focus/TranserFocusToWindow/TranserFocusToWindow.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Focus/TranserFocusToWindow/TranserFocusToWindow.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
   @test
+  @key headful
   @bug 6562853 7035459
   @summary Tests that focus transfered directy to window w/o transfering it to frame.
   @author Oleg Sukhodolsky: area=awt.focus
--- a/jdk/test/java/awt/Focus/TypeAhead/TestFocusFreeze.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Focus/TypeAhead/TestFocusFreeze.java	Mon Aug 08 08:12:20 2016 -0700
@@ -22,14 +22,15 @@
  */
 
 /*
-   @test
-   @bug        6183877 6216005 6225560
-   @library    ../../regtesthelpers
-   @build      Util
-   @summary    Tests that keyboard input doesn't freeze due to type-ahead problems
-   @author     Denis.Mikhalkin, Anton.Tarasov: area=awt.focus
-   @run        main TestFocusFreeze
-*/
+ * @test
+ * @key headful
+ * @bug        6183877 6216005 6225560
+ * @library    ../../regtesthelpers
+ * @build      Util
+ * @summary    Tests that keyboard input doesn't freeze due to type-ahead problems
+ * @author     Denis.Mikhalkin, Anton.Tarasov: area=awt.focus
+ * @run        main TestFocusFreeze
+ */
 
 import java.awt.Component;
 import java.awt.DefaultKeyboardFocusManager;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Frame/8158918/SetExtendedState.java	Mon Aug 08 08:12:20 2016 -0700
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * 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 8158918
+ * @summary setExtendedState(1) for maximized Frame results in state==7
+ * @run main SetExtendedState
+ */
+import java.awt.Frame;
+
+public class SetExtendedState {
+
+    public static void main(String[] args) {
+        Frame frame = new Frame("frame");
+        frame.setBounds(100, 100, 200, 200);
+        frame.setVisible(true);
+        frame.setExtendedState(Frame.MAXIMIZED_BOTH);
+        frame.setExtendedState(Frame.ICONIFIED);
+        if (frame.getExtendedState() != Frame.ICONIFIED) {
+            frame.dispose();
+            throw new RuntimeException("Test Failed");
+        }
+        frame.dispose();
+    }
+}
+
+
--- a/jdk/test/java/awt/Frame/DecoratedExceptions/DecoratedExceptions.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Frame/DecoratedExceptions/DecoratedExceptions.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @summary An attempt to set non-trivial background, shape, or translucency
  *          to a decorated toplevel should end with an exception.
  * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
--- a/jdk/test/java/awt/Frame/DisposeParentGC/DisposeParentGC.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Frame/DisposeParentGC/DisposeParentGC.java	Mon Aug 08 08:12:20 2016 -0700
@@ -30,6 +30,7 @@
 
 /*
  * @test
+ * @key headful
  * @summary Display a dialog with a parent, the dialog contains all awt components
  *          added to it & each components are setted with different cursors types.
  *          Dispose the parent & collect GC. Garbage collection should happen
--- a/jdk/test/java/awt/Frame/FramesGC/FramesGC.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Frame/FramesGC/FramesGC.java	Mon Aug 08 08:12:20 2016 -0700
@@ -30,6 +30,7 @@
 
 /*
  * @test
+ * @key headful
  * @summary Verify that disposed frames are collected with GC
  * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
  * @library ../../../../lib/testlibrary
--- a/jdk/test/java/awt/Frame/MiscUndecorated/ActiveAWTWindowTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Frame/MiscUndecorated/ActiveAWTWindowTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -22,14 +22,15 @@
  */
 
 /*
-* @test
-* @summary To check proper WINDOW_EVENTS are triggered when Frame gains or losses the focus
-* @author Jitender(jitender.singh@eng.sun.com) area=AWT
-* @author yan
-* @library ../../../../lib/testlibrary
-* @build ExtendedRobot
-* @run main ActiveAWTWindowTest
-*/
+ * @test
+ * @key headful
+ * @summary To check proper WINDOW_EVENTS are triggered when Frame gains or losses the focus
+ * @author Jitender(jitender.singh@eng.sun.com) area=AWT
+ * @author yan
+ * @library ../../../../lib/testlibrary
+ * @build ExtendedRobot
+ * @run main ActiveAWTWindowTest
+ */
 
 import java.awt.*;
 import java.awt.event.*;
--- a/jdk/test/java/awt/Frame/MiscUndecorated/ActiveSwingWindowTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Frame/MiscUndecorated/ActiveSwingWindowTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -22,14 +22,15 @@
  */
 
 /*
-* @test
-* @summary To check proper WINDOW_EVENTS are triggered when JFrame gains or losses the focus
-* @author Jitender(jitender.singh@eng.sun.com) area=AWT
-* @author yan
-* @library ../../../../lib/testlibrary
-* @build ExtendedRobot
-* @run main ActiveSwingWindowTest
-*/
+ * @test
+ * @key headful
+ * @summary To check proper WINDOW_EVENTS are triggered when JFrame gains or losses the focus
+ * @author Jitender(jitender.singh@eng.sun.com) area=AWT
+ * @author yan
+ * @library ../../../../lib/testlibrary
+ * @build ExtendedRobot
+ * @run main ActiveSwingWindowTest
+ */
 
 import java.awt.*;
 import java.awt.event.*;
--- a/jdk/test/java/awt/Frame/MiscUndecorated/FrameCloseTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Frame/MiscUndecorated/FrameCloseTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -22,14 +22,15 @@
  */
 
 /*
-* @test
-* @summary To make sure Undecorated Frame triggers correct windows events while closing
-* @author Jitender(jitender.singh@eng.sun.com) area=AWT*
-* @author yan
-* @library ../../../../lib/testlibrary
-* @build ExtendedRobot
-* @run main FrameCloseTest
-*/
+ * @test
+ * @key headful
+ * @summary To make sure Undecorated Frame triggers correct windows events while closing
+ * @author Jitender(jitender.singh@eng.sun.com) area=AWT*
+ * @author yan
+ * @library ../../../../lib/testlibrary
+ * @build ExtendedRobot
+ * @run main FrameCloseTest
+ */
 
 import java.awt.*;
 import java.awt.event.*;
--- a/jdk/test/java/awt/Frame/MiscUndecorated/RepaintTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Frame/MiscUndecorated/RepaintTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -20,16 +20,18 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 /*
-* @test
-* @summary Make sure that on changing state of Undecorated Frame,
-*          all the components on it are repainted correctly
-* @author Jitender(jitender.singh@eng.sun.com) area=AWT
-* @author yan
-* @library ../../../../lib/testlibrary
-* @build ExtendedRobot
-* @run main RepaintTest
-*/
+ * @test
+ * @key headful
+ * @summary Make sure that on changing state of Undecorated Frame,
+ *          all the components on it are repainted correctly
+ * @author Jitender(jitender.singh@eng.sun.com) area=AWT
+ * @author yan
+ * @library ../../../../lib/testlibrary
+ * @build ExtendedRobot
+ * @run main RepaintTest
+ */
 
 import java.awt.*;
 import java.awt.event.*;
--- a/jdk/test/java/awt/Frame/ShapeNotSetSometimes/ShapeNotSetSometimes.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Frame/ShapeNotSetSometimes/ShapeNotSetSometimes.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
   @test
+  @key headful
   @bug 6988428
   @summary Tests whether shape is always set
   @author anthony.petrov@oracle.com: area=awt.toplevel
--- a/jdk/test/java/awt/FullScreen/TranslucentWindow/TranslucentWindow.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/FullScreen/TranslucentWindow/TranslucentWindow.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 6837004
  * @summary Checks that non-opaque window can be made a fullscreen window
  * @author Artem Ananiev
--- a/jdk/test/java/awt/Graphics2D/WhiteTextColorTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Graphics2D/WhiteTextColorTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -27,11 +27,13 @@
 
 /**
  * @test
+ * @key headful
  * @bug 8056009
  * @summary tests whether Graphics.setColor-calls with Color.white are ignored directly
  *          after pipeline initialization for a certain set of operations.
  * @author ceisserer
  */
+
 public class WhiteTextColorTest extends Frame {
     public static volatile boolean success = false;
 
--- a/jdk/test/java/awt/GridLayout/ChangeGridSize/ChangeGridSize.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/GridLayout/ChangeGridSize/ChangeGridSize.java	Mon Aug 08 08:12:20 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
 
 /*
  * @test
+ * @key headful
  * @summary Have different components having different preferred sizes
  *          added to a grid layout. Change the rows and columns of the
  *          grid layout and check the components are re-laid out.
@@ -33,14 +34,13 @@
  *          depending on the preferred sizes and gaps and click the cornors
  *          of the components to check if events are triggered
  * @library ../../../../lib/testlibrary/
- * @build ExtendedRobot
  * @run main ChangeGridSize
  * @run main ChangeGridSize -hg 20 -vg 20
  */
 
 public class ChangeGridSize {
 
-    private int width = 200;
+    private int width = 300;
     private int height = 200;
     private final int hGap, vGap;
     private final int rows = 3;
@@ -50,7 +50,7 @@
     private Button[] buttons;
     private Frame frame;
 
-    private ExtendedRobot robot;
+    private Robot robot;
     private GridLayout layout;
 
     private volatile boolean actionPerformed = false;
@@ -58,7 +58,7 @@
     public ChangeGridSize(int hGap, int vGap) throws Exception  {
         this.hGap = hGap;
         this.vGap = vGap;
-        robot = new ExtendedRobot();
+        robot = new Robot();
         EventQueue.invokeAndWait( () -> {
             frame = new Frame("Test frame");
             frame.setSize(width, height);
@@ -122,10 +122,12 @@
         robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
         robot.delay(500);
         robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
-        robot.waitForIdle(3000);
+        robot.delay(3000);
 
-        if(!actionPerformed)
+        if (!actionPerformed) {
+            frame.dispose();
             throw new RuntimeException("Clicking on the left top of button did not trigger action event");
+        }
 
         actionPerformed = false;
         robot.mouseMove(bottomRightX, bottomRightY);
@@ -133,10 +135,12 @@
         robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
         robot.delay(500);
         robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
-        robot.waitForIdle(3000);
+        robot.delay(3000);
 
-        if(!actionPerformed)
+        if (!actionPerformed) {
+            frame.dispose();
             throw new RuntimeException("Clicking on the bottom right of button did not trigger action event");
+        }
     }
 
     private void doTest() throws Exception {
@@ -154,6 +158,7 @@
         for (int i = 0; i < buttons.length; i++) {
             if (buttons[i].getSize().width != componentWidth ||
                     buttons[i].getSize().height != componentHeight) {
+                frame.dispose();
                 throw new RuntimeException(
                         "FAIL: Button " + i + " not of proper size" +
                         "Expected: " + componentWidth + "*" + componentHeight +
--- a/jdk/test/java/awt/GridLayout/ComponentPreferredSize/ComponentPreferredSize.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/GridLayout/ComponentPreferredSize/ComponentPreferredSize.java	Mon Aug 08 08:12:20 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
 
 /*
  * @test
+ * @key headful
  * @summary Have different components having different preferred sizes
  *          added to a grid layout having various values of row/columns.
  *          Check if the compnents are correctly laid out.
@@ -33,14 +34,13 @@
  *          depending on the preferred sizes and gaps and click the cornors
  *          of the components to check if events are triggered
  * @library ../../../../lib/testlibrary/
- * @build ExtendedRobot
  * @run main ComponentPreferredSize
  * @run main ComponentPreferredSize -hg 20 -vg 20
  */
 
 public class ComponentPreferredSize {
 
-    private int width = 200;
+    private int width = 300;
     private int height = 200;
     private final int hGap, vGap;
     private final int rows = 3;
@@ -50,7 +50,7 @@
     private Button[] buttons;
     private Frame frame;
 
-    private ExtendedRobot robot;
+    private Robot robot;
     private GridLayout layout;
 
     private volatile boolean actionPerformed = false;
@@ -58,7 +58,7 @@
     public ComponentPreferredSize(int hGap, int vGap) throws Exception {
         this.hGap = hGap;
         this.vGap = vGap;
-        robot = new ExtendedRobot();
+        robot = new Robot();
         EventQueue.invokeAndWait( () -> {
             frame = new Frame("Test frame");
             frame.setSize(width, height);
@@ -115,10 +115,12 @@
         robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
         robot.delay(500);
         robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
-        robot.waitForIdle(3000);
+        robot.delay(3000);
 
-        if(!actionPerformed)
+        if (!actionPerformed) {
+            frame.dispose();
             throw new RuntimeException("Clicking on the left top of button did not trigger action event");
+        }
 
         actionPerformed = false;
         robot.mouseMove(bottomRightX, bottomRightY);
@@ -126,10 +128,12 @@
         robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
         robot.delay(500);
         robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
-        robot.waitForIdle(3000);
+        robot.delay(3000);
 
-        if(!actionPerformed)
+        if (!actionPerformed) {
+            frame.dispose();
             throw new RuntimeException("Clicking on the bottom right of button did not trigger action event");
+        }
     }
 
     private void doTest() throws Exception {
@@ -146,6 +150,7 @@
         for (int i = 0; i < buttons.length; i++) {
             if (buttons[i].getSize().width != componentWidth ||
                     buttons[i].getSize().height != componentHeight) {
+                frame.dispose();
                 throw new RuntimeException(
                         "FAIL: Button " + i + " not of proper size" +
                         "Expected: " + componentWidth + "*" + componentHeight +
--- a/jdk/test/java/awt/LightweightComponent/LightweightEventTest/LightweightEventTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/LightweightComponent/LightweightEventTest/LightweightEventTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /**
  * @test
+ * @key headful
  * @summary Test of mouse move messages to lightweight components
  * @library ../../regtesthelpers
  * @build Util
--- a/jdk/test/java/awt/LightweightDispatcher/LWDispatcherMemoryLeakTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/LightweightDispatcher/LWDispatcherMemoryLeakTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -38,6 +38,7 @@
 
 /*
  @test
+ @key headful
  @bug 7079254
  @summary Toolkit eventListener leaks memory
  @library ../regtesthelpers
--- a/jdk/test/java/awt/List/EmptyListEventTest/EmptyListEventTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/List/EmptyListEventTest/EmptyListEventTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 6366126
  * @summary List throws ArrayIndexOutOfBoundsException when pressing ENTER after removing all the items, Win32
  * @author Dmitry Cherepanov area=awt.list
--- a/jdk/test/java/awt/List/NofocusListDblClickTest/NofocusListDblClickTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/List/NofocusListDblClickTest/NofocusListDblClickTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -22,6 +22,7 @@
  */
 /*
   @test
+  @key headful
   @bug       6240202
   @summary   Tests that non-focusable List in a Window generates ActionEvent.
   @author    anton.tarasov@sun.com: area=awt-list
--- a/jdk/test/java/awt/MenuBar/MenuBarSetFont/MenuBarSetFont.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/MenuBar/MenuBarSetFont/MenuBarSetFont.java	Mon Aug 08 08:12:20 2016 -0700
@@ -37,6 +37,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 6263470
  * @summary Tries to change font of MenuBar. Test passes if the font has changed
  * fails otherwise.
--- a/jdk/test/java/awt/Modal/FileDialog/FileDialogAppModal1Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/FileDialog/FileDialogAppModal1Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054359 7186009
  *
  * @summary Check whether FileDialog blocks an application modal Dialog
--- a/jdk/test/java/awt/Modal/FileDialog/FileDialogAppModal2Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/FileDialog/FileDialogAppModal2Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054359 7186009
  *
  * @summary Check whether FileDialog blocks an application modal Dialog
--- a/jdk/test/java/awt/Modal/FileDialog/FileDialogAppModal3Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/FileDialog/FileDialogAppModal3Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054359 7186009
  *
  * @summary Check whether FileDialog blocks an application modal Dialog
--- a/jdk/test/java/awt/Modal/FileDialog/FileDialogAppModal4Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/FileDialog/FileDialogAppModal4Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054359 7186009
  *
  * @summary Check whether FileDialog blocks an application modal Dialog
--- a/jdk/test/java/awt/Modal/FileDialog/FileDialogAppModal5Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/FileDialog/FileDialogAppModal5Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054359 7186009
  *
  * @summary Check whether FileDialog blocks an application modal Dialog
--- a/jdk/test/java/awt/Modal/FileDialog/FileDialogAppModal6Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/FileDialog/FileDialogAppModal6Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054359 7186009
  *
  * @summary Check whether FileDialog blocks an application modal Dialog
--- a/jdk/test/java/awt/Modal/FileDialog/FileDialogDocModal1Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/FileDialog/FileDialogDocModal1Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054359 7186009
  *
  * @summary Check whether FileDialog blocks a document modal Dialog
--- a/jdk/test/java/awt/Modal/FileDialog/FileDialogDocModal2Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/FileDialog/FileDialogDocModal2Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054359 7186009
  *
  * @summary Check whether FileDialog blocks a document modal Dialog
--- a/jdk/test/java/awt/Modal/FileDialog/FileDialogDocModal3Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/FileDialog/FileDialogDocModal3Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054359 7186009
  *
  * @summary Check whether FileDialog blocks a document modal Dialog
--- a/jdk/test/java/awt/Modal/FileDialog/FileDialogDocModal4Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/FileDialog/FileDialogDocModal4Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054359 7186009
  *
  * @summary Check whether FileDialog blocks a document modal Dialog
--- a/jdk/test/java/awt/Modal/FileDialog/FileDialogDocModal5Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/FileDialog/FileDialogDocModal5Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054359 7186009
  *
  * @summary Check whether FileDialog blocks a document modal Dialog
--- a/jdk/test/java/awt/Modal/FileDialog/FileDialogDocModal6Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/FileDialog/FileDialogDocModal6Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054359 7186009
  *
  * @summary Check whether FileDialog blocks a document modal Dialog
--- a/jdk/test/java/awt/Modal/FileDialog/FileDialogDocModal7Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/FileDialog/FileDialogDocModal7Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054359 7186009
  * @summary Check whether a FileDialog set to document modality behaves as expected.
  *
--- a/jdk/test/java/awt/Modal/FileDialog/FileDialogModal1Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/FileDialog/FileDialogModal1Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054359 7186009
  *
  * @summary Check whether FileDialog blocks a modal Dialog
--- a/jdk/test/java/awt/Modal/FileDialog/FileDialogModal2Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/FileDialog/FileDialogModal2Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054359 7186009
  *
  * @summary Check whether FileDialog blocks a modal Dialog
--- a/jdk/test/java/awt/Modal/FileDialog/FileDialogModal3Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/FileDialog/FileDialogModal3Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054359 7186009
  *
  * @summary Check whether FileDialog blocks a modal Dialog
--- a/jdk/test/java/awt/Modal/FileDialog/FileDialogModal4Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/FileDialog/FileDialogModal4Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054359 7186009
  *
  * @summary Check whether FileDialog blocks a modal Dialog
--- a/jdk/test/java/awt/Modal/FileDialog/FileDialogModal5Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/FileDialog/FileDialogModal5Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054359 7186009
  *
  * @summary Check whether FileDialog blocks a modal Dialog
--- a/jdk/test/java/awt/Modal/FileDialog/FileDialogModal6Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/FileDialog/FileDialogModal6Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054359 7186009
  *
  * @summary Check whether FileDialog blocks a modal Dialog
--- a/jdk/test/java/awt/Modal/FileDialog/FileDialogNonModal1Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/FileDialog/FileDialogNonModal1Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054359 7186009
  *
  * @summary Check whether FileDialog blocks a non-modal Dialog
--- a/jdk/test/java/awt/Modal/FileDialog/FileDialogNonModal2Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/FileDialog/FileDialogNonModal2Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054359
  *
  * @summary Check whether FileDialog blocks a non-modal Dialog
--- a/jdk/test/java/awt/Modal/FileDialog/FileDialogNonModal3Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/FileDialog/FileDialogNonModal3Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054359
  *
  * @summary Check whether FileDialog blocks a non-modal Dialog
--- a/jdk/test/java/awt/Modal/FileDialog/FileDialogNonModal4Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/FileDialog/FileDialogNonModal4Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054359
  *
  * @summary Check whether FileDialog blocks a non-modal Dialog
--- a/jdk/test/java/awt/Modal/FileDialog/FileDialogNonModal5Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/FileDialog/FileDialogNonModal5Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054359
  *
  * @summary Check whether FileDialog blocks a non-modal Dialog
--- a/jdk/test/java/awt/Modal/FileDialog/FileDialogNonModal6Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/FileDialog/FileDialogNonModal6Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054359
  *
  * @summary Check whether FileDialog blocks a non-modal Dialog
--- a/jdk/test/java/awt/Modal/FileDialog/FileDialogNonModal7Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/FileDialog/FileDialogNonModal7Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054359
  * @summary Check whether a modeless FileDialog behaves as expected.
  *
--- a/jdk/test/java/awt/Modal/FileDialog/FileDialogTKModal1Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/FileDialog/FileDialogTKModal1Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054359 8055752
  *
  * @summary Check whether FileDialog blocks a toolkit modal Dialog
--- a/jdk/test/java/awt/Modal/FileDialog/FileDialogTKModal2Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/FileDialog/FileDialogTKModal2Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054359 8055752
  *
  * @summary Check whether FileDialog blocks a toolkit modal Dialog
--- a/jdk/test/java/awt/Modal/FileDialog/FileDialogTKModal3Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/FileDialog/FileDialogTKModal3Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054359 8055752
  *
  * @summary Check whether FileDialog blocks a toolkit modal Dialog
--- a/jdk/test/java/awt/Modal/FileDialog/FileDialogTKModal4Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/FileDialog/FileDialogTKModal4Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054359 8055752
  *
  * @summary Check whether FileDialog blocks a toolkit modal Dialog
--- a/jdk/test/java/awt/Modal/FileDialog/FileDialogTKModal5Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/FileDialog/FileDialogTKModal5Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054359 8055752
  *
  * @summary Check whether FileDialog blocks a toolkit modal Dialog
--- a/jdk/test/java/awt/Modal/FileDialog/FileDialogTKModal6Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/FileDialog/FileDialogTKModal6Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054359 8055752
  *
  * @summary Check whether FileDialog blocks a toolkit modal Dialog
--- a/jdk/test/java/awt/Modal/FileDialog/FileDialogTKModal7Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/FileDialog/FileDialogTKModal7Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054359 7186009
  * @summary Check whether a FileDialog set to toolkit modality behaves as expected.
  *
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDDAppModalTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDDAppModalTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether an application modal Dialog created with a Dialog
  *          constructor receives focus, whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDDDocModalTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDDDocModalTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether a document modal Dialog created with a Dialog
  *          constructor receives focus, whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDDModelessTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDDModelessTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether a modeless Dialog created with a Dialog
  *          constructor receives focus, whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDDNonModalTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDDNonModalTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether a non-modal Dialog created with a Dialog
  *          constructor receives focus, whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDDSetModalTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDDSetModalTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether a modal Dialog created with a Dialog
  *          constructor receives focus, whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDDToolkitModalTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDDToolkitModalTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether a toolkit modal Dialog created with a Dialog
  *          constructor receives focus, whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFAppModalTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFAppModalTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether an application modal Dialog created with a Frame
  *          constructor receives focus, whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFSetModalTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFSetModalTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether a modal Dialog created with a Frame
  *          constructor receives focus, whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFToolkitModalTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFToolkitModalTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether a toolkit modal Dialog created with a Frame
  *          constructor receives focus, whether its components receives focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFWModeless1Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFWModeless1Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether a modeless Dialog created with a Frame
  *          constructor receives focus, whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFWModeless2Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFWModeless2Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether a modeless Dialog created with a Dialog
  *          constructor receives focus, whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFWNonModal1Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFWNonModal1Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether a non-modal Dialog created with a Frame
  *          constructor receives focus, whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFWNonModal2Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDFWNonModal2Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether a non-modal Dialog created with a Dialog
  *          constructor receives focus, whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDocModalTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingDocModalTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -28,6 +28,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Test if a document modality works as expected:
  *          whether all the windows lying down the document root
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDAppModalTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDAppModalTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether an application modal Dialog created with a Frame
  *          constructor receives focus, whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDDocModalTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDDocModalTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether a document modal Dialog created with a Frame
  *          constructor receives focus, whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDModelessTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDModelessTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether a modeless Dialog created with a Frame
  *          constructor receives focus, whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDNonModalTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDNonModalTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether a non-modal Dialog created with a Frame
  *          constructor receives focus, whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDSetModalTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDSetModalTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether a modal Dialog created with a Frame
  *          constructor receives focus, whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDToolkitModalTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDToolkitModalTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether a toolkit modal Dialog created with a Frame
  *          constructor receives focus, whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWDocModal1Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWDocModal1Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether a document modal Dialog created with a null Frame
  *          constructor receives focus; whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWDocModal2Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWDocModal2Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether a document modal Dialog created with a null Dialog
  *          constructor receives focus; whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWDocModal3Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWDocModal3Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether a document modal Dialog created with a hidden Frame
  *          constructor receives focus; whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWDocModal4Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWDocModal4Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether a document modal Dialog created with a hidden Dialog
  *          constructor receives focus; whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWModeless1Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWModeless1Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether a modeless Dialog created with a null Frame
  *          constructor receives focus; whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWModeless2Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWModeless2Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether a modeless Dialog created with a null Dialog
  *          constructor receives focus; whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWModeless3Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWModeless3Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether a modeless Dialog created with a hidden Frame
  *          constructor receives focus; whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWModeless4Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWModeless4Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether a modeless Dialog created with a hidden Dialog
  *          constructor receives focus; whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWNonModal1Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWNonModal1Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether a non-modal Dialog created with a null Frame
  *          constructor receives focus; whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWNonModal2Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWNonModal2Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether a non-modal Dialog created with a null Dialog
  *          constructor receives focus; whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWNonModal3Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWNonModal3Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether a non-modal Dialog created with a hidden Frame
  *          constructor receives focus; whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWNonModal4Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingFDWNonModal4Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether a non-modal Dialog created with a hidden Dialog
  *          constructor receives focus; whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsAppModal1Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsAppModal1Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether an application modal Dialog created with a null Frame
  *          constructor receives focus; whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsAppModal2Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsAppModal2Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether an application modal Dialog created with a null Dialog
  *          constructor receives focus; whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsAppModal3Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsAppModal3Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether an application modal Dialog created with a hidden Frame
  *          constructor receives focus; whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsAppModal4Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsAppModal4Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether an application modal Dialog created with a hidden Dialog
  *          constructor receives focus; whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsAppModal5Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsAppModal5Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether an application modal Dialog created with a Frame
  *          constructor receives focus; whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsAppModal6Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsAppModal6Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether an application modal Dialog created with a Dialog
  *          constructor receives focus; whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsDocModal1Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsDocModal1Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether a document modal Dialog created with a Frame
  *          constructor receives focus; whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsDocModal2Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsDocModal2Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether a document modal Dialog created with a Dialog
  *          constructor receives focus; whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsSetModal1Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsSetModal1Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether a modal Dialog created with a null Frame
  *          constructor receives focus; whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsSetModal2Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsSetModal2Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether a modal Dialog created with a null Dialog
  *          constructor receives focus; whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsSetModal3Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsSetModal3Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether a modal Dialog created with a hidden Frame
  *          constructor receives focus; whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsSetModal4Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsSetModal4Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether a modal Dialog created with a hidden Dialog
  *          constructor receives focus; whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsSetModal5Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsSetModal5Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether a modal Dialog created with a Frame
  *          constructor receives focus; whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsSetModal6Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsSetModal6Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether a modal Dialog created with a Dialog
  *          constructor receives focus; whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsToolkitModal1Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsToolkitModal1Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether a toolkit modal Dialog created with a null Frame
  *          constructor receives focus; whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsToolkitModal2Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsToolkitModal2Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether a toolkit modal Dialog created with a null Dialog
  *          constructor receives focus; whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsToolkitModal3Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsToolkitModal3Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether a toolkit modal Dialog created with a hidden Frame
  *          constructor receives focus; whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsToolkitModal4Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsToolkitModal4Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether a toolkit modal Dialog created with a hidden Dialog
  *          constructor receives focus; whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsToolkitModal5Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsToolkitModal5Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether a toolkit modal Dialog created with a Frame
  *          constructor receives focus; whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsToolkitModal6Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/BlockingWindowsToolkitModal6Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether a toolkit modal Dialog created with a Dialog
  *          constructor receives focus; whether its components receive focus
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/UnblockedDialogAppModalTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/UnblockedDialogAppModalTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether an application modal Dialog receives focus; check
  *          if its components receive focus and respond to key events
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/UnblockedDialogDocModalTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/UnblockedDialogDocModalTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether a document modal Dialog receives focus; check
  *          if its components receive focus and respond to key events
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/UnblockedDialogModelessTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/UnblockedDialogModelessTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether a modeless Dialog receives focus; check
  *          if its components receive focus and respond to key events
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/UnblockedDialogNonModalTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/UnblockedDialogNonModalTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether a non-modal Dialog receives focus; check
  *          if its components receive focus and respond to key events
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/UnblockedDialogSetModalTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/UnblockedDialogSetModalTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether a modal Dialog receives focus; check
  *          if its components receive focus and respond to key events
--- a/jdk/test/java/awt/Modal/ModalBlockingTests/UnblockedDialogToolkitModalTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalBlockingTests/UnblockedDialogToolkitModalTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8049617
  * @summary Check whether a toolkit modal Dialog receives focus; check
  *          if its components receive focus and respond to key events
--- a/jdk/test/java/awt/Modal/ModalExclusionTests/ApplicationExcludeDialogFileTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalExclusionTests/ApplicationExcludeDialogFileTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8047179 8044429
  * @summary Check whether a FileDialog blocks an application modality excluded Dialog
  *          (it shouldn't). Checks also whether setting a parent dialog to be
--- a/jdk/test/java/awt/Modal/ModalExclusionTests/ApplicationExcludeDialogPageSetupTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalExclusionTests/ApplicationExcludeDialogPageSetupTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 7125054 8044429
  * @summary Check whether a pageDialog blocks an application modality excluded Dialog
  *          (it shouldn't). Checks also whether setting a parent dialog to be
--- a/jdk/test/java/awt/Modal/ModalExclusionTests/ApplicationExcludeDialogPrintSetupTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalExclusionTests/ApplicationExcludeDialogPrintSetupTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 7125054 8044429
  * @summary Check whether a printDialog blocks an application modality excluded Dialog
  *          (it shouldn't). Checks also whether setting a parent dialog to be
--- a/jdk/test/java/awt/Modal/ModalExclusionTests/ApplicationExcludeFrameFileTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalExclusionTests/ApplicationExcludeFrameFileTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8047179 8044429
  * @summary Check whether a FileDialog blocks an application modality excluded Frame
  *          (it shouldn't). Checks also whether setting a parent frame to be
--- a/jdk/test/java/awt/Modal/ModalExclusionTests/ApplicationExcludeFramePageSetupTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalExclusionTests/ApplicationExcludeFramePageSetupTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 7125054 8044429
  * @summary Check whether a pageDialog blocks an application modality excluded Frame
  *          (it shouldn't). Checks also whether setting a parent frame to be
--- a/jdk/test/java/awt/Modal/ModalExclusionTests/ApplicationExcludeFramePrintSetupTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalExclusionTests/ApplicationExcludeFramePrintSetupTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 7125054 8044429
  * @summary Check whether a printDialog blocks an application modality excluded Frame
  *          (it shouldn't). Checks also whether setting a parent frame to be
--- a/jdk/test/java/awt/Modal/ModalExclusionTests/ToolkitExcludeDialogFileTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalExclusionTests/ToolkitExcludeDialogFileTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8047179 8044429
  * @summary Check whether a FileDialog blocks a toolkit modality excluded Dialog
  *          (it shouldn't). Checks also whether setting a parent dialog to be
--- a/jdk/test/java/awt/Modal/ModalExclusionTests/ToolkitExcludeDialogPageSetupTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalExclusionTests/ToolkitExcludeDialogPageSetupTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 7125054 8044429
  * @summary Check whether a pageDialog blocks a toolkit modality excluded Dialog
  *          (it shouldn't). Checks also whether setting a parent dialog to be
--- a/jdk/test/java/awt/Modal/ModalExclusionTests/ToolkitExcludeDialogPrintSetupTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalExclusionTests/ToolkitExcludeDialogPrintSetupTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 7125054 8044429
  * @summary Check whether a printDialog blocks a toolkit modality excluded Dialog
  *          (it shouldn't). Checks also whether setting a parent dialog to be
--- a/jdk/test/java/awt/Modal/ModalExclusionTests/ToolkitExcludeFrameFileTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalExclusionTests/ToolkitExcludeFrameFileTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8047179 8044429
  * @summary Check whether a FileDialog blocks a toolkit modality excluded Frame
  *          (it shouldn't). Checks also whether setting a parent frame to be
--- a/jdk/test/java/awt/Modal/ModalExclusionTests/ToolkitExcludeFramePageSetupTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalExclusionTests/ToolkitExcludeFramePageSetupTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 7125054 8044429
  * @summary Check whether a pageDialog blocks a toolkit modality excluded Frame
  *          (it shouldn't). Checks also whether setting a parent frame to be
--- a/jdk/test/java/awt/Modal/ModalExclusionTests/ToolkitExcludeFramePrintSetupTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalExclusionTests/ToolkitExcludeFramePrintSetupTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 7125054 8044429
  * @summary Check whether a printDialog blocks a toolkit modality excluded Frame
  *          (it shouldn't). Checks also whether setting a parent frame to be
--- a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFAppModalTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFAppModalTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8047367
  * @summary Check whether the focus transfer between windows occurs correctly when the following
  *          happens: an application modal dialog (D) having null frame owner is shown;
--- a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFDocModalTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFDocModalTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8047367 8049339
  * @summary Check whether the focus transfer between windows occurs correctly when the
  *          following happens: a document modal dialog (D) having null frame owner is shown;
--- a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFModelessTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFModelessTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8047367 8049339
  * @summary Check whether the focus transfer between windows occurs correctly when the
  *          following happens: a modeless dialog (D) having null frame owner is shown;
--- a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFNonModalTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFNonModalTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8047367 8049339
  * @summary Check whether the focus transfer between windows occurs correctly when the following
  *          happens: a non-modal dialog (D) having null frame owner is shown; a window having D
--- a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsAppModalTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsAppModalTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8047367
  * @summary Check whether the focus transfer between windows occurs correctly when
  *          the following happens: an application modal dialog (D1) having a null
--- a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsDocModalTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsDocModalTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8047367
  * @summary Check whether the focus transfer between windows occurs correctly when
  *          the following happens: a document modal dialog (D1) having a null
--- a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsModelessTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsModelessTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8047367
  * @summary Check whether the focus transfer between windows occurs correctly when
  *          the following happens: a modeless dialog (D1) having a null
--- a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsNonModalTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsNonModalTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8047367
  * @summary Check whether the focus transfer between windows occurs correctly when
  *          the following happens: a non-modal dialog (D1) having a null
--- a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWAppModalTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWAppModalTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8047367
  * @summary Check whether the focus transfer between windows occurs correctly when
  *          the following happens: a frame is shown; an application modal dialog (D)
--- a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWDocModalTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWDocModalTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8047367
  * @summary Check whether the focus transfer between windows occurs correctly when
  *          the following happens: a frame is shown; a document modal dialog (D)
--- a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWModelessTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWModelessTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8047367
  * @summary Check whether the focus transfer between windows occurs correctly when
  *          the following happens: a frame is shown; a modeless dialog (D)
--- a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWNonModalTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWNonModalTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8047367
  * @summary Check whether the focus transfer between windows occurs correctly when
  *          the following happens: a frame is shown; a non-modal dialog (D)
--- a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDAppModal1Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDAppModal1Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8047367 8049339
  * @summary Check whether the focus transfer between windows occurs correctly when the following happens:
  *          a frame (F) is shown; a window having F as owner is shown; an application modal dialog having
--- a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDAppModal2Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDAppModal2Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8047367 8049339
  * @summary Check whether the focus transfer between windows occurs correctly when the following happens:
  *          a frame (F) is shown; a window having F as owner is shown; an application modal dialog having
--- a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDAppModal3Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDAppModal3Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8047367 8049339
  * @summary Check whether the focus transfer between windows occurs correctly when the following happens:
  *          a frame (F) is shown; a window having F as owner is shown; an application modal dialog having
--- a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDAppModal4Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDAppModal4Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8047367 8049339
  * @summary Check whether the focus transfer between windows occurs correctly when the following happens:
  *          a frame (F) is shown; a window having F as owner is shown; an application modal dialog having
--- a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDDocModal1Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDDocModal1Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8047367 8049339
  * @summary Check whether the focus transfer between windows occurs correctly when the following happens:
  *          a frame (F) is shown; a window having F as owner is shown; a document modal dialog having
--- a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDDocModal2Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDDocModal2Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8047367 8049339
  * @summary Check whether the focus transfer between windows occurs correctly when the following happens:
  *          a frame (F) is shown; a window having F as owner is shown; a document modal dialog having
--- a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDDocModal3Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDDocModal3Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8047367 8049339
  * @summary Check whether the focus transfer between windows occurs correctly when the following happens:
  *          a frame (F) is shown; a window having F as owner is shown; a document modal dialog having
--- a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDDocModal4Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDDocModal4Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8047367 8049339
  * @summary Check whether the focus transfer between windows occurs correctly when the following happens:
  *          a frame (F) is shown; a window having F as owner is shown; a document modal dialog having
--- a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDModeless1Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDModeless1Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8047367 8049339
  * @summary Check whether the focus transfer between windows occurs correctly when the following happens:
  *          a frame (F) is shown; a window having F as owner is shown; a modeless dialog having
--- a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDModeless2Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDModeless2Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8047367 8049339
  * @summary Check whether the focus transfer between windows occurs correctly when the following happens:
  *          a frame (F) is shown; a window having F as owner is shown; a modeless dialog having
--- a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDModeless3Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDModeless3Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8047367 8049339
  * @summary Check whether the focus transfer between windows occurs correctly when the following happens:
  *          a frame (F) is shown; a window having F as owner is shown; a modeless dialog having
--- a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDModeless4Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDModeless4Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8047367 8049339
  * @summary Check whether the focus transfer between windows occurs correctly when the following happens:
  *          a frame (F) is shown; a window having F as owner is shown; a modeless dialog having
--- a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal1Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal1Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8047367 8049339
  * @summary Check whether the focus transfer between windows occurs correctly when the following happens:
  *          a frame (F) is shown; a window having F as owner is shown; a non-modal dialog having
--- a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal2Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal2Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8047367 8049339
  * @summary Check whether the focus transfer between windows occurs correctly when the following happens:
  *          a frame (F) is shown; a window having F as owner is shown; a non-modal dialog having
--- a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal3Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal3Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8047367 8049339
  * @summary Check whether the focus transfer between windows occurs correctly when the following happens:
  *          a frame (F) is shown; a window having F as owner is shown; a non-modal dialog having
--- a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal4Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal4Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8047367 8049339
  * @summary Check whether the focus transfer between windows occurs correctly when the following happens:
  *          a frame (F) is shown; a window having F as owner is shown; a non-modal dialog having
--- a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFAppModal1Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFAppModal1Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8047367
  * @summary Check whether the focus transfer between windows occurs correctly when
  *          the following happens: a window having a hidden frame owner is shown;
--- a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFAppModal2Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFAppModal2Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8047367 8048263
  * @summary Check whether the focus transfer between windows occurs correctly when
  *          the following happens: a window having a hidden frame owner is shown;
--- a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFAppModal3Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFAppModal3Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8047367
  * @summary Check whether the focus transfer between windows occurs correctly when
  *          the following happens: a window having a frame (F) owner is shown;
--- a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFDocModal1Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFDocModal1Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8047367
  * @summary Check whether the focus transfer between windows occurs correctly when
  *          the following happens: a window having a hidden frame owner is shown;
--- a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFDocModal2Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFDocModal2Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8047367
  * @summary Check whether the focus transfer between windows occurs correctly when
  *          the following happens: a window having a hidden frame owner is shown;
--- a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFDocModal3Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFDocModal3Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8047367
  * @summary Check whether the focus transfer between windows occurs correctly when
  *          the following happens: a window having a frame (F) owner is shown;
--- a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFModeless1Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFModeless1Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8047367
  * @summary Check whether the focus transfer between windows occurs correctly when
  *          the following happens: a window having a hidden frame owner is shown;
--- a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFModeless2Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFModeless2Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8047367
  * @summary Check whether the focus transfer between windows occurs correctly when
  *          the following happens: a window having a hidden frame owner is shown;
--- a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFModeless3Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFModeless3Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8047367
  * @summary Check whether the focus transfer between windows occurs correctly when
  *          the following happens: a window having a frame (F) owner is shown;
--- a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFNonModal1Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFNonModal1Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8047367
  * @summary Check whether the focus transfer between windows occurs correctly when
  *          the following happens: a window having a hidden frame owner is shown;
--- a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFNonModal2Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFNonModal2Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8047367
  * @summary Check whether the focus transfer between windows occurs correctly when
  *          the following happens: a window having a hidden frame owner is shown;
--- a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFNonModal3Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFNonModal3Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8047367
  * @summary Check whether the focus transfer between windows occurs correctly when
  *          the following happens: a window having a frame (F) owner is shown;
--- a/jdk/test/java/awt/Modal/ModalInternalFrameTest/ModalInternalFrameTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ModalInternalFrameTest/ModalInternalFrameTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
   @test
+  @key headful
   @bug 6518753
   @summary Tests the functionality of modal Swing internal frames
   @author artem.ananiev: area=awt.modal
--- a/jdk/test/java/awt/Modal/MultipleDialogs/MultipleDialogs1Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/MultipleDialogs/MultipleDialogs1Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054358
  * @summary Check whether a set of dialogs created with a toolkit excluded Frame
  *          parent has a proper modal blocking behavior. Also show a document modal
--- a/jdk/test/java/awt/Modal/MultipleDialogs/MultipleDialogs2Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/MultipleDialogs/MultipleDialogs2Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054358
  * @summary Check whether a set of dialogs created with an application excluded Frame
  *          parent has a proper modal blocking behavior. Also show a document modal
--- a/jdk/test/java/awt/Modal/MultipleDialogs/MultipleDialogs3Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/MultipleDialogs/MultipleDialogs3Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054358
  * @summary Check correctness of modal blocking behavior for a chain of Dialogs
  *          having different modality types with a Frame as a document root.
--- a/jdk/test/java/awt/Modal/MultipleDialogs/MultipleDialogs4Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/MultipleDialogs/MultipleDialogs4Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054358 8055003
  * @summary Check whether application and document modality levels for Dialog
  *          work properly. Also check whether the blocking dialogs are
--- a/jdk/test/java/awt/Modal/MultipleDialogs/MultipleDialogs5Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/MultipleDialogs/MultipleDialogs5Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,9 +23,10 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054358
  * @summary This is a simple check if a chain of dialogs having different
-  *         modality types block each other properly.
+ *          modality types block each other properly.
  *
  * @library ../helpers ../../../../lib/testlibrary/
  * @build ExtendedRobot
--- a/jdk/test/java/awt/Modal/NullModalityDialogTest/NullModalityDialogTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/NullModalityDialogTest/NullModalityDialogTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -29,6 +29,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8047367
  * @summary Check whether a Dialog set with null modality type
  *          behaves like a modeless dialog
--- a/jdk/test/java/awt/Modal/OnTop/OnTopAppModal1Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/OnTop/OnTopAppModal1Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8052012
  * @summary Check whether an application modal Dialog created with null Frame
  *          constructor stays on top of the windows it blocks.
--- a/jdk/test/java/awt/Modal/OnTop/OnTopAppModal2Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/OnTop/OnTopAppModal2Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8052012
  * @summary Check whether an application modal Dialog created with null Dialog
  *          constructor stays on top of the windows it blocks.
--- a/jdk/test/java/awt/Modal/OnTop/OnTopAppModal3Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/OnTop/OnTopAppModal3Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8052012
  * @summary Check whether an application modal Dialog created with hidden Frame
  *          constructor stays on top of the windows it blocks.
--- a/jdk/test/java/awt/Modal/OnTop/OnTopAppModal4Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/OnTop/OnTopAppModal4Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8052012
  * @summary Check whether an application modal Dialog created with hidden Dialog
  *          constructor stays on top of the windows it blocks.
--- a/jdk/test/java/awt/Modal/OnTop/OnTopAppModal5Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/OnTop/OnTopAppModal5Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8052012
  * @summary Check whether an application modal Dialog created with visible Frame
  *          constructor stays on top of the windows it blocks.
--- a/jdk/test/java/awt/Modal/OnTop/OnTopAppModal6Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/OnTop/OnTopAppModal6Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8052012
  * @summary Check whether an application modal Dialog created with visible
  *          Dialog constructor stays on top of the windows it blocks.
--- a/jdk/test/java/awt/Modal/OnTop/OnTopDocModal1Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/OnTop/OnTopDocModal1Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8052012
  * @summary Check whether a document modal Dialog created with null Frame
  *          constructor follows normal Z order.
--- a/jdk/test/java/awt/Modal/OnTop/OnTopDocModal2Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/OnTop/OnTopDocModal2Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8052012
  * @summary Check whether a document modal Dialog created with null Dialog
  *          constructor follows normal Z order.
--- a/jdk/test/java/awt/Modal/OnTop/OnTopDocModal3Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/OnTop/OnTopDocModal3Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8052012
  * @summary Check whether a document modal Dialog created with hidden Frame
  *          constructor follows normal Z order.
--- a/jdk/test/java/awt/Modal/OnTop/OnTopDocModal4Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/OnTop/OnTopDocModal4Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8052012
  * @summary Check whether a document modal Dialog created with hidden Dialog
  *          constructor follows normal Z order.
--- a/jdk/test/java/awt/Modal/OnTop/OnTopDocModal5Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/OnTop/OnTopDocModal5Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8052012
  * @summary Check whether a document modal Dialog created with visible Frame
  *          constructor stays on top of the windows it blocks.
--- a/jdk/test/java/awt/Modal/OnTop/OnTopDocModal6Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/OnTop/OnTopDocModal6Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8052012
  * @summary Check whether a document modal Dialog created with visible
  *          Dialog constructor stays on top of the windows it blocks.
--- a/jdk/test/java/awt/Modal/OnTop/OnTopModal1Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/OnTop/OnTopModal1Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8052012
  * @summary Check whether a modal Dialog created with null Frame
  *          constructor stays on top of the windows it blocks.
--- a/jdk/test/java/awt/Modal/OnTop/OnTopModal2Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/OnTop/OnTopModal2Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8052012
  * @summary Check whether a modal Dialog created with null Dialog
  *          constructor stays on top of the windows it blocks.
--- a/jdk/test/java/awt/Modal/OnTop/OnTopModal3Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/OnTop/OnTopModal3Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8052012
  * @summary Check whether a modal Dialog created with hidden Frame
  *          constructor stays on top of the windows it blocks.
--- a/jdk/test/java/awt/Modal/OnTop/OnTopModal4Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/OnTop/OnTopModal4Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8052012
  * @summary Check whether a modal Dialog created with hidden Dialog
  *          constructor stays on top of the windows it blocks.
--- a/jdk/test/java/awt/Modal/OnTop/OnTopModal5Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/OnTop/OnTopModal5Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8052012
  * @summary Check whether a modal Dialog created with visible Frame
  *          constructor stays on top of the windows it blocks.
--- a/jdk/test/java/awt/Modal/OnTop/OnTopModal6Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/OnTop/OnTopModal6Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8052012
  * @summary Check whether a modal Dialog created with visible Dialog
  *          constructor stays on top of the windows it blocks.
--- a/jdk/test/java/awt/Modal/OnTop/OnTopModeless1Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/OnTop/OnTopModeless1Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8052012
  * @summary Check whether a modeless Dialog created with a
  *          null Frame constructor follows normal Z Order.
--- a/jdk/test/java/awt/Modal/OnTop/OnTopModeless2Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/OnTop/OnTopModeless2Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8052012
  * @summary Check whether a modeless Dialog created with a
  *          null Dialog constructor follows normal Z Order.
--- a/jdk/test/java/awt/Modal/OnTop/OnTopModeless3Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/OnTop/OnTopModeless3Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8052012
  * @summary Check whether a modeless Dialog created with a
  *          hidden Frame constructor follows normal Z Order.
--- a/jdk/test/java/awt/Modal/OnTop/OnTopModeless4Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/OnTop/OnTopModeless4Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8052012
  * @summary Check whether a modeless Dialog created with a
  *          hidden Dialog constructor follows normal Z Order.
--- a/jdk/test/java/awt/Modal/OnTop/OnTopModeless5Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/OnTop/OnTopModeless5Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8052012
  * @summary Check whether a modeless Dialog created with a
  *          visible Frame constructor follows normal Z Order.
--- a/jdk/test/java/awt/Modal/OnTop/OnTopModeless6Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/OnTop/OnTopModeless6Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8052012
  * @summary Check whether a modeless Dialog created with a visible Dialog
  *          constructor follows a normal Z order.
--- a/jdk/test/java/awt/Modal/OnTop/OnTopTKModal1Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/OnTop/OnTopTKModal1Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8052012
  * @summary Check whether a toolkit modal Dialog created with null Frame
  *          constructor stays on top of the windows it blocks.
--- a/jdk/test/java/awt/Modal/OnTop/OnTopTKModal2Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/OnTop/OnTopTKModal2Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8052012
  * @summary Check whether a toolkit modal Dialog created with null Dialog
  *          constructor stays on top of the windows it blocks.
--- a/jdk/test/java/awt/Modal/OnTop/OnTopTKModal3Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/OnTop/OnTopTKModal3Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8052012
  * @summary Check whether a toolkit modal Dialog created with hidden Frame
  *          constructor stays on top of the windows it blocks.
--- a/jdk/test/java/awt/Modal/OnTop/OnTopTKModal4Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/OnTop/OnTopTKModal4Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8052012
  * @summary Check whether a toolkit modal Dialog created with hidden Dialog
  *          constructor stays on top of the windows it blocks.
--- a/jdk/test/java/awt/Modal/OnTop/OnTopTKModal5Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/OnTop/OnTopTKModal5Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8052012
  * @summary Check whether a toolkit modal Dialog created with visible Frame
  *          constructor stays on top of the windows it blocks.
--- a/jdk/test/java/awt/Modal/OnTop/OnTopTKModal6Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/OnTop/OnTopTKModal6Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8052012
  * @summary Check whether a toolkit modal Dialog created with visible
  *          Dialog constructor stays on top of the windows it blocks.
--- a/jdk/test/java/awt/Modal/ToBack/ToBackAppModal1Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToBack/ToBackAppModal1Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054143
  * @summary Check whether an application modal dialog having a null Frame
  *          constructor still stays on top of the blocked windows even
--- a/jdk/test/java/awt/Modal/ToBack/ToBackAppModal2Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToBack/ToBackAppModal2Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054143
  * @summary Check whether an application modal dialog having a null Dialog
  *          constructor still stays on top of the blocked windows even
--- a/jdk/test/java/awt/Modal/ToBack/ToBackAppModal3Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToBack/ToBackAppModal3Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054143
  * @summary Check whether an application modal dialog having a hidden Frame
  *          constructor still stays on top of the blocked windows even
--- a/jdk/test/java/awt/Modal/ToBack/ToBackAppModal4Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToBack/ToBackAppModal4Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054143
  * @summary Check whether an application modal dialog having a hidden Dialog
  *          constructor still stays on top of the blocked windows even
--- a/jdk/test/java/awt/Modal/ToBack/ToBackAppModal5Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToBack/ToBackAppModal5Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054143
  * @summary Check whether an application modal dialog having a visible Frame
  *          constructor still stays on top of the blocked windows even
--- a/jdk/test/java/awt/Modal/ToBack/ToBackAppModal6Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToBack/ToBackAppModal6Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054143
  * @summary Check whether an application modal dialog having a visible Dialog
  *          constructor still stays on top of the blocked windows even
--- a/jdk/test/java/awt/Modal/ToBack/ToBackDocModal1Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToBack/ToBackDocModal1Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054143
  * @summary Check if toBack method works correctly for
  *          a document modal dialog with null Frame parent.
--- a/jdk/test/java/awt/Modal/ToBack/ToBackDocModal2Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToBack/ToBackDocModal2Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054143
  * @summary Check if toBack method works correctly for
  *          a document modal dialog with null Dialog parent.
--- a/jdk/test/java/awt/Modal/ToBack/ToBackDocModal3Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToBack/ToBackDocModal3Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054143
  * @summary Check if toBack method works correctly for
  *          a document modal dialog with hidden Frame parent.
--- a/jdk/test/java/awt/Modal/ToBack/ToBackDocModal4Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToBack/ToBackDocModal4Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054143
  * @summary Check if toBack method works correctly for
  *          a document modal dialog with hidden Dialog parent.
--- a/jdk/test/java/awt/Modal/ToBack/ToBackDocModal5Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToBack/ToBackDocModal5Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054143
  * @summary Check whether a document modal dialog having a visible Frame
  *          constructor still stays on top of the blocked windows even
--- a/jdk/test/java/awt/Modal/ToBack/ToBackDocModal6Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToBack/ToBackDocModal6Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054143
  * @summary Check whether a document modal dialog having a visible Dialog
  *          constructor still stays on top of the blocked windows even
--- a/jdk/test/java/awt/Modal/ToBack/ToBackModal1Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToBack/ToBackModal1Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054143
  * @summary Check whether a modal dialog having a null Frame
  *          constructor still stays on top of the blocked windows even
--- a/jdk/test/java/awt/Modal/ToBack/ToBackModal2Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToBack/ToBackModal2Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054143
  * @summary Check whether a modal dialog having a null Dialog
  *          constructor still stays on top of the blocked windows even
--- a/jdk/test/java/awt/Modal/ToBack/ToBackModal3Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToBack/ToBackModal3Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054143
  * @summary Check whether a modal dialog having a hidden Frame
  *          constructor still stays on top of the blocked windows even
--- a/jdk/test/java/awt/Modal/ToBack/ToBackModal4Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToBack/ToBackModal4Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054143
  * @summary Check whether a modal dialog having a hidden Dialog
  *          constructor still stays on top of the blocked windows even
--- a/jdk/test/java/awt/Modal/ToBack/ToBackModal5Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToBack/ToBackModal5Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054143
  * @summary Check whether a modal dialog having a visible Frame
  *          constructor still stays on top of the blocked windows even
--- a/jdk/test/java/awt/Modal/ToBack/ToBackModal6Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToBack/ToBackModal6Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054143
  * @summary Check whether a modal dialog having a visible Dialog
  *          constructor still stays on top of the blocked windows even
--- a/jdk/test/java/awt/Modal/ToBack/ToBackModeless1Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToBack/ToBackModeless1Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054143
  * @summary Check whether a modeless dialog having a null Frame constructor
  *          goes behind other windows when toBack is called for it.
--- a/jdk/test/java/awt/Modal/ToBack/ToBackModeless2Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToBack/ToBackModeless2Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054143
  * @summary Check whether a modeless dialog having a null Dialog constructor
  *          goes behind other windows when toBack is called for it.
--- a/jdk/test/java/awt/Modal/ToBack/ToBackModeless3Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToBack/ToBackModeless3Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054143
  * @summary Check whether a modeless dialog having a hidden Frame constructor
  *          goes behind other windows when toBack is called for it.
--- a/jdk/test/java/awt/Modal/ToBack/ToBackModeless4Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToBack/ToBackModeless4Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054143
  * @summary Check whether a modeless dialog having a hidden Dialog constructor
  *          goes behind other windows when toBack is called for it.
--- a/jdk/test/java/awt/Modal/ToBack/ToBackModeless5Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToBack/ToBackModeless5Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054143
  * @summary Check if toBack method works correctly for a modeless dialog
  *          having a visible Frame constructor.
--- a/jdk/test/java/awt/Modal/ToBack/ToBackModeless6Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToBack/ToBackModeless6Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054143
  * @summary Check if toBack method works correctly for a modeless dialog
  *          having a visible Dialog constructor.
--- a/jdk/test/java/awt/Modal/ToBack/ToBackNonModal1Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToBack/ToBackNonModal1Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054143
  * @summary Check whether a non-modal dialog having a null Frame constructor
  *          goes behind other windows when toBack is called for it.
--- a/jdk/test/java/awt/Modal/ToBack/ToBackNonModal2Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToBack/ToBackNonModal2Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054143
  * @summary Check whether a non-modal dialog having a null Dialog constructor
  *          goes behind other windows when toBack is called for it.
--- a/jdk/test/java/awt/Modal/ToBack/ToBackNonModal3Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToBack/ToBackNonModal3Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054143
  * @summary Check whether a non-modal dialog having a hidden Frame constructor
  *          goes behind other windows when toBack is called for it.
--- a/jdk/test/java/awt/Modal/ToBack/ToBackNonModal4Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToBack/ToBackNonModal4Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054143
  * @summary Check whether a non-modal dialog having a hidden Dialog constructor
  *          goes behind other windows when toBack is called for it.
--- a/jdk/test/java/awt/Modal/ToBack/ToBackNonModal5Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToBack/ToBackNonModal5Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054143
  * @summary Check if toBack method works correctly for a non-modal dialog
  *          having a visible Frame constructor.
--- a/jdk/test/java/awt/Modal/ToBack/ToBackNonModal6Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToBack/ToBackNonModal6Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054143
  * @summary Check if toBack method works correctly for a non-modal dialog
  *          having a visible Dialog constructor.
--- a/jdk/test/java/awt/Modal/ToBack/ToBackTKModal1Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToBack/ToBackTKModal1Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054143
  * @summary Check whether a toolkit modal dialog having a null Frame
  *          constructor still stays on top of the blocked windows even
--- a/jdk/test/java/awt/Modal/ToBack/ToBackTKModal2Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToBack/ToBackTKModal2Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054143
  * @summary Check whether a toolkit modal dialog having a null Dialog
  *          constructor still stays on top of the blocked windows even
--- a/jdk/test/java/awt/Modal/ToBack/ToBackTKModal3Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToBack/ToBackTKModal3Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054143
  * @summary Check whether a toolkit modal dialog having a hidden Frame
  *          constructor still stays on top of the blocked windows even
--- a/jdk/test/java/awt/Modal/ToBack/ToBackTKModal4Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToBack/ToBackTKModal4Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054143
  * @summary Check whether a toolkit modal dialog having a hidden Dialog
  *          constructor still stays on top of the blocked windows even
--- a/jdk/test/java/awt/Modal/ToBack/ToBackTKModal5Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToBack/ToBackTKModal5Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054143
  * @summary Check whether a toolkit modal dialog having a visible Frame
  *          constructor still stays on top of the blocked windows even
--- a/jdk/test/java/awt/Modal/ToBack/ToBackTKModal6Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToBack/ToBackTKModal6Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8054143
  * @summary Check whether a toolkit modal dialog having a visible Dialog
  *          constructor still stays on top of the blocked windows even
--- a/jdk/test/java/awt/Modal/ToFront/DialogToFrontAppModalTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToFront/DialogToFrontAppModalTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8050885
  * @summary Check that calling toFront method for a dialog in presence of
  *          blocking application modal dialog does not bring it to the top
--- a/jdk/test/java/awt/Modal/ToFront/DialogToFrontDocModalTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToFront/DialogToFrontDocModalTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8050885
  * @summary Check that calling toFront method for a dialog in presence of
  *          blocking document modal dialog does not bring it to the top
--- a/jdk/test/java/awt/Modal/ToFront/DialogToFrontModalTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToFront/DialogToFrontModalTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8050885
  * @summary Check that calling toFront method for a dialog in presence of
  *          blocking modal dialog does not bring it to the top
--- a/jdk/test/java/awt/Modal/ToFront/DialogToFrontModeless1Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToFront/DialogToFrontModeless1Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8050885
  * @summary Check that calling toFront method does not bring a dialog to the top
  *          of a child modeless dialog.
--- a/jdk/test/java/awt/Modal/ToFront/DialogToFrontNonModalTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToFront/DialogToFrontNonModalTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8050885
  * @summary Check that calling toFront method does not bring a dialog to the top
  *          of a non-modal child dialog.
--- a/jdk/test/java/awt/Modal/ToFront/DialogToFrontTKModalTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToFront/DialogToFrontTKModalTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8050885
  * @summary Check that calling toFront method for a dialog in presence of
  *          blocking toolkit modal dialog does not bring it to the top
--- a/jdk/test/java/awt/Modal/ToFront/FrameToFrontAppModal1Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToFront/FrameToFrontAppModal1Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8050885
  * @summary Check that calling toFront method for a frame in presence of
  *          blocking application modal dialog having a null Frame parent
--- a/jdk/test/java/awt/Modal/ToFront/FrameToFrontAppModal2Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToFront/FrameToFrontAppModal2Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8050885
  * @summary Check that calling toFront method for a frame in presence of
  *          blocking application modal dialog having a null Dialog parent
--- a/jdk/test/java/awt/Modal/ToFront/FrameToFrontAppModal3Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToFront/FrameToFrontAppModal3Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8050885
  * @summary Check that calling toFront method for a frame in presence of
  *          blocking application modal dialog having a hidden Frame parent
--- a/jdk/test/java/awt/Modal/ToFront/FrameToFrontAppModal4Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToFront/FrameToFrontAppModal4Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8050885
  * @summary Check that calling toFront method for a frame in presence of
  *          blocking application modal dialog having a hidden Dialog parent
--- a/jdk/test/java/awt/Modal/ToFront/FrameToFrontAppModal5Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToFront/FrameToFrontAppModal5Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8050885
  * @summary Check that calling toFront method for a frame in presence of
  *          blocking application modal dialog having a visible Frame parent
--- a/jdk/test/java/awt/Modal/ToFront/FrameToFrontDocModal1Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToFront/FrameToFrontDocModal1Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8050885
  * @summary Check that calling toFront method for a frame in presence of
  *          blocking document modal dialog having a visible Frame parent
--- a/jdk/test/java/awt/Modal/ToFront/FrameToFrontDocModal2Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToFront/FrameToFrontDocModal2Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8050885
  * @summary Check if toFront method works correctly for a document modal dialog.
  *
--- a/jdk/test/java/awt/Modal/ToFront/FrameToFrontModal1Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToFront/FrameToFrontModal1Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8050885
  * @summary Check that calling toFront method for a frame in presence of
  *          blocking modal dialog having a null Frame parent
--- a/jdk/test/java/awt/Modal/ToFront/FrameToFrontModal2Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToFront/FrameToFrontModal2Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8050885
  * @summary Check that calling toFront method for a frame in presence of
  *          blocking modal dialog having a null Dialog parent
--- a/jdk/test/java/awt/Modal/ToFront/FrameToFrontModal3Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToFront/FrameToFrontModal3Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8050885
  * @summary Check that calling toFront method for a frame in presence of
  *          blocking modal dialog having a hidden Frame parent
--- a/jdk/test/java/awt/Modal/ToFront/FrameToFrontModal4Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToFront/FrameToFrontModal4Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8050885
  * @summary Check that calling toFront method for a frame in presence of
  *          blocking modal dialog having a hidden Dialog parent
--- a/jdk/test/java/awt/Modal/ToFront/FrameToFrontModal5Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToFront/FrameToFrontModal5Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8050885
  * @summary Check that calling toFront method for a frame in presence of
  *          blocking modal dialog having a visible Frame parent
--- a/jdk/test/java/awt/Modal/ToFront/FrameToFrontModeless1Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToFront/FrameToFrontModeless1Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8050885
  * @summary Check that calling toFront method does not bring a frame to the top of
  *          a modeless child dialog.
--- a/jdk/test/java/awt/Modal/ToFront/FrameToFrontNonModalTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToFront/FrameToFrontNonModalTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8050885
  * @summary Check that calling toFront method does not bring a frame to the top
  *          of a non-modal child dialog.
--- a/jdk/test/java/awt/Modal/ToFront/FrameToFrontTKModal1Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToFront/FrameToFrontTKModal1Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8050885
  * @summary Check that calling toFront method for a frame in presence of
  *          blocking modal toolkit dialog having a null Frame parent
--- a/jdk/test/java/awt/Modal/ToFront/FrameToFrontTKModal2Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToFront/FrameToFrontTKModal2Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8050885
  * @summary Check that calling toFront method for a frame in presence of
  *          blocking toolkit modal dialog having a null Dialog parent
--- a/jdk/test/java/awt/Modal/ToFront/FrameToFrontTKModal3Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToFront/FrameToFrontTKModal3Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8050885
  * @summary Check that calling toFront method for a frame in presence of
  *          blocking toolkit modal dialog having a hidden Frame parent
--- a/jdk/test/java/awt/Modal/ToFront/FrameToFrontTKModal4Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToFront/FrameToFrontTKModal4Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8050885
  * @summary Check that calling toFront method for a frame in presence of
  *          blocking toolkit modal dialog having a hidden Dialog parent
--- a/jdk/test/java/awt/Modal/ToFront/FrameToFrontTKModal5Test.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Modal/ToFront/FrameToFrontTKModal5Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8050885
  * @summary Check that calling toFront method for a frame in presence of
  *          blocking toolkit modal dialog having a visible Frame parent
--- a/jdk/test/java/awt/Mouse/EnterExitEvents/DragWindowOutOfFrameTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Mouse/EnterExitEvents/DragWindowOutOfFrameTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 7154048
  * @summary Window created under a mouse does not receive mouse enter event.
  *     Mouse Entered/Exited events should be generated during dragging the window
--- a/jdk/test/java/awt/Mouse/EnterExitEvents/DragWindowTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Mouse/EnterExitEvents/DragWindowTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 7154048
  * @summary Window created under a mouse does not receive mouse enter event.
  *     Mouse Entered/Exited events are wrongly generated during dragging the window
--- a/jdk/test/java/awt/Mouse/EnterExitEvents/ResizingFrameTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Mouse/EnterExitEvents/ResizingFrameTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 7154048
  * @summary Programmatically resized  window does not receive mouse entered/exited events
  * @author  alexandr.scherbatiy area=awt.event
--- a/jdk/test/java/awt/Mouse/GetMousePositionTest/GetMousePositionWithOverlay.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Mouse/GetMousePositionTest/GetMousePositionWithOverlay.java	Mon Aug 08 08:12:20 2016 -0700
@@ -29,6 +29,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 8012026
  * @summary Component.getMousePosition() does not work in an applet on MacOS
  * @author Petr Pchelko
--- a/jdk/test/java/awt/Mouse/GetMousePositionTest/GetMousePositionWithPopup.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Mouse/GetMousePositionTest/GetMousePositionWithPopup.java	Mon Aug 08 08:12:20 2016 -0700
@@ -30,6 +30,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 8012026
  * @summary Component.getMousePosition() does not work in an applet on MacOS
  * @author Petr Pchelko
--- a/jdk/test/java/awt/Mouse/MouseComboBoxTest/MouseComboBoxTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Mouse/MouseComboBoxTest/MouseComboBoxTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8032872
  * @summary Tests JComboBox selection via the mouse
  * @author Dmitry Markov
--- a/jdk/test/java/awt/Mouse/MouseDragEvent/MouseDraggedTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Mouse/MouseDragEvent/MouseDraggedTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -26,6 +26,7 @@
 import javax.swing.*;
 /*
  * @test
+ * @key headful
  * @bug 8080137
  * @summary Dragged events for extra mouse buttons (4,5,6) are not generated
  *            on JSplitPane
--- a/jdk/test/java/awt/Mouse/RemovedComponentMouseListener/RemovedComponentMouseListener.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Mouse/RemovedComponentMouseListener/RemovedComponentMouseListener.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8061636
  * @summary fix for 7079254 changes behavior of MouseListener, MouseMotionListener
  * @library ../../regtesthelpers
--- a/jdk/test/java/awt/MouseAdapter/MouseAdapterUnitTest/MouseAdapterUnitTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/MouseAdapter/MouseAdapterUnitTest/MouseAdapterUnitTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
   @test
+  @key headful
   @bug 4453162
   @summary MouseAdapter should implement MouseMotionListener and MouseWheelListener
   @author andrei.dmitriev: area=
--- a/jdk/test/java/awt/MouseInfo/JContainerMousePositionTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/MouseInfo/JContainerMousePositionTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
   @test
+  @key headful
   @summary unit test for a new method in Container class: getMousePosition(boolean)
   @author dav@sparc.spb.su: area=
   @bug 4009555
--- a/jdk/test/java/awt/Multiscreen/LocationRelativeToTest/LocationRelativeToTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Multiscreen/LocationRelativeToTest/LocationRelativeToTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -22,15 +22,16 @@
  */
 
 /*
- @test
- @bug 6232687
- @summary Tests that Window.setLocationRelativeTo() method works correctly
-for different multiscreen configurations
- @author artem.ananiev, area=awt.multiscreen
- @library ../../regtesthelpers
- @build Util
- @run main LocationRelativeToTest
-*/
+ * @test
+ * @key headful
+ * @bug 6232687
+ * @summary Tests that Window.setLocationRelativeTo() method works correctly
+ *          for different multiscreen configurations
+ * @author artem.ananiev, area=awt.multiscreen
+ * @library ../../regtesthelpers
+ * @build Util
+ * @run main LocationRelativeToTest
+ */
 
 import java.awt.*;
 import java.awt.event.*;
--- a/jdk/test/java/awt/Multiscreen/TranslucencyThrowsExceptionWhenFullScreen/TranslucencyThrowsExceptionWhenFullScreen.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Multiscreen/TranslucencyThrowsExceptionWhenFullScreen/TranslucencyThrowsExceptionWhenFullScreen.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
   @test
+  @key headful
   @bug 6838089
   @summary Translucent windows should throw exception in FS mode
   @author dmitry.cherepanov@oracle.com: area=awt-multiscreen
--- a/jdk/test/java/awt/Paint/ExposeOnEDT.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Paint/ExposeOnEDT.java	Mon Aug 08 08:12:20 2016 -0700
@@ -26,6 +26,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 7090424
  * @author Sergey Bylokhov
  * @library ../../../lib/testlibrary/
--- a/jdk/test/java/awt/Paint/PaintNativeOnUpdate.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Paint/PaintNativeOnUpdate.java	Mon Aug 08 08:12:20 2016 -0700
@@ -31,6 +31,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 7157680
  * @library ../../../lib/testlibrary
  * @build ExtendedRobot
--- a/jdk/test/java/awt/Paint/bug8024864.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Paint/bug8024864.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,7 +21,9 @@
  * questions.
  */
 
-/* @test
+/*
+ * @test
+ * @key headful
  * @bug 8024864 8031422
  * @summary [macosx] Problems with rendering of controls
  * @author Petr Pchelko
--- a/jdk/test/java/awt/PrintJob/PrinterException.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/PrintJob/PrinterException.java	Mon Aug 08 08:12:20 2016 -0700
@@ -22,6 +22,7 @@
  */
 /*
  * @test
+ * @key headful
  * @bug 7161283 8158520
  * @summary  Toolkit.getPrintJob throws NPE if no printer available
  * @run main PrinterException
--- a/jdk/test/java/awt/Robot/AcceptExtraMouseButtons/AcceptExtraMouseButtons.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Robot/AcceptExtraMouseButtons/AcceptExtraMouseButtons.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
   @test %I% %E%
+  @key headful
   @bug 6315717
   @summary verifies that Robot is accepting extra mouse buttons
   @author Andrei Dmitriev : area=awt.mouse
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Robot/ModifierRobotKey/ModifierRobotEnhancedKeyTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -0,0 +1,257 @@
+/*
+ * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.BorderLayout;
+import java.awt.Canvas;
+import java.awt.EventQueue;
+import java.awt.Frame;
+import java.awt.event.FocusAdapter;
+import java.awt.event.FocusEvent;
+import java.awt.event.InputEvent;
+import java.awt.event.KeyAdapter;
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseEvent;
+
+import static jdk.testlibrary.Asserts.assertTrue;
+
+/*
+ * NOTE: this is no intentionally a manual test (i.e. has no test tag) because
+ * even on Windows, the various tested key-combination may get partially
+ * intercepted by other applications and this can leave the whole system in an
+ * inconsistent state. For example on my Windows machine with Intel Graphics
+ * the key combinations "Ctl-Alt-F11" and "Ctl-Alt-F12" triggers some Intel
+ * Graphics utilities by default. If the test is run in such an environment,
+ * some key events of the test are intercepted by those utilities with the
+ * result that the test fails and no more keyboard input will be possible at
+ * all.
+ *
+ * To execute the test add a '@' before the 'test' keyword below to make it a tag.
+ */
+
+/*
+ * test 8155742
+ *
+ * @summary Make sure that modifier key mask is set when robot press
+ *          some key with one or more modifiers.
+ * @library ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @key headful
+ * @run main/timeout=600 ModifierRobotEnhancedKeyTest
+ */
+
+public class ModifierRobotEnhancedKeyTest extends KeyAdapter {
+
+    private boolean focusGained = false;
+    private boolean startTest = false;
+    private ExtendedRobot robot;
+    private Frame frame;
+    private Canvas canvas;
+
+    private volatile boolean tempPress = false;
+
+    private int[] textKeys, modifierKeys, inputMasks;
+    private boolean[] modifierStatus, textStatus;
+
+    private final static int waitDelay = 5000;
+    private Object tempLock = new Object();
+    private Object keyLock = new Object();
+
+    public static void main(String[] args) throws Exception {
+        String os = System.getProperty("os.name").toLowerCase();
+        if (!os.contains("windows")) {
+            System.out.println("*** this test is for windows only because some of the tested key combinations " +
+                               "might be caught by the os and therefore don't reach the canvas ***");
+            return;
+        }
+
+        ModifierRobotEnhancedKeyTest test = new ModifierRobotEnhancedKeyTest();
+        test.doTest();
+    }
+
+    public ModifierRobotEnhancedKeyTest() throws Exception {
+        modifierKeys =  new int[4];
+        modifierKeys[0] = KeyEvent.VK_SHIFT;
+        modifierKeys[1] = KeyEvent.VK_CONTROL;
+        modifierKeys[2] = KeyEvent.VK_ALT;
+        modifierKeys[3] = KeyEvent.VK_ALT_GRAPH;
+
+        inputMasks = new int[4];
+        inputMasks[0] =  InputEvent.SHIFT_MASK;
+        inputMasks[1] =  InputEvent.CTRL_MASK;
+        inputMasks[2] =  InputEvent.ALT_MASK;
+        inputMasks[3] =  InputEvent.ALT_GRAPH_MASK;
+
+        modifierStatus = new boolean[modifierKeys.length];
+
+        textKeys = new int[6];
+        textKeys[0] = KeyEvent.VK_A;
+        textKeys[1] = KeyEvent.VK_S;
+        textKeys[2] = KeyEvent.VK_DELETE;
+        textKeys[3] = KeyEvent.VK_HOME;
+        textKeys[4] = KeyEvent.VK_F12;
+        textKeys[5] = KeyEvent.VK_LEFT;
+
+        textStatus = new boolean[textKeys.length];
+
+        EventQueue.invokeAndWait( () -> { initializeGUI(); });
+    }
+
+    public void keyPressed(KeyEvent event) {
+
+        tempPress = true;
+        synchronized (tempLock) { tempLock.notifyAll(); }
+
+        if (! startTest) {
+            return;
+        }
+        for (int x = 0; x < inputMasks.length; x++) {
+            if ((event.getModifiers() & inputMasks[x]) != 0) {
+                System.out.println("Modifier set: " + event.getKeyModifiersText(inputMasks[x]));
+                modifierStatus[x] = true;
+            }
+        }
+        for (int x = 0; x < textKeys.length; x++) {
+            if (event.getKeyCode() == textKeys[x]) {
+                System.out.println("Text set: " + event.getKeyText(textKeys[x]));
+                textStatus[x] = true;
+            }
+        }
+
+        synchronized (keyLock) { keyLock.notifyAll(); }
+    }
+
+    private void initializeGUI() {
+        frame = new Frame("Test frame");
+        canvas = new Canvas();
+        canvas.addFocusListener(new FocusAdapter() {
+            public void focusGained(FocusEvent event) { focusGained = true; }
+        });
+        canvas.addKeyListener(this);
+        frame.setLayout(new BorderLayout());
+        frame.add(canvas);
+        frame.setSize(200, 200);
+        frame.setVisible(true);
+    }
+
+    public void doTest() throws Exception {
+        robot = new ExtendedRobot();
+
+        robot.mouseMove((int) frame.getLocationOnScreen().getX() + frame.getSize().width / 2,
+                        (int) frame.getLocationOnScreen().getY() + frame.getSize().height / 2);
+        robot.click(MouseEvent.BUTTON1_MASK);
+        robot.waitForIdle();
+
+        assertTrue(focusGained, "FAIL: Canvas gained focus!");
+
+        for (int i = 0; i < modifierKeys.length; i++) {
+            for (int j = 0; j < textKeys.length; j++) {
+                tempPress = false;
+                robot.keyPress(modifierKeys[i]);
+                robot.waitForIdle();
+                if (! tempPress) {
+                    synchronized (tempLock) { tempLock.wait(waitDelay); }
+                }
+                assertTrue(tempPress, "FAIL: keyPressed triggered for i=" + i);
+
+                resetStatus();
+                startTest = true;
+                robot.keyPress(textKeys[j]);
+                robot.waitForIdle();
+                if (! modifierStatus[i] || ! textStatus[j]) {
+                    synchronized (keyLock) { keyLock.wait(waitDelay); }
+                }
+
+
+                assertTrue(modifierStatus[i] && textStatus[j],
+                        "FAIL: KeyEvent not proper!"+
+                        "Key checked: i=" + i + "; j=" + j+
+                        "ModifierStatus = " + modifierStatus[i]+
+                        "TextStatus = " + textStatus[j]);
+                startTest = false;
+                robot.keyRelease(textKeys[j]);
+                robot.waitForIdle();
+                robot.keyRelease(modifierKeys[i]);
+                robot.waitForIdle();
+            }
+        }
+
+        for (int i = 0; i < modifierKeys.length; i++) {
+            for (int j = i + 1; j < modifierKeys.length; j++) {
+                for (int k = 0; k < textKeys.length; k++) {
+                    tempPress = false;
+                    robot.keyPress(modifierKeys[i]);
+                    robot.waitForIdle();
+                    if (! tempPress) {
+                        synchronized (tempLock) { tempLock.wait(waitDelay); }
+                    }
+
+                    assertTrue(tempPress, "FAIL: MultiKeyTest: keyPressed triggered for i=" + i);
+
+                    tempPress = false;
+                    robot.keyPress(modifierKeys[j]);
+                    robot.waitForIdle();
+                    if (! tempPress) {
+                        synchronized (tempLock) { tempLock.wait(waitDelay); }
+                    }
+                    assertTrue(tempPress, "FAIL: MultiKeyTest keyPressed triggered for j=" + j);
+
+                    resetStatus();
+                    startTest = true;
+                    robot.keyPress(textKeys[k]);
+                    robot.waitForIdle();
+                    if (! modifierStatus[i] || ! modifierStatus[j] || ! textStatus[k]) {
+                        synchronized (keyLock) {
+                            keyLock.wait(waitDelay);
+                        }
+                    }
+                    assertTrue(modifierStatus[i] && modifierStatus[j] && textStatus[k],
+                            "FAIL: KeyEvent not proper!"+
+                            "Key checked: i=" + i + "; j=" + j + "; k=" + k+
+                            "Modifier1Status = " + modifierStatus[i]+
+                            "Modifier2Status = " + modifierStatus[j]+
+                            "TextStatus = " + textStatus[k]);
+
+                    startTest = false;
+                    robot.keyRelease(textKeys[k]);
+                    robot.waitForIdle();
+                    robot.keyRelease(modifierKeys[j]);
+                    robot.waitForIdle();
+                    robot.keyRelease(modifierKeys[i]);
+                    robot.waitForIdle();
+                }
+            }
+        }
+
+        frame.dispose();
+    }
+
+    private void resetStatus() {
+        for (int i = 0; i < modifierStatus.length; i++) {
+            modifierStatus[i] = false;
+        }
+        for (int i = 0; i < textStatus.length; i++) {
+            textStatus[i] = false;
+        }
+    }
+
+}
--- a/jdk/test/java/awt/Robot/ModifierRobotKey/ModifierRobotKeyTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Robot/ModifierRobotKey/ModifierRobotKeyTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -36,6 +36,7 @@
 
 /*
  * @test 8155742
+ * @key headful
  * @summary Make sure that modifier key mask is set when robot press
  *          some key with one or more modifiers.
  * @library ../../../../lib/testlibrary/
--- a/jdk/test/java/awt/TextArea/TextAreaCaretVisibilityTest/bug7129742.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/TextArea/TextAreaCaretVisibilityTest/bug7129742.java	Mon Aug 08 08:12:20 2016 -0700
@@ -26,7 +26,9 @@
  */
 
 
-/* @test
+/*
+ * @test
+ * @key headful
  * @bug 7129742
  * @summary Focus in non-editable TextArea is not shown on Linux.
  * @requires (os.family == "linux" | os.family == "solaris")
--- a/jdk/test/java/awt/TextArea/TextAreaEditing/TextAreaEditing.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/TextArea/TextAreaEditing/TextAreaEditing.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  @test
+ @key headful
  @bug 8040322 8060137
  @library ../../regtesthelpers
  @build Util
--- a/jdk/test/java/awt/TextField/TextFieldEditing/TextFieldEditing.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/TextField/TextFieldEditing/TextFieldEditing.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  @test
+ @key headful
  @bug 8060137
  @library ../../regtesthelpers
  @build Util
--- a/jdk/test/java/awt/Toolkit/AutoShutdown/ShowExitTest/ShowExitTest.sh	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Toolkit/AutoShutdown/ShowExitTest/ShowExitTest.sh	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 
 #
 #   @test       ShowExitTest.sh
+#   @key        headful
 #   @bug        6513421
 #   @summary    Java process does not terminate on closing the Main Application Frame
 #
--- a/jdk/test/java/awt/Toolkit/LockingKeyStateTest/LockingKeyStateTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Toolkit/LockingKeyStateTest/LockingKeyStateTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -26,6 +26,7 @@
 
 /*
   @test
+  @key headful
   @summary verify LOCK buttons toogle
   @author Yuri.Nesterenko, Dmitriy.Ermashov
   @library ../../../../lib/testlibrary
--- a/jdk/test/java/awt/Toolkit/SecurityTest/SecurityTest2.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Toolkit/SecurityTest/SecurityTest2.java	Mon Aug 08 08:12:20 2016 -0700
@@ -22,13 +22,14 @@
  */
 
 /*
-  @test
-  @bug 6599601
-  @summary tests that a simple GUI application runs without any
-exceptions thrown
-  @author Artem.Ananiev area=awt.Toolkit
-  @run main SecurityTest2
-*/
+ * @test
+ * @key headful
+ * @bug 6599601
+ * @summary tests that a simple GUI application runs without any
+ *          exceptions thrown
+ * @author Artem.Ananiev area=awt.Toolkit
+ * @run main SecurityTest2
+ */
 
 import java.awt.*;
 
--- a/jdk/test/java/awt/TrayIcon/PopupMenuLeakTest/PopupMenuLeakTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/TrayIcon/PopupMenuLeakTest/PopupMenuLeakTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  @test
+ @key headful
   @bug 8007220
   @summary Reference to the popup leaks after the TrayIcon is removed
   @author Petr Pchelko
--- a/jdk/test/java/awt/Window/8027025/Test8027025.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Window/8027025/Test8027025.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,7 +21,9 @@
  * questions.
  */
 
-/* @test
+/*
+ * @test
+ * @key headful
  * @bug 8027025
  * @summary [macosx] getLocationOnScreen returns 0 if parent invisible
  * @author Petr Pchelko
--- a/jdk/test/java/awt/Window/AlwaysOnTop/AlwaysOnTopFieldTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Window/AlwaysOnTop/AlwaysOnTopFieldTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -26,6 +26,7 @@
 import java.awt.Window;
 /**
  * @test
+ * @key headful
  * @bug 7081594
  * @author Alexander Scherbatiy
  * @summary Windows owned by an always-on-top window DO NOT automatically become always-on-top
@@ -37,7 +38,7 @@
         Robot robot;
         try {
             robot = new Robot();
-        }catch(Exception ex) {
+        } catch(Exception ex) {
             ex.printStackTrace();
             throw new RuntimeException("Unexpected failure");
         }
--- a/jdk/test/java/awt/Window/AlwaysOnTop/AutoTestOnTop.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Window/AlwaysOnTop/AutoTestOnTop.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
   @test
+  @key headful
   @bug 4632143
   @summary Unit test for the RFE window/frame/dialog always on top
   @author dom@sparc.spb.su: area=awt.toplevel
--- a/jdk/test/java/awt/Window/ChildProperties/ChildWindowProperties.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Window/ChildProperties/ChildWindowProperties.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,12 +21,14 @@
  * questions.
  */
 
- /*
- @test
- @bug 8057574
- @summary Verify that child Window does not inherit parent's Properties
- @run main ChildWindowProperties
+/*
+ * @test
+ * @key headful
+ * @bug 8057574
+ * @summary Verify that child Window does not inherit parent's Properties
+ * @run main ChildWindowProperties
  */
+
 import java.awt.Color;
 import java.awt.Dialog;
 import java.awt.Font;
--- a/jdk/test/java/awt/Window/GetScreenLocation/GetScreenLocationTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Window/GetScreenLocation/GetScreenLocationTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,8 +23,9 @@
 
 /**
  * @test @summary setLocationRelativeTo stopped working in Ubuntu 13.10 (Unity)
- * @bug 8036915
- * @run main GetScreenLocationTest
+ * @bug 8036915 8161273
+ * @run main/othervm -Dsun.java2d.uiScale=1 GetScreenLocationTest
+ * @run main/othervm -Dsun.java2d.uiScale=2 GetScreenLocationTest
  */
 import java.awt.*;
 
@@ -33,28 +34,28 @@
     public static void main(String[] args) throws Exception {
         Robot robot = new Robot();
         Window frame = null;
-        for(int i = 0; i < 50; i++) {
+        for(int i = 0; i < 30; i++) {
             if(frame != null) frame.dispose();
             frame = new Dialog((Frame)null);
-            frame.setBounds(0, 0, 200, 200);
+            frame.setBounds(0, 0, 200, 100);
             frame.setVisible(true);
             robot.waitForIdle();
             robot.delay(200);
-            frame.setLocation(321, 321);
+            frame.setLocation(321, 121);
             robot.waitForIdle();
             robot.delay(200);
             Dimension size = frame.getSize();
-            if(size.width != 200 || size.height != 200) {
+            if(size.width != 200 || size.height != 100) {
                 frame.dispose();
                 throw new RuntimeException("getSize() is wrong " + size);
             }
             Rectangle r = frame.getBounds();
             frame.dispose();
-            if(r.x != 321 || r.y != 321) {
+            if(r.x != 321 || r.y != 121) {
                 throw new RuntimeException("getLocation() returns " +
                         "wrong coordinates " + r.getLocation());
             }
-            if(r.width != 200 || r.height != 200) {
+            if(r.width != 200 || r.height != 100) {
                 throw new RuntimeException("getSize() is wrong " + r.getSize());
             }
         }
--- a/jdk/test/java/awt/Window/MaximizeOffscreen/MaximizeOffscreenTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Window/MaximizeOffscreen/MaximizeOffscreenTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /**
  * @test @summary JVM crash if the frame maximized from offscreen
+ * @key headful
  * @bug 8020210
  * @author Petr Pchelko
  * @library ../../regtesthelpers
--- a/jdk/test/java/awt/Window/OwnedWindowsSerialization/OwnedWindowsSerialization.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Window/OwnedWindowsSerialization/OwnedWindowsSerialization.java	Mon Aug 08 08:12:20 2016 -0700
@@ -28,7 +28,9 @@
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 
-/* @test
+/*
+ * @test
+ * @key headful
  * @bug 8027152
  * @summary Checks that ownedWindowList is serialized and deserialized properly and alwaysOnTop works after deserialization
  * @author Petr Pchelko
--- a/jdk/test/java/awt/Window/TopLevelLocation/TopLevelLocation.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Window/TopLevelLocation/TopLevelLocation.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 8027628
  * @author Oleg Pekhovskiy
  * @summary JWindow jumps to (0, 0) after mouse clicked
--- a/jdk/test/java/awt/Window/WindowGCInFullScreen/WindowGCInFullScreen.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Window/WindowGCInFullScreen/WindowGCInFullScreen.java	Mon Aug 08 08:12:20 2016 -0700
@@ -32,6 +32,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 8019591
  * @author Sergey Bylokhov
  */
--- a/jdk/test/java/awt/Window/WindowJumpingTest/WindowJumpingTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Window/WindowJumpingTest/WindowJumpingTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,7 +21,9 @@
  * questions.
  */
 
-/* @test
+/*
+ * @test
+ * @key headful
  * @bug 8080729
  * @summary Dialogs on multiscreen jump to parent frame on focus gain
  * @author Dmitry Markov
--- a/jdk/test/java/awt/Window/WindowsLeak/WindowsLeak.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/Window/WindowsLeak/WindowsLeak.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8013563 8028486
  * @summary Tests that windows are removed from windows list
  * @library /javax/swing/regtesthelpers
--- a/jdk/test/java/awt/datatransfer/DataFlavor/NullDataFlavorTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/datatransfer/DataFlavor/NullDataFlavorTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
   @test
+  @key headful
   @bug 4682039
   @summary Tests that DataTransferer.getFormatsForFlavors() does not throw
            NullPointerException if some of given as parameter data flavors
--- a/jdk/test/java/awt/datatransfer/UnicodeTransferTest/UnicodeTransferTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/datatransfer/UnicodeTransferTest/UnicodeTransferTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
   @test
+  @key headful
   @bug 4718897
   @summary tests that a Unicode string can be transferred between JVMs.
   @author das@sparc.spb.su area=datatransfer
--- a/jdk/test/java/awt/dnd/AcceptDropMultipleTimes/AcceptDropMultipleTimes.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/dnd/AcceptDropMultipleTimes/AcceptDropMultipleTimes.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 8029979
  * @summary Checks if acceptDrop() can be called several times
  * @library ../../regtesthelpers
--- a/jdk/test/java/awt/dnd/DisposeFrameOnDragCrash/DisposeFrameOnDragTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/dnd/DisposeFrameOnDragCrash/DisposeFrameOnDragTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /**
  * @test @summary JVM crash if the frame is disposed in DropTargetListener
+ * @key headful
  * @author Petr Pchelko
  * @library ../../regtesthelpers
  * @build Util
--- a/jdk/test/java/awt/dnd/DropTargetEnterExitTest/ExtraDragEnterTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/dnd/DropTargetEnterExitTest/ExtraDragEnterTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 8024163
  * @summary Checks the dragEnter event is correctly generated
  * @library ../../regtesthelpers
--- a/jdk/test/java/awt/dnd/DropTargetEnterExitTest/MissedDragExitTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/dnd/DropTargetEnterExitTest/MissedDragExitTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 8024163
  * @summary Checks that dragExit is generated when the new DropTarget is created under the drag
  * @library ../../regtesthelpers
--- a/jdk/test/java/awt/dnd/MissingDragExitEventTest/MissingDragExitEventTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/dnd/MissingDragExitEventTest/MissingDragExitEventTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 8027913
  * @library ../../regtesthelpers
  * @build Util
--- a/jdk/test/java/awt/event/KeyEvent/AltCharAcceleratorTest/AltCharAcceleratorTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/event/KeyEvent/AltCharAcceleratorTest/AltCharAcceleratorTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -22,13 +22,14 @@
  */
 
 /*
-@test
-@bug 8068283
-@summary Checks that <Alt>+Char accelerators work when pressed in a text component
-@author Anton Nashatyrev
-@modules java.desktop/sun.awt
-@run main AltCharAcceleratorTest
-*/
+ * @test
+ * @key headful
+ * @bug 8068283
+ * @summary Checks that <Alt>+Char accelerators work when pressed in a text component
+ * @author Anton Nashatyrev
+ * @modules java.desktop/sun.awt
+ * @run main AltCharAcceleratorTest
+ */
 
 import javax.swing.*;
 import java.awt.*;
--- a/jdk/test/java/awt/event/KeyEvent/CorrectTime/CorrectTime.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/event/KeyEvent/CorrectTime/CorrectTime.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
   @test
+  @key headful
   @bug 6451578
   @library ../../../regtesthelpers
   @build Sysout AbstractTest Util
--- a/jdk/test/java/awt/event/KeyEvent/ExtendedKeyCode/ExtendedKeyCodeTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/event/KeyEvent/ExtendedKeyCode/ExtendedKeyCodeTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -28,6 +28,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8007156 8025126
  * @summary Extended key code is not set for a key event
  * @author Alexandr Scherbatiy
--- a/jdk/test/java/awt/event/KeyEvent/ExtendedModifiersTest/ExtendedModifiersTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/event/KeyEvent/ExtendedModifiersTest/ExtendedModifiersTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8043126 8145116
  * @summary Check whether
  *          1. correct extended modifiers are returned
@@ -281,4 +282,4 @@
         ExtendedModifiersTest test = new ExtendedModifiersTest();
         test.doTest();
     }
-}
\ No newline at end of file
+}
--- a/jdk/test/java/awt/event/KeyEvent/KeyMaskTest/KeyMaskTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/event/KeyEvent/KeyMaskTest/KeyMaskTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8043126
  * @summary Check whether KeyEvent.getModifiers() returns correct modifiers
  *          when Ctrl, Alt or Shift keys are pressed.
--- a/jdk/test/java/awt/event/KeyEvent/SwallowKeyEvents/SwallowKeyEvents.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/event/KeyEvent/SwallowKeyEvents/SwallowKeyEvents.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
   @test
+  @key headful
   @bug       7154072 7161320
   @summary   Tests that key events with modifiers are not swallowed.
   @author    anton.tarasov: area=awt.focus
--- a/jdk/test/java/awt/event/MouseEvent/DisabledComponents/DisabledComponentsTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/event/MouseEvent/DisabledComponents/DisabledComponentsTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
   @test
+  @key headful
   @bug 4173714
   @summary java.awt.button behaves differently under Win32/Solaris
   @author tdv@sparc.spb.su
--- a/jdk/test/java/awt/event/MouseEvent/EnterAsGrabbedEvent/EnterAsGrabbedEvent.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/event/MouseEvent/EnterAsGrabbedEvent/EnterAsGrabbedEvent.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
   @test
+  @key headful
   @bug 6317481 8012325
   @summary REG:Pressing the mouse, dragging and releasing it outside the button triggers ActionEvent, XAWT
   @author Dmitry.Cherepanov@SUN.COM area=awt.event
--- a/jdk/test/java/awt/event/MouseEvent/MouseButtonsAndKeyMasksTest/MouseButtonsAndKeyMasksTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/event/MouseEvent/MouseButtonsAndKeyMasksTest/MouseButtonsAndKeyMasksTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -40,6 +40,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8043126
  * @summary Check whether MouseEvent.getModifiers(), MouseEvent.getModifiersEx()
  *          and KeyEvent.getModifiers() return correct modifiers when pressing
--- a/jdk/test/java/awt/event/MouseEvent/MouseButtonsTest/MouseButtonsTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/event/MouseEvent/MouseButtonsTest/MouseButtonsTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -38,6 +38,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8043126
  * @summary Check whether getButton() returns correct mouse button
  *          number when the mouse buttons are pressed and getModifiers()
--- a/jdk/test/java/awt/event/MouseEvent/MultipleMouseButtonsTest/MultipleMouseButtonsTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/event/MouseEvent/MultipleMouseButtonsTest/MultipleMouseButtonsTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -32,6 +32,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8043126
  * @summary Check whether correct modifiers set when multiple mouse buttons were pressed;
  *          check number of received events.
--- a/jdk/test/java/awt/event/MouseEvent/SpuriousExitEnter/SpuriousExitEnter_3.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/event/MouseEvent/SpuriousExitEnter/SpuriousExitEnter_3.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
   @test
+  @key headful
   @bug 6479820
   @library ../../../regtesthelpers
   @build Util
--- a/jdk/test/java/awt/event/MouseWheelEvent/InfiniteRecursion/InfiniteRecursion.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/event/MouseWheelEvent/InfiniteRecursion/InfiniteRecursion.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
   @test
+  @key headful
   @bug 6480024
   @library ../../../regtesthelpers
   @build Util Sysout AbstractTest
--- a/jdk/test/java/awt/event/MouseWheelEvent/InfiniteRecursion/InfiniteRecursion_1.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/event/MouseWheelEvent/InfiniteRecursion/InfiniteRecursion_1.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
   @test
+  @key headful
   @bug 6480024
   @library ../../../regtesthelpers
   @build Util Sysout AbstractTest
--- a/jdk/test/java/awt/event/MouseWheelEvent/InfiniteRecursion/InfiniteRecursion_4.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/event/MouseWheelEvent/InfiniteRecursion/InfiniteRecursion_4.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
   @test
+  @key headful
   @bug 6480024
   @library ../../../regtesthelpers
   @build Util Sysout AbstractTest
--- a/jdk/test/java/awt/event/MouseWheelEvent/WheelModifier/WheelModifier.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/event/MouseWheelEvent/WheelModifier/WheelModifier.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,11 +21,14 @@
  * questions.
  */
 
-/* @test
+/*
+   @test
+   @key headful
    @bug 8041470
    @summary JButtons stay pressed after they have lost focus if you use the mouse wheel
    @author Anton Nashatyrev
-*/
+ */
+
 import javax.swing.*;
 import java.awt.*;
 import java.awt.event.*;
--- a/jdk/test/java/awt/event/TextEvent/TextEventSequenceTest/TextEventSequenceTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/event/TextEvent/TextEventSequenceTest/TextEventSequenceTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 4028580
  * @summary TextArea does not send TextEvent when setText. Does for insert
  * @author kdm@sparc.spb.su: area= awt.TextAvent
--- a/jdk/test/java/awt/grab/GrabOnUnfocusableToplevel/GrabOnUnfocusableToplevel.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/grab/GrabOnUnfocusableToplevel/GrabOnUnfocusableToplevel.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
   @test
+  @key headful
   @bug 6539458
   @summary JPopupMenu does not display if invoker is instance of JWindow
   @author oleg.sukhodolsky area=awt.grab
--- a/jdk/test/java/awt/im/memoryleak/InputContextMemoryLeakTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/im/memoryleak/InputContextMemoryLeakTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -36,6 +36,7 @@
 
 /*
  @test
+ @key headful
  @bug 7079260
  @summary XInputContext leaks memory by needRecetXXIClient field
  @author Petr Pchelko
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/image/LookupOp/RasterOpNullDestinationRasterTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * 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 6427331
+ * @summary Test to check there is no NullPointerException raised if
+ * null raster is provided as destination in case of RasterOp.filter()
+ * @run main RasterOpNullDestinationRasterTest
+ */
+
+import java.awt.Point;
+import java.awt.image.ByteLookupTable;
+import java.awt.image.DataBuffer;
+import java.awt.image.DataBufferByte;
+import java.awt.image.LookupOp;
+import java.awt.image.PixelInterleavedSampleModel;
+import java.awt.image.Raster;
+import java.awt.image.RasterOp;
+import java.awt.image.SampleModel;
+
+public class RasterOpNullDestinationRasterTest {
+
+    public static void main(String[] args) {
+
+        byte[][] data = new byte[1][10];
+        ByteLookupTable lut = new ByteLookupTable(0, data);
+        RasterOp op = new LookupOp(lut, null);
+
+        int[] bandOffsets = {0};
+        Point location = new Point(0, 0);
+        DataBuffer db = new DataBufferByte(10 * 10);
+        SampleModel sm = new PixelInterleavedSampleModel(DataBuffer.TYPE_BYTE,
+                                                         10, 10, 1, 10,
+                                                         bandOffsets);
+
+        Raster src = Raster.createRaster(sm, db, location);
+
+        op.filter(src, null); // this used to result in NullPointerException
+    }
+}
--- a/jdk/test/java/awt/image/multiresolution/MenuMultiresolutionIconTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/image/multiresolution/MenuMultiresolutionIconTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8150258
  * @author a.stepanov
  * @summary Check that correct resolution variants are chosen for menu icons
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/image/multiresolution/MultiResolutionIcon/IconTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -0,0 +1,163 @@
+/**
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * 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 8147648
+ * @summary [hidpi] multiresolution image: wrong resolution variant is used as
+ * icon in the Unity panel
+ * @run main/othervm -Dsun.java2d.uiScale=2 IconTest
+ */
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.awt.image.BaseMultiResolutionImage;
+import java.awt.image.BufferedImage;
+import java.util.concurrent.CountDownLatch;
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.SwingUtilities;
+
+public class IconTest {
+
+    private final static int SZ = 8;
+    private static GridBagLayout layout;
+    private static JPanel mainControlPanel;
+    private static JPanel resultButtonPanel;
+    private static JLabel instructionText;
+    private static JButton passButton;
+    private static JButton failButton;
+    private static JButton testButton;
+    private static JFrame f;
+    private static CountDownLatch latch;
+
+    private static BufferedImage generateImage(int scale, Color c) {
+        int x = SZ * scale;
+        BufferedImage img = new BufferedImage(x, x, BufferedImage.TYPE_INT_RGB);
+        Graphics g = img.getGraphics();
+        try {
+            if (g != null) {
+                g.setColor(c);
+                g.fillRect(0, 0, x, x);
+                g.setColor(Color.YELLOW);
+                g.drawRect(0, 0, x-1, x-1);
+            }
+        } finally {
+            g.dispose();
+        }
+        return img;
+    }
+
+
+    private static void createUI() throws Exception {
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                f = new JFrame("TrayIcon Test");
+
+                final BaseMultiResolutionImage IMG = new BaseMultiResolutionImage(
+                        new BufferedImage[]{generateImage(1, Color.RED), generateImage(2, Color.BLUE)});
+                layout = new GridBagLayout();
+                mainControlPanel = new JPanel(layout);
+                resultButtonPanel = new JPanel(layout);
+                f.setIconImage(IMG);
+                GridBagConstraints gbc = new GridBagConstraints();
+                String instructions
+                        = "<html>INSTRUCTIONS:<br>"
+                        + "Check if test button and unity icons are both blue with yellow border.<br><br>"
+                        + "If Icon color is blue press pass"
+                        + " else press fail.<br><br></html>";
+
+                instructionText = new JLabel();
+                instructionText.setText(instructions);
+
+                gbc.gridx = 0;
+                gbc.gridy = 0;
+                gbc.fill = GridBagConstraints.HORIZONTAL;
+                mainControlPanel.add(instructionText, gbc);
+                testButton = new JButton("Test");
+                testButton.setActionCommand("Test");
+                mainControlPanel.add(testButton, gbc);
+
+                testButton.setIcon(new ImageIcon(IMG));
+                gbc.gridx = 0;
+                gbc.gridy = 0;
+                resultButtonPanel.add(testButton, gbc);
+
+                passButton = new JButton("Pass");
+                passButton.setActionCommand("Pass");
+                passButton.addActionListener((ActionEvent e) -> {
+                    latch.countDown();
+                    f.dispose();
+                });
+                failButton = new JButton("Fail");
+                failButton.setActionCommand("Fail");
+                failButton.addActionListener(new ActionListener() {
+                    @Override
+                    public void actionPerformed(ActionEvent e) {
+                        latch.countDown();
+                        f.dispose();
+                        throw new RuntimeException("Test Failed");
+                    }
+                });
+                gbc.gridx = 1;
+                gbc.gridy = 0;
+                resultButtonPanel.add(passButton, gbc);
+                gbc.gridx = 2;
+                gbc.gridy = 0;
+                resultButtonPanel.add(failButton, gbc);
+
+                gbc.gridx = 0;
+                gbc.gridy = 1;
+                mainControlPanel.add(resultButtonPanel, gbc);
+
+                f.add(mainControlPanel);
+                f.setSize(400, 200);
+                f.setLocationRelativeTo(null);
+                f.setVisible(true);
+
+                f.addWindowListener(new WindowAdapter() {
+                    @Override
+                    public void windowClosing(WindowEvent e) {
+                        latch.countDown();
+                        f.dispose();
+                    }
+                });
+            }
+        });
+    }
+
+    public static void main(String[] args) throws Exception {
+        latch = new CountDownLatch(1);
+        createUI();
+        latch.await();
+    }
+}
+
--- a/jdk/test/java/awt/image/multiresolution/MultiResolutionJOptionPaneIconTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/image/multiresolution/MultiResolutionJOptionPaneIconTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
   @test
+  @key headful
   @bug 8150176 8150844
   @author a.stepanov
   @summary Check if correct resolution variant is used
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/print/PrinterJob/BannerTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -0,0 +1,160 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * 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 6575247
+ * @summary  Verifies if Banner page is printed
+ * @requires (os.family == "linux" | os.family == "solaris")
+ * @run main/manual BannerTest
+ */
+
+import java.awt.BorderLayout;
+import java.awt.FlowLayout;
+import java.awt.Graphics;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.awt.print.PageFormat;
+import java.awt.print.Printable;
+import static java.awt.print.Printable.NO_SUCH_PAGE;
+import static java.awt.print.Printable.PAGE_EXISTS;
+import java.awt.print.PrinterException;
+import java.awt.print.PrinterJob;
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JPanel;
+import javax.swing.JTextArea;
+import javax.swing.SwingUtilities;
+
+
+public class BannerTest implements Printable {
+    private static Thread mainThread;
+    private static boolean testPassed;
+    private static boolean testGeneratedInterrupt;
+
+    public static void main(String[] args)  throws Exception {
+        SwingUtilities.invokeAndWait(() -> {
+            doTest(BannerTest::printTest);
+        });
+        mainThread = Thread.currentThread();
+        try {
+            Thread.sleep(180000);
+        } catch (InterruptedException e) {
+            if (!testPassed && testGeneratedInterrupt) {
+                throw new RuntimeException("Banner page did not print");
+            }
+        }
+        if (!testGeneratedInterrupt) {
+            throw new RuntimeException("user has not executed the test");
+        }
+    }
+
+    private static void printTest() {
+        PrinterJob job = PrinterJob.getPrinterJob();
+        if (job.getPrintService() == null) {
+            System.out.println("No printers. Test cannot continue");
+            return;
+        }
+        job.setPrintable(new BannerTest());
+        if(job.printDialog()) {
+            try {
+                job.print();
+            } catch (PrinterException e) {
+                e.printStackTrace();
+                fail();
+            }
+        }
+    }
+
+    public static synchronized void pass() {
+        testPassed = true;
+        testGeneratedInterrupt = true;
+        mainThread.interrupt();
+    }
+
+    public static synchronized void fail() {
+        testPassed = false;
+        testGeneratedInterrupt = true;
+        mainThread.interrupt();
+    }
+
+    private static void doTest(Runnable action) {
+        String description
+                = " A print dialog will be shown.\n"
+                + " Click on the \"Appearance\" tab.\n "
+                + " Select the \"Banner page\" checkbox.\n"
+                + " Click on Print, and check if Banner page is printed.\n "
+                + " If Banner page is printed, press PASS else press FAIL";
+
+        final JDialog dialog = new JDialog();
+        dialog.setTitle("printBannerTest");
+        JTextArea textArea = new JTextArea(description);
+        textArea.setEditable(false);
+        final JButton testButton = new JButton("Start Test");
+        final JButton passButton = new JButton("PASS");
+        passButton.setEnabled(false);
+        passButton.addActionListener((e) -> {
+            dialog.dispose();
+            pass();
+        });
+        final JButton failButton = new JButton("FAIL");
+        failButton.setEnabled(false);
+        failButton.addActionListener((e) -> {
+            dialog.dispose();
+            fail();
+        });
+        testButton.addActionListener((e) -> {
+            testButton.setEnabled(false);
+            action.run();
+            passButton.setEnabled(true);
+            failButton.setEnabled(true);
+        });
+        JPanel mainPanel = new JPanel(new BorderLayout());
+        mainPanel.add(textArea, BorderLayout.CENTER);
+        JPanel buttonPanel = new JPanel(new FlowLayout());
+        buttonPanel.add(testButton);
+        buttonPanel.add(passButton);
+        buttonPanel.add(failButton);
+        mainPanel.add(buttonPanel, BorderLayout.SOUTH);
+        dialog.add(mainPanel);
+        dialog.pack();
+        dialog.setVisible(true);
+        dialog.addWindowListener(new WindowAdapter() {
+           @Override
+            public void windowClosing(WindowEvent e) {
+                System.out.println("main dialog closing");
+                testGeneratedInterrupt = false;
+                mainThread.interrupt();
+            }
+        });
+    }
+
+    @Override
+    public int print(Graphics g, PageFormat pf, int pi)
+            throws PrinterException {
+        System.out.println("pi = " + pi);
+        g.drawString("Testing", 100, 100);
+        if (pi == 1)
+            return NO_SUCH_PAGE;
+        return PAGE_EXISTS;
+    }
+}
--- a/jdk/test/java/awt/print/PrinterJob/LandscapeStackOverflow.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/java/awt/print/PrinterJob/LandscapeStackOverflow.java	Mon Aug 08 08:12:20 2016 -0700
@@ -22,6 +22,7 @@
  */
 /*
  * @test
+ * @key headful
  * @bug 6842011 8158758
  * @summary Test if StackOverflowError occurs during printing landscape with
  *          scale and transform.
--- a/jdk/test/javax/imageio/plugins/external_plugin_tests/TestClassPathPlugin.sh	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/imageio/plugins/external_plugin_tests/TestClassPathPlugin.sh	Mon Aug 08 08:12:20 2016 -0700
@@ -22,7 +22,7 @@
 #
 
 # @test
-# @bug 8081729
+# @bug 8081729 8140314
 # @summary Test external plugin as classpath jar and as a modular jar.
 #          Test both cases with and without a security manager.
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/imageio/plugins/jpeg/ReadAllThumbnailsTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -0,0 +1,126 @@
+/*
+ * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
+ * 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     4958271 8160943
+ * @summary This test verifies that ImageReader.readAll() method is able to read
+ *          all the thumbnails present in the input source without throwing any
+ *          exception while reading through Jpeg data.
+ * @run     main ReadAllThumbnailsTest
+ */
+
+import java.util.Iterator;
+import java.io.File;
+import javax.imageio.IIOImage;
+import javax.imageio.ImageIO;
+import javax.imageio.ImageReader;
+import javax.imageio.stream.ImageInputStream;
+
+public class ReadAllThumbnailsTest {
+
+    public ReadAllThumbnailsTest() {
+
+        try {
+            ImageReader reader = null;
+
+            String fileName = "thumbimg.jpg";
+            String sep = System.getProperty("file.separator");
+            String dir = System.getProperty("test.src", ".");
+            String filePath = dir+sep+fileName;
+            System.out.println("Test file: " + filePath);
+            File f = new File(filePath);
+
+            ImageInputStream iis = ImageIO.createImageInputStream(f);
+            Iterator readerIt = ImageIO.getImageReaders(iis);
+            if (readerIt.hasNext()) {
+                reader = (ImageReader) readerIt.next();
+            }
+
+            if (reader == null) {
+                error("FAIL: Reader is not available for reading a " +
+                      "JPG image with thumbnails. Test Aborted !!");
+            }
+
+            reader.setInput(iis);
+
+            if (!reader.readerSupportsThumbnails()) {
+                error("FAIL: JPG Reader fails to support thumbnails."
+                        + " Test aborted !!");
+            }
+
+            int numThumbnails = reader.getNumThumbnails(0);
+            if (numThumbnails <= 0) {
+                error(" FAIL: Reader.getNumThumbnails() returns 0 when the " +
+                      "input image contains some thumbnails");
+            }
+            IIOImage iioImg = reader.readAll(0, null);
+            int thumbnailsRead = iioImg.getNumThumbnails();
+
+            if (numThumbnails == thumbnailsRead) {
+                System.out.println("PASS: Thumbnails are read properly by"
+                        + " ImageReader.readAll(index, readParam) ");
+            } else {
+                error("FAIL: Some of the thumbnails are not read" +
+                      " from the input source when calling" +
+                      " ImageReader.readAll(index, readParam) ");
+            }
+
+            iis = ImageIO.createImageInputStream(f);
+            reader.setInput(iis);
+
+            iioImg = null;
+            Iterator imgIter = reader.readAll(null);
+            if (imgIter.hasNext()) {
+                iioImg = (IIOImage) imgIter.next();
+                thumbnailsRead = iioImg.getNumThumbnails();
+
+                if (numThumbnails == thumbnailsRead) {
+                    System.out.println("PASS: Thumbnails are read properly by"
+                            + " ImageReader.readAll(Iter)");
+                } else {
+                    error("FAIL: Some of the thumbnails are not read " +
+                          "from the input source when calling"
+                            + " ImageReader.readAll(Iter)");
+                }
+            } else {
+                error("FAIL: ImageReader.readAll(Iter) fails to read the image"
+                        + " & thumbnails from the input source");
+            }
+
+        } catch (Exception e) {
+            error(" FAIL: The following exception is thrown by " +
+                  "ImageReader.readAll() method when input source contains " +
+                  "some thumbnails. Exception: " + e.toString());
+        }
+
+    }
+
+    public final void error(String mesg) {
+        throw new RuntimeException(mesg);
+    }
+
+    public static void main(String args[]) {
+        ReadAllThumbnailsTest test = new ReadAllThumbnailsTest();
+    }
+}
Binary file jdk/test/javax/imageio/plugins/jpeg/thumbimg.jpg has changed
--- a/jdk/test/javax/imageio/plugins/tiff/MultiPageImageTIFFFieldTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/imageio/plugins/tiff/MultiPageImageTIFFFieldTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,7 +23,6 @@
 
 /**
  * @test
- * @ignore  8148454
  * @bug     8152183 8148454
  * @author  a.stepanov
  * @summary check that TIFFields are derived properly for multi-page tiff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/print/attribute/TestOrientationSupportForStreamPrnSrv.java	Mon Aug 08 08:12:20 2016 -0700
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * 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 4882305
+ * @summary  Verifies if StreamPrintServ.getSupportedAttributeValues returns
+ *           valid Orientation attribute and not null for image/jpeg DocFlavor.
+ * @run main TestOrientationSupportForStreamPrnSrv
+ */
+import java.io.File;
+import java.io.FileOutputStream;
+import javax.print.DocFlavor;
+import javax.print.PrintService;
+import javax.print.PrintServiceLookup;
+import javax.print.StreamPrintServiceFactory;
+import javax.print.attribute.standard.OrientationRequested;
+
+public class TestOrientationSupportForStreamPrnSrv {
+
+    public static void main(java.lang.String[] args) throws Exception {
+        PrintService service = null;
+        PrintService defService = PrintServiceLookup.lookupDefaultPrintService();
+        File f = null;
+        FileOutputStream fos = null;
+        String mType = "application/postscript";
+        DocFlavor flavors[] = null;
+
+        f = new File("streamexample1.ps");
+        fos = new FileOutputStream(f);
+        StreamPrintServiceFactory[] factories = StreamPrintServiceFactory.
+                lookupStreamPrintServiceFactories(DocFlavor.INPUT_STREAM.JPEG,
+                        mType);
+        if (factories.length > 0) {
+            System.out.println("output format "+factories[0].getOutputFormat());
+            service = factories[0].getPrintService(fos);
+            flavors = factories[0].getSupportedDocFlavors();
+        }
+        System.out.println("Stream Print Service "+service);
+
+        if (service == null) {
+            throw new RuntimeException("No Stream Print Service found");
+        }
+        System.out.println("is OrientationRequested supported? "+
+                service.isAttributeCategorySupported(OrientationRequested.class));
+
+        for (int k = 0; k < flavors.length; k ++) {
+            Object obj = service.getSupportedAttributeValues(OrientationRequested.class,
+                    flavors[k], null);
+            if (flavors[k].equals(DocFlavor.INPUT_STREAM.JPEG)) {
+                if (obj == null) {
+                    throw new RuntimeException(""
+                            + "StreamPrintServ.getSupportedAttributeValues "
+                            + "returns null for image/jpeg DocFlavor for "
+                            + "supported Orientation category");
+                }
+            }
+        }
+    }
+}
+
--- a/jdk/test/javax/swing/AbstractButton/6711682/bug6711682.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/AbstractButton/6711682/bug6711682.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,12 +21,14 @@
  * questions.
  */
 
-/* @test
-   @bug 6711682
-   @summary  JCheckBox in JTable: checkbox doesn't alaways respond to the first mouse click
-   @author Alexander Potochkin
-   @run main bug6711682
-*/
+/*
+ * @test
+ * @key headful
+ * @bug 6711682
+ * @summary  JCheckBox in JTable: checkbox doesn't alaways respond to the first mouse click
+ * @author Alexander Potochkin
+ * @run main bug6711682
+ */
 
 import javax.swing.*;
 import javax.swing.event.CellEditorListener;
--- a/jdk/test/javax/swing/Action/8133039/bug8133039.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/Action/8133039/bug8133039.java	Mon Aug 08 08:12:20 2016 -0700
@@ -35,6 +35,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 8133039
  * @summary Provide public API to sun.swing.UIAction#isEnabled(Object)
  * @modules java.desktop/sun.swing
--- a/jdk/test/javax/swing/AncestorNotifier/7193219/bug7193219.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/AncestorNotifier/7193219/bug7193219.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,11 +21,13 @@
  * questions.
  */
 
-/* @test
-   @bug 7193219
-   @summary JComboBox serialization fails in JDK 1.7
-   @author Anton Litvinov
-*/
+/*
+ * @test
+ * @key headful
+ * @bug 7193219
+ * @summary JComboBox serialization fails in JDK 1.7
+ * @author Anton Litvinov
+ */
 
 import java.io.*;
 
--- a/jdk/test/javax/swing/GroupLayout/8013566/bug8013566.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/GroupLayout/8013566/bug8013566.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,12 +21,14 @@
  * questions.
  */
 
-/* @test
-   @bug 8013566
-   @summary Failure of GroupLayout in combination of addPreferredGap and addGroup's
-   last row
-   @author Semyon Sadetsky
-*/
+/*
+ * @test
+ * @key headful
+ * @bug 8013566
+ * @summary Failure of GroupLayout in combination of addPreferredGap and addGroup's
+ * last row
+ * @author Semyon Sadetsky
+ */
 
 import javax.swing.*;
 
--- a/jdk/test/javax/swing/GroupLayout/8079640/bug8079640.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/GroupLayout/8079640/bug8079640.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,11 +21,13 @@
  * questions.
  */
 
-/* @test
-   @bug 8079640
-   @summary GroupLayout incorrect layout with large JTextArea
-   @author Semyon Sadetsky
-  */
+/*
+ * @test
+ * @key headful
+ * @bug 8079640
+ * @summary GroupLayout incorrect layout with large JTextArea
+ * @author Semyon Sadetsky
+ */
 
 
 import javax.swing.*;
--- a/jdk/test/javax/swing/InputVerifier/VerifyTarget/VerifyTargetTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/InputVerifier/VerifyTarget/VerifyTargetTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
   @test
+  @key headful
   @bug 8154431
   @summary Allow source and target based validation for the focus transfer
            between two JComponents.
@@ -90,4 +91,4 @@
     public void focusLost(FocusEvent e) {
         success = false;
     }
-}
\ No newline at end of file
+}
--- a/jdk/test/javax/swing/JButton/4368790/bug4368790.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JButton/4368790/bug4368790.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,12 +21,14 @@
  * questions.
  */
 
-/* @test
-   @bug 4368790
-   @summary JButton stays pressed when focus stolen
-   @author Alexander Potochkin
-   @run main bug4368790
-*/
+/*
+ * @test
+ * @key headful
+ *    @bug 4368790
+ *    @summary JButton stays pressed when focus stolen
+ *    @author Alexander Potochkin
+ *    @run main bug4368790
+ */
 
 import javax.swing.*;
 import java.awt.*;
--- a/jdk/test/javax/swing/JButton/JButtonPaintNPE/JButtonPaintNPE.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JButton/JButtonPaintNPE/JButtonPaintNPE.java	Mon Aug 08 08:12:20 2016 -0700
@@ -33,6 +33,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 8009919
  * @author Sergey Bylokhov
  * @library ../../../../lib/testlibrary/
--- a/jdk/test/javax/swing/JButton/PressedButtonRightClickTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JButton/PressedButtonRightClickTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -33,6 +33,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug  8049069
  * @summary Tests whether right mouse click releases a pressed JButton
  */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JButton/TimeChangeButtonClickTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -0,0 +1,220 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * 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 7096375
+ * @summary  Test that Swing does not ignore first click on a JButton after
+ * decreasing system's time
+ * @run main/manual TimeChangeButtonClickTest
+ */
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.util.concurrent.CountDownLatch;
+import javax.swing.BorderFactory;
+import javax.swing.JPanel;
+import javax.swing.JTextArea;
+import javax.swing.SwingUtilities;
+import javax.swing.JButton;
+import javax.swing.JFrame;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.concurrent.TimeUnit;
+import javax.swing.Box;
+import javax.swing.JLabel;
+
+public class TimeChangeButtonClickTest {
+
+    public static void main(String args[]) throws Exception {
+        final CountDownLatch latch = new CountDownLatch(1);
+        TestUI test = new TestUI(latch);
+
+        SwingUtilities.invokeLater(new Runnable() {
+            @Override
+            public void run() {
+                try {
+                    test.createUI();
+                } catch (Exception ex) {
+                    throw new RuntimeException("Exception while creating test UI");
+                }
+            }
+        });
+
+        boolean status = latch.await(5, TimeUnit.MINUTES);
+
+        if (!status) {
+            System.out.println("Test timed out.");
+        }
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                try {
+                    test.disposeUI();
+                } catch (Exception ex) {
+                    throw new RuntimeException("Exception while disposing test UI");
+                }
+            }
+        });
+
+        if (test.testResult == false) {
+            throw new RuntimeException("Test Failed.");
+        }
+    }
+}
+
+class TestUI {
+
+    private static JFrame mainFrame;
+    private static JPanel mainControlPanel;
+
+    private static JTextArea instructionTextArea;
+
+    private static JPanel resultButtonPanel;
+    private static JButton passButton;
+    private static JButton failButton;
+
+    private static JPanel testPanel;
+    private static JButton testButton;
+    private static JLabel buttonPressCountLabel;
+
+    private static GridBagLayout layout;
+    private final CountDownLatch latch;
+    public boolean testResult = false;
+    private int buttonPressCount = 0;
+
+    public TestUI(CountDownLatch latch) throws Exception {
+        this.latch = latch;
+    }
+
+    public final void createUI() throws Exception {
+
+        mainFrame = new JFrame("TimeChangeButtonClickTest");
+
+        layout = new GridBagLayout();
+        mainControlPanel = new JPanel(layout);
+        resultButtonPanel = new JPanel(layout);
+        testPanel = new JPanel(layout);
+
+        GridBagConstraints gbc = new GridBagConstraints();
+
+        // Create Test instructions
+        String instructions
+                = "Test 1 : --------------------\n"
+                + "1. Click 'Test Button' with left mouse button\n"
+                + "Observe : Button Press count change to 1\n"
+                + "Test 2 : --------------------\n"
+                + "1. Change the system time to one hour less than current time\n"
+                + "2. Click 'Test Button' with left mouse button\n"
+                + "Observe : Button Press count change to 2\n"
+                + "Test 3 : --------------------\n"
+                + "1. Change the system time by adding two hours\n"
+                + "2. Click 'Test Button' with left mouse button\n"
+                + "Observe : Button Press count change to 3\n"
+                + "--------------------\n"
+                + "Restore the system time.\n"
+                + "--------------------\n"
+                + "Press 'Pass' if Button Press count is 3, 'Fail' otherwise";
+
+        instructionTextArea = new JTextArea();
+        instructionTextArea.setText(instructions);
+        instructionTextArea.setEditable(false);
+        instructionTextArea.setBorder(BorderFactory.
+                createTitledBorder("Test Instructions"));
+
+        gbc.gridx = 0;
+        gbc.gridy = 0;
+        gbc.fill = GridBagConstraints.HORIZONTAL;
+        mainControlPanel.add(instructionTextArea, gbc);
+
+        // Create Test Button and label
+        testButton = new JButton("Test Button");
+        testButton.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                buttonPressCount++;
+                buttonPressCountLabel.setText(
+                        "Button Press Count : " + buttonPressCount);
+            }
+        });
+
+        gbc.gridx = 0;
+        gbc.gridy = 0;
+        testPanel.add(testButton, gbc);
+
+        gbc.gridx = 0;
+        gbc.gridy = 1;
+        testPanel.add(Box.createVerticalStrut(50));
+
+        gbc.gridx = 0;
+        gbc.gridy = 2;
+        buttonPressCountLabel = new JLabel(
+                "Button Press Count : " + buttonPressCount);
+        testPanel.add(buttonPressCountLabel, gbc);
+
+        mainControlPanel.add(testPanel);
+
+        // Create resultButtonPanel with Pass, Fail buttons
+        passButton = new JButton("Pass");
+        passButton.setActionCommand("Pass");
+        passButton.addActionListener((ActionEvent e) -> {
+            System.out.println("Pass Button pressed!");
+            testResult = true;
+            latch.countDown();
+
+        });
+
+        failButton = new JButton("Fail");
+        failButton.setActionCommand("Fail");
+        failButton.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                System.out.println("Fail Button pressed!");
+                testResult = false;
+                latch.countDown();
+            }
+        });
+
+        gbc.gridx = 0;
+        gbc.gridy = 0;
+        resultButtonPanel.add(passButton, gbc);
+        gbc.gridx = 1;
+        gbc.gridy = 0;
+        resultButtonPanel.add(failButton, gbc);
+
+        gbc.gridx = 0;
+        gbc.gridy = 1;
+        mainControlPanel.add(resultButtonPanel, gbc);
+
+        mainFrame.add(mainControlPanel);
+
+        mainFrame.pack();
+        mainFrame.setVisible(true);
+    }
+
+    public void disposeUI() {
+        mainFrame.setVisible(false);
+        mainFrame.dispose();
+    }
+}
+
--- a/jdk/test/javax/swing/JColorChooser/Test6541987.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JColorChooser/Test6541987.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 6541987
  * @summary Tests closing by ESC
  * @author Sergey Malenkov
--- a/jdk/test/javax/swing/JColorChooser/Test6559154.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JColorChooser/Test6559154.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 6559154
  * @summary Tests EDT hanging
  * @author Sergey Malenkov
--- a/jdk/test/javax/swing/JColorChooser/Test6827032.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JColorChooser/Test6827032.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 6827032
  * @summary Color chooser with drag enabled shouldn't throw NPE
  * @author Peter Zhelezniakov
--- a/jdk/test/javax/swing/JColorChooser/Test7194184.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JColorChooser/Test7194184.java	Mon Aug 08 08:12:20 2016 -0700
@@ -27,6 +27,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 7194184
  * @summary Tests JColorChooser Swatch keyboard accessibility.
  * @author Sean Chou
--- a/jdk/test/javax/swing/JColorChooser/Test8051548.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JColorChooser/Test8051548.java	Mon Aug 08 08:12:20 2016 -0700
@@ -37,6 +37,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8051548
  * @summary JColorChooser should have a way to disable transparency controls
  * @author Alexandr Scherbatiy
--- a/jdk/test/javax/swing/JComboBox/4199622/bug4199622.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JComboBox/4199622/bug4199622.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,7 +21,9 @@
  * questions.
  */
 
-/* @test
+/*
+   @test
+   @key headful
    @bug 4199622
    @summary RFE: JComboBox shouldn't send ActionEvents for keyboard navigation
    @author Vladislav Karnaukhov
@@ -29,7 +31,7 @@
    @modules java.desktop/com.sun.java.swing.plaf.windows
    @build jdk.testlibrary.OSInfo
    @run main bug4199622
-*/
+ */
 
 import com.sun.java.swing.plaf.windows.WindowsLookAndFeel;
 import jdk.testlibrary.OSInfo;
--- a/jdk/test/javax/swing/JComboBox/4515752/DefaultButtonTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JComboBox/4515752/DefaultButtonTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -27,6 +27,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 4515752 4337071
  * @author Mark Davidson
  * @summary Tests the invocation of the default button within the JComboBox.
--- a/jdk/test/javax/swing/JComboBox/4523758/bug4523758.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JComboBox/4523758/bug4523758.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,7 +21,9 @@
  * questions.
  */
 
-/* @test
+/*
+ * @test
+ * @key headful
  * @bug 4523758
  * @summary Directly check that torn-off combo works
  * @library ../../../../lib/testlibrary
--- a/jdk/test/javax/swing/JComboBox/4743225/bug4743225.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JComboBox/4743225/bug4743225.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,7 +21,9 @@
  * questions.
  */
 
-/* @test
+/*
+ * @test
+ * @key headful
  * @bug 4743225
  * @summary Size of JComboBox list is wrong when list is populated via PopupMenuListener
  * @author Alexander Potochkin
--- a/jdk/test/javax/swing/JComboBox/6236162/bug6236162.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JComboBox/6236162/bug6236162.java	Mon Aug 08 08:12:20 2016 -0700
@@ -20,16 +20,19 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
-/* @test
-   @bug 6236162
-   @summary Checks that there is no an inconsistence in combo box
-            behavior when user points an item in combo popup
-            by mouse and then uses UP/DOWN keys.
-   @library ../../regtesthelpers
-   @build Util
-   @author Mikhail Lapshin
-   @run main bug6236162
-*/
+
+/*
+ * @test
+ * @key headful
+ * @bug 6236162
+ * @summary Checks that there is no an inconsistence in combo box
+ *          behavior when user points an item in combo popup
+ *          by mouse and then uses UP/DOWN keys.
+ * @library ../../regtesthelpers
+ * @build Util
+ * @author Mikhail Lapshin
+ * @run main bug6236162
+ */
 
 import javax.swing.*;
 import javax.swing.plaf.basic.*;
--- a/jdk/test/javax/swing/JComboBox/6406264/bug6406264.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JComboBox/6406264/bug6406264.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,11 +23,13 @@
  * questions.
  */
 
-/* @test
-   @bug 6406264
-   @summary Tests that JComboBox's focusable popup can be shown.
-   @author Mikhail Lapshin
-   @run main bug6406264
+/*
+ * @test
+ * @key headful
+ * @bug 6406264
+ * @summary Tests that JComboBox's focusable popup can be shown.
+ * @author Mikhail Lapshin
+ * @run main bug6406264
  */
 
 import javax.swing.JComboBox;
--- a/jdk/test/javax/swing/JComboBox/6559152/bug6559152.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JComboBox/6559152/bug6559152.java	Mon Aug 08 08:12:20 2016 -0700
@@ -20,15 +20,18 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
-/* @test
-   @bug 6559152
-   @summary Checks that you can select an item in JComboBox with keyboard
-            when it is a JTable cell editor.
-   @author Mikhail Lapshin
-   @library ../../../../lib/testlibrary
-   @build ExtendedRobot
-   @run main bug6559152
-*/
+
+/*
+ * @test
+ * @key headful
+ * @bug 6559152
+ * @summary Checks that you can select an item in JComboBox with keyboard
+ *          when it is a JTable cell editor.
+ * @author Mikhail Lapshin
+ * @library ../../../../lib/testlibrary
+ * @build ExtendedRobot
+ * @run main bug6559152
+ */
 
 import javax.swing.*;
 import javax.swing.table.DefaultTableModel;
--- a/jdk/test/javax/swing/JComboBox/6607130/bug6607130.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JComboBox/6607130/bug6607130.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,7 +21,9 @@
  * questions.
  */
 
-/* @test
+/*
+ * @test
+ * @key headful
  * @bug 6607130
  * @summary Checks that JComboBox cell editor is hidden if the same
  *          item is selected with keyboard.
--- a/jdk/test/javax/swing/JComboBox/7195179/Test7195179.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JComboBox/7195179/Test7195179.java	Mon Aug 08 08:12:20 2016 -0700
@@ -35,6 +35,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 7195179
  * @summary Tests that combobox works with generified renderers
  * @author Sergey Malenkov
--- a/jdk/test/javax/swing/JComboBox/8015300/Test8015300.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JComboBox/8015300/Test8015300.java	Mon Aug 08 08:12:20 2016 -0700
@@ -37,8 +37,9 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8015300
- * @summary Tests that editable combobox select all text
+ * @summary Tests that editable combobox selects all text.
  * @author Sergey Malenkov
  * @library ../../../../lib/testlibrary/
  * @modules java.desktop/com.sun.java.swing.plaf.windows
--- a/jdk/test/javax/swing/JComboBox/8032878/bug8032878.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JComboBox/8032878/bug8032878.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,7 +21,9 @@
  * questions.
  */
 
-/* @test
+/*
+ * @test
+ * @key headful
  * @bug 8032878 8078855
  * @summary Checks that JComboBox as JTable cell editor processes key events
  *          even where setSurrendersFocusOnKeystroke flag in JTable is false and
--- a/jdk/test/javax/swing/JComboBox/8033069/bug8033069NoScrollBar.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JComboBox/8033069/bug8033069NoScrollBar.java	Mon Aug 08 08:12:20 2016 -0700
@@ -35,7 +35,9 @@
 import javax.swing.UIManager.LookAndFeelInfo;
 import javax.swing.UnsupportedLookAndFeelException;
 
-/* @test
+/*
+ * @test
+ * @key headful
  * @bug 8033069
  * @summary Checks that JComboBox popup does not close when mouse wheel is
  *          rotated over combo box and over its popup. The case where popup
--- a/jdk/test/javax/swing/JComboBox/8033069/bug8033069ScrollBar.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JComboBox/8033069/bug8033069ScrollBar.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,7 +23,9 @@
 
 import java.awt.AWTException;
 
-/* @test
+/*
+ * @test
+ * @key headful
  * @bug 8033069
  * @summary Checks that JComboBox popup does not close when mouse wheel is
  *          rotated over combo box and over its popup. The case where
--- a/jdk/test/javax/swing/JComboBox/8057893/bug8057893.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JComboBox/8057893/bug8057893.java	Mon Aug 08 08:12:20 2016 -0700
@@ -33,6 +33,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 8057893
  * @author Alexander Scherbatiy
  * @summary JComboBox actionListener never receives "comboBoxEdited"
--- a/jdk/test/javax/swing/JComboBox/8072767/bug8072767.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JComboBox/8072767/bug8072767.java	Mon Aug 08 08:12:20 2016 -0700
@@ -37,6 +37,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 8072767
  * @author Alexander Scherbatiy
  * @summary DefaultCellEditor for comboBox creates ActionEvent with wrong source
--- a/jdk/test/javax/swing/JComboBox/8136998/bug8136998.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JComboBox/8136998/bug8136998.java	Mon Aug 08 08:12:20 2016 -0700
@@ -38,7 +38,9 @@
 import javax.swing.UnsupportedLookAndFeelException;
 import javax.swing.WindowConstants;
 
-/* @test
+/*
+ * @test
+ * @key headful
  * @bug 8136998
  * @summary Checks that JComboBox does not prevent mouse-wheel scrolling JScrollPane.
  * @library ../../regtesthelpers
--- a/jdk/test/javax/swing/JComboBox/ConsumedKeyTest/ConsumedKeyTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JComboBox/ConsumedKeyTest/ConsumedKeyTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -27,6 +27,7 @@
 
 /*
   @test
+  @key headful
   @bug 8031485 8058193
   @summary Combo box consuming escape and enter key events
   @author Petr Pchelko
--- a/jdk/test/javax/swing/JComboBox/ShowPopupAfterHidePopupTest/ShowPopupAfterHidePopupTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JComboBox/ShowPopupAfterHidePopupTest/ShowPopupAfterHidePopupTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,12 +21,14 @@
  * questions.
  */
 
-/* @test
-   @bug 8006417
-   @summary JComboBox.showPopup(), hidePopup() fails in JRE 1.7 on OS X
-   @author Anton Litvinov
-   @run main ShowPopupAfterHidePopupTest
-*/
+/*
+ * @test
+ * @key headful
+ * @bug 8006417
+ * @summary JComboBox.showPopup(), hidePopup() fails in JRE 1.7 on OS X
+ * @author Anton Litvinov
+ * @run main ShowPopupAfterHidePopupTest
+ */
 
 import java.awt.*;
 
--- a/jdk/test/javax/swing/JComponent/6989617/bug6989617.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JComponent/6989617/bug6989617.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,12 +21,14 @@
  * questions.
  */
 
-/* @test
-   @bug 6989617
-   @summary Enable JComponent to control repaintings of its children
-   @author Alexander Potochkin
-   @run main bug6989617
-*/
+/*
+ * @test
+ * @key headful
+ * @bug 6989617
+ * @summary Enable JComponent to control repaintings of its children
+ * @author Alexander Potochkin
+ * @run main bug6989617
+ */
 
 import javax.swing.*;
 import java.awt.*;
--- a/jdk/test/javax/swing/JComponent/7154030/bug7154030.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JComponent/7154030/bug7154030.java	Mon Aug 08 08:12:20 2016 -0700
@@ -40,7 +40,9 @@
 import java.awt.Toolkit;
 import java.awt.image.BufferedImage;
 
-/* @test 1.1 2012/04/12
+/*
+ * @test
+ * @key headful
  * @bug 7154030
  * @summary Swing components fail to hide after calling hide()
  * @author Jonathan Lu
--- a/jdk/test/javax/swing/JDialog/Transparency/TransparencyTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JDialog/Transparency/TransparencyTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
  /*
  @test
+ @key headful
  @bug 8062946
  @summary Verify Transparency upon iconify/deiconify sequence
  @run main TransparencyTest
--- a/jdk/test/javax/swing/JDialog/WrongBackgroundColor/WrongBackgroundColor.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JDialog/WrongBackgroundColor/WrongBackgroundColor.java	Mon Aug 08 08:12:20 2016 -0700
@@ -33,6 +33,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 8033786
  * @summary JDialog should update background color of the native peer.
  * @author Sergey Bylokhov
--- a/jdk/test/javax/swing/JEditorPane/4492274/bug4492274.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JEditorPane/4492274/bug4492274.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,7 +21,9 @@
  * questions.
  */
 
-/* @test
+/*
+ * @test
+ * @key headful
  * @bug 4492274
  * @summary  Tests if JEditorPane.getPage() correctly returns anchor reference.
  * @author Denis Sharypov
--- a/jdk/test/javax/swing/JEditorPane/6917744/bug6917744.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JEditorPane/6917744/bug6917744.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,7 +21,9 @@
  * questions.
  */
 
-/* @test
+/*
+ * @test
+ * @key headful
  * @bug 6917744
  * @summary JScrollPane Page Up/Down keys do not handle correctly html tables with different cells contents
  * @author Pavel Porvatov
--- a/jdk/test/javax/swing/JEditorPane/8146319/JEditorPaneTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JEditorPane/8146319/JEditorPaneTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8146319
  * @summary JEditorPane function setPage leaves a file lock
  * @run main JEditorPaneTest
--- a/jdk/test/javax/swing/JFileChooser/4524490/bug4524490.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JFileChooser/4524490/bug4524490.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 4524490
  * @summary Tests if in JFileChooser, ALT+L does not bring focus to 'Files' selection list in Motif LAF
  * @author Konstantin Eremin
--- a/jdk/test/javax/swing/JFileChooser/6396844/TwentyThousandTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JFileChooser/6396844/TwentyThousandTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 6396844
  * @summary Tests memory leak for 20000 files
  * @author Sergey Malenkov
--- a/jdk/test/javax/swing/JFileChooser/7199708/bug7199708.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JFileChooser/7199708/bug7199708.java	Mon Aug 08 08:12:20 2016 -0700
@@ -40,6 +40,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 7199708 8159587
  * @author Alexander Scherbatiy
  * @summary FileChooser crashs when opening large folder
--- a/jdk/test/javax/swing/JFileChooser/8002077/bug8002077.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JFileChooser/8002077/bug8002077.java	Mon Aug 08 08:12:20 2016 -0700
@@ -30,6 +30,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 8002077
  * @author Alexander Scherbatiy
  * @summary Possible mnemonic issue on JFileChooser Save button on nimbus L&F
--- a/jdk/test/javax/swing/JFileChooser/8016665/JFileChooserOrientation.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JFileChooser/8016665/JFileChooserOrientation.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,7 +21,9 @@
  * questions.
  */
 
-/* @test
+/*
+ * @test
+ * @key headful
  * @bug 8016665
  * @summary verifies different behaviour of JFileChooser changing orientation
  * @run main JFileChooserOrientation
--- a/jdk/test/javax/swing/JFileChooser/8021253/bug8021253.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JFileChooser/8021253/bug8021253.java	Mon Aug 08 08:12:20 2016 -0700
@@ -35,6 +35,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 8021253
  * @author Alexander Scherbatiy
  * @summary JFileChooser does not react on pressing enter since java 7
--- a/jdk/test/javax/swing/JFileChooser/8041694/bug8041694.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JFileChooser/8041694/bug8041694.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,13 +21,15 @@
  * questions.
  */
 
-/* @test
-   @bug 8041694
-   @summary JFileChooser removes trailing spaces in the selected directory name
-   @author Anton Litvinov
-   @library ../../../../lib/testlibrary
-   @build jdk.testlibrary.OSInfo
-   @run main bug8041694
+/*
+ * @test
+ * @key headful
+ * @bug 8041694
+ * @summary JFileChooser removes trailing spaces in the selected directory name
+ * @author Anton Litvinov
+ * @library ../../../../lib/testlibrary
+ * @build jdk.testlibrary.OSInfo
+ * @run main bug8041694
  */
 
 import java.awt.AWTException;
--- a/jdk/test/javax/swing/JFileChooser/DeserializedJFileChooser/DeserializedJFileChooserTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JFileChooser/DeserializedJFileChooser/DeserializedJFileChooserTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 8146301
  * @summary Enter key does not work in a deserialized JFileChooser.
  * @run main DeserializedJFileChooserTest
--- a/jdk/test/javax/swing/JFrame/HangNonVolatileBuffer/HangNonVolatileBuffer.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JFrame/HangNonVolatileBuffer/HangNonVolatileBuffer.java	Mon Aug 08 08:12:20 2016 -0700
@@ -28,6 +28,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 8029455
  * @summary Swing should not hang if non-volatile image is used as a backbuffer.
  * @run main/othervm -Dswing.volatileImageBufferEnabled=false HangNonVolatileBuffer
--- a/jdk/test/javax/swing/JInternalFrame/4769772/TestJInternalFrameIconify.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JInternalFrame/4769772/TestJInternalFrameIconify.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 4769772
  * @summary JInternalFrame.setIcon(true) before JDesktopPane.add(JIF) causes wrong state
  * @run main TestJInternalFrameIconify
--- a/jdk/test/javax/swing/JInternalFrame/5066752/bug5066752.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JInternalFrame/5066752/bug5066752.java	Mon Aug 08 08:12:20 2016 -0700
@@ -22,6 +22,7 @@
  */
 /*
   @test
+  @key headful
   @bug 5066752
   @summary  Transparent JDesktopPane impossible because isOpaque() returns true
   @author mb50250: area=JDesktopPane
--- a/jdk/test/javax/swing/JInternalFrame/6647340/bug6647340.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JInternalFrame/6647340/bug6647340.java	Mon Aug 08 08:12:20 2016 -0700
@@ -22,6 +22,7 @@
  */
 
 /* @test
+ * @key headful
  * @bug 6647340
  * @summary Checks that iconified internal frame follows
  *          the main frame borders properly.
--- a/jdk/test/javax/swing/JInternalFrame/6725409/bug6725409.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JInternalFrame/6725409/bug6725409.java	Mon Aug 08 08:12:20 2016 -0700
@@ -22,6 +22,7 @@
  */
 
 /* @test
+ * @key headful
  * @bug 6725409
  * @summary Checks that JInternalFrame's system menu
  *          can be localized during run-time
--- a/jdk/test/javax/swing/JInternalFrame/8020708/bug8020708.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JInternalFrame/8020708/bug8020708.java	Mon Aug 08 08:12:20 2016 -0700
@@ -35,6 +35,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 8020708 8032568
  * @author Alexander Scherbatiy
  * @summary NLS: mnemonics missing in SwingSet2/JInternalFrame demo
--- a/jdk/test/javax/swing/JInternalFrame/8069348/bug8069348.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JInternalFrame/8069348/bug8069348.java	Mon Aug 08 08:12:20 2016 -0700
@@ -36,6 +36,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 8069348
  * @summary SunGraphics2D.copyArea() does not properly work for scaled graphics
  * @author Alexandr Scherbatiy
--- a/jdk/test/javax/swing/JInternalFrame/8145896/TestJInternalFrameMaximize.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JInternalFrame/8145896/TestJInternalFrameMaximize.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8145896
  * @summary JInternalFrame setMaximum before adding to desktop throws null pointer exception
  * @library ../../regtesthelpers
--- a/jdk/test/javax/swing/JInternalFrame/8146321/JInternalFrameIconTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JInternalFrame/8146321/JInternalFrameIconTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,7 +21,9 @@
  * questions.
  */
 
-/* @test
+/*
+ * @test
+ * @key headful
  * @bug 8146321 8151282
  * @summary verifies JInternalFrame Icon and ImageIcon
  * @library ../../regtesthelpers
--- a/jdk/test/javax/swing/JInternalFrame/InternalFrameIsNotCollectedTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JInternalFrame/InternalFrameIsNotCollectedTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,11 +21,13 @@
  * questions.
  */
 
- /* @test
-    @bug 8012004
-    @summary JINTERNALFRAME NOT BEING FINALIZED AFTER CLOSING
-    @author mcherkas
-    @run main InternalFrameIsNotCollectedTest
+/*
+ * @test
+ * @key headful
+ * @bug 8012004
+ * @summary JINTERNALFRAME NOT BEING FINALIZED AFTER CLOSING
+ * @author mcherkas
+ * @run main InternalFrameIsNotCollectedTest
  */
 import javax.swing.*;
 import java.awt.*;
--- a/jdk/test/javax/swing/JInternalFrame/NormalBoundsTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JInternalFrame/NormalBoundsTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
  /*
  @test
+ @key headful
  @bug 7126823
  @summary Verify NormalBounds upon iconify/deiconify sequence
  @run main NormalBoundsTest
--- a/jdk/test/javax/swing/JInternalFrame/Test6505027.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JInternalFrame/Test6505027.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 6505027
  * @summary Tests focus problem inside internal frame
  * @author Sergey Malenkov
--- a/jdk/test/javax/swing/JInternalFrame/Test6802868.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JInternalFrame/Test6802868.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 6802868
  * @summary JInternalFrame is not maximized when maximized parent frame
  * @author Alexander Potochkin
--- a/jdk/test/javax/swing/JLabel/6596966/bug6596966.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JLabel/6596966/bug6596966.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,15 +21,17 @@
  * questions.
  */
 
-/* @test
-   @bug 6596966
-   @summary Some JFileChooser mnemonics do not work with sticky keys
-   @library ../../regtesthelpers
-   @library ../../../../lib/testlibrary
-   @build Util jdk.testlibrary.OSInfo
-   @run main bug6596966
-   @author Pavel Porvatov
-*/
+/*
+ * @test
+ * @key headful
+ * @bug 6596966
+ * @summary Some JFileChooser mnemonics do not work with sticky keys
+ * @library ../../regtesthelpers
+ * @library ../../../../lib/testlibrary
+ * @build Util jdk.testlibrary.OSInfo
+ * @run main bug6596966
+ * @author Pavel Porvatov
+ */
 
 import java.awt.*;
 import java.awt.event.KeyEvent;
--- a/jdk/test/javax/swing/JLabel/7004134/bug7004134.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JLabel/7004134/bug7004134.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,12 +21,14 @@
  * questions.
  */
 
-/* @test
-   @bug 7004134
-   @summary JLabel containing a ToolTipText does no longer show ToolTip after browser refresh
-   @author Pavel Porvatov
-   @modules java.desktop/sun.awt
-*/
+/*
+ * @test
+ * @key headful
+ * @bug 7004134
+ * @summary JLabel containing a ToolTipText does no longer show ToolTip after browser refresh
+ * @author Pavel Porvatov
+ * @modules java.desktop/sun.awt
+ */
 
 import sun.awt.SunToolkit;
 
--- a/jdk/test/javax/swing/JLayer/6824395/bug6824395.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JLayer/6824395/bug6824395.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
  /*
  * @test
+ * @key headful
  * @summary Checks that JLayer inside JViewport works is correctly laid out
  * @author Alexander Potochkin
  * @library ../../../../lib/testlibrary/
--- a/jdk/test/javax/swing/JLayer/6872503/bug6872503.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JLayer/6872503/bug6872503.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,7 +21,9 @@
  * questions.
  */
 
-/* @test
+/*
+ * @test
+ * @key headful
  * @bug 6872503
  * @summary Checks that JLayer correctly works with its AWTEventListener
  * @author Alexander Potochkin
--- a/jdk/test/javax/swing/JList/6462008/bug6462008.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JList/6462008/bug6462008.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 6462008
  * @summary Tests that mouse/keyboard work properly on JList with lead < 0 or > list.getModel().getSize()
  * @author Shannon Hickey
--- a/jdk/test/javax/swing/JList/6510999/bug6510999.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JList/6510999/bug6510999.java	Mon Aug 08 08:12:20 2016 -0700
@@ -20,12 +20,14 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
-/* @test
-   @bug 6510999
-   @summary Selection in a JList with both scrollbars visible jumps on arrowkey-down
-   @author Alexander Potochkin
-   @run main bug6510999
-*/
+/*
+ * @test
+ * @key headful
+ * @bug 6510999
+ * @summary Selection in a JList with both scrollbars visible jumps on arrowkey-down
+ * @author Alexander Potochkin
+ * @run main bug6510999
+ */
 
 import javax.swing.*;
 import java.awt.*;
--- a/jdk/test/javax/swing/JMenu/4213634/bug4213634.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JMenu/4213634/bug4213634.java	Mon Aug 08 08:12:20 2016 -0700
@@ -35,7 +35,9 @@
 import javax.swing.JTextArea;
 import javax.swing.SwingUtilities;
 
-/* @test
+/*
+ * @test
+ * @key headful
  * @bug 4213634 8017187
  * @author Scott Violet
  * @library ../../regtesthelpers
--- a/jdk/test/javax/swing/JMenu/4417601/bug4417601.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JMenu/4417601/bug4417601.java	Mon Aug 08 08:12:20 2016 -0700
@@ -20,14 +20,17 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
-/* @test
-   @bug 4417601
-   @summary JMenus with no items paint a tiny menu.
-   @author Alexander Potochkin
-   @library ../../../../lib/testlibrary
-   @build ExtendedRobot
-   @run main bug4417601
-*/
+
+/*
+ * @test
+ * @key headful
+ * @bug 4417601
+ * @summary JMenus with no items paint a tiny menu.
+ * @author Alexander Potochkin
+ * @library ../../../../lib/testlibrary
+ * @build ExtendedRobot
+ * @run main bug4417601
+ */
 
 import javax.swing.*;
 import java.awt.event.*;
--- a/jdk/test/javax/swing/JMenu/4515762/bug4515762.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JMenu/4515762/bug4515762.java	Mon Aug 08 08:12:20 2016 -0700
@@ -27,6 +27,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 4515762
  * @author Mark Davidson
  * @summary Tests the ability to support duplicate mnemonics
--- a/jdk/test/javax/swing/JMenu/4692443/bug4692443.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JMenu/4692443/bug4692443.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @library ../../regtesthelpers
  * @build Util
  * @bug 4692443 7105030
--- a/jdk/test/javax/swing/JMenu/6359669/bug6359669.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JMenu/6359669/bug6359669.java	Mon Aug 08 08:12:20 2016 -0700
@@ -20,14 +20,16 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
-/* @test
-   @bug 6359669
-   @summary REGRESSION: Submenu does not work if populated in PopupMenuListener.popupMenuWillBecomeVisible
-   @author Alexander Potochkin
-   @library ../../../../lib/testlibrary
-   @build ExtendedRobot
-   @run main bug6359669
-*/
+/*
+ * @test
+ * @key headful
+ * @bug 6359669
+ * @summary REGRESSION: Submenu does not work if populated in PopupMenuListener.popupMenuWillBecomeVisible
+ * @author Alexander Potochkin
+ * @library ../../../../lib/testlibrary
+ * @build ExtendedRobot
+ * @run main bug6359669
+ */
 
 import javax.swing.*;
 import javax.swing.event.PopupMenuListener;
--- a/jdk/test/javax/swing/JMenu/6470128/bug6470128.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JMenu/6470128/bug6470128.java	Mon Aug 08 08:12:20 2016 -0700
@@ -20,14 +20,18 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
-/* @test
-   @bug 6470128
-   @summary Escape Key causes JMenu Selection to Disappear
-   @author Alexander Potochkin
-   @library ../../../../lib/testlibrary
-   @build jdk.testlibrary.OSInfo
-   @run main bug6470128
-*/
+
+/*
+ * @test
+ * @key headful
+ * @bug 6470128
+ * @summary Escape Key causes JMenu Selection to Disappear
+ * @author Alexander Potochkin
+ * @library ../../../../lib/testlibrary
+ * @build jdk.testlibrary.OSInfo
+ * @run main bug6470128
+ */
+
 import javax.swing.*;
 import java.awt.*;
 import java.awt.event.KeyEvent;
--- a/jdk/test/javax/swing/JMenu/8072900/WrongSelectionOnMouseOver.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JMenu/8072900/WrongSelectionOnMouseOver.java	Mon Aug 08 08:12:20 2016 -0700
@@ -22,12 +22,13 @@
  */
 
 /*
-@test
-@bug 8072900
-@summary Mouse events are captured by the wrong menu in OS X
-@author Anton Nashatyrev
-@run main WrongSelectionOnMouseOver
-*/
+ * @test
+ * @key headful
+ * @bug 8072900
+ * @summary Mouse events are captured by the wrong menu in OS X
+ * @author Anton Nashatyrev
+ * @run main WrongSelectionOnMouseOver
+ */
 
 import javax.swing.*;
 import javax.swing.event.MenuEvent;
--- a/jdk/test/javax/swing/JMenuBar/4750590/bug4750590.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JMenuBar/4750590/bug4750590.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,13 +21,15 @@
  * questions.
  */
 
-/* @test
- @library ../../regtesthelpers
- @build Util
- @bug 4750590 8015597
- @summary SwingSet: Cannot change Themes using menu accelerators
- @author Alexander Zuev
- @run main bug4750590
+/*
+ * @test
+ * @key headful
+ * @library ../../regtesthelpers
+ * @build Util
+ * @bug 4750590 8015597
+ * @summary SwingSet: Cannot change Themes using menu accelerators
+ * @author Alexander Zuev
+ * @run main bug4750590
  */
 
 import javax.swing.*;
--- a/jdk/test/javax/swing/JMenuBar/MisplacedBorder/MisplacedBorder.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JMenuBar/MisplacedBorder/MisplacedBorder.java	Mon Aug 08 08:12:20 2016 -0700
@@ -40,6 +40,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 8073795
  * @summary JMenuBar has incorrect border when the window is on retina display.
  * @author Sergey Bylokhov
--- a/jdk/test/javax/swing/JMenuItem/4171437/bug4171437.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JMenuItem/4171437/bug4171437.java	Mon Aug 08 08:12:20 2016 -0700
@@ -20,13 +20,17 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
-/* @test
-   @bug 4171437
-   @library ../../regtesthelpers
-   @build Util
-   @author Georges Saab
-   @run main bug4171437
-*/
+
+/*
+ * @test
+ * @key headful
+ * @bug 4171437
+ * @library ../../regtesthelpers
+ * @build Util
+ * @author Georges Saab
+ * @run main bug4171437
+ */
+
 import java.awt.*;
 import java.awt.event.*;
 import java.util.ArrayList;
--- a/jdk/test/javax/swing/JMenuItem/4654927/bug4654927.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JMenuItem/4654927/bug4654927.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 4654927
  * @summary Clicking on Greyed Menuitems closes the Menubar Dropdown
  * @author Alexander Potochkin
--- a/jdk/test/javax/swing/JMenuItem/6209975/bug6209975.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JMenuItem/6209975/bug6209975.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 6209975
  * @summary regression: JMenuItem icons overimposed on JMenuItem labels under Metal LAF
  * @author Alexander Zuev
--- a/jdk/test/javax/swing/JMenuItem/6249972/bug6249972.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JMenuItem/6249972/bug6249972.java	Mon Aug 08 08:12:20 2016 -0700
@@ -20,13 +20,16 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
-/* @test
-   @bug 6249972
-   @summary Tests that JMenuItem(String,int) handles lower-case mnemonics properly.
-   @library ../../../../lib/testlibrary
-   @build ExtendedRobot
-   @author Mikhail Lapshin
-   @run main bug6249972
+
+/*
+ * @test
+ * @key headful
+ * @bug 6249972
+ * @summary Tests that JMenuItem(String,int) handles lower-case mnemonics properly.
+ * @library ../../../../lib/testlibrary
+ * @build ExtendedRobot
+ * @author Mikhail Lapshin
+ * @run main bug6249972
  */
 
 import javax.swing.*;
--- a/jdk/test/javax/swing/JOptionPane/6428694/bug6428694.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JOptionPane/6428694/bug6428694.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,13 +21,14 @@
  * questions.
  */
 /*
-@test
-@bug 6428694
-@summary Checks that double click closes JOptionPane's input dialog.
-@library ../../../../lib/testlibrary
-@build ExtendedRobot
-@author Mikhail Lapshin
-@run main bug6428694
+ * @test
+ * @key headful
+ * @bug 6428694
+ * @summary Checks that double click closes JOptionPane's input dialog.
+ * @library ../../../../lib/testlibrary
+ * @build ExtendedRobot
+ * @author Mikhail Lapshin
+ * @run main bug6428694
 */
 
 import javax.swing.JFrame;
--- a/jdk/test/javax/swing/JOptionPane/6464022/bug6464022.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JOptionPane/6464022/bug6464022.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,12 +23,13 @@
 
 /*
  * @test
+ * @key headful
  * @bug 6464022
  * @summary Memory leak in JOptionPane.createDialog
  * @author Pavel Porvatov
  * @library ../../regtesthelpers
  * @build Util
- * @run main bug6464022
+ * @run main/othervm -mx128m bug6464022
  */
 
 import javax.swing.*;
--- a/jdk/test/javax/swing/JOptionPane/7138665/bug7138665.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JOptionPane/7138665/bug7138665.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,11 +21,13 @@
  * questions.
  */
 
-/* @test
-   @bug 7138665
-   @summary JOptionPane.getValue() unexpected change between JRE 1.6 and JRE 1.7
-   @author Pavel Porvatov
-*/
+/*
+ * @test
+ * @key headful
+ * @bug 7138665
+ * @summary JOptionPane.getValue() unexpected change between JRE 1.6 and JRE 1.7
+ * @author Pavel Porvatov
+ */
 
 import javax.swing.*;
 import java.awt.*;
--- a/jdk/test/javax/swing/JOptionPane/8139213/OptionPaneTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JOptionPane/8139213/OptionPaneTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8139213
  * @summary Mac OS Aqua X LAF: JOptionPane truncates the first button
  * @run main OptionPaneTest
--- a/jdk/test/javax/swing/JPopupMenu/4458079/bug4458079.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JPopupMenu/4458079/bug4458079.java	Mon Aug 08 08:12:20 2016 -0700
@@ -20,14 +20,18 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
-/* @test
-   @bug 4458079
-   @library ../../regtesthelpers
-   @build Util
-   @summary Tests calling removeAll() from PopupMenuListener
-   @author Peter Zhelezniakov
-   @run main bug4458079
-*/
+
+/*
+ * @test
+ * @key headful
+ * @bug 4458079
+ * @library ../../regtesthelpers
+ * @build Util
+ * @summary Tests calling removeAll() from PopupMenuListener
+ * @author Peter Zhelezniakov
+ * @run main bug4458079
+ */
+
 import java.awt.Robot;
 import java.awt.Toolkit;
 import java.awt.event.*;
--- a/jdk/test/javax/swing/JPopupMenu/4966112/bug4966112.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JPopupMenu/4966112/bug4966112.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 4966112
  * @summary Some Composite components does not show the Context Popup.
  * @library ../../regtesthelpers
--- a/jdk/test/javax/swing/JPopupMenu/6415145/bug6415145.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JPopupMenu/6415145/bug6415145.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,14 +21,15 @@
  * questions.
  */
 /*
-@test
-@bug 6415145
-@summary REGRESSION: Selected item is not being updated while dragging above popup menu
-@library ../../../../lib/testlibrary
-@build ExtendedRobot
-@author Mikhail Lapshin
-@run main bug6415145
-*/
+ * @test
+ * @key headful
+ * @bug 6415145
+ * @summary REGRESSION: Selected item is not being updated while dragging above popup menu
+ * @library ../../../../lib/testlibrary
+ * @build ExtendedRobot
+ * @author Mikhail Lapshin
+ * @run main bug6415145
+ */
 
 import javax.swing.*;
 import java.awt.event.*;
--- a/jdk/test/javax/swing/JPopupMenu/6495920/bug6495920.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JPopupMenu/6495920/bug6495920.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 6495920
  * @summary Tests that if the JPopupMenu.setVisible method throws an exception,
             interaction with GNOME is not crippled
--- a/jdk/test/javax/swing/JPopupMenu/6515446/bug6515446.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JPopupMenu/6515446/bug6515446.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,14 +21,15 @@
  * questions.
  */
 /*
-@test
-@bug 6515446
-@summary JMenuItems in JPopupMenus not receiving ActionEvents - incompat with 1.5
-@author Alexander Potochkin
-@library ../../../../lib/testlibrary
-@build ExtendedRobot
-@run main bug6515446
-*/
+ * @test
+ * @key headful
+ * @bug 6515446
+ * @summary JMenuItems in JPopupMenus not receiving ActionEvents - incompat with 1.5
+ * @author Alexander Potochkin
+ * @library ../../../../lib/testlibrary
+ * @build ExtendedRobot
+ * @run main bug6515446
+ */
 
 import javax.swing.*;
 import java.awt.event.*;
--- a/jdk/test/javax/swing/JPopupMenu/6544309/bug6544309.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JPopupMenu/6544309/bug6544309.java	Mon Aug 08 08:12:20 2016 -0700
@@ -20,7 +20,9 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
-/* @test
+/*
+   @test
+  @key headful
    @bug 6544309
    @summary Checks that 'Select Input Method' popup menu allows to select
             items with keyboard.
--- a/jdk/test/javax/swing/JPopupMenu/6580930/bug6580930.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JPopupMenu/6580930/bug6580930.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,14 +21,15 @@
  * questions.
  */
 /*
-@test
-@bug 6580930 7184956
-@summary Swing Popups should overlap taskbar
-@author Alexander Potochkin
-@library ../../../../lib/testlibrary
-@build ExtendedRobot
-@run main bug6580930
-*/
+ * @test
+ * @key headful
+ * @bug 6580930 7184956
+ * @summary Swing Popups should overlap taskbar
+ * @author Alexander Potochkin
+ * @library ../../../../lib/testlibrary
+ * @build ExtendedRobot
+ * @run main bug6580930
+ */
 
 import javax.swing.*;
 import java.awt.*;
--- a/jdk/test/javax/swing/JPopupMenu/6583251/bug6583251.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JPopupMenu/6583251/bug6583251.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,12 +24,13 @@
  */
 
 /*
-@test
-@bug 6583251
-@summary One more ClassCastException in Swing with TrayIcon
-@author Alexander Potochkin
-@run main bug6583251
-*/
+ * @test
+ * @key headful
+ * @bug 6583251
+ * @summary One more ClassCastException in Swing with TrayIcon
+ * @author Alexander Potochkin
+ * @run main bug6583251
+ */
 
 import javax.swing.*;
 import java.awt.*;
--- a/jdk/test/javax/swing/JPopupMenu/6691503/bug6691503.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JPopupMenu/6691503/bug6691503.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 6691503
  * @summary Checks that there is no opportunity for a malicious applet
  * to show a popup menu which has whole screen size.
--- a/jdk/test/javax/swing/JPopupMenu/6694823/bug6694823.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JPopupMenu/6694823/bug6694823.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 6694823
  * @summary Checks that popup menu cannot be partially hidden
  * by the task bar in applets.
--- a/jdk/test/javax/swing/JPopupMenu/6800513/bug6800513.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JPopupMenu/6800513/bug6800513.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 6800513
  * @summary GTK-LaF renders menus incompletely
  * @author Mario Torre
--- a/jdk/test/javax/swing/JPopupMenu/6827786/bug6827786.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JPopupMenu/6827786/bug6827786.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 6827786
  * @summary Tests duplicate mnemonics
  * @author Peter Zhelezniakov
--- a/jdk/test/javax/swing/JPopupMenu/6987844/bug6987844.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JPopupMenu/6987844/bug6987844.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 6987844
  * @summary Incorrect width of JComboBox drop down
  * @author Alexander Potochkin
--- a/jdk/test/javax/swing/JPopupMenu/7156657/bug7156657.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JPopupMenu/7156657/bug7156657.java	Mon Aug 08 08:12:20 2016 -0700
@@ -29,7 +29,9 @@
 import java.awt.image.BufferedImage;
 import java.util.concurrent.Callable;
 
-/* @test
+/*
+   @test
+  @key headful
    @bug 7156657
    @summary Version 7 doesn't support translucent popup menus against a translucent window
    @library ../../regtesthelpers
--- a/jdk/test/javax/swing/JPopupMenu/8147521/PopupMenuTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JPopupMenu/8147521/PopupMenuTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8147521 8158358
  * @summary [macosx] Internal API Usage: setPopupType used to force creation of
  * heavyweight popup
--- a/jdk/test/javax/swing/JProgressBar/8015748/JProgressBarOrientationRobotTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JProgressBar/8015748/JProgressBarOrientationRobotTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,7 +21,9 @@
  * questions.
  */
 
-/* @test
+/*
+ * @test
+ * @key headful
  * @bug 8015748
  * @summary verifies ProgressBar RightToLeft orientations for all Look and Feels
  * @library ../../regtesthelpers
--- a/jdk/test/javax/swing/JRadioButton/8033699/bug8033699.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JRadioButton/8033699/bug8033699.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
  /*
  * @test
+ * @key headful
  * @library ../../regtesthelpers
  * @build Util
  * @bug 8033699
--- a/jdk/test/javax/swing/JRadioButton/8041561/bug8041561.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JRadioButton/8041561/bug8041561.java	Mon Aug 08 08:12:20 2016 -0700
@@ -36,6 +36,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 8041561
  * @author Alexander Scherbatiy
  * @summary Inconsistent opacity behaviour between JCheckBox and JRadioButton
--- a/jdk/test/javax/swing/JRadioButton/8075609/bug8075609.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JRadioButton/8075609/bug8075609.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
  /*
  * @test
+ * @key headful
  * @library ../../regtesthelpers
  * @build Util
  * @bug 8075609
--- a/jdk/test/javax/swing/JRadioButton/FocusTraversal/FocusTraversal.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JRadioButton/FocusTraversal/FocusTraversal.java	Mon Aug 08 08:12:20 2016 -0700
@@ -22,9 +22,10 @@
  */
 
 /* @test
- @bug 8129940 8132770
- @summary JRadioButton should run custom FocusTraversalKeys for all LaFs
- @run main FocusTraversal
+ * @key headful
+ * @bug 8129940 8132770 8161470
+ * @summary JRadioButton should run custom FocusTraversalKeys for all LaFs
+ * @run main FocusTraversal
  */
 import java.awt.BorderLayout;
 import java.awt.Component;
@@ -60,7 +61,7 @@
     public static void main(String[] args) throws Exception {
 
         robot = new Robot();
-        robot.delay(2000);
+        robot.waitForIdle();
         UIManager.LookAndFeelInfo[] lookAndFeelArray
                 = UIManager.getInstalledLookAndFeels();
         for (UIManager.LookAndFeelInfo lookAndFeelItem : lookAndFeelArray) {
@@ -72,11 +73,11 @@
             throws Exception {
         if (tryLookAndFeel(lookAndFeelString)) {
             createUI(lookAndFeelString);
-            robot.delay(2000);
+            robot.waitForIdle();
             runTestCase();
-            robot.delay(2000);
+            robot.waitForIdle();
             cleanUp();
-            robot.delay(2000);
+            robot.waitForIdle();
         }
     }
 
--- a/jdk/test/javax/swing/JRootPane/4670486/bug4670486.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JRootPane/4670486/bug4670486.java	Mon Aug 08 08:12:20 2016 -0700
@@ -27,6 +27,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 4670486
  * @author Mark Davidson
  * @summary Regression: Popup menu bindings doesn't work when a default button has been defined.
--- a/jdk/test/javax/swing/JRootPane/SilenceOfDeprecatedMenuBar/SilenceOfDeprecatedMenuBar.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JRootPane/SilenceOfDeprecatedMenuBar/SilenceOfDeprecatedMenuBar.java	Mon Aug 08 08:12:20 2016 -0700
@@ -32,6 +32,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 6368321
  * @author Sergey Bylokhov
  */
--- a/jdk/test/javax/swing/JScrollBar/4708809/bug4708809.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JScrollBar/4708809/bug4708809.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 4708809
  * @summary JScrollBar functionality slightly different from native scrollbar
  * @author Andrey Pikalev
--- a/jdk/test/javax/swing/JScrollBar/4865918/bug4865918.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JScrollBar/4865918/bug4865918.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 4865918
  * @summary REGRESSION:JCK1.4a-runtime api/javax_swing/interactive/JScrollBarTests.html#JScrollBar
  * @author Andrey Pikalev
--- a/jdk/test/javax/swing/JScrollBar/6542335/bug6542335.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JScrollBar/6542335/bug6542335.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,12 +21,14 @@
  * questions.
  */
 
-/* @test
-   @bug 6542335
-   @summary different behavior on knob of scroll bar between 1.4.2 and 5.0
-   @author  Alexander Potochkin
-   @run main bug6542335
-*/
+/*
+ * @test
+ * @key headful
+ * @bug 6542335
+ * @summary different behavior on knob of scroll bar between 1.4.2 and 5.0
+ * @author  Alexander Potochkin
+ * @run main bug6542335
+ */
 
 import javax.swing.*;
 import javax.swing.plaf.basic.BasicScrollBarUI;
--- a/jdk/test/javax/swing/JScrollBar/7163696/Test7163696.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JScrollBar/7163696/Test7163696.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 7163696
  * @summary Tests that JScrollBar scrolls to the left
  * @author Sergey Malenkov
--- a/jdk/test/javax/swing/JScrollBar/bug4202954/bug4202954.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JScrollBar/bug4202954/bug4202954.java	Mon Aug 08 08:12:20 2016 -0700
@@ -20,14 +20,16 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
-/* @test
+/*
+   @test
+   @key headful
    @bug 4202954
    @library ../../../../lib/testlibrary
    @library ../../regtesthelpers
    @build Util jdk.testlibrary.OSInfo
    @author Michael C. Albers
    @run main bug4202954
-*/
+ */
 
 import java.awt.*;
 import java.awt.event.InputEvent;
--- a/jdk/test/javax/swing/JScrollPane/6274267/bug6274267.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JScrollPane/6274267/bug6274267.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,13 +23,15 @@
  * questions.
  */
 
-/* @test
-   @bug 6274267
-   @summary Checks that ScrollPaneLayout properly calculates preferred
-   layout size.
-   @author Mikhail Lapshin
-   @run main bug6274267
-*/
+/*
+ * @test
+ * @key headful
+ * @bug 6274267
+ * @summary Checks that ScrollPaneLayout properly calculates preferred
+ * layout size.
+ * @author Mikhail Lapshin
+ * @run main bug6274267
+ */
 
 import javax.swing.*;
 import java.awt.*;
--- a/jdk/test/javax/swing/JScrollPane/HorizontalMouseWheelOnShiftPressed/HorizontalMouseWheelOnShiftPressed.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JScrollPane/HorizontalMouseWheelOnShiftPressed/HorizontalMouseWheelOnShiftPressed.java	Mon Aug 08 08:12:20 2016 -0700
@@ -35,6 +35,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 8033000 8147994
  * @author Alexander Scherbatiy
  * @summary No Horizontal Mouse Wheel Support In BasicScrollPaneUI
--- a/jdk/test/javax/swing/JScrollPane/Test6526631.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JScrollPane/Test6526631.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 6526631
  * @summary Resizes right-oriented scroll pane
  * @author Sergey Malenkov
--- a/jdk/test/javax/swing/JScrollPane/bug8044371.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JScrollPane/bug8044371.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8044371
  * @summary setOneTouchExpandable functionality of JSplitPane will reduce vertical Scrollbar
  * @author Anton Nashatyrev
--- a/jdk/test/javax/swing/JSlider/6348946/bug6348946.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JSlider/6348946/bug6348946.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 6348946
  * @summary Tests that JSlider's thumb moves in the right direction
  *          when it is used as a JTable cell editor.
--- a/jdk/test/javax/swing/JSlider/6401380/bug6401380.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JSlider/6401380/bug6401380.java	Mon Aug 08 08:12:20 2016 -0700
@@ -20,14 +20,17 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
-/* @test
-   @bug 6401380
-   @summary JSlider - mouse click ont the left side of the knob is ignored.
-   @library ../../../../lib/testlibrary
-   @build ExtendedRobot
-   @author Alexander Potochkin
-   @run main bug6401380
-*/
+
+/*
+ * @test
+ * @key headful
+ * @bug 6401380
+ * @summary JSlider - mouse click ont the left side of the knob is ignored.
+ * @library ../../../../lib/testlibrary
+ * @build ExtendedRobot
+ * @author Alexander Potochkin
+ * @run main bug6401380
+ */
 
 import javax.swing.*;
 import javax.swing.plaf.basic.BasicSliderUI;
--- a/jdk/test/javax/swing/JSlider/6794831/bug6794831.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JSlider/6794831/bug6794831.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,7 +21,9 @@
  * questions.
  */
 
-/* @test
+/*
+ * @test
+ * @key headful
  * @bug 6794831
  * @summary Infinite loop while painting ticks on Slider with maximum=MAX_INT
  * @author Pavel Porvatov
--- a/jdk/test/javax/swing/JSlider/6848475/bug6848475.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JSlider/6848475/bug6848475.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,7 +21,9 @@
  * questions.
  */
 
-/* @test
+/*
+ * @test
+ * @key headful
  * @bug 6848475
  * @summary JSlider does not display the correct value of its BoundedRangeModel
  * @author Pavel Porvatov
--- a/jdk/test/javax/swing/JSlider/6918861/bug6918861.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JSlider/6918861/bug6918861.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,7 +21,9 @@
  * questions.
  */
 
-/* @test
+/*
+ * @test
+ * @key headful
  * @bug 6918861
  * @summary SynthSliderUI.uninstallDefaults() is not called when UI is uninstalled
  * @author Pavel Porvatov
--- a/jdk/test/javax/swing/JSlider/6923305/bug6923305.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JSlider/6923305/bug6923305.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,7 +21,9 @@
  * questions.
  */
 
-/* @test
+/*
+ * @test
+ * @key headful
  * @bug 6923305
  * @summary SynthSliderUI paints the slider track when the slider's "paintTrack" property is set to false
  * @author Pavel Porvatov
--- a/jdk/test/javax/swing/JSpinner/4973721/bug4973721.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JSpinner/4973721/bug4973721.java	Mon Aug 08 08:12:20 2016 -0700
@@ -20,14 +20,16 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
-/* @test
+/*
+   @test
+   @key headful
    @bug 4973721
    @summary Up and Down Arrow key buttons are not working for the JSpinner in Synth LAF
    @library ../../regtesthelpers
    @build Util
    @author Oleg Mokhovikov
    @run main bug4973721
-*/
+ */
 
 import java.awt.Robot;
 import javax.swing.event.ChangeListener;
--- a/jdk/test/javax/swing/JSpinner/6421058/bug6421058.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JSpinner/6421058/bug6421058.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,13 +21,14 @@
  * questions.
  */
 
- /*
-  * @test
-  * @bug 6421058
-  * @summary Verify font of the text field is changed to the font of
-  *        JSpinner if the font of text field was NOT set by the user
-  * @run main bug6421058
-  */
+/*
+ * @test
+ * @key headful
+ * @bug 6421058
+ * @summary Verify font of the text field is changed to the font of
+ *          JSpinner if the font of text field was NOT set by the user
+ * @run main bug6421058
+ */
 
 import java.awt.Font;
 import javax.swing.JFrame;
--- a/jdk/test/javax/swing/JSpinner/6532833/bug6532833.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JSpinner/6532833/bug6532833.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,7 +21,9 @@
  * questions.
  */
 
-/* @test
+/*
+ * @test
+ * @key headful
  * @bug 6532833 7077259
  * @summary PIT: Metal LAF - The right side border is not shown for the Spinner after the removing the buttons
  * @author Pavel Porvatov
--- a/jdk/test/javax/swing/JSpinner/8008657/bug8008657.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JSpinner/8008657/bug8008657.java	Mon Aug 08 08:12:20 2016 -0700
@@ -37,6 +37,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 8008657
  * @author Alexander Scherbatiy
  * @summary JSpinner setComponentOrientation doesn't affect on text orientation
--- a/jdk/test/javax/swing/JSpinner/WrongEditorTextFieldFont/WrongEditorTextFieldFont.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JSpinner/WrongEditorTextFieldFont/WrongEditorTextFieldFont.java	Mon Aug 08 08:12:20 2016 -0700
@@ -36,6 +36,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 5036022
  * @author Sergey Bylokhov
  */
--- a/jdk/test/javax/swing/JSplitPane/4816114/bug4816114.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JSplitPane/4816114/bug4816114.java	Mon Aug 08 08:12:20 2016 -0700
@@ -20,12 +20,15 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
-/* @test
-   @bug 4816114
-   @summary REGRESSION: Regression in divider location behavior when JSplitPane is resized
-   @author Andrey Pikalev
-   @run main bug4816114
-*/
+
+/*
+ * @test
+ * @key headful
+ * @bug 4816114
+ * @summary REGRESSION: Regression in divider location behavior when JSplitPane is resized
+ * @author Andrey Pikalev
+ * @run main bug4816114
+ */
 
 import javax.swing.*;
 import java.awt.*;
--- a/jdk/test/javax/swing/JSplitPane/4885629/bug4885629.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JSplitPane/4885629/bug4885629.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 4885629
  * @summary With JSplitPane in VERTICAL_SPLIT, SplitPaneBorder draws bottom edge of divider
  * @author Andrey Pikalev
--- a/jdk/test/javax/swing/JTabbedPane/4361477/bug4361477.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JTabbedPane/4361477/bug4361477.java	Mon Aug 08 08:12:20 2016 -0700
@@ -28,6 +28,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 4361477
  * @summary JTabbedPane throws ArrayOutOfBoundsException
  * @author Oleg Mokhovikov
--- a/jdk/test/javax/swing/JTabbedPane/4624207/bug4624207.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JTabbedPane/4624207/bug4624207.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 4624207
  * @summary JTabbedPane mnemonics don't work from outside the tabbed pane
  * @author Oleg Mokhovikov
--- a/jdk/test/javax/swing/JTabbedPane/6495408/bug6495408.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JTabbedPane/6495408/bug6495408.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,6 +25,7 @@
 import java.awt.*;
 /*
  * @test
+ * @key headful
  * @bug 6495408
  * @summary REGRESSION: JTabbedPane throws ArrayIndexOutOfBoundsException
  * @author Alexander Potochkin
--- a/jdk/test/javax/swing/JTabbedPane/7024235/Test7024235.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JTabbedPane/7024235/Test7024235.java	Mon Aug 08 08:12:20 2016 -0700
@@ -38,6 +38,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 7024235
  * @summary Tests JFrame.pack() with the JTabbedPane
  * @library ../../../../lib/testlibrary/
--- a/jdk/test/javax/swing/JTabbedPane/7161568/bug7161568.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JTabbedPane/7161568/bug7161568.java	Mon Aug 08 08:12:20 2016 -0700
@@ -26,6 +26,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 7161568
  * @author Alexander Scherbatiy
  * @summary Tests that navigating tabs in the JTAbbedPane does not throw NPE
--- a/jdk/test/javax/swing/JTabbedPane/8007563/Test8007563.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JTabbedPane/8007563/Test8007563.java	Mon Aug 08 08:12:20 2016 -0700
@@ -33,6 +33,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8007563
  * @summary Tests JTabbedPane background
  * @author Sergey Malenkov
--- a/jdk/test/javax/swing/JTabbedPane/8017284/bug8017284.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JTabbedPane/8017284/bug8017284.java	Mon Aug 08 08:12:20 2016 -0700
@@ -31,6 +31,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 8017284
  * @author Alexander Scherbatiy
  * @summary  Aqua LaF: memory leak when HTML is used for JTabbedPane tab titles
--- a/jdk/test/javax/swing/JTabbedPane/8134116/Bug8134116.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JTabbedPane/8134116/Bug8134116.java	Mon Aug 08 08:12:20 2016 -0700
@@ -12,6 +12,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8134116
  * @summary JTabbedPane$Page.getBounds throws IndexOutOfBoundsException
  * @run main Bug8134116
--- a/jdk/test/javax/swing/JTabbedPane/8137169/ScrollableTabbedPaneTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JTabbedPane/8137169/ScrollableTabbedPaneTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,7 +21,9 @@
  * questions.
  */
 
-/* @test
+/*
+ * @test
+ * @key headful
  * @bug 8137169
  * @summary verifies TabbedScrollPane minimum height for all Look and Feels
  * @library ../../regtesthelpers
--- a/jdk/test/javax/swing/JTable/4220171/bug4220171.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JTable/4220171/bug4220171.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 4220171
  * @author Konstantin Eremin
  * @summary Tests
--- a/jdk/test/javax/swing/JTable/6263446/bug6263446.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JTable/6263446/bug6263446.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 6263446
  * @summary Tests that double-clicking to edit a cell doesn't select the content.
  * @author Shannon Hickey
--- a/jdk/test/javax/swing/JTable/6777378/bug6777378.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JTable/6777378/bug6777378.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,7 +21,9 @@
  * questions.
  */
 
-/* @test
+/*
+   @test
+  @key headful
    @bug 6777378
    @summary NullPointerException in XPDefaultRenderer.paint()
    @author Alexander Potochkin
--- a/jdk/test/javax/swing/JTable/6894632/bug6894632.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JTable/6894632/bug6894632.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,12 +21,14 @@
  * questions.
  */
 
-/* @test
-   @bug 6894632
-   @summary Removing rows from a DefaultTableModel with a RowSorter deselectes
-   last row
-   @author Semyon Sadetsky
-*/
+/*
+ * @test
+ * @key headful
+ * @bug 6894632
+ * @summary Removing rows from a DefaultTableModel with a RowSorter deselectes
+ * last row
+ * @author Semyon Sadetsky
+ */
 
 import javax.swing.*;
 import javax.swing.table.DefaultTableModel;
--- a/jdk/test/javax/swing/JTable/6913768/bug6913768.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JTable/6913768/bug6913768.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,7 +21,9 @@
  * questions.
  */
 
-/* @test
+/*
+ * @test
+ * @key headful
  * @bug 6913768
  * @summary With default SynthLookAndFeel instance installed new JTable creation leads to throwing NPE
  * @author Pavel Porvatov
--- a/jdk/test/javax/swing/JTable/7055065/bug7055065.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JTable/7055065/bug7055065.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,7 +25,9 @@
  * Portions Copyright (c) 2012 IBM Corporation
  */
 
-/* @test 1.1 2012/04/19
+/*
+ * @test
+ * @key headful
  * @bug 7055065
  * @summary NullPointerException when sorting JTable with empty cell
  * @author Jonathan Lu
--- a/jdk/test/javax/swing/JTable/7068740/bug7068740.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JTable/7068740/bug7068740.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,12 +21,14 @@
  * questions.
  */
 
-/* @test
-   @bug 7068740
-   @summary JTable wrapped in JLayer can't use PGUP/PGDOWN keys
-   @author Vladislav Karnaukhov
-   @run main bug7068740
-*/
+/*
+ * @test
+ * @key headful
+ * @bug 7068740
+ * @summary JTable wrapped in JLayer can't use PGUP/PGDOWN keys
+ * @author Vladislav Karnaukhov
+ * @run main bug7068740
+ */
 
 import javax.swing.*;
 import javax.swing.plaf.LayerUI;
--- a/jdk/test/javax/swing/JTable/7124218/SelectEditTableCell.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JTable/7124218/SelectEditTableCell.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,7 +21,9 @@
  * questions.
  */
 
-/* @test
+/*
+ * @test
+ * @key headful
  * @bug 7124218
  * @summary verifies different behaviour of SPACE and ENTER in JTable
  * @library ../../regtesthelpers
--- a/jdk/test/javax/swing/JTable/7188612/JTableAccessibleGetLocationOnScreen.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JTable/7188612/JTableAccessibleGetLocationOnScreen.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,7 +25,9 @@
  * Portions Copyright (c) 2012 IBM Corporation
  */
 
-/* @test
+/*
+ * @test
+ * @key headful
  * @bug 7188612
  * @summary AccessibleTableHeader and AccessibleJTableCell should stick to
  *    AccessibleComponent.getLocationOnScreen api.
--- a/jdk/test/javax/swing/JTable/8032874/bug8032874.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JTable/8032874/bug8032874.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,7 +21,9 @@
  * questions.
  */
 
-/* @test
+/*
+ * @test
+ * @key headful
  * @bug 8032874
  * @summary Test whether ArrayIndexOutOfBoundsException is thrown or not,
  *          once selected row is removed from JTable with Sorter and Filter
--- a/jdk/test/javax/swing/JTableHeader/4473075/bug4473075.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JTableHeader/4473075/bug4473075.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,7 +21,9 @@
  * questions.
  */
 
-/* @test
+/*
+   @test
+  @key headful
    @bug 4473075
    @summary JTable header rendering problem (after setting preferred size)
    @author Semyon Sadetsky
--- a/jdk/test/javax/swing/JTableHeader/6884066/bug6884066.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JTableHeader/6884066/bug6884066.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,7 +21,9 @@
  * questions.
  */
 
-/* @test
+/*
+   @test
+  @key headful
    @bug 6884066
    @summary JTableHeader listens mouse in disabled state and doesn't work when not attached to a table
    @author Alexander Potochkin
--- a/jdk/test/javax/swing/JTableHeader/6889007/bug6889007.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JTableHeader/6889007/bug6889007.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,7 +21,9 @@
  * questions.
  */
 
-/* @test
+/*
+   @test
+  @key headful
    @bug 6889007
    @summary No resize cursor during hovering mouse over JTable
    @author Alexander Potochkin
--- a/jdk/test/javax/swing/JTextArea/4697612/bug4697612.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JTextArea/4697612/bug4697612.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 4697612 6244705
  * @author Peter Zhelezniakov
  * @library ../../regtesthelpers
--- a/jdk/test/javax/swing/JTextArea/7049024/bug7049024.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JTextArea/7049024/bug7049024.java	Mon Aug 08 08:12:20 2016 -0700
@@ -25,7 +25,9 @@
  * Portions Copyright (c) 2011 IBM Corporation
  */
 
-/* @test
+/*
+ * @test
+ * @key headful
  * @bug 7049024
  * @summary DnD fails with JTextArea and JTextField
  * @author Sean Chou
--- a/jdk/test/javax/swing/JTextArea/8149849/DNDTextToScaledArea.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JTextArea/8149849/DNDTextToScaledArea.java	Mon Aug 08 08:12:20 2016 -0700
@@ -34,6 +34,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 8149849
  * @summary [hidpi] DnD issues (cannot DnD from JFileChooser to JEditorPane or
  *          other text component) when scale > 1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JTextArea/ScrollbarFlicker/ScrollFlickerTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * 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 8160246
+ * @summary Regression: 4410243 reproducible with GTK LaF
+ * @run main ScrollFlickerTest
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.ComponentAdapter;
+import java.awt.event.ComponentEvent;
+
+public class ScrollFlickerTest {
+
+    private static JFrame frame;
+    private static JScrollPane scroll;
+    private static int cnt = 0;
+
+    public static void main(String[] args) throws Exception {
+        SwingUtilities.invokeAndWait(() -> {
+            frame = new JFrame();
+            frame.setSize(300, 200);
+            frame.getContentPane().setLayout(null);
+            JTextArea text = new JTextArea("Test test test test");
+            text.setLineWrap(true);
+            scroll = new JScrollPane(text);
+            frame.getContentPane().add(scroll);
+            scroll.setBounds(1, 1, 100, 50);
+            frame.setVisible(true);
+        });
+
+        Robot robot = new Robot();
+        robot.waitForIdle();
+        robot.delay(200);
+
+        SwingUtilities.invokeAndWait(() -> {
+            scroll.getViewport().addChangeListener((e) -> cnt++);
+            Insets insets = scroll.getInsets();
+            scroll.setSize(insets.left + insets.right +
+                    scroll.getVerticalScrollBar().getPreferredSize().width, 50);
+            scroll.revalidate();
+        });
+
+        robot.delay(1000);
+
+        SwingUtilities.invokeLater(frame::dispose);
+
+        if (cnt > 2) {
+            throw new RuntimeException("Scroll bar flickers");
+        }
+    }
+}
--- a/jdk/test/javax/swing/JTextArea/Test6593649.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JTextArea/Test6593649.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,12 +21,14 @@
  * questions.
  */
 
-/* @test
-   @bug 6593649
-   @summary Word wrap does not work in JTextArea: long lines are not wrapped
-   @author Lillian Angel
-   @run main Test6593649
-*/
+/*
+ * @test
+ * @key headful
+ * @bug 6593649
+ * @summary Word wrap does not work in JTextArea: long lines are not wrapped
+ * @author Lillian Angel
+ * @run main Test6593649
+ */
 
 import javax.swing.*;
 import java.awt.*;
--- a/jdk/test/javax/swing/JTextArea/TextViewOOM/TextViewOOM.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JTextArea/TextViewOOM/TextViewOOM.java	Mon Aug 08 08:12:20 2016 -0700
@@ -29,6 +29,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 8072775
  * @run main/othervm -Xmx80m TextViewOOM
  */
--- a/jdk/test/javax/swing/JTextField/8036819/bug8036819.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JTextField/8036819/bug8036819.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @library ../../regtesthelpers
  * @build Util
  * @bug 8036819
--- a/jdk/test/javax/swing/JTextPane/JTextPaneDocumentAlignment.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JTextPane/JTextPaneDocumentAlignment.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,11 +21,13 @@
  * questions.
  */
 
-/* @test
-   @bug 8132136
-   @summary [PIT] RTL orientation in JEditorPane is broken
-   @author Semyon Sadetsky
-  */
+/*
+ * @test
+ * @key headful
+ * @bug 8132136
+ * @summary [PIT] RTL orientation in JEditorPane is broken
+ * @author Semyon Sadetsky
+ */
 
 import javax.swing.*;
 import javax.swing.text.BadLocationException;
--- a/jdk/test/javax/swing/JTextPane/JTextPaneDocumentWrapping.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JTextPane/JTextPaneDocumentWrapping.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,11 +21,13 @@
  * questions.
  */
 
-/* @test
-   @bug 8133108
-   @summary [PIT] Container size is wrong in JEditorPane
-   @author Semyon Sadetsky
-  */
+/*
+ * @test
+ * @key headful
+ * @bug 8133108
+ * @summary [PIT] Container size is wrong in JEditorPane
+ * @author Semyon Sadetsky
+ */
 
 import javax.swing.*;
 import javax.swing.text.BadLocationException;
--- a/jdk/test/javax/swing/JTextPane/bug8025082.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JTextPane/bug8025082.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8025082
  * @summary The behaviour of the highlight will be lost after clicking the set
  * button.
--- a/jdk/test/javax/swing/JToolBar/4247996/bug4247996.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JToolBar/4247996/bug4247996.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,7 +21,9 @@
  * questions.
  */
 
-/* @test
+/*
+ * @test
+ * @key headful
  * @bug 4247996 4260485
  * @summary Test that rollover toolbar doesn't corrupt buttons
  * @author Peter Zhelezniakov
--- a/jdk/test/javax/swing/JToolBar/4529206/bug4529206.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JToolBar/4529206/bug4529206.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,12 +23,14 @@
  * questions.
  */
 
-/* @test
-   @bug     4529206
-   @summary JToolBar - setFloating does not work correctly
-   @author  Konstantin Eremin
-   @run     main bug4529206
-*/
+/*
+ * @test
+ * @key headful
+ * @bug     4529206
+ * @summary JToolBar - setFloating does not work correctly
+ * @author  Konstantin Eremin
+ * @run     main bug4529206
+ */
 
 import javax.swing.*;
 import java.awt.*;
--- a/jdk/test/javax/swing/JToolTip/4846413/bug4846413.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JToolTip/4846413/bug4846413.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 4846413
  * @summary Checks if No tooltip modification when no KeyStroke modifier
  * @library ../../regtesthelpers
--- a/jdk/test/javax/swing/JToolTip/6219960/bug6219960.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JToolTip/6219960/bug6219960.java	Mon Aug 08 08:12:20 2016 -0700
@@ -44,6 +44,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 6219960
  * @summary null reference in ToolTipManager
  * @run main bug6219960
--- a/jdk/test/javax/swing/JTree/4330357/bug4330357.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JTree/4330357/bug4330357.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 4330357
  * @summary Tests that real editor in JTree cleans up after editing was stopped
  * @library ../../regtesthelpers
--- a/jdk/test/javax/swing/JTree/4908142/bug4908142.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JTree/4908142/bug4908142.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 4908142
  * @summary JList doesn't handle search function appropriately
  * @author Andrey Pikalev
--- a/jdk/test/javax/swing/JTree/4927934/bug4927934.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JTree/4927934/bug4927934.java	Mon Aug 08 08:12:20 2016 -0700
@@ -20,7 +20,9 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
-/* @test
+/*
+   @test
+  @key headful
    @bug 4927934
    @summary JTree traversal is unlike Native windows tree traversal
    @author Andrey Pikalev
--- a/jdk/test/javax/swing/JTree/6263446/bug6263446.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JTree/6263446/bug6263446.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 6263446
  * @summary Tests that double-clicking to edit a cell doesn't select the content.
  * @author Shannon Hickey
--- a/jdk/test/javax/swing/JTree/6505523/bug6505523.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JTree/6505523/bug6505523.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 6505523
  * @summary NullPointerException in BasicTreeUI when a node is removed by expansion listener
  * @author Alexandr Scherbatiy
--- a/jdk/test/javax/swing/JTree/6578666/bug6578666.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JTree/6578666/bug6578666.java	Mon Aug 08 08:12:20 2016 -0700
@@ -22,6 +22,7 @@
  */
 /*
  * @test
+ * @key headful
  * @bug 6578666
  * @summary REGRESSION: Exception occurs when updateUI for JTree is triggered by KeyEvent
  * @run main bug6578666
--- a/jdk/test/javax/swing/JTree/8003400/Test8003400.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JTree/8003400/Test8003400.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8003400
  * @summary Tests that JTree shows the last row
  * @author Sergey Malenkov
--- a/jdk/test/javax/swing/JTree/8004298/bug8004298.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JTree/8004298/bug8004298.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8004298
  * @summary NPE in WindowsTreeUI.ensureRowsAreVisible
  * @author Alexander Scherbatiy
--- a/jdk/test/javax/swing/JTree/DnD/LastNodeLowerHalfDrop.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JTree/DnD/LastNodeLowerHalfDrop.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,7 +21,9 @@
  * questions.
  */
 
-/* @test
+/*
+ * @test
+ * @key headful
  * @bug 8129830 8132771
  * @summary JTree drag/drop on lower half of last child of container incorrect
  * @run main LastNodeLowerHalfDrop
--- a/jdk/test/javax/swing/JViewport/7107099/bug7107099.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JViewport/7107099/bug7107099.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,7 +21,9 @@
  * questions.
  */
 
-/* @test
+/*
+   @test
+  @key headful
    @bug 7107099
    @summary JScrollBar does not show up even if there are enough lebgth of textstring in textField
    @author Pavel Porvatov
--- a/jdk/test/javax/swing/JWindow/ShapedAndTranslucentWindows/PerPixelTranslucentCanvas.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/JWindow/ShapedAndTranslucentWindows/PerPixelTranslucentCanvas.java	Mon Aug 08 08:12:20 2016 -0700
@@ -27,6 +27,7 @@
 
 /*
  * @test
+ * @key headful
  * @summary Check if a per-pixel translucent window shows up with correct translucency
  * @author mrkam
  * @library ../../../../lib/testlibrary
--- a/jdk/test/javax/swing/KeyboardManager/8013370/Test8013370.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/KeyboardManager/8013370/Test8013370.java	Mon Aug 08 08:12:20 2016 -0700
@@ -40,6 +40,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8013370
  * @summary Ensure that key stroke is not null
  * @author Sergey Malenkov
--- a/jdk/test/javax/swing/LookAndFeel/6897701/JMenuItemsTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/LookAndFeel/6897701/JMenuItemsTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,12 +21,14 @@
  * questions.
  */
 
- /*
+/*
  * @test
+ * @key headful
  * @bug 6897701
  * @summary Verify JMenu and JMenuItem Disabled state for Nimbus LAF
  * @run main JMenuItemsTest
  */
+
 import java.awt.Color;
 import java.awt.Rectangle;
 import java.awt.image.BufferedImage;
--- a/jdk/test/javax/swing/LookAndFeel/8146276/NimbusGlueTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/LookAndFeel/8146276/NimbusGlueTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8146276
  * @summary Right aligned toolbar component does not appear
  * @run main NimbusGlueTest
--- a/jdk/test/javax/swing/Popup/6514582/bug6514582.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/Popup/6514582/bug6514582.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,12 +23,14 @@
  * questions.
  */
 
-/* @test
-   @bug 6514582
-   @summary SubMenu of a JMenu with no items paints a single pixel tiny menu.
-   @author Alexander Potochkin
-   @run main bug6514582
-*/
+/*
+ * @test
+ * @key headful
+ * @bug 6514582
+ * @summary SubMenu of a JMenu with no items paints a single pixel tiny menu.
+ * @author Alexander Potochkin
+ * @run main bug6514582
+ */
 
 import javax.swing.*;
 import java.awt.*;
--- a/jdk/test/javax/swing/Popup/TaskbarPositionTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/Popup/TaskbarPositionTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -28,6 +28,7 @@
 
 /**
  * @test @bug 4245587 4474813 4425878 4767478 8015599
+ * @key headful
  * @author Mark Davidson
  * @summary Tests the location of the heavy weight popup portion of JComboBox,
  * JMenu and JPopupMenu.
--- a/jdk/test/javax/swing/PopupFactory/6276087/NonOpaquePopupMenuTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/PopupFactory/6276087/NonOpaquePopupMenuTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 6276087
  * @author Romain Guy
  * @summary Tests opacity of a popup menu.
--- a/jdk/test/javax/swing/PopupFactory/8048506/bug8048506.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/PopupFactory/8048506/bug8048506.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8048506
  * @summary Tests that popup with null-owner does not throw NPE
  * @author Dmitry Markov
--- a/jdk/test/javax/swing/RepaintManager/IconifyTest/IconifyTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/RepaintManager/IconifyTest/IconifyTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -22,6 +22,7 @@
  */
 /*
  * @test
+ * @key headful
  * @bug 4665214
  * @summary Makes sure that RepaintManager doesn't attempt to repaint
  *          a frame when it is iconified.
--- a/jdk/test/javax/swing/Security/6657138/ComponentTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/Security/6657138/ComponentTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 6657138
  * @summary Verifies that buttons and labels work well after the fix for 6657138
  * @author Alexander Potochkin
--- a/jdk/test/javax/swing/SwingUtilities/4917669/bug4917669.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/SwingUtilities/4917669/bug4917669.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 4917669
  * @summary 1.4 REGRESSION: MenuItem accelerator doesn't work if parent menu is in JDialog
  * @author Alexander Zuev
--- a/jdk/test/javax/swing/SwingUtilities/7088744/bug7088744.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/SwingUtilities/7088744/bug7088744.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,11 +21,13 @@
  * questions.
  */
 
-/* @test
-   @bug 7088744
-   @summary SwingUtilities.isMiddleMouseButton does not work with ALT/Meta keys
-   @author Pavel Porvatov
-*/
+/*
+ * @test
+ * @key headful
+ * @bug 7088744
+ * @summary SwingUtilities.isMiddleMouseButton does not work with ALT/Meta keys
+ * @author Pavel Porvatov
+ */
 
 import java.awt.Component;
 import java.awt.Event;
--- a/jdk/test/javax/swing/SwingUtilities/7146377/bug7146377.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/SwingUtilities/7146377/bug7146377.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,11 +21,13 @@
  * questions.
  */
 
-/* @test
-   @bug 7146377
-   @summary closed/javax/swing/DataTransfer/4876520/bug4876520.java failed since b08 in jdk 8
-   @author Pavel Porvatov
-*/
+/*
+ * @test
+ * @key headful
+ * @bug 7146377
+ * @summary closed/javax/swing/DataTransfer/4876520/bug4876520.java failed since b08 in jdk 8
+ * @author Pavel Porvatov
+ */
 
 import javax.swing.*;
 import java.awt.*;
--- a/jdk/test/javax/swing/SwingUtilities/TestBadBreak/TestBadBreak.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/SwingUtilities/TestBadBreak/TestBadBreak.java	Mon Aug 08 08:12:20 2016 -0700
@@ -36,6 +36,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 8015085 8079253
  * @summary Shortening via " ... " is broken for Strings containing a combining
  *          diaeresis.
--- a/jdk/test/javax/swing/ToolTipManager/7123767/bug7123767.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/ToolTipManager/7123767/bug7123767.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,13 +21,15 @@
  * questions.
  */
 
-/* @test
-   @bug 7123767
-   @summary Wrong tooltip location in Multi-Monitor configurations
-   @author Vladislav Karnaukhov
-   @modules java.desktop/sun.awt
-   @run main bug7123767
-*/
+/*
+ * @test
+ * @key headful
+ * @bug 7123767
+ * @summary Wrong tooltip location in Multi-Monitor configurations
+ * @author Vladislav Karnaukhov
+ * @modules java.desktop/sun.awt
+ * @run main bug7123767
+ */
 
 import javax.swing.*;
 import javax.swing.plaf.metal.MetalLookAndFeel;
--- a/jdk/test/javax/swing/ToolTipManager/Test6256140.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/ToolTipManager/Test6256140.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 6256140
  * @summary Esc key doesn't restore old value in JFormattedtextField when ToolTip is set
  * @author Alexander Potochkin
--- a/jdk/test/javax/swing/UIDefaults/6795356/bug6795356.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/UIDefaults/6795356/bug6795356.java	Mon Aug 08 08:12:20 2016 -0700
@@ -28,7 +28,7 @@
  * @author Alexander Potochkin
  * @library ../../regtesthelpers
  * @build Util
- * @run main bug6795356
+ * @run main/othervm -mx128m bug6795356
  */
 
 import java.lang.ref.WeakReference;
--- a/jdk/test/javax/swing/dnd/7171812/bug7171812.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/dnd/7171812/bug7171812.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,11 +21,13 @@
  * questions.
  */
 
-/* @test
-   @bug 7171812
-   @summary [macosx] Views keep scrolling back to the drag position after DnD
-   @author Alexander Zuev
-   @run main bug7171812
+/*
+ * @test
+ * @key headful
+ * @bug 7171812
+ * @summary [macosx] Views keep scrolling back to the drag position after DnD
+ * @author Alexander Zuev
+ * @run main bug7171812
  */
 
 import java.awt.*;
--- a/jdk/test/javax/swing/plaf/basic/BasicComboPopup/7072653/bug7072653.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/plaf/basic/BasicComboPopup/7072653/bug7072653.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,7 +21,9 @@
  * questions.
  */
 
-/* @test
+/*
+ * @test
+ * @key headful
  * @bug 7072653 8144161
  * @summary JComboBox popup mispositioned if its height exceeds the screen height
  * @run main bug7072653
--- a/jdk/test/javax/swing/plaf/basic/BasicHTML/4251579/bug4251579.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/plaf/basic/BasicHTML/4251579/bug4251579.java	Mon Aug 08 08:12:20 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 4251579
  * @summary  Tests if style sheets are working in JLabel
  * @author Denis Sharypov
--- a/jdk/test/javax/swing/plaf/basic/BasicMenuUI/4983388/bug4983388.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/plaf/basic/BasicMenuUI/4983388/bug4983388.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,14 +21,16 @@
  * questions.
  */
 
-/* @test
-   @bug 4983388 8015600
-   @summary shortcuts on menus do not work on JDS
-   @author Oleg Mokhovikov
-   @library ../../../../regtesthelpers
-   @build Util
-   @run main bug4983388
-*/
+/*
+ * @test
+ * @key headful
+ * @bug 4983388 8015600
+ * @summary shortcuts on menus do not work on JDS
+ * @author Oleg Mokhovikov
+ * @library ../../../../regtesthelpers
+ * @build Util
+ * @run main bug4983388
+ */
 
 import java.awt.*;
 import javax.swing.*;
--- a/jdk/test/javax/swing/plaf/basic/BasicRootPaneUI/HiddenDefaultButtonTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/plaf/basic/BasicRootPaneUI/HiddenDefaultButtonTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,7 +21,9 @@
  * questions.
  */
 
-/* @test
+/*
+ * @test
+ * @key headful
  * @bug 6827800
  * @summary Test to check hidden default button does not respond to 'Enter' key
  * @run main HiddenDefaultButtonTest
--- a/jdk/test/javax/swing/plaf/basic/BasicTextUI/8001470/bug8001470.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/plaf/basic/BasicTextUI/8001470/bug8001470.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,11 +21,13 @@
  * questions.
  */
 
-/* @test
-   @bug 8001470
-   @summary JTextField's size is computed incorrectly when it contains Indic or Thai characters
-   @author Semyon Sadetsky
-  */
+/*
+ * @test
+ * @key headful
+ * @bug 8001470
+ * @summary JTextField's size is computed incorrectly when it contains Indic or Thai characters
+ * @author Semyon Sadetsky
+ */
 
 import javax.swing.*;
 import java.awt.*;
--- a/jdk/test/javax/swing/plaf/basic/BasicTreeUI/8023474/bug8023474.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/plaf/basic/BasicTreeUI/8023474/bug8023474.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8023474
  * @summary Tests that the first mouse press starts editing in JTree
  * @author Dmitry Markov
--- a/jdk/test/javax/swing/plaf/gtk/crash/RenderBadPictureCrash.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/plaf/gtk/crash/RenderBadPictureCrash.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  @test
+ @key headful
  @bug 8056151 8131751
  @summary Switching to GTK L&F on-the-fly leads to X Window System error RenderBadPicture
  @run main/othervm -Dswing.defaultlaf=javax.swing.plaf.metal.MetalLookAndFeel -Dsun.java2d.xrender=T RenderBadPictureCrash
--- a/jdk/test/javax/swing/plaf/nimbus/8041642/bug8041642.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/plaf/nimbus/8041642/bug8041642.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,11 +21,13 @@
  * questions.
  */
 
-/* @test
-   @bug 8041642 8079450
-   @summary Incorrect paint of JProgressBar in Nimbus LF
-   @author Semyon Sadetsky
-*/
+/*
+ * @test
+ * @key headful
+ * @bug 8041642 8079450
+ * @summary Incorrect paint of JProgressBar in Nimbus LF
+ * @author Semyon Sadetsky
+ */
 
 import javax.swing.*;
 import java.awt.*;
--- a/jdk/test/javax/swing/plaf/nimbus/8041725/bug8041725.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/plaf/nimbus/8041725/bug8041725.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,11 +21,13 @@
  * questions.
  */
 
-/* @test
-   @bug 8041725
-   @summary JList selection colors are not UIResource instances in Nimbus L&F
-   @author Anton Litvinov
-*/
+/*
+ * @test
+ * @key headful
+ * @bug 8041725
+ * @summary JList selection colors are not UIResource instances in Nimbus L&F
+ * @author Anton Litvinov
+ */
 
 import java.awt.*;
 import javax.swing.*;
--- a/jdk/test/javax/swing/plaf/nimbus/8057791/bug8057791.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/plaf/nimbus/8057791/bug8057791.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,20 +21,20 @@
  * questions.
  */
 
-/* @test
-   @bug 8057791
+ /* @test
+   @bug 8057791 8160438
    @summary Selection in JList is drawn with wrong colors in Nimbus L&F
-   @author Anton Litvinov
    @run main bug8057791
  */
-
 import java.awt.Color;
+import java.awt.Font;
 import java.awt.Graphics;
+import java.awt.Point;
 import java.awt.Rectangle;
+import java.awt.Robot;
 import java.awt.image.BufferedImage;
-import java.lang.reflect.InvocationTargetException;
-import java.util.HashSet;
 import javax.swing.DefaultListModel;
+import javax.swing.JFrame;
 import javax.swing.JList;
 import javax.swing.SwingUtilities;
 import javax.swing.UIManager;
@@ -42,59 +42,148 @@
 import javax.swing.plaf.nimbus.NimbusLookAndFeel;
 
 public class bug8057791 {
-    public static void main(String[] args) {
+
+    private static JFrame frame;
+    private static JList<String> list;
+    private static DefaultListModel<String> model;
+    private static Robot robot;
+    private static final int SELECTED_INDEX = 0;
+    private static volatile String errorString = "";
+
+    public static void main(String[] args) throws Exception {
+        robot = new Robot();
+        robot.waitForIdle();
+        runSteps();
+        if (!errorString.isEmpty()) {
+            throw new RuntimeException("Error Log:\n" + errorString);
+        }
+    }
+
+    private static void runSteps() throws Exception {
+        if (tryNimbusLookAndFeel()) {
+            createUI();
+            robot.waitForIdle();
+            runColorTestCase();
+            robot.waitForIdle();
+            cleanUp();
+        }
+
+    }
+
+    private static boolean tryNimbusLookAndFeel()
+            throws Exception {
         try {
             UIManager.setLookAndFeel(new NimbusLookAndFeel());
-
-            SwingUtilities.invokeAndWait(new Runnable() {
-                @Override
-                public void run() {
-                    final int listWidth = 50;
-                    final int listHeight = 50;
-                    final int selCellIndex = 0;
+        } catch (UnsupportedLookAndFeelException e) {
+            errorString += e.getMessage();
+            return false;
+        }
+        return true;
+    }
 
-                    JList<String> list = new JList<String>();
-                    list.setSize(listWidth, listHeight);
-                    DefaultListModel<String> listModel = new DefaultListModel<String>();
-                    listModel.add(selCellIndex, "E");
-                    list.setModel(listModel);
-                    list.setSelectedIndex(selCellIndex);
-
-                    BufferedImage img = new BufferedImage(listWidth, listHeight,
-                        BufferedImage.TYPE_INT_ARGB);
-                    Graphics g = img.getGraphics();
-                    list.paint(g);
-                    g.dispose();
+    private static void createUI()
+            throws Exception {
+        SwingUtilities.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                frame = new JFrame();
+                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+                list = new JList<>();
+                model = new DefaultListModel<>();
+                model.add(0, "@@");
+                Font font = list.getFont();
+                list.setFont(
+                        new Font(font.getFontName(),
+                                Font.BOLD,
+                                (int) (font.getSize2D() * 2)));
+                list.setModel(model);
+                list.setSelectedIndex(SELECTED_INDEX);
+                frame.add(list);
+                frame.pack();
+                frame.setLocationRelativeTo(null);
+                frame.setVisible(true);
+            }
+        });
+    }
 
-                    Rectangle cellRect = list.getCellBounds(selCellIndex, selCellIndex);
-                    HashSet<Color> cellColors = new HashSet<Color>();
-                    int uniqueColorIndex = 0;
-                    for (int x = cellRect.x; x < (cellRect.x + cellRect.width); x++) {
-                        for (int y = cellRect.y; y < (cellRect.y + cellRect.height); y++) {
-                            Color cellColor = new Color(img.getRGB(x, y), true);
-                            if (cellColors.add(cellColor)) {
-                                System.err.println(String.format("Cell color #%d: %s",
-                                    uniqueColorIndex++, cellColor));
-                            }
-                        }
-                    }
+    private static void runColorTestCase() throws Exception {
+        SwingUtilities.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                Rectangle cellBounds = list.getCellBounds(SELECTED_INDEX, SELECTED_INDEX);
+                cellBounds.x += list.getLocationOnScreen().x;
+                cellBounds.y += list.getLocationOnScreen().y;
+                //positive test cases
+                Color foregroundColor = list.getSelectionForeground();
+                Color backgroundColor = list.getSelectionBackground();
+                checkColor(foregroundColor, cellBounds);
+                checkColor(backgroundColor, cellBounds);
+                //negative test cases
+                Color changedForegroundColor = foregroundColor.darker();
+                Color changedBackgroundColor = backgroundColor.brighter();
+                checkNotColor(changedForegroundColor, cellBounds);
+                checkNotColor(changedBackgroundColor, cellBounds);
+            }
+        });
+    }
+
+    private static void checkColor(Color colorCheck, Rectangle bounds) {
+        if (!findColor(colorCheck, bounds)) {
+            String error = "[ERROR][" + colorCheck.toString()
+                    + "] Not found in selected cell";
+            errorString += error;
+        }
+    }
 
-                    Color selForegroundColor = list.getSelectionForeground();
-                    Color selBackgroundColor = list.getSelectionBackground();
-                    if (!cellColors.contains(new Color(selForegroundColor.getRGB(), true))) {
-                        throw new RuntimeException(String.format(
-                            "Selected cell is drawn without selection foreground color '%s'.",
-                            selForegroundColor));
-                    }
-                    if (!cellColors.contains(new Color(selBackgroundColor.getRGB(), true))) {
-                        throw new RuntimeException(String.format(
-                            "Selected cell is drawn without selection background color '%s'.",
-                            selBackgroundColor));
+    private static void checkNotColor(Color colorCheck, Rectangle bounds) {
+        if (findColor(colorCheck, bounds)) {
+            String error = "[ERROR][" + colorCheck.toString()
+                    + "] is found in selected cell. "
+                    + "Not supposed to be found in negative test case";
+            errorString += error;
+        }
+    }
+
+    private static boolean findColor(Color colorCheck, Rectangle bounds) {
+        BufferedImage img = new BufferedImage(bounds.width,
+                bounds.height,
+                BufferedImage.TYPE_INT_ARGB);
+        Graphics g = img.getGraphics();
+        list.paint(g);
+        g.dispose();
+        checkLoops:
+        for (int x = 0; x < bounds.width; x++) {
+            for (int y = 0; y < bounds.height; y++) {
+                Point relativePointCheck = new Point(bounds.x + x, bounds.y + y);
+                robot.mouseMove(relativePointCheck.x, relativePointCheck.y);
+                Color detectedColor = robot.getPixelColor(relativePointCheck.x,
+                        relativePointCheck.y);
+                if (detectedColor.equals(colorCheck)) {
+                    return true;
+                }
+                if (isMac()) {
+                    //One more chance for Mac due to non-Generic display setting
+                    detectedColor = new Color(img.getRGB(x, y), true);
+                    if (detectedColor.equals(colorCheck)) {
+                        return true;
                     }
                 }
-            });
-        } catch (UnsupportedLookAndFeelException | InterruptedException | InvocationTargetException e) {
-            throw new RuntimeException(e);
+            }
         }
+        return false;
+    }
+
+    private static boolean isMac() {
+        String osName = System.getProperty("os.name");
+        return osName.contains("Mac");
+    }
+
+    private static void cleanUp() throws Exception {
+        SwingUtilities.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                frame.dispose();
+            }
+        });
     }
 }
--- a/jdk/test/javax/swing/plaf/nimbus/Test6919629.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/plaf/nimbus/Test6919629.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,7 +21,9 @@
  * questions.
  */
 
-/* @test
+/*
+   @test
+   @key headful
    @bug 6919629
    @summary Tests that components with Nimbus.Overrides are GC'ed properly
    @author Peter Zhelezniakov
--- a/jdk/test/javax/swing/plaf/synth/7158712/bug7158712.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/plaf/synth/7158712/bug7158712.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,12 +21,14 @@
  * questions.
  */
 
-/* @test
-   @bug 7158712
-   @summary Synth Property "ComboBox.popupInsets" is ignored
-   @library ../../../regtesthelpers
-   @author Pavel Porvatov
-*/
+/*
+ * @test
+ * @key headful
+ * @bug 7158712
+ * @summary Synth Property "ComboBox.popupInsets" is ignored
+ * @library ../../../regtesthelpers
+ * @author Pavel Porvatov
+ */
 
 import javax.swing.*;
 import javax.swing.plaf.basic.BasicComboPopup;
--- a/jdk/test/javax/swing/plaf/synth/8040328/bug8040328.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/plaf/synth/8040328/bug8040328.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,11 +21,13 @@
  * questions.
  */
 
-/* @test
+/*
+   @test
+   @key headful
    @bug 8040328
    @summary JSlider has wrong preferred size with Synth LAF
    @author Semyon Sadetsky
-*/
+ */
 
 import javax.swing.*;
 import javax.swing.plaf.synth.SynthLookAndFeel;
--- a/jdk/test/javax/swing/plaf/synth/SynthButtonUI/6276188/bug6276188.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/plaf/synth/SynthButtonUI/6276188/bug6276188.java	Mon Aug 08 08:12:20 2016 -0700
@@ -22,6 +22,7 @@
  */
 /**
  * @test 1.4 08/08/05
+ * @key headful
  * @bug 6276188
  * @library ../../../../regtesthelpers
  * @build Util
--- a/jdk/test/javax/swing/plaf/synth/SynthScrollbarThumbPainter/SynthScrollbarThumbPainterTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/plaf/synth/SynthScrollbarThumbPainter/SynthScrollbarThumbPainterTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,7 +21,9 @@
  * questions.
  */
 
-/* @test
+/*
+ * @test
+ * @key headful
  * @bug 7172750
  * @summary Test to check Synth ScrollBar:ScrollBarThumb[].backgroundPainter is invoked
  * @run main SynthScrollbarThumbPainterTest
--- a/jdk/test/javax/swing/plaf/synth/Test8015926.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/plaf/synth/Test8015926.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8015926
  * @summary Tests that there are no NPE during painting
  * @author Sergey Malenkov
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/regtesthelpers/JRobot.java	Mon Aug 08 08:12:20 2016 -0700
@@ -0,0 +1,294 @@
+/*
+ * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ */
+
+/**
+ * JRobot is a wrapper around java.awt.Robot that provides some convenience
+ * methods.
+ * <p>When using jtreg you would include this class via something like:
+ * <pre>
+ * @library ../../../regtesthelpers
+ * @build JRobot
+ * </pre>
+ *
+ */
+import java.awt.AWTException;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.EventQueue;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.event.InputEvent;
+import java.awt.event.KeyEvent;
+import javax.swing.SwingUtilities;
+
+public class JRobot extends java.awt.Robot {
+    private static int DEFAULT_DELAY = 550;
+    private static int INTERNAL_DELAY = 250;
+
+    private int delay;
+    private boolean delaysEnabled;
+
+    protected JRobot(boolean enableDelays) throws AWTException {
+        super();
+        delaysEnabled = enableDelays;
+        setAutoWaitForIdle(enableDelays);
+        if (enableDelays) {
+            setAutoDelay(INTERNAL_DELAY);
+            setDelay(DEFAULT_DELAY);
+        }
+    }
+
+    /**
+     * Return a JRobot. Delays are enabled by default.
+     * @return a JRobot
+     */
+    public static JRobot getRobot() {
+        return getRobot(true);
+    }
+
+    /**
+     * Create a JRobot. The parameter controls whether delays are enabled.
+     * @param enableDelays controls whether delays are enabled.
+     * @return a JRobot
+     */
+    public static JRobot getRobot(boolean enableDelays) {
+        JRobot robot = null;
+        try {
+            robot = new JRobot(enableDelays);
+        } catch (AWTException e) {
+            System.err.println("Coudn't create Robot, details below");
+            throw new Error(e);
+        }
+        return robot;
+    }
+
+    /**
+     * Press and release a key.
+     * @param keycode which key to press. For example, KeyEvent.VK_DOWN
+     */
+    public void hitKey(int keycode) {
+        keyPress(keycode);
+        keyRelease(keycode);
+        delay();
+    }
+
+    /**
+     * Press and release a key with modifiers.
+     * @param keys keys to press. Keys are pressed in order they are passed as
+     * parameters to this method. All keys except the last one are considered
+     * modifiers. For example, to press Ctrl+Shift+T, call:
+     * hitKey(KeyEvent.VK_CONTROL, KeyEvent.VK_SHIFT, KeyEvent.VK_T);
+     */
+    public void hitKey(int... keys) {
+        for (int i = 0; i < keys.length; i++) {
+            keyPress(keys[i]);
+        }
+
+        for (int i = keys.length - 1; i >= 0; i--) {
+            keyRelease(keys[i]);
+        }
+        delay();
+    }
+
+    /**
+     * Move mouse cursor to the center of the Component.
+     * @param c Component the mouse is placed over
+     */
+    public void moveMouseTo(Component c) {
+        Point p = c.getLocationOnScreen();
+        Dimension size = c.getSize();
+        p.x += size.width / 2;
+        p.y += size.height / 2;
+        mouseMove(p.x, p.y);
+        delay();
+    }
+
+    /**
+     * Move mouse smoothly from (x0, y0) to (x1, y1).
+     */
+    public void glide(int x0, int y0, int x1, int y1) {
+        float dmax = (float)Math.max(Math.abs(x1 - x0), Math.abs(y1 - y0));
+        float dx = (x1 - x0) / dmax;
+        float dy = (y1 - y0) / dmax;
+
+        mouseMove(x0, y0);
+        for (int i=1; i<=dmax; i++) {
+            mouseMove((int)(x0 + dx*i), (int)(y0 + dy*i));
+        }
+        delay();
+    }
+
+    /**
+     * Perform a mouse click, i.e. press and release mouse button(s).
+     * @param buttons mouse button(s).
+     *                For example, MouseEvent.BUTTON1_MASK
+     */
+    public void clickMouse(int buttons) {
+        mousePress(buttons);
+        mouseRelease(buttons);
+        delay();
+    }
+
+    /**
+     * Perform a click with the first mouse button.
+     */
+    public void clickMouse() {
+        clickMouse(InputEvent.BUTTON1_MASK);
+    }
+
+    /**
+     * Click in the center of the given Component
+     * @param c the Component to click on
+     * @param buttons mouse button(s).
+     */
+    public void clickMouseOn(Component c, int buttons) {
+        moveMouseTo(c);
+        clickMouse(buttons);
+    }
+
+    /**
+     * Click the first mouse button in the center of the given Component
+     * @param c the Component to click on
+     */
+    public void clickMouseOn(Component c) {
+        clickMouseOn(c, InputEvent.BUTTON1_MASK);
+    }
+
+    /**
+     * Return whether delays are enabled
+     * @return whether delays are enabled
+     */
+    public boolean getDelaysEnabled() {
+        return delaysEnabled;
+    }
+
+    /**
+     * Delay execution by delay milliseconds
+     */
+    public void delay() {
+        delay(delay);
+    }
+
+    /**
+     * Return the delay amount, in milliseconds
+     */
+    public int getDelay() {
+        return delay;
+    }
+
+    /**
+     * Set the delay amount, in milliseconds
+     */
+    public void setDelay(int delay) {
+        this.delay = delay;
+    }
+
+    /**
+     * Waits until all events currently on the event queue have been processed.
+     * Does nothing if called on EDT
+     */
+    public synchronized void waitForIdle() {
+        if (!EventQueue.isDispatchThread()) {
+            super.waitForIdle();
+        }
+    }
+
+    /**
+     * Calculate the center of the Rectangle passed, and return them
+     * in a Point object.
+     * @param r a non-null Rectangle
+     * @return a new Point object containing coordinates of r's center
+     */
+    public Point centerOf(Rectangle r) {
+        return new Point(r.x + r.width / 2, r.y + r.height / 2);
+    }
+
+    /**
+     * Calculate the center of the Rectangle passed, and store it in p.
+     * @param r a non-null Rectangle
+     * @param p a non-null Point that receives coordinates of r's center
+     * @return p
+     */
+    public Point centerOf(Rectangle r, Point p) {
+        p.x = r.x + r.width / 2;
+        p.y = r.y + r.height / 2;
+        return p;
+    }
+
+    /**
+     * Convert a rectangle from coordinate system of Component c to
+     * screen coordinate system.
+     * @param r a non-null Rectangle
+     * @param c a Component whose coordinate system is used for conversion
+     */
+    public void convertRectToScreen(Rectangle r, Component c) {
+        Point p = new Point(r.x, r.y);
+        SwingUtilities.convertPointToScreen(p, c);
+        r.x = p.x;
+        r.y = p.y;
+    }
+
+    /**
+     * Compares two rectangles pixel-by-pixel.
+     * @param r0 the first area
+     * @param r1 the second area
+     * return true if all pixels in the two areas are identical
+     */
+    public boolean compareRects(Rectangle r0, Rectangle r1) {
+        int xShift = r1.x - r0.x;
+        int yShift = r1.y - r0.y;
+
+        for (int y = r0.y; y < r0.y + r0.height; y++) {
+            for (int x = r0.x; x < r0.x + r0.width; x++) {
+                if (!comparePixels(x, y, x + xShift, y + yShift)) {
+                    return false;
+                }
+            }
+        }
+        return true;
+    }
+
+    /**
+     * Compares colors of two points on the screen.
+     * @param p0 the first point
+     * @param p1 the second point
+     * return true if the two points have the same color
+     */
+    public boolean comparePixels(Point p0, Point p1) {
+        return comparePixels(p0.x, p0.y, p1.x, p1.y);
+    }
+
+    /**
+     * Compares colors of two points on the screen.
+     * @param x0 the x coordinate of the first point
+     * @param y0 the y coordinate of the first point
+     * @param x1 the x coordinate of the second point
+     * @param y1 the y coordinate of the second point
+     * return true if the two points have the same color
+     */
+    public boolean comparePixels(int x0, int y0, int x1, int y1) {
+        return (getPixelColor(x0, y0).equals(getPixelColor(x1, y1)));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/regtesthelpers/SwingTestHelper.java	Mon Aug 08 08:12:20 2016 -0700
@@ -0,0 +1,862 @@
+/*
+ * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ */
+
+import java.awt.*;
+import java.awt.event.*;
+import java.beans.*;
+import java.lang.reflect.*;
+import java.util.*;
+
+import javax.swing.*;
+
+/**
+ * SwingTestHelper is a utility class for writing AWT/Swing regression
+ * tests that require interacting with the UI.  Typically such tests
+ * consist of executing a chunk of code, waiting on an event, executing
+ * more code ...  This is painful in that you typically have to use various
+ * invokeLaters and threading to handle that interaction.  SwingTestHelper
+ * strealines this process.
+ * <p>
+ * SwingTestHelper uses reflection to invoke all methods starting with
+ * the name <code>onEDT</code> on the EDT and all methods starting with
+ * <code>onBackgroundThread</code> on a background thread.  Between each method
+ * invocation all pending events on the EDT are processed.  The methods
+ * are first sorted based on an integer after the method names and invoked
+ * in that order.  For example, the following subclass:
+ * <pre>
+ * class Test extends SwingTestHelper {
+ *   private void onEDT10();
+ *   private void onBackgroundThread20();
+ *   private void onBackgroundThread30();
+ *   private void onEDT40();
+ *   private void onBackgroundThread50();
+ * }
+ * </pre>
+ * Will have the methods invoked in the order <code>onEDT10</code>,
+ * <code>onBackgroundThread20</code>, <code>onBackgroundThread30</code>,
+ * <code>onEDT40</code>, <code>onBackgroundThread50</code>.
+ * <p>
+ * If you're not happy with method mangling you can also use annotations.
+ * The following gives the same result as the previous example:
+ * <pre>
+ * class Test extends SwingTestHelper {
+ *   &#064;Test(10)
+ *   private void foo(); // Was onEDT10
+ *
+ *   &#064;Test(value=20, onEDT=false)
+ *   private void bar(); // Was onBackgroundThread20
+ *
+ *   &#064;Test(value=30, onEDT=false)
+ *   private void baz(); // Was onBackgroundThread30
+ *
+ *   &#064;Test(40)
+ *   private void zed(); // Was onEDT40
+ *
+ *   &#064;Test(value=50, onEDT=false)
+ *   private void onBackgroundThread50(); // Was onBackgroundThread50
+ * }
+ * </pre>
+ * <p>
+ * It is recommended that you increment the value in increments of
+ * 10.  This makes it easier to add methods at a later date without
+ * having to change all method names/annotations after the newly added
+ * method.
+ * <p>
+ * Between each of the methods, all pending events (native and Java)
+ * are processed.
+ * <p>
+ * Failure of the test is signaled by any method throwing
+ * an exception, directly invoking <code>fail</code> or one of the
+ * <code>assert</code> variants.  If no methods throw an exception the test is
+ * assumed to have passed.
+ * <p>
+ * Often times it is necessary to block until focus has been gained on a
+ * particular widget.  This can be handled by the
+ * <code>requestAndWaitForFocus</code> method.  It will invoke
+ * <code>requestFocus</code> and block the test (not the EDT) until focus
+ * has been granted to the widget.
+ * <p>
+ * Care must be taken when using <code>Robot</code> directly.  For
+ * example, it's tempting to flood <code>Robot</code> with events and
+ * assume they will be received after some delay.  Depending upon the
+ * machine you may need to increase the delay.  Instead it's
+ * preferrable to block test execution until the event has been
+ * received and processed.  This can be done using the method
+ * <code>waitForEvent</code>.  For example, to block until a key typed
+ * event has been processed do the following:
+ * <pre>
+ *   private void onEDT() {
+ *     robot.moveMouseTo(myComponent);
+ *     robot.mousePress(xxx);
+ *     robot.mouseRelease(xxx);
+ *     waitForEvent(myComponent, MouseEvent.MOUSE_RELEASED);
+ *   }
+ * </pre>
+ * <p>
+ * Waiting for focus and events are specific examples of a more
+ * general problem.  Often times you need the EDT to continue processing
+ * events, but want to block test execution until something happens.
+ * In the case of focus you want to block test execution until focus
+ * is gained.  The method <code>waitForCondition</code> can be used to
+ * block test execution until the supplied <code>Runnable</code> returns.  The
+ * <code>Runnable</code> is invoked on the background thread.
+ * <p>
+ * To use this class you will need to do the following:
+ * <ol>
+ * <li>Override the method <code>createContentPane</code>.  All of your logic
+ *     for setting up the test environment should go here.  This method is
+ *     invoked on the EDT.
+ * <li>Implement the necessary <code>onEDTXX</code> and
+ *     <code>onBackgroundThreadXXX</code> methods to do the actual testing.
+ * <li>Make your <code>main</code> method look like:
+ *     <code>new MySwingTestHelper().run(args)</code>.  This will block
+ *     until the test fails or succeeds.
+ * <li>To use this with jtreg you'll need to have something like:
+ *   <pre>
+ *     &#064;library ../../../regtesthelpers
+ *     &#064;build Test JRobot Assert SwingTestHelper
+ *     &#064;run main MySwingTestHelper
+ *     * </pre>
+ * </ol>
+ * <p>
+ * Here's a complete example:
+ * <pre>
+ * public class bug4852305 extends SwingTestHelper {
+ *     private JTable table;
+ *
+ *     public static void main(String[] args) throws Throwable {
+ *         new bug4852305().run(args);
+ *     }
+ *
+ *     protected Component createContentPane() {
+ *         DefaultTableModel model = new DefaultTableModel(1, 2);
+ *         model.setValueAt("x", 0, 0);
+ *         model.setValueAt("z", 0, 1);
+ *         table = new JTable(model);
+ *         table.setDefaultEditor(Object.class, new DefaultCellEditor(new JTextField()) {
+ *             public boolean isCellEditable(EventObject anEvent) {
+ *                 if ((anEvent instanceof KeyEvent) ||
+ *                         (anEvent instanceof ActionEvent)) {
+ *                     return false;
+ *                 }
+ *                 return true;
+ *             }
+ *         });
+ *         return new JScrollPane(table);
+ *     }
+ *
+ *     private void onEDT10() {
+ *         requestAndWaitForFocus(table);
+ *     }
+ *
+ *     private void onEDT20() {
+ *         robot.keyPress(KeyEvent.VK_A);
+ *         robot.keyRelease(KeyEvent.VK_A);
+ *         waitForEvent(table, KeyEvent.KEY_RELEASED);
+ *     }
+ *
+ *     private void onEDT30() {
+ *         if (table.isEditing()) {
+ *             fail("Should not be editing");
+ *         }
+ *     }
+ * }
+ * </pre>
+ *
+ *
+ * @author Scott Violet
+ */
+public abstract class SwingTestHelper {
+    private static final String ON_EDT_METHOD_NAME = "onEDT";
+    private static final String IN_BACKGROUND_METHOD_NAME = "onBackgroundThread";
+
+    // Whether or not we've installed a PropertyChangeListener on the
+    // KeyboardFocusManager
+    private boolean installedFocusListener;
+    // Component currently blocking on until focus has been received.
+    private Component componentWaitingForFocus;
+
+    // Set to true when done.
+    private boolean done;
+    // If failed, this gives the exception.  Only the first exception is
+    // kept.
+    private Throwable error;
+
+    // List of methods to invoke
+    private java.util.List<Method> methods;
+
+    // The conditions the background thread is blocked on.
+    private java.util.List<Runnable> conditions;
+
+    // Whether or not we've installed the AWTEventListener
+    private boolean installedEventListener;
+
+    /**
+     * Instance of <code>Robot</code> returned from <code>createRobot</code>.
+     */
+    protected JRobot robot;
+
+    /**
+     * <code>Window</code> returned from <code>createWindow</code>.
+     */
+    protected Window window;
+
+    // Listens for the first paint event
+    private AWTEventListener paintListener;
+    // Whether or not we've received a paint event.
+    private boolean receivedFirstPaint;
+
+    // used if the user wants to slow down method processing
+    private PauseCondition delay = null;
+
+    private boolean showProgress;
+    private JProgressBar progBar;
+
+
+    public SwingTestHelper() {
+        paintListener = new AWTEventListener() {
+            public void eventDispatched(AWTEvent ev) {
+                if ((ev.getID() & PaintEvent.PAINT) != 0 &&
+                        ev.getSource() == window) {
+                    synchronized(SwingTestHelper.this) {
+                        if (receivedFirstPaint) {
+                            return;
+                        }
+                        receivedFirstPaint = true;
+                    }
+                    Toolkit.getDefaultToolkit().removeAWTEventListener(
+                                   paintListener);
+                    startControlLoop();
+                }
+            }
+        };
+        Toolkit.getDefaultToolkit().addAWTEventListener(
+            paintListener, AWTEvent.PAINT_EVENT_MASK);
+    }
+
+    /**
+     * Sets whether SwingTestHelper should use {@code SunToolkit.realSync}
+     * to wait for events to finish, or {@code Robot.waitForIdle}. The default
+     * is to use realSync.
+     * Nov 2014: no realSync any more, just robot.waitForIdle which actually
+     * _is_ realSync on all platforms but OS X (and thus cannot be used on EDT).
+     */
+    public void setUseRealSync(boolean useRealSync) {
+        //NOOP
+    }
+
+    /**
+     * Set the amount of time to delay between invoking methods in
+     * the control loop. Useful to slow down testing.
+     */
+    protected void setDelay(int delay) {
+        if (delay <= 0) {
+            this.delay = null;
+        } else {
+            this.delay = new PauseCondition(delay);
+        }
+    }
+
+    /**
+     * Sets whether or not progress through the list of methods is
+     * shown by a progress bar at the bottom of the window created
+     * by {@code createWindow}.
+     */
+    protected void setShowProgress(boolean showProgress) {
+        this.showProgress = showProgress;
+    }
+
+    /**
+     * Creates and returns the <code>Window</code> for the test.  This
+     * implementation returns a JFrame with a default close operation
+     * of <code>EXIT_ON_CLOSE</code>.  The <code>Component</code>
+     * returned from <code>createContentPane</code> is added the
+     * <code>JFrame</code> and the the frame is packed.
+     * <p>
+     * Typically you only need override <code>createContentPane</code>.
+     */
+    protected Window createWindow() {
+        JFrame frame = new JFrame("Test: " + getClass().getName());
+        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        frame.add(createContentPane());
+        if (showProgress) {
+            progBar = new JProgressBar();
+            progBar.setString("");
+            progBar.setStringPainted(true);
+            frame.add(progBar, BorderLayout.SOUTH);
+        }
+        frame.pack();
+        return frame;
+    }
+
+    /**
+     * Returns the <code>Component</code> to place in the frame.
+     * Override this or the <code>createWindow</code> method.
+     */
+    protected Component createContentPane() {
+        return null;
+    }
+
+    /**
+     * Invokes <code>requestFocus</code> on the passed in component (assuming
+     * it doesn't already have focus).  Test execution is blocked until focus
+     * has been gained on the component.  This method <b>must</b> be invoked
+     * on the EDT, if you do not invoke it from the edt the test will fail.
+     *
+     * @param c the <code>Component</code> to wait for focus on
+     */
+    protected void requestAndWaitForFocus(Component c) {
+        requestAndWaitForFocus(c, true);
+    }
+
+    /**
+     * Blocks test execution until focus is gained on the component.
+     * This method <b>must</b> be invoked
+     * on the EDT, if you do not invoke it from the edt the test will fail.
+     */
+    protected void waitForFocusGained(Component c) {
+        requestAndWaitForFocus(c, false);
+    }
+
+    private void requestAndWaitForFocus(Component c, boolean requestFocus) {
+        if (!EventQueue.isDispatchThread()) {
+            System.out.println(
+                "requestAndWaitForFocus should be invoked on EDT");
+            throw new RuntimeException();
+        }
+        if (componentWaitingForFocus != null) {
+            System.out.println("Already waiting for focus");
+            throw new RuntimeException();
+        }
+        if (!installedFocusListener) {
+            installedFocusListener = true;
+            KeyboardFocusManager.getCurrentKeyboardFocusManager().
+                addPropertyChangeListener(new FocusListener());
+        }
+        synchronized(this) {
+            if (c.hasFocus()) {
+                return;
+            }
+            componentWaitingForFocus = c;
+        }
+        if (requestFocus) {
+            c.requestFocus();
+        }
+        waitForCondition(new FocusCondition());
+    }
+
+    /**
+     * Blocks test execution until the specified event has been received.
+     * This method immediately returns and the EDT will continue to
+     * process events, but test execution is blocked until
+     * the event is received.
+     *
+     * @param event the event type to wait for
+     */
+    protected void waitForEvent(int event) {
+        waitForEvent(null, event);
+    }
+
+    /**
+     * Blocks test execution until the specified event has been received.
+     * This method immediately returns and the EDT will continue to
+     * process events, but test execution is blocked until
+     * the event is received.
+     *
+     * @param target the <code>Component</code> to wait for the event on;
+     *               <code>null</code> indicates it does not matter which
+     *               component the event is received on
+     * @param event the event type to wait for
+     */
+    protected void waitForEvent(Component target, int event) {
+        waitForCondition(new EventCondition(target, event));
+        if (!installedEventListener) {
+            installedEventListener = true;
+            Toolkit.getDefaultToolkit().addAWTEventListener(
+                    new EventListener(), 0xFFFFFFFFFFFFFFFFl);
+        }
+    }
+
+    /**
+     * Paused test execution for the specified amount of time.  The caller
+     * immediately returns and the EDT can process events.
+     *
+     * @param time the amount of time, in milliseconds, to pause for
+     */
+    protected void pause(int time) {
+        waitForCondition(new PauseCondition(time));
+    }
+
+    /**
+     * Schedules a <code>Runnable</code> that will be processed in the
+     * background thread.  This method immediately returns, and the
+     * EDT is free to continue processing events. Test execution is
+     * blocked until the <code>Runnable</code> completes.
+     */
+    protected void waitForCondition(Runnable runnable) {
+        synchronized(this) {
+            if (conditions == null) {
+                conditions = new LinkedList<Runnable>();
+            }
+            conditions.add(runnable);
+        }
+    }
+
+    /**
+     * Runs the test.  This method blocks the caller until the test
+     * fails or succeeds. Recognized arguments are:
+     * <p>
+     * "-exit": Causes main to exit when the test is done.
+     * "-showProg": Indicate the progress of the test with a
+     *              progress bar in the main window. Only works
+     *              if the test hasn't overridden {@code createWindow}.
+     * "-delay int": Sets the delay between executing methods.
+     *               Useful when you want to slow a test to watch it.
+     *
+     * @param args the arguments from main, it's ok to pass in null
+     */
+    protected final void run(String[] args) throws Throwable {
+        boolean exit = false;
+        if (args != null) {
+            for (int i = 0; i < args.length; i++) {
+                if (args[i].equals("-exit")) {
+                    exit = true;
+                } else if (args[i].equals("-delay")) {
+                    try {
+                        setDelay(Integer.parseInt(args[++i]));
+                    } catch (NumberFormatException ne) {
+                        throw new RuntimeException("-delay requires an integer value");
+                    } catch (ArrayIndexOutOfBoundsException ae) {
+                        throw new RuntimeException("-delay requires an integer value");
+                    }
+                } else if (args[i].equals("-showProg")) {
+                    setShowProgress(true);
+                } else {
+                    throw new RuntimeException("Invalid argument \"" + args[i] + "\"");
+                }
+            }
+        }
+
+        createWindow0();
+        synchronized(this) {
+            while(!done) {
+                wait();
+            }
+        }
+        if (exit) {
+            // Not in harness
+            if (error != null) {
+                System.out.println("FAILED: " + error);
+                error.printStackTrace();
+            }
+            System.exit(0);
+        }
+        if (error != null) {
+            throw error;
+        }
+    }
+
+    /**
+     * Creates the window, on the EDT.
+     */
+    private void createWindow0() {
+        EventQueue.invokeLater(new Runnable() {
+            public void run() {
+                window = createWindow();
+                window.show();
+            }
+        });
+    }
+
+    /**
+     * Initializes the progress bar if necessary.
+     */
+    private void initProgressBar(final int size) {
+        EventQueue.invokeLater(new Runnable() {
+            public void run() {
+                if (progBar != null) {
+                    progBar.setMaximum(size);
+                }
+            }
+        });
+    }
+
+    /**
+     * Starst the control loop.
+     */
+    private void startControlLoop() {
+        robot = createRobot();
+        if (robot != null) {
+            calculateMethods();
+            initProgressBar(methods.size());
+            new Thread(new Runnable() {
+                public void run() {
+                    controlLoop();
+                }
+            }).start();
+        }
+    }
+
+    /**
+     * Increment the progress bar.
+     */
+    private void nextProgress(final String name) {
+        EventQueue.invokeLater(new Runnable() {
+            public void run() {
+                if (progBar != null) {
+                    progBar.setString(name);
+                    progBar.setValue(progBar.getValue() + 1);
+                }
+            }
+        });
+    }
+
+    private synchronized Runnable currentCondition() {
+        if (conditions != null && conditions.size() > 0) {
+            return conditions.get(0);
+        }
+        return null;
+    }
+
+    private synchronized Runnable nextCondition() {
+        return conditions.remove(0);
+    }
+
+    private void controlLoop() {
+        int methodIndex = 0;
+        while (methodIndex < methods.size()) {
+            // Wait for any pending conditions
+            Runnable condition;
+            while ((condition = currentCondition()) != null) {
+                try {
+                    condition.run();
+                } catch (Exception e) {
+                    fail(e);
+                    return;
+                }
+                waitForEDTToFinish();
+                synchronized(this) {
+                    if (done) {
+                        return;
+                    }
+                }
+                // Advance to next condition
+                nextCondition();
+            }
+
+            // Let all events on the EDT finish
+            waitForEDTToFinish();
+
+            if (delay != null) {
+                delay.run();
+            }
+
+            // Invoke the next method
+            Method method = methods.get(methodIndex++);
+            Test test = method.getAnnotation(Test.class);
+            boolean onEDT = true;
+            if (test != null) {
+                onEDT = test.onEDT();
+            }
+            else if (!method.getName().startsWith(ON_EDT_METHOD_NAME)) {
+                onEDT = false;
+            }
+            if (onEDT) {
+                invokeOnEDT(method);
+            }
+            else {
+                invoke(method);
+            }
+
+            // Let all events on the EDT finish
+            waitForEDTToFinish();
+
+            nextProgress(method.getName());
+
+            // If done, stop.
+            synchronized(this) {
+                if (done) {
+                    return;
+                }
+            }
+        }
+
+        // No more methods, if we get and done isn't true, set it true
+        // so that the main thread wakes up.
+        synchronized(this) {
+            if (!done) {
+                done = true;
+                notifyAll();
+            }
+        }
+    }
+
+    private void waitForEDTToFinish() {
+            robot.waitForIdle();
+        }
+
+    private void invokeOnEDT(final Method method) {
+        try {
+            EventQueue.invokeAndWait(new Runnable() {
+                public void run() {
+                    invoke(method);
+                }
+            });
+        } catch (InvocationTargetException ite) {
+            fail(ite);
+        } catch (InterruptedException ie) {
+            fail(ie);
+        }
+    }
+
+    private void invoke(Method method) {
+        System.out.println("invoking: " + method.getName());
+        try {
+            if (Modifier.isPrivate(method.getModifiers())) {
+                method.setAccessible(true);
+            }
+            method.invoke(this);
+        } catch (Exception e) {
+            fail(e);
+        }
+    }
+
+    // Determines the methods to execute.
+    private void calculateMethods() {
+        // Using a Set avoids duplicating methods returned by both
+        // getMethods() and getDeclaredMethods().
+        HashSet<Method> allMethods = new HashSet<Method>();
+        allMethods.addAll(Arrays.asList(getClass().getMethods()));
+        allMethods.addAll(Arrays.asList(getClass().getDeclaredMethods()));
+
+        methods = new ArrayList<Method>();
+        for (Method method : allMethods) {
+            Test test = method.getAnnotation(Test.class);
+            if (test != null) {
+                methods.add(method);
+            }
+            else if (method.getName().startsWith(ON_EDT_METHOD_NAME)) {
+                methods.add(method);
+            }
+            else if (method.getName().startsWith(IN_BACKGROUND_METHOD_NAME)) {
+                methods.add(method);
+            }
+        }
+        Comparator<Method> comparator = new Comparator<Method>() {
+            public int compare(Method m1, Method m2) {
+                int index1 = getIndex(m1);
+                int index2 = getIndex(m2);
+                return index1 - index2;
+            }
+            private int getIndex(Method m) {
+                String name = m.getName();
+                String indexAsString;
+                Test test = m.getAnnotation(Test.class);
+                if (test != null) {
+                    return test.value();
+                }
+                if (name.startsWith(ON_EDT_METHOD_NAME)) {
+                    indexAsString = name.substring(
+                            ON_EDT_METHOD_NAME.length());
+                }
+                else {
+                    indexAsString = name.substring(
+                            IN_BACKGROUND_METHOD_NAME.length());
+                }
+                if (indexAsString.length() == 0) {
+                    System.out.println(
+                            "onEDT and onBackgroundThread must be " +
+                            "followed by an integer specifying " +
+                            "order.");
+                    System.exit(0);
+                }
+                return Integer.parseInt(indexAsString);
+            }
+        };
+        Collections.sort(methods, comparator);
+    }
+
+    /**
+     * Invoke if the test should be considered to have failed.  This will
+     * stop test execution.
+     */
+    public void fail(String reason) {
+        fail(new RuntimeException(reason));
+    }
+
+    /**
+     * Invoke if the test should be considered to have failed.  This will
+     * stop test execution.
+     */
+    public void fail(Throwable error) {
+        synchronized(this) {
+            if (this.error == null) {
+                if (error instanceof InvocationTargetException) {
+                    this.error = ((InvocationTargetException)error).
+                            getCause();
+                }
+                else {
+                    this.error = error;
+                }
+                this.done = true;
+                notifyAll();
+            }
+        }
+    }
+
+    /**
+     * Invoke to prematurely stop test execution while there are remaining
+     * methods.  You typically don't invoke this, instead if all methods have
+     * been executed and fail hasn't been invoked, the test is considered to
+     * have passed.
+     */
+    public void succeeded() {
+        synchronized(this) {
+            this.done = true;
+            notifyAll();
+        }
+    }
+
+    /**
+     * Creates and returns the Robot that will be used.  You generally don't
+     * need to override this.
+     */
+    protected JRobot createRobot() {
+        JRobot robot = JRobot.getRobot(false);
+        return robot;
+    }
+
+
+    private class FocusListener implements PropertyChangeListener {
+        public void propertyChange(PropertyChangeEvent e) {
+            if (componentWaitingForFocus != null &&
+                    "focusOwner".equals(e.getPropertyName()) &&
+                    componentWaitingForFocus == e.getNewValue()) {
+                synchronized(SwingTestHelper.this) {
+                    componentWaitingForFocus = null;
+                    SwingTestHelper.this.notifyAll();
+                }
+            }
+        }
+    }
+
+
+    private class EventCondition implements Runnable {
+        private Component component;
+        private int eventID;
+        private boolean received;
+
+        EventCondition(Component component, int eventID) {
+            this.component = component;
+            this.eventID = eventID;
+        }
+
+        public int getEventID() {
+            return eventID;
+        }
+
+        public Component getComponent() {
+            return component;
+        }
+
+        public void received() {
+            synchronized(SwingTestHelper.this) {
+                this.received = true;
+                SwingTestHelper.this.notifyAll();
+            }
+        }
+
+        public boolean isWaiting() {
+            return !received;
+        }
+
+        public void run() {
+            synchronized(SwingTestHelper.this) {
+                while (!received) {
+                    try {
+                        SwingTestHelper.this.wait();
+                    } catch (InterruptedException ie) {
+                        fail(ie);
+                    }
+                }
+            }
+        }
+    }
+
+
+    private class FocusCondition implements Runnable {
+        public void run() {
+            synchronized(SwingTestHelper.this) {
+                while (componentWaitingForFocus != null) {
+                    try {
+                        SwingTestHelper.this.wait();
+                    } catch (InterruptedException ie) {
+                        fail(ie);
+                    }
+                }
+            }
+        }
+    }
+
+
+    private class PauseCondition implements Runnable {
+        private int time;
+        PauseCondition(int time) {
+            this.time = time;
+        }
+        public void run() {
+            try {
+                Thread.sleep(time);
+            } catch (InterruptedException ie) {
+                fail(ie);
+            }
+        }
+    }
+
+
+    private class EventListener implements AWTEventListener {
+        public void eventDispatched(AWTEvent ev) {
+            int eventID = ev.getID();
+            synchronized (SwingTestHelper.this) {
+                for (Runnable condition : conditions) {
+                    if (condition instanceof EventCondition) {
+                        EventCondition ec = (EventCondition)condition;
+                        if (ec.isWaiting()) {
+                            if (eventID == ec.getEventID() &&
+                                    (ec.getComponent() == null ||
+                                     ev.getSource() == ec.getComponent())) {
+                                ec.received();
+                            }
+                            return;
+                        }
+                    }
+                    else {
+                        return;
+                    }
+                }
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/regtesthelpers/Test.java	Mon Aug 08 08:12:20 2016 -0700
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.METHOD)
+public @interface Test {
+    int value();
+    boolean onEDT() default true;
+}
\ No newline at end of file
--- a/jdk/test/javax/swing/regtesthelpers/Util.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/regtesthelpers/Util.java	Mon Aug 08 08:12:20 2016 -0700
@@ -81,7 +81,8 @@
 
     /**
      * Fills the heap until OutOfMemoryError occurs. This method is useful for
-     * WeakReferences removing.
+     * WeakReferences removing. To minimize the amount of filled memory the
+     * test should provide reasonable heap size via -mx option.
      */
     public static void generateOOME() {
         List<Object> bigLeak = new LinkedList<Object>();
--- a/jdk/test/javax/swing/reliability/TaskUndJFrameProperties.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/reliability/TaskUndJFrameProperties.java	Mon Aug 08 08:12:20 2016 -0700
@@ -26,6 +26,7 @@
 
 /*
  * @test
+ * @key headful
  * @summary Construct a Undecorated JFrame, try to change the properties
  *          using setVisible() method.
  * @author Aruna Samji
--- a/jdk/test/javax/swing/reliability/TaskZoomJFrameChangeState.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/reliability/TaskZoomJFrameChangeState.java	Mon Aug 08 08:12:20 2016 -0700
@@ -26,6 +26,7 @@
 
 /*
  * @test
+ * @key headful
  * @summary Construct a JFrame, zoom it from the normal state and back forth
  *          using Frame.ZOOMED and Frame.NORMAL. Iconofy from the zoomed
  *          state and back forth using Frame.ICONIFIED and Frame.NORMAL and
--- a/jdk/test/javax/swing/reliability/TaskZoomJFrameRepaint.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/reliability/TaskZoomJFrameRepaint.java	Mon Aug 08 08:12:20 2016 -0700
@@ -26,6 +26,7 @@
 
 /*
  * @test
+ * @key headful
  * @summary Construct a jframe with some components and zoom the frame and bring it back to normal state.
  * @author Aruna Samji
  * @library ../../../lib/testlibrary
--- a/jdk/test/javax/swing/text/AbstractDocument/6968363/Test6968363.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/text/AbstractDocument/6968363/Test6968363.java	Mon Aug 08 08:12:20 2016 -0700
@@ -42,6 +42,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 6968363
  * @summary Ensures that a custom document may not extend AbstractDocument
  * @author Sergey Malenkov
--- a/jdk/test/javax/swing/text/CSSBorder/6796710/bug6796710.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/text/CSSBorder/6796710/bug6796710.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 6796710 7124242
  * @summary Html content in JEditorPane is overlapping on swing components while resizing the application.
  * @library ../../../regtesthelpers
--- a/jdk/test/javax/swing/text/DefaultEditorKit/4278839/bug4278839.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/text/DefaultEditorKit/4278839/bug4278839.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,7 +21,9 @@
  * questions.
  */
 
-/* @test Jan 16, 2003
+/*
+ * @test
+ * @key headful
  * @bug 4278839
  * @summary Incorrect cursor movement between words at the end of line
  * @author Anton Nashatyrev
--- a/jdk/test/javax/swing/text/DefaultStyledDocument/6636983/bug6636983.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/text/DefaultStyledDocument/6636983/bug6636983.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 6636983
  * @summary test that composed text at the line starts is handled correctly
  * @author Sergey Groznyh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/text/FlowView/LayoutTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
+ * 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 6452106 6606443 8161195
+   @author Peter Zhelezniakov
+   @library ../../regtesthelpers
+   @build Test JRobot SwingTestHelper
+   @run main/timeout=300 LayoutTest
+*/
+
+import javax.swing.text.*;
+import javax.swing.*;
+import java.awt.event.*;
+import java.awt.*;
+
+public class LayoutTest extends SwingTestHelper {
+    JTextPane text;
+
+    public static void main(String[] args) throws Throwable {
+        new LayoutTest().run(args);
+    }
+
+    protected Component createContentPane() {
+        return text = new JTextPane();
+    }
+
+    @Test(value=10, onEDT=true)
+    private void onEDT10() {
+        requestAndWaitForFocus(text);
+    }
+
+
+    @Test(value=100, onEDT=true)
+    private void prepare6452106() {
+        text.setText("This is easily generated on my\nmachine");
+        Document doc = text.getDocument();
+
+        // wrap the long paragraph
+        Dimension d = text.getPreferredSize();
+        Dimension size = new Dimension(d.width * 2 / 3, d.height * 5);
+        window.setSize(size);
+
+        // place caret at the end of 2nd line
+        Element p1 = doc.getDefaultRootElement().getElement(0);
+        int pos = p1.getEndOffset();
+        text.setCaretPosition(pos - 1);
+    }
+
+    @Test(value=110, onEDT=false)
+    private void test6452106() {
+        robot.setDelay(300);
+        robot.hitKey(KeyEvent.VK_DELETE);
+        robot.hitKey(KeyEvent.VK_SPACE);
+        robot.hitKey(KeyEvent.VK_SPACE);
+    }
+
+
+    @Test(value=200, onEDT=true)
+    private void prepare6606443() {
+        text.setText("This is easily\ngenerated\non my machine");
+        text.setSelectionStart(15);
+        text.setSelectionEnd(24);
+    }
+
+    @Test(value=210, onEDT=false)
+    private void test6606443() {
+        robot.hitKey(KeyEvent.VK_ENTER);
+    }
+}
--- a/jdk/test/javax/swing/text/JTextComponent/5074573/bug5074573.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/text/JTextComponent/5074573/bug5074573.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 5074573
  * @summary tests delte-next-word and delete-prev-word actions for all text compnents and all look&feels
  * @author Igor Kushnirskiy
--- a/jdk/test/javax/swing/text/NavigationFilter/6735293/bug6735293.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/text/NavigationFilter/6735293/bug6735293.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 6735293
  * @summary javax.swing.text.NavigationFilter.getNextVisualPositionFrom() not always throws BadLocationException
  * @author Pavel Porvatov
--- a/jdk/test/javax/swing/text/NavigationFilter/8058305/bug8058305.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/text/NavigationFilter/8058305/bug8058305.java	Mon Aug 08 08:12:20 2016 -0700
@@ -30,6 +30,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8058305
  * @summary BadLocationException is not thrown by
  *   javax.swing.text.View.getNextVisualPositionFrom() for invalid positions
--- a/jdk/test/javax/swing/text/TableView/I18nLayoutTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/text/TableView/I18nLayoutTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8133864
  * @summary  Wrong display, when the document I18n properties is true.
  * @author Semyon Sadetsky
@@ -345,4 +346,4 @@
             Specs.add(cellEnd);
         }
     }
-}
\ No newline at end of file
+}
--- a/jdk/test/javax/swing/text/Utilities/bug7045593.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/text/Utilities/bug7045593.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 7045593
  * @summary Possible Regression : JTextfield cursor placement behavior algorithm has changed
  * @author Pavel Porvatov
--- a/jdk/test/javax/swing/text/View/8014863/bug8014863.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/text/View/8014863/bug8014863.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8014863
  * @bug 8024395
  * @summary  Tests the calculation of the line breaks when a text is inserted
--- a/jdk/test/javax/swing/text/View/8048110/bug8048110.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/text/View/8048110/bug8048110.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,7 +21,9 @@
  * questions.
  */
 
-/* @test
+/*
+ * @test
+ * @key headful
  * @bug 8048110
  * @summary Using tables in JTextPane leads to infinite loop in FlowLayout.layoutRow
  * @author Dmitry Markov
--- a/jdk/test/javax/swing/text/html/7189299/bug7189299.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/text/html/7189299/bug7189299.java	Mon Aug 08 08:12:20 2016 -0700
@@ -39,6 +39,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 8008289
  * @summary Shared ButtonModel instance should deregister previous listeners.
  * @author Frank Ding
--- a/jdk/test/javax/swing/text/html/8031109/bug8031109.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/text/html/8031109/bug8031109.java	Mon Aug 08 08:12:20 2016 -0700
@@ -31,6 +31,7 @@
 import javax.swing.text.EditorKit;
 /*
  * @test
+ * @key headful
  * @bug 8031109
  * @author Victor Dyakov
  * @summary  Rendering HTML code in JEditorPane throws NumberFormatException
--- a/jdk/test/javax/swing/text/html/8034955/bug8034955.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/text/html/8034955/bug8034955.java	Mon Aug 08 08:12:20 2016 -0700
@@ -27,6 +27,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 8034955
  * @author Alexander Scherbatiy
  * @summary JLabel/JToolTip throw ClassCastException for "<html>a<title>"
--- a/jdk/test/javax/swing/text/html/CSS/4530474/bug4530474.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/text/html/CSS/4530474/bug4530474.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 4530474
  * @summary  Tests if background-color CSS attribute in HTML font tag in class attribute
  * @author Denis Sharypov
--- a/jdk/test/javax/swing/text/html/HTMLDocument/8058120/bug8058120.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/text/html/HTMLDocument/8058120/bug8058120.java	Mon Aug 08 08:12:20 2016 -0700
@@ -22,6 +22,7 @@
  */
 
 /* @test
+ * @key headful
  * @bug 8058120
  * @summary Rendering / caret errors with HTMLDocument
  * @author Dmitry Markov
--- a/jdk/test/javax/swing/text/html/HTMLEditorKit/4242228/bug4242228.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/text/html/HTMLEditorKit/4242228/bug4242228.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,11 +21,13 @@
  * questions.
  */
 
-/* @test
-   @bug 4242228
-   @summary Tests that HTMLEditorKit.setText() doesn't throw exceptions
-   @author Peter Zhelezniakov
-*/
+/*
+ * @test
+ * @key headful
+ * @bug 4242228
+ * @summary Tests that HTMLEditorKit.setText() doesn't throw exceptions
+ * @author Peter Zhelezniakov
+ */
 
 import javax.swing.*;
 import javax.swing.event.ChangeEvent;
--- a/jdk/test/javax/swing/text/html/HTMLEditorKit/5043626/bug5043626.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/text/html/HTMLEditorKit/5043626/bug5043626.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @key headful
  * @bug 5043626
  * @summary  Tests pressing Home or Ctrl+Home set cursor to invisible element <head>
  * @author Alexander Potochkin
--- a/jdk/test/javax/swing/text/rtf/RTFWriteParagraphAlignTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/javax/swing/text/rtf/RTFWriteParagraphAlignTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,11 +21,13 @@
  * questions.
  */
 
-/* @test
-   @bug 8139215
-   @summary RTFEditorKit does not save alignment
-   @author Semyon Sadetsky
-  */
+/*
+ * @test
+ * @key headful
+ * @bug 8139215
+ * @summary RTFEditorKit does not save alignment
+ * @author Semyon Sadetsky
+ */
 
 import javax.swing.*;
 import javax.swing.text.*;
--- a/jdk/test/sun/awt/dnd/8024061/bug8024061.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/sun/awt/dnd/8024061/bug8024061.java	Mon Aug 08 08:12:20 2016 -0700
@@ -21,7 +21,9 @@
  * questions.
  */
 
-/* @test
+/*
+ * @test
+ * @key headful
  * @bug 8024061
  * @summary Checks that no exception is thrown if dragGestureRecognized
  *          takes a while to complete.
--- a/jdk/test/sun/awt/image/OffScreenImageSource/ImageConsumerUnregisterTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/sun/awt/image/OffScreenImageSource/ImageConsumerUnregisterTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -22,7 +22,7 @@
  */
 
 /* @test
- * @bug 8160421
+ * @bug 8160421 8161902
  * @summary Test to check OffScreenImageSource handles case where
  *          imageComplete(ImageConsumer.SINGLEFRAMEDONE) unregisters.
  * @run main/othervm ImageConsumerUnregisterTest
@@ -35,7 +35,7 @@
 
     public static void main(String[] args) throws Exception {
 
-        final java.awt.Component component = new TestBug8160421();
+        final java.awt.Component component = new ImageConsumerUnregisterTest();
 
         // Redirect the System.err stream and verify there is no
         // stacktrace printed
@@ -59,7 +59,8 @@
             System.setErr(obj);
 
             if (!str.isEmpty()) {
-                throw new RuntimeException("Invalid imageComplete(STATICIMAGEDONE) call");
+                throw new RuntimeException("Invalid"
+                        + " imageComplete(STATICIMAGEDONE) call");
             }
         }
     }
--- a/jdk/test/sun/java2d/ClassCastExceptionForInvalidSurface.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/sun/java2d/ClassCastExceptionForInvalidSurface.java	Mon Aug 08 08:12:20 2016 -0700
@@ -40,6 +40,7 @@
 
 /**
  * @test
+ * @key headful
  * @bug 8158072 7172749
  */
 public final class ClassCastExceptionForInvalidSurface {
--- a/jdk/test/sun/java2d/Disposer/TestDisposerLeak.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/sun/java2d/Disposer/TestDisposerLeak.java	Mon Aug 08 08:12:20 2016 -0700
@@ -31,7 +31,7 @@
  * @test
  * @bug 8129457
  * @summary Check Disposer disposes all objects without any memory leaks
- * @run main/othervm TestDisposerLeak
+ * @run main/othervm -mx128m TestDisposerLeak
  * @modules java.desktop/sun.java2d
  */
 public final class TestDisposerLeak {
--- a/jdk/test/sun/java2d/SunGraphics2D/SourceClippingBlitTest/SourceClippingBlitTest.java	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/sun/java2d/SunGraphics2D/SourceClippingBlitTest/SourceClippingBlitTest.java	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
   @test
+  @key headful
   @bug 6244574
   @bug 6258142
   @bug 6395165
--- a/jdk/test/sun/java2d/X11SurfaceData/SharedMemoryPixmapsTest/SharedMemoryPixmapsTest.sh	Fri Aug 05 09:50:29 2016 -0700
+++ b/jdk/test/sun/java2d/X11SurfaceData/SharedMemoryPixmapsTest/SharedMemoryPixmapsTest.sh	Mon Aug 08 08:12:20 2016 -0700
@@ -23,6 +23,7 @@
 #
 
 # @test
+# @key headful
 # @bug 6363434 6588884
 # @summary Verify that shared memory pixmaps are not broken
 # by filling a VolatileImage with red color and copying it