From d9bd02ffc269240b77c01153f6f48c643e1991ce Mon Sep 17 00:00:00 2001 From: Petr Pchelko Date: Fri, 18 Apr 2014 10:47:23 +0400 Subject: [PATCH 01/50] 8035169: Move ThreadGroupUtils from the sun.misc package Reviewed-by: anthony, serb, azvegint --- jdk/src/macosx/classes/sun/font/CFontManager.java | 2 +- jdk/src/macosx/classes/sun/lwawt/LWToolkit.java | 2 +- jdk/src/macosx/native/sun/awt/awt.m | 2 +- jdk/src/share/classes/sun/awt/AWTAutoShutdown.java | 2 +- .../classes/sun/{misc => awt/util}/ThreadGroupUtils.java | 4 ++-- jdk/src/share/classes/sun/font/CreatedFontTracker.java | 2 +- jdk/src/share/classes/sun/font/SunFontManager.java | 2 +- jdk/src/share/classes/sun/java2d/Disposer.java | 2 +- jdk/src/share/classes/sun/java2d/opengl/OGLRenderQueue.java | 2 +- jdk/src/solaris/classes/sun/awt/X11/XToolkit.java | 2 +- jdk/src/solaris/classes/sun/awt/X11GraphicsDevice.java | 2 +- .../classes/sun/awt/shell/Win32ShellFolderManager2.java | 2 +- jdk/src/windows/classes/sun/awt/windows/WToolkit.java | 2 +- .../classes/sun/java2d/d3d/D3DScreenUpdateManager.java | 2 +- 14 files changed, 15 insertions(+), 15 deletions(-) rename jdk/src/share/classes/sun/{misc => awt/util}/ThreadGroupUtils.java (95%) diff --git a/jdk/src/macosx/classes/sun/font/CFontManager.java b/jdk/src/macosx/classes/sun/font/CFontManager.java index ad2bfab62ba..8e1cead53c2 100644 --- a/jdk/src/macosx/classes/sun/font/CFontManager.java +++ b/jdk/src/macosx/classes/sun/font/CFontManager.java @@ -40,7 +40,7 @@ import javax.swing.plaf.FontUIResource; import sun.awt.FontConfiguration; import sun.awt.HeadlessToolkit; -import sun.misc.ThreadGroupUtils; +import sun.awt.util.ThreadGroupUtils; import sun.lwawt.macosx.*; public class CFontManager extends SunFontManager { diff --git a/jdk/src/macosx/classes/sun/lwawt/LWToolkit.java b/jdk/src/macosx/classes/sun/lwawt/LWToolkit.java index 8dd9467eed6..b18fdb004f1 100644 --- a/jdk/src/macosx/classes/sun/lwawt/LWToolkit.java +++ b/jdk/src/macosx/classes/sun/lwawt/LWToolkit.java @@ -35,7 +35,7 @@ import java.util.*; import sun.awt.*; import sun.print.*; -import sun.misc.ThreadGroupUtils; +import sun.awt.util.ThreadGroupUtils; import static sun.lwawt.LWWindowPeer.PeerType; diff --git a/jdk/src/macosx/native/sun/awt/awt.m b/jdk/src/macosx/native/sun/awt/awt.m index 0f553d0e69f..f5fe3ea9eba 100644 --- a/jdk/src/macosx/native/sun/awt/awt.m +++ b/jdk/src/macosx/native/sun/awt/awt.m @@ -435,7 +435,7 @@ JNF_COCOA_ENTER(env); forceEmbeddedMode = YES; } JNIEnv* env = [ThreadUtilities getJNIEnvUncached]; - jclass jc_ThreadGroupUtils = (*env)->FindClass(env, "sun/misc/ThreadGroupUtils"); + jclass jc_ThreadGroupUtils = (*env)->FindClass(env, "sun/awt/util/ThreadGroupUtils"); jmethodID sjm_getRootThreadGroup = (*env)->GetStaticMethodID(env, jc_ThreadGroupUtils, "getRootThreadGroup", "()Ljava/lang/ThreadGroup;"); jobject rootThreadGroup = (*env)->CallStaticObjectMethod(env, jc_ThreadGroupUtils, sjm_getRootThreadGroup); [ThreadUtilities setAppkitThreadGroup:(*env)->NewGlobalRef(env, rootThreadGroup)]; diff --git a/jdk/src/share/classes/sun/awt/AWTAutoShutdown.java b/jdk/src/share/classes/sun/awt/AWTAutoShutdown.java index f03cd50988d..d5b7633f224 100644 --- a/jdk/src/share/classes/sun/awt/AWTAutoShutdown.java +++ b/jdk/src/share/classes/sun/awt/AWTAutoShutdown.java @@ -35,7 +35,7 @@ import java.util.Map; import java.util.Set; import sun.util.logging.PlatformLogger; -import sun.misc.ThreadGroupUtils; +import sun.awt.util.ThreadGroupUtils; /** * This class is to let AWT shutdown automatically when a user is done diff --git a/jdk/src/share/classes/sun/misc/ThreadGroupUtils.java b/jdk/src/share/classes/sun/awt/util/ThreadGroupUtils.java similarity index 95% rename from jdk/src/share/classes/sun/misc/ThreadGroupUtils.java rename to jdk/src/share/classes/sun/awt/util/ThreadGroupUtils.java index 066a8002f72..5d58a1c29d4 100644 --- a/jdk/src/share/classes/sun/misc/ThreadGroupUtils.java +++ b/jdk/src/share/classes/sun/awt/util/ThreadGroupUtils.java @@ -23,13 +23,13 @@ * questions. */ -package sun.misc; +package sun.awt.util; /** * A utility class needed to access the root {@code ThreadGroup} * * The class should not depend on any others, because it' called from JNI_OnLoad of the AWT - * native library. Triggering class loading could could lead to a deadlock. + * native library. Triggering class loading could lead to a deadlock. */ public final class ThreadGroupUtils { diff --git a/jdk/src/share/classes/sun/font/CreatedFontTracker.java b/jdk/src/share/classes/sun/font/CreatedFontTracker.java index 02b264db785..43f8b098658 100644 --- a/jdk/src/share/classes/sun/font/CreatedFontTracker.java +++ b/jdk/src/share/classes/sun/font/CreatedFontTracker.java @@ -35,7 +35,7 @@ import java.util.concurrent.Semaphore; import java.util.concurrent.TimeUnit; import sun.awt.AppContext; -import sun.misc.ThreadGroupUtils; +import sun.awt.util.ThreadGroupUtils; public class CreatedFontTracker { diff --git a/jdk/src/share/classes/sun/font/SunFontManager.java b/jdk/src/share/classes/sun/font/SunFontManager.java index 8487b9632a1..04df414365c 100644 --- a/jdk/src/share/classes/sun/font/SunFontManager.java +++ b/jdk/src/share/classes/sun/font/SunFontManager.java @@ -52,7 +52,7 @@ import javax.swing.plaf.FontUIResource; import sun.awt.AppContext; import sun.awt.FontConfiguration; import sun.awt.SunToolkit; -import sun.misc.ThreadGroupUtils; +import sun.awt.util.ThreadGroupUtils; import sun.java2d.FontSupport; import sun.util.logging.PlatformLogger; diff --git a/jdk/src/share/classes/sun/java2d/Disposer.java b/jdk/src/share/classes/sun/java2d/Disposer.java index 1acf1447cdc..ba69ce763dd 100644 --- a/jdk/src/share/classes/sun/java2d/Disposer.java +++ b/jdk/src/share/classes/sun/java2d/Disposer.java @@ -25,7 +25,7 @@ package sun.java2d; -import sun.misc.ThreadGroupUtils; +import sun.awt.util.ThreadGroupUtils; import java.lang.ref.Reference; import java.lang.ref.ReferenceQueue; diff --git a/jdk/src/share/classes/sun/java2d/opengl/OGLRenderQueue.java b/jdk/src/share/classes/sun/java2d/opengl/OGLRenderQueue.java index a73a883d16f..ecf1ed3467b 100644 --- a/jdk/src/share/classes/sun/java2d/opengl/OGLRenderQueue.java +++ b/jdk/src/share/classes/sun/java2d/opengl/OGLRenderQueue.java @@ -25,7 +25,7 @@ package sun.java2d.opengl; -import sun.misc.ThreadGroupUtils; +import sun.awt.util.ThreadGroupUtils; import sun.java2d.pipe.RenderBuffer; import sun.java2d.pipe.RenderQueue; import static sun.java2d.pipe.BufferedOpCodes.*; diff --git a/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java b/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java index c10a1d9522c..3648e874b6a 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java @@ -51,7 +51,7 @@ import sun.awt.datatransfer.DataTransferer; import sun.font.FontConfigManager; import sun.java2d.SunGraphicsEnvironment; import sun.misc.*; -import sun.misc.ThreadGroupUtils; +import sun.awt.util.ThreadGroupUtils; import sun.print.PrintJob2D; import sun.security.action.GetPropertyAction; import sun.security.action.GetBooleanAction; diff --git a/jdk/src/solaris/classes/sun/awt/X11GraphicsDevice.java b/jdk/src/solaris/classes/sun/awt/X11GraphicsDevice.java index d69a4a0bce0..10365f9a647 100644 --- a/jdk/src/solaris/classes/sun/awt/X11GraphicsDevice.java +++ b/jdk/src/solaris/classes/sun/awt/X11GraphicsDevice.java @@ -42,7 +42,7 @@ import sun.java2d.opengl.GLXGraphicsConfig; import sun.java2d.xr.XRGraphicsConfig; import sun.java2d.loops.SurfaceType; -import sun.misc.ThreadGroupUtils; +import sun.awt.util.ThreadGroupUtils; /** * This is an implementation of a GraphicsDevice object for a single diff --git a/jdk/src/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java b/jdk/src/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java index c6b7351699e..269eff2e421 100644 --- a/jdk/src/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java +++ b/jdk/src/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java @@ -39,7 +39,7 @@ import java.util.concurrent.*; import static sun.awt.shell.Win32ShellFolder2.*; import sun.awt.OSInfo; -import sun.misc.ThreadGroupUtils; +import sun.awt.util.ThreadGroupUtils; // NOTE: This class supersedes Win32ShellFolderManager, which was removed // from distribution after version 1.4.2. diff --git a/jdk/src/windows/classes/sun/awt/windows/WToolkit.java b/jdk/src/windows/classes/sun/awt/windows/WToolkit.java index 71af30e5190..2a27c2df9cc 100644 --- a/jdk/src/windows/classes/sun/awt/windows/WToolkit.java +++ b/jdk/src/windows/classes/sun/awt/windows/WToolkit.java @@ -40,7 +40,7 @@ import sun.awt.AWTAutoShutdown; import sun.awt.AWTPermissions; import sun.awt.LightweightFrame; import sun.awt.SunToolkit; -import sun.misc.ThreadGroupUtils; +import sun.awt.util.ThreadGroupUtils; import sun.awt.Win32GraphicsDevice; import sun.awt.Win32GraphicsEnvironment; import sun.awt.datatransfer.DataTransferer; diff --git a/jdk/src/windows/classes/sun/java2d/d3d/D3DScreenUpdateManager.java b/jdk/src/windows/classes/sun/java2d/d3d/D3DScreenUpdateManager.java index bc9e98eb85c..bd210e92765 100644 --- a/jdk/src/windows/classes/sun/java2d/d3d/D3DScreenUpdateManager.java +++ b/jdk/src/windows/classes/sun/java2d/d3d/D3DScreenUpdateManager.java @@ -38,7 +38,7 @@ import java.util.ArrayList; import java.util.HashMap; import sun.awt.AWTAccessor; -import sun.misc.ThreadGroupUtils; +import sun.awt.util.ThreadGroupUtils; import sun.awt.Win32GraphicsConfig; import sun.awt.windows.WComponentPeer; import sun.java2d.InvalidPipeException; From 0a31e5f2467b81735348e7b555ee106d11330f37 Mon Sep 17 00:00:00 2001 From: Sergey Bylokhov Date: Fri, 18 Apr 2014 20:10:39 +0400 Subject: [PATCH 02/50] 8026252: [macosx] Change AWT_DEBUG_BUG_REPORT_MESSAGE for macosx platform Reviewed-by: azvegint, pchelko --- jdk/src/macosx/native/sun/osxapp/AWT_debug.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/jdk/src/macosx/native/sun/osxapp/AWT_debug.h b/jdk/src/macosx/native/sun/osxapp/AWT_debug.h index 1d02a824f3a..46f57cc6d73 100644 --- a/jdk/src/macosx/native/sun/osxapp/AWT_debug.h +++ b/jdk/src/macosx/native/sun/osxapp/AWT_debug.h @@ -32,9 +32,10 @@ #define kInternalError "java/lang/InternalError" #define AWT_DEBUG_LOG(str) \ - NSLog(@"Cocoa AWT: %@ %@", str, [NSThread callStackSymbols]) + NSLog(@"\tCocoa AWT: %@ %@", str, [NSThread callStackSymbols]) #define AWT_DEBUG_BUG_REPORT_MESSAGE \ - NSLog(@"\tPlease file a bug report at http://java.net/jira/browse/MACOSX_PORT with this message and a reproducible test case.") + NSLog(@"\tPlease file a bug report at http://bugreport.java.com/bugreport \ +with this message and a reproducible test case.") #endif From 81ae76b8dd94c3d1cdbcdcd3cc8c6ad568646ab6 Mon Sep 17 00:00:00 2001 From: Henry Jen Date: Fri, 18 Apr 2014 09:56:34 -0700 Subject: [PATCH 03/50] 8038644: Fix raw and unchecked warnings in sun.java2d.* Reviewed-by: darcy, prr --- jdk/src/share/classes/sun/java2d/Spans.java | 23 ++++++++----------- .../classes/sun/java2d/SunGraphics2D.java | 7 ++++-- .../sun/java2d/SunGraphicsEnvironment.java | 2 +- .../classes/sun/java2d/cmm/lcms/LCMS.java | 4 ++-- .../share/classes/sun/java2d/loops/Blit.java | 12 +++++----- .../sun/java2d/loops/CustomComponent.java | 2 +- .../sun/java2d/loops/GeneralRenderer.java | 2 +- .../sun/java2d/loops/GraphicsPrimitive.java | 15 ++++++------ .../java2d/loops/GraphicsPrimitiveMgr.java | 21 +++++++++-------- .../java2d/loops/GraphicsPrimitiveProxy.java | 6 ++--- .../classes/sun/java2d/loops/MaskBlit.java | 12 +++++----- .../sun/java2d/opengl/OGLBlitLoops.java | 8 +++---- .../sun/java2d/pipe/AlphaPaintPipe.java | 20 ++++++++-------- .../classes/sun/java2d/pipe/RenderQueue.java | 4 ++-- .../sun/java2d/pipe/SpanClipRenderer.java | 6 ++--- .../sun/java2d/x11/X11SurfaceData.java | 2 +- 16 files changed, 74 insertions(+), 72 deletions(-) diff --git a/jdk/src/share/classes/sun/java2d/Spans.java b/jdk/src/share/classes/sun/java2d/Spans.java index ae708f1f161..abd1eda118f 100644 --- a/jdk/src/share/classes/sun/java2d/Spans.java +++ b/jdk/src/share/classes/sun/java2d/Spans.java @@ -49,7 +49,7 @@ public class Spans { * Holds a list of individual * Span instances. */ - private List mSpans = new Vector(kMaxAddsSinceSort); + private List mSpans = new Vector<>(kMaxAddsSinceSort); /** * The number of Span @@ -144,7 +144,7 @@ public class Spans { Collections.sort(mSpans); mAddsSinceSort = 0; - Iterator iter = mSpans.iterator(); + Iterator iter = mSpans.iterator(); /* Have 'span' start at the first span in * the collection. The collection may be empty @@ -152,7 +152,7 @@ public class Spans { */ Span span = null; if (iter.hasNext()) { - span = (Span) iter.next(); + span = iter.next(); } /* Loop over the spans collapsing those that intersect @@ -160,7 +160,7 @@ public class Spans { */ while (iter.hasNext()) { - Span nextSpan = (Span) iter.next(); + Span nextSpan = iter.next(); /* The spans are in ascending start position * order and so the next span's starting point @@ -202,9 +202,9 @@ public class Spans { private void printSpans() { System.out.println("----------"); if (mSpans != null) { - Iterator iter = mSpans.iterator(); + Iterator iter = mSpans.iterator(); while (iter.hasNext()) { - Span span = (Span) iter.next(); + Span span = iter.next(); System.out.println(span); } } @@ -216,7 +216,7 @@ public class Spans { /** * Holds a single half-open interval. */ - static class Span implements Comparable { + static class Span implements Comparable { /** * The span includes the starting point. @@ -315,8 +315,7 @@ public class Spans { * position. The end position is ignored * in this ranking. */ - public int compareTo(Object o) { - Span otherSpan = (Span) o; + public int compareTo(Span otherSpan) { float otherStart = otherSpan.getStart(); int result; @@ -345,7 +344,7 @@ public class Spans { * SpanIntersection.instance to * get the single instance of this class. */ - static class SpanIntersection implements Comparator { + static class SpanIntersection implements Comparator { /** * This class is a Singleton and the following @@ -361,10 +360,8 @@ public class Spans { } - public int compare(Object o1, Object o2) { + public int compare(Span span1, Span span2) { int result; - Span span1 = (Span) o1; - Span span2 = (Span) o2; /* Span 1 is entirely to the left of span2. * span1: <-----< diff --git a/jdk/src/share/classes/sun/java2d/SunGraphics2D.java b/jdk/src/share/classes/sun/java2d/SunGraphics2D.java index 287549c2062..58f90c36b11 100644 --- a/jdk/src/share/classes/sun/java2d/SunGraphics2D.java +++ b/jdk/src/share/classes/sun/java2d/SunGraphics2D.java @@ -1430,8 +1430,11 @@ public final class SunGraphics2D } } - RenderingHints makeHints(Map hints) { - RenderingHints model = new RenderingHints(hints); + RenderingHints makeHints(Map hints) { + RenderingHints model = new RenderingHints(null); + if (hints != null) { + model.putAll(hints); + } model.put(SunHints.KEY_RENDERING, SunHints.Value.get(SunHints.INTKEY_RENDERING, renderHint)); diff --git a/jdk/src/share/classes/sun/java2d/SunGraphicsEnvironment.java b/jdk/src/share/classes/sun/java2d/SunGraphicsEnvironment.java index c4e0be79f1c..cc2d113e064 100644 --- a/jdk/src/share/classes/sun/java2d/SunGraphicsEnvironment.java +++ b/jdk/src/share/classes/sun/java2d/SunGraphicsEnvironment.java @@ -82,7 +82,7 @@ public abstract class SunGraphicsEnvironment extends GraphicsEnvironment public SunGraphicsEnvironment() { java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction() { + new java.security.PrivilegedAction() { public Object run() { String version = System.getProperty("os.version", "0.0"); try { diff --git a/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMS.java b/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMS.java index d01dff66c45..c9333616065 100644 --- a/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMS.java +++ b/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMS.java @@ -189,7 +189,7 @@ public class LCMS implements PCMM { LCMSImageLayout dest); public static native void freeTransform(long ID); - public static native void initLCMS(Class Trans, Class IL, Class Pf); + public static native void initLCMS(Class Trans, Class IL, Class Pf); private LCMS() {}; @@ -201,7 +201,7 @@ public class LCMS implements PCMM { } java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction() { + new java.security.PrivilegedAction() { public Object run() { /* We need to load awt here because of usage trace and * disposer frameworks diff --git a/jdk/src/share/classes/sun/java2d/loops/Blit.java b/jdk/src/share/classes/sun/java2d/loops/Blit.java index 7a337e15214..802385279a2 100644 --- a/jdk/src/share/classes/sun/java2d/loops/Blit.java +++ b/jdk/src/share/classes/sun/java2d/loops/Blit.java @@ -217,8 +217,8 @@ public class Blit extends GraphicsPrimitive Blit performop; Blit convertresult; - WeakReference srcTmp; - WeakReference dstTmp; + WeakReference srcTmp; + WeakReference dstTmp; public GeneralXorBlit(SurfaceType srctype, CompositeType comptype, @@ -257,14 +257,14 @@ public class Blit extends GraphicsPrimitive } else { SurfaceData cachedSrc = null; if (srcTmp != null) { - cachedSrc = (SurfaceData) srcTmp.get(); + cachedSrc = srcTmp.get(); } src = convertFrom(convertsrc, srcData, srcx, srcy, width, height, cachedSrc); sx = 0; sy = 0; if (src != cachedSrc) { - srcTmp = new WeakReference(src); + srcTmp = new WeakReference<>(src); } } @@ -277,7 +277,7 @@ public class Blit extends GraphicsPrimitive // assert: convertresult != null SurfaceData cachedDst = null; if (dstTmp != null) { - cachedDst = (SurfaceData) dstTmp.get(); + cachedDst = dstTmp.get(); } dst = convertFrom(convertdst, dstData, dstx, dsty, width, height, cachedDst); @@ -285,7 +285,7 @@ public class Blit extends GraphicsPrimitive dy = 0; opclip = null; if (dst != cachedDst) { - dstTmp = new WeakReference(dst); + dstTmp = new WeakReference<>(dst); } } diff --git a/jdk/src/share/classes/sun/java2d/loops/CustomComponent.java b/jdk/src/share/classes/sun/java2d/loops/CustomComponent.java index 55a921aeb1d..ff346172387 100644 --- a/jdk/src/share/classes/sun/java2d/loops/CustomComponent.java +++ b/jdk/src/share/classes/sun/java2d/loops/CustomComponent.java @@ -50,7 +50,7 @@ public final class CustomComponent { public static void register() { // REMIND: This does not work for all destinations yet since // the screen SurfaceData objects do not implement getRaster - Class owner = CustomComponent.class; + Class owner = CustomComponent.class; GraphicsPrimitive[] primitives = { new GraphicsPrimitiveProxy(owner, "OpaqueCopyAnyToArgb", Blit.methodSignature, diff --git a/jdk/src/share/classes/sun/java2d/loops/GeneralRenderer.java b/jdk/src/share/classes/sun/java2d/loops/GeneralRenderer.java index ac01d5324c3..af0fa2ece8b 100644 --- a/jdk/src/share/classes/sun/java2d/loops/GeneralRenderer.java +++ b/jdk/src/share/classes/sun/java2d/loops/GeneralRenderer.java @@ -50,7 +50,7 @@ import sun.font.GlyphList; public final class GeneralRenderer { public static void register() { - Class owner = GeneralRenderer.class; + Class owner = GeneralRenderer.class; GraphicsPrimitive[] primitives = { new GraphicsPrimitiveProxy(owner, "SetFillRectANY", FillRect.methodSignature, diff --git a/jdk/src/share/classes/sun/java2d/loops/GraphicsPrimitive.java b/jdk/src/share/classes/sun/java2d/loops/GraphicsPrimitive.java index 47db650374a..ca23fe72aec 100644 --- a/jdk/src/share/classes/sun/java2d/loops/GraphicsPrimitive.java +++ b/jdk/src/share/classes/sun/java2d/loops/GraphicsPrimitive.java @@ -316,7 +316,7 @@ public abstract class GraphicsPrimitive { public abstract GraphicsPrimitive traceWrap(); - static HashMap traceMap; + static HashMap traceMap; public static int traceflags; public static String tracefile; @@ -427,13 +427,14 @@ public abstract class GraphicsPrimitive { public void run() { PrintStream ps = getTraceOutputFile(); - Iterator iterator = traceMap.entrySet().iterator(); + Iterator> iterator = + traceMap.entrySet().iterator(); long total = 0; int numprims = 0; while (iterator.hasNext()) { - Map.Entry me = (Map.Entry) iterator.next(); + Map.Entry me = iterator.next(); Object prim = me.getKey(); - int[] count = (int[]) me.getValue(); + int[] count = me.getValue(); if (count[0] == 1) { ps.print("1 call to "); } else { @@ -455,15 +456,15 @@ public abstract class GraphicsPrimitive { public synchronized static void tracePrimitive(Object prim) { if ((traceflags & TRACECOUNTS) != 0) { if (traceMap == null) { - traceMap = new HashMap(); + traceMap = new HashMap<>(); TraceReporter.setShutdownHook(); } - Object o = traceMap.get(prim); + int[] o = traceMap.get(prim); if (o == null) { o = new int[1]; traceMap.put(prim, o); } - ((int[]) o)[0]++; + o[0]++; } if ((traceflags & TRACELOG) != 0) { PrintStream ps = getTraceOutputFile(); diff --git a/jdk/src/share/classes/sun/java2d/loops/GraphicsPrimitiveMgr.java b/jdk/src/share/classes/sun/java2d/loops/GraphicsPrimitiveMgr.java index 6f76f544bec..177aa2148aa 100644 --- a/jdk/src/share/classes/sun/java2d/loops/GraphicsPrimitiveMgr.java +++ b/jdk/src/share/classes/sun/java2d/loops/GraphicsPrimitiveMgr.java @@ -45,11 +45,11 @@ public final class GraphicsPrimitiveMgr { private static GraphicsPrimitive generalPrimitives[]; private static boolean needssort = true; - private static native void initIDs(Class GP, Class ST, Class CT, - Class SG2D, Class Color, Class AT, - Class XORComp, Class AlphaComp, - Class Path2D, Class Path2DFloat, - Class SHints); + private static native void initIDs(Class GP, Class ST, Class CT, + Class SG2D, Class Color, Class AT, + Class XORComp, Class AlphaComp, + Class Path2D, Class Path2DFloat, + Class SHints); private static native void registerNativeLoops(); static { @@ -73,16 +73,17 @@ public final class GraphicsPrimitiveMgr { public int uniqueID; } - private static Comparator primSorter = new Comparator() { - public int compare(Object o1, Object o2) { - int id1 = ((GraphicsPrimitive) o1).getUniqueID(); - int id2 = ((GraphicsPrimitive) o2).getUniqueID(); + private static Comparator primSorter = + new Comparator() { + public int compare(GraphicsPrimitive o1, GraphicsPrimitive o2) { + int id1 = o1.getUniqueID(); + int id2 = o2.getUniqueID(); return (id1 == id2 ? 0 : (id1 < id2 ? -1 : 1)); } }; - private static Comparator primFinder = new Comparator() { + private static Comparator primFinder = new Comparator() { public int compare(Object o1, Object o2) { int id1 = ((GraphicsPrimitive) o1).getUniqueID(); int id2 = ((PrimitiveSpec) o2).uniqueID; diff --git a/jdk/src/share/classes/sun/java2d/loops/GraphicsPrimitiveProxy.java b/jdk/src/share/classes/sun/java2d/loops/GraphicsPrimitiveProxy.java index 15c93111d69..73f18a60946 100644 --- a/jdk/src/share/classes/sun/java2d/loops/GraphicsPrimitiveProxy.java +++ b/jdk/src/share/classes/sun/java2d/loops/GraphicsPrimitiveProxy.java @@ -41,7 +41,7 @@ package sun.java2d.loops; */ public class GraphicsPrimitiveProxy extends GraphicsPrimitive { - private Class owner; + private Class owner; private String relativeClassName; /** @@ -53,7 +53,7 @@ public class GraphicsPrimitiveProxy extends GraphicsPrimitive { * @param relativeClassName The name of the class this is a proxy for. * This should not include the package. */ - public GraphicsPrimitiveProxy(Class owner, String relativeClassName, + public GraphicsPrimitiveProxy(Class owner, String relativeClassName, String methodSignature, int primID, SurfaceType srctype, @@ -80,7 +80,7 @@ public class GraphicsPrimitiveProxy extends GraphicsPrimitive { String name = getPackageName(owner.getName()) + "." + relativeClassName; try { - Class clazz = Class.forName(name); + Class clazz = Class.forName(name); GraphicsPrimitive p = (GraphicsPrimitive) clazz.newInstance(); if (!satisfiesSameAs(p)) { throw new RuntimeException("Primitive " + p diff --git a/jdk/src/share/classes/sun/java2d/loops/MaskBlit.java b/jdk/src/share/classes/sun/java2d/loops/MaskBlit.java index 39a047d19ff..1572d05e0b6 100644 --- a/jdk/src/share/classes/sun/java2d/loops/MaskBlit.java +++ b/jdk/src/share/classes/sun/java2d/loops/MaskBlit.java @@ -143,8 +143,8 @@ public class MaskBlit extends GraphicsPrimitive MaskBlit performop; Blit convertresult; - WeakReference srcTmp; - WeakReference dstTmp; + WeakReference srcTmp; + WeakReference dstTmp; public General(SurfaceType srctype, CompositeType comptype, @@ -184,14 +184,14 @@ public class MaskBlit extends GraphicsPrimitive } else { SurfaceData cachedSrc = null; if (srcTmp != null) { - cachedSrc = (SurfaceData) srcTmp.get(); + cachedSrc = srcTmp.get(); } src = convertFrom(convertsrc, srcData, srcx, srcy, width, height, cachedSrc); sx = 0; sy = 0; if (src != cachedSrc) { - srcTmp = new WeakReference(src); + srcTmp = new WeakReference<>(src); } } @@ -204,7 +204,7 @@ public class MaskBlit extends GraphicsPrimitive // assert: convertresult != null SurfaceData cachedDst = null; if (dstTmp != null) { - cachedDst = (SurfaceData) dstTmp.get(); + cachedDst = dstTmp.get(); } dst = convertFrom(convertdst, dstData, dstx, dsty, width, height, cachedDst); @@ -212,7 +212,7 @@ public class MaskBlit extends GraphicsPrimitive dy = 0; opclip = null; if (dst != cachedDst) { - dstTmp = new WeakReference(dst); + dstTmp = new WeakReference<>(dst); } } diff --git a/jdk/src/share/classes/sun/java2d/opengl/OGLBlitLoops.java b/jdk/src/share/classes/sun/java2d/opengl/OGLBlitLoops.java index a613daf4808..64459c1145e 100644 --- a/jdk/src/share/classes/sun/java2d/opengl/OGLBlitLoops.java +++ b/jdk/src/share/classes/sun/java2d/opengl/OGLBlitLoops.java @@ -728,7 +728,7 @@ class OGLTextureToSurfaceTransform extends TransformBlit { class OGLGeneralBlit extends Blit { private Blit performop; - private WeakReference srcTmp; + private WeakReference srcTmp; OGLGeneralBlit(SurfaceType dstType, CompositeType compType, @@ -750,7 +750,7 @@ class OGLGeneralBlit extends Blit { SurfaceData cachedSrc = null; if (srcTmp != null) { // use cached intermediate surface, if available - cachedSrc = (SurfaceData)srcTmp.get(); + cachedSrc = srcTmp.get(); } // convert source to IntArgbPre @@ -763,7 +763,7 @@ class OGLGeneralBlit extends Blit { if (src != cachedSrc) { // cache the intermediate surface - srcTmp = new WeakReference(src); + srcTmp = new WeakReference<>(src); } } } @@ -802,7 +802,7 @@ class OGLAnyCompositeBlit extends Blit { if (dstBuffer != cachedDst) { // cache the intermediate surface - dstTmp = new WeakReference(dstBuffer); + dstTmp = new WeakReference<>(dstBuffer); } // now blit the buffer back to the destination diff --git a/jdk/src/share/classes/sun/java2d/pipe/AlphaPaintPipe.java b/jdk/src/share/classes/sun/java2d/pipe/AlphaPaintPipe.java index 547211cf1e5..70cb1c18efe 100644 --- a/jdk/src/share/classes/sun/java2d/pipe/AlphaPaintPipe.java +++ b/jdk/src/share/classes/sun/java2d/pipe/AlphaPaintPipe.java @@ -48,16 +48,16 @@ import sun.java2d.loops.GraphicsPrimitiveMgr; * SunGraphics2D. */ public class AlphaPaintPipe implements CompositePipe { - static WeakReference cachedLastRaster; - static WeakReference cachedLastColorModel; - static WeakReference cachedLastData; + static WeakReference cachedLastRaster; + static WeakReference cachedLastColorModel; + static WeakReference cachedLastData; static class TileContext { SunGraphics2D sunG2D; PaintContext paintCtxt; ColorModel paintModel; - WeakReference lastRaster; - WeakReference lastData; + WeakReference lastRaster; + WeakReference lastData; MaskBlit lastMask; Blit lastBlit; SurfaceData dstData; @@ -105,8 +105,8 @@ public class AlphaPaintPipe implements CompositePipe { SurfaceData srcData = null; Raster lastRas = null; if (context.lastData != null && context.lastRaster != null) { - srcData = (SurfaceData) context.lastData.get(); - lastRas = (Raster) context.lastRaster.get(); + srcData = context.lastData.get(); + lastRas = context.lastRaster.get(); if (srcData == null || lastRas == null) { srcData = null; lastRas = null; @@ -127,7 +127,7 @@ public class AlphaPaintPipe implements CompositePipe { } if (lastRas != srcRaster) { lastRas = srcRaster; - context.lastRaster = new WeakReference(lastRas); + context.lastRaster = new WeakReference<>(lastRas); // REMIND: This will fail for a non-Writable raster! BufferedImage bImg = new BufferedImage(paintModel, @@ -135,7 +135,7 @@ public class AlphaPaintPipe implements CompositePipe { paintModel.isAlphaPremultiplied(), null); srcData = BufImgSurfaceData.createData(bImg); - context.lastData = new WeakReference(srcData); + context.lastData = new WeakReference<>(srcData); context.lastMask = null; context.lastBlit = null; } @@ -197,7 +197,7 @@ public class AlphaPaintPipe implements CompositePipe { { // Avoid creating new WeakReference if possible cachedLastColorModel = - new WeakReference(context.paintModel); + new WeakReference<>(context.paintModel); } cachedLastData = context.lastData; } diff --git a/jdk/src/share/classes/sun/java2d/pipe/RenderQueue.java b/jdk/src/share/classes/sun/java2d/pipe/RenderQueue.java index 6f65c05349c..f9dc262f17c 100644 --- a/jdk/src/share/classes/sun/java2d/pipe/RenderQueue.java +++ b/jdk/src/share/classes/sun/java2d/pipe/RenderQueue.java @@ -81,10 +81,10 @@ public abstract class RenderQueue { * A Set containing hard references to Objects that must stay alive until * the queue has been completely flushed. */ - protected Set refSet; + protected Set refSet; protected RenderQueue() { - refSet = new HashSet(); + refSet = new HashSet<>(); buf = RenderBuffer.allocate(BUFFER_SIZE); } diff --git a/jdk/src/share/classes/sun/java2d/pipe/SpanClipRenderer.java b/jdk/src/share/classes/sun/java2d/pipe/SpanClipRenderer.java index bba66f65907..0e18b92a7d7 100644 --- a/jdk/src/share/classes/sun/java2d/pipe/SpanClipRenderer.java +++ b/jdk/src/share/classes/sun/java2d/pipe/SpanClipRenderer.java @@ -39,14 +39,14 @@ public class SpanClipRenderer implements CompositePipe { CompositePipe outpipe; - static Class RegionClass = Region.class; - static Class RegionIteratorClass = RegionIterator.class; + static Class RegionClass = Region.class; + static Class RegionIteratorClass = RegionIterator.class; static { initIDs(RegionClass, RegionIteratorClass); } - static native void initIDs(Class rc, Class ric); + static native void initIDs(Class rc, Class ric); public SpanClipRenderer(CompositePipe pipe) { outpipe = pipe; diff --git a/jdk/src/solaris/classes/sun/java2d/x11/X11SurfaceData.java b/jdk/src/solaris/classes/sun/java2d/x11/X11SurfaceData.java index af65891495f..4e6c24f2e23 100644 --- a/jdk/src/solaris/classes/sun/java2d/x11/X11SurfaceData.java +++ b/jdk/src/solaris/classes/sun/java2d/x11/X11SurfaceData.java @@ -72,7 +72,7 @@ public abstract class X11SurfaceData extends XSurfaceData { protected int depth; - private static native void initIDs(Class xorComp, boolean tryDGA); + private static native void initIDs(Class xorComp, boolean tryDGA); protected native void initSurface(int depth, int width, int height, long drawable); From a2651f668e20d651428158c7cc56bfb6590246e5 Mon Sep 17 00:00:00 2001 From: Petr Pchelko Date: Mon, 21 Apr 2014 11:00:46 +0400 Subject: [PATCH 04/50] 8037477: Reproducible hang of JAWS and webstart application with JAB 2.0.4 Reviewed-by: anthony, serb --- .../accessibility/AccessibleContext.java | 23 ++++++++++++++++ .../share/classes/sun/awt/AWTAccessor.java | 27 +++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/jdk/src/share/classes/javax/accessibility/AccessibleContext.java b/jdk/src/share/classes/javax/accessibility/AccessibleContext.java index 15f0f7f3983..b7f584b95db 100644 --- a/jdk/src/share/classes/javax/accessibility/AccessibleContext.java +++ b/jdk/src/share/classes/javax/accessibility/AccessibleContext.java @@ -25,6 +25,9 @@ package javax.accessibility; +import sun.awt.AWTAccessor; +import sun.awt.AppContext; + import java.util.Locale; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeSupport; @@ -79,6 +82,26 @@ import java.awt.IllegalComponentStateException; */ public abstract class AccessibleContext { + /** + * The AppContext that should be used to dispatch events for this + * AccessibleContext + */ + private volatile AppContext targetAppContext; + + static { + AWTAccessor.setAccessibleContextAccessor(new AWTAccessor.AccessibleContextAccessor() { + @Override + public void setAppContext(AccessibleContext accessibleContext, AppContext appContext) { + accessibleContext.targetAppContext = appContext; + } + + @Override + public AppContext getAppContext(AccessibleContext accessibleContext) { + return accessibleContext.targetAppContext; + } + }); + } + /** * Constant used to determine when the accessibleName property has * changed. The old value in the PropertyChangeEvent will be the old diff --git a/jdk/src/share/classes/sun/awt/AWTAccessor.java b/jdk/src/share/classes/sun/awt/AWTAccessor.java index 9e41cd4dfaa..b99ccdfe2ee 100644 --- a/jdk/src/share/classes/sun/awt/AWTAccessor.java +++ b/jdk/src/share/classes/sun/awt/AWTAccessor.java @@ -27,6 +27,7 @@ package sun.awt; import sun.misc.Unsafe; +import javax.accessibility.AccessibleContext; import java.awt.*; import java.awt.KeyboardFocusManager; import java.awt.DefaultKeyboardFocusManager; @@ -761,6 +762,14 @@ public final class AWTAccessor { void updateSystemColors(); } + /* + * An accessor object for the AccessibleContext class + */ + public interface AccessibleContextAccessor { + void setAppContext(AccessibleContext accessibleContext, AppContext appContext); + AppContext getAppContext(AccessibleContext accessibleContext); + } + /* * Accessor instances are initialized in the static initializers of * corresponding AWT classes by using setters defined below. @@ -791,6 +800,7 @@ public final class AWTAccessor { private static ToolkitAccessor toolkitAccessor; private static InvocationEventAccessor invocationEventAccessor; private static SystemColorAccessor systemColorAccessor; + private static AccessibleContextAccessor accessibleContextAccessor; /* * Set an accessor object for the java.awt.Component class. @@ -1234,4 +1244,21 @@ public final class AWTAccessor { public static void setSystemColorAccessor(SystemColorAccessor systemColorAccessor) { AWTAccessor.systemColorAccessor = systemColorAccessor; } + + /* + * Get the accessor object for the javax.accessibility.AccessibleContext class. + */ + public static AccessibleContextAccessor getAccessibleContextAccessor() { + if (accessibleContextAccessor == null) { + unsafe.ensureClassInitialized(AccessibleContext.class); + } + return accessibleContextAccessor; + } + + /* + * Set the accessor object for the javax.accessibility.AccessibleContext class. + */ + public static void setAccessibleContextAccessor(AccessibleContextAccessor accessor) { + AWTAccessor.accessibleContextAccessor = accessor; + } } From 704f4dc11341abce912047621f389f50b2f5930f Mon Sep 17 00:00:00 2001 From: Dmitriy Ermashov Date: Mon, 21 Apr 2014 14:35:14 +0400 Subject: [PATCH 05/50] 8039279: Move awt tests to openjdk repository Reviewed-by: pchelko, alexsch --- .../SetMaximizedBounds.java | 88 +++++++ .../ChangeGridSize/ChangeGridSize.java | 189 ++++++++++++++ .../ComponentPreferredSize.java | 181 ++++++++++++++ .../ModifierRobotKeyTest.java | 230 ++++++++++++++++++ .../LockingKeyStateTest.java | 126 ++++++++++ 5 files changed, 814 insertions(+) create mode 100644 jdk/test/java/awt/Frame/SetMaximizedBounds/SetMaximizedBounds.java create mode 100644 jdk/test/java/awt/GridLayout/ChangeGridSize/ChangeGridSize.java create mode 100644 jdk/test/java/awt/GridLayout/ComponentPreferredSize/ComponentPreferredSize.java create mode 100644 jdk/test/java/awt/Robot/ModifierRobotKey/ModifierRobotKeyTest.java create mode 100644 jdk/test/java/awt/Toolkit/LockingKeyStateTest/LockingKeyStateTest.java diff --git a/jdk/test/java/awt/Frame/SetMaximizedBounds/SetMaximizedBounds.java b/jdk/test/java/awt/Frame/SetMaximizedBounds/SetMaximizedBounds.java new file mode 100644 index 00000000000..da5b3800eae --- /dev/null +++ b/jdk/test/java/awt/Frame/SetMaximizedBounds/SetMaximizedBounds.java @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.*; + +/* + * @test + * @summary When Frame.setExtendedState(Frame.MAXIMIZED_BOTH) + * is called for a Frame after been called setMaximizedBounds() with + * certain value, Frame bounds must equal to this value. + * + * @library ../../../../lib/testlibrary + * @build ExtendedRobot + * @run main SetMaximizedBounds + */ + +public class SetMaximizedBounds { + + Frame frame; + Rectangle bound; + boolean supported; + ExtendedRobot robot; + static Rectangle max = new Rectangle(100,100,400,400); + + public void doTest() throws Exception { + robot = new ExtendedRobot(); + + EventQueue.invokeAndWait( () -> { + frame = new Frame( "TestFrame "); + frame.setLayout(new FlowLayout()); + + if (Toolkit.getDefaultToolkit().isFrameStateSupported(Frame.MAXIMIZED_BOTH)) { + supported = true; + frame.setMaximizedBounds(max); + } else { + supported = false; + } + + frame.setSize(200, 200); + frame.setVisible(true); + }); + + robot.waitForIdle(2000); + if (supported) { + EventQueue.invokeAndWait( () -> { + frame.setExtendedState(Frame.MAXIMIZED_BOTH); + }); + robot.waitForIdle(2000); + bound = frame.getBounds(); + if(!bound.equals(max)) + throw new RuntimeException("The bounds of the Frame do not equal to what" + + " is specified when the frame is in Frame.MAXIMIZED_BOTH state"); + } else { + System.out.println("Frame.MAXIMIZED_BOTH not supported"); + } + + frame.dispose(); + } + + public static void main(String[] args) throws Exception { + String os = System.getProperty("os.name").toLowerCase(); + System.out.println(os); + if (os.contains("windows") || os.contains("os x")) + new SetMaximizedBounds().doTest(); + else + System.out.println("Platform "+os+" is not supported. Supported platforms are Windows and OS X."); + } +} diff --git a/jdk/test/java/awt/GridLayout/ChangeGridSize/ChangeGridSize.java b/jdk/test/java/awt/GridLayout/ChangeGridSize/ChangeGridSize.java new file mode 100644 index 00000000000..86f7a7a8b3a --- /dev/null +++ b/jdk/test/java/awt/GridLayout/ChangeGridSize/ChangeGridSize.java @@ -0,0 +1,189 @@ +/* + * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.*; +import java.awt.event.*; + +/* + * @test + * @summary Have different components having different preferred sizes + * added to a grid layout. Change the rows and columns of the + * grid layout and check the components are re-laid out. + * The strategy followed is to calculate the component location + * depending on the preferred sizes and gaps and click the cornors + * of the components to check if events are triggered + * @library ../../../../lib/testlibrary/ + * @build ExtendedRobot + * @run main ChangeGridSize + * @run main ChangeGridSize -hg 20 -vg 20 + */ + +public class ChangeGridSize { + + private int width = 200; + private int height = 200; + private final int hGap, vGap; + private final int rows = 3; + private final int columns = 2; + private final int componentCount = 6; + + private Button[] buttons; + private Frame frame; + + private ExtendedRobot robot; + private GridLayout layout; + + private volatile boolean actionPerformed = false; + + public ChangeGridSize(int hGap, int vGap) throws Exception { + this.hGap = hGap; + this.vGap = vGap; + robot = new ExtendedRobot(); + EventQueue.invokeAndWait( () -> { + frame = new Frame("Test frame"); + frame.setSize(width, height); + layout = new GridLayout(rows + 3, columns - 1, hGap, vGap); + frame.setLayout(layout); + + buttons = new Button[componentCount]; + for (int i = 0; i < componentCount; i++) { + buttons[i] = new Button("Button" + i); + frame.add(buttons[i]); + buttons[i].addActionListener( (event) -> { actionPerformed = true; }); + } + frame.setVisible(true); + }); + } + + public static void main(String[] args) throws Exception { + int hGap = 0; + int vGap = 0; + for (int i = 0; i < args.length; i++) { + switch (args[i]) { + case "-hg": + hGap = Integer.parseInt(args[++i]); + break; + case "-vg": + vGap = Integer.parseInt(args[++i]); + break; + } + } + new ChangeGridSize(hGap, vGap).doTest(); + } + + private void resizeFrame() throws Exception { + EventQueue.invokeAndWait(() -> { + Insets insets = frame.getInsets(); + double dH = (height-insets.top-insets.bottom - vGap*(rows-1)) % rows; + double dW = (width-insets.left-insets.right - hGap*(columns-1)) % columns; + height -= dH; + width -= dW; + frame.setSize(width, height); + frame.revalidate(); + }); + robot.waitForIdle(); + } + + private void changeGridSize() throws Exception { + EventQueue.invokeAndWait(() -> { + layout.setRows(rows); + layout.setColumns(columns); + + frame.revalidate(); + }); + robot.waitForIdle(); + } + + public void testBoundaries(int topLeftX, int topLeftY, int bottomRightX, int bottomRightY) throws Exception { + + actionPerformed = false; + robot.mouseMove(topLeftX, topLeftY); + robot.delay(500); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.delay(500); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + robot.waitForIdle(3000); + + if(!actionPerformed) + throw new RuntimeException("Clicking on the left top of button did not trigger action event"); + + actionPerformed = false; + robot.mouseMove(bottomRightX, bottomRightY); + robot.delay(500); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.delay(500); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + robot.waitForIdle(3000); + + if(!actionPerformed) + throw new RuntimeException("Clicking on the bottom right of button did not trigger action event"); + } + + private void doTest() throws Exception { + robot.waitForIdle(); + changeGridSize(); + resizeFrame(); + + int availableWidth = width - frame.getInsets().left - + frame.getInsets().right; + int componentWidth = (availableWidth + hGap) / columns - hGap; + int availableHeight = height - frame.getInsets().top - + frame.getInsets().bottom; + int componentHeight = (availableHeight + vGap) / rows - vGap; + + for (int i = 0; i < buttons.length; i++) { + if (buttons[i].getSize().width != componentWidth || + buttons[i].getSize().height != componentHeight) { + throw new RuntimeException( + "FAIL: Button " + i + " not of proper size" + + "Expected: " + componentWidth + "*" + componentHeight + + "Actual: " + buttons[i].getSize().width + "*" + buttons[i].getSize().height); + } + } + + // Components are visible. They should trigger events. + // Now you can check for the actual size shown. + int currentRow = 1; + int currentColumn = 0; + for (int i = 0; i < buttons.length; i++) { + currentColumn++; + if (currentColumn > columns) { + currentColumn = 1; + currentRow++; + } + + int topPosX = frame.getLocationOnScreen().x + + frame.getInsets().left + + (currentColumn - 1) * (componentWidth + hGap); + int topPosY = frame.getLocationOnScreen().y + + frame.getInsets().top + + (currentRow - 1) * (componentHeight + vGap); + + int bottomPosX = topPosX + componentWidth - 1; + int bottomPosY = topPosY + componentHeight - 1; + testBoundaries(topPosX, topPosY, bottomPosX, bottomPosY); + } + + frame.dispose(); + } +} diff --git a/jdk/test/java/awt/GridLayout/ComponentPreferredSize/ComponentPreferredSize.java b/jdk/test/java/awt/GridLayout/ComponentPreferredSize/ComponentPreferredSize.java new file mode 100644 index 00000000000..d8ceac748c8 --- /dev/null +++ b/jdk/test/java/awt/GridLayout/ComponentPreferredSize/ComponentPreferredSize.java @@ -0,0 +1,181 @@ +/* + * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.*; +import java.awt.event.InputEvent; + +/* + * @test + * @summary Have different components having different preferred sizes + * added to a grid layout having various values of row/columns. + * Check if the compnents are correctly laid out. + * The strategy followed is to calculate the component location + * depending on the preferred sizes and gaps and click the cornors + * of the components to check if events are triggered + * @library ../../../../lib/testlibrary/ + * @build ExtendedRobot + * @run main ComponentPreferredSize + * @run main ComponentPreferredSize -hg 20 -vg 20 + */ + +public class ComponentPreferredSize { + + private int width = 200; + private int height = 200; + private final int hGap, vGap; + private final int rows = 3; + private final int columns = 2; + private final int componentCount = 6; + + private Button[] buttons; + private Frame frame; + + private ExtendedRobot robot; + private GridLayout layout; + + private volatile boolean actionPerformed = false; + + public ComponentPreferredSize(int hGap, int vGap) throws Exception { + this.hGap = hGap; + this.vGap = vGap; + robot = new ExtendedRobot(); + EventQueue.invokeAndWait( () -> { + frame = new Frame("Test frame"); + frame.setSize(width, height); + layout = new GridLayout(rows, columns, hGap, vGap); + frame.setLayout(layout); + + buttons = new Button[componentCount]; + for (int i = 0; i < componentCount; i++) { + buttons[i] = new Button("Button" + i); + buttons[i].setPreferredSize(new Dimension((int) Math.random() * 100, + (int) Math.random() * 100)); + frame.add(buttons[i]); + buttons[i].addActionListener((event) -> {actionPerformed = true;}); + } + + frame.setVisible(true); + }); + } + + public static void main(String[] args) throws Exception { + int hGap = 0; + int vGap = 0; + for (int i = 0; i < args.length; i++) { + switch (args[i]) { + case "-hg": + hGap = Integer.parseInt(args[++i]); + break; + case "-vg": + vGap = Integer.parseInt(args[++i]); + break; + } + } + new ComponentPreferredSize(hGap, vGap).doTest(); + } + + private void resizeFrame() throws Exception { + EventQueue.invokeAndWait(() -> { + Insets insets = frame.getInsets(); + double dH = (height-insets.top-insets.bottom - vGap*(rows-1)) % rows; + double dW = (width-insets.left-insets.right - hGap*(columns-1)) % columns; + height -= dH; + width -= dW; + frame.setSize(width, height); + frame.revalidate(); + }); + robot.waitForIdle(); + } + + public void testBoundaries(int topLeftX, int topLeftY, int bottomRightX, int bottomRightY) throws Exception { + + actionPerformed = false; + robot.mouseMove(topLeftX, topLeftY); + robot.delay(500); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.delay(500); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + robot.waitForIdle(3000); + + if(!actionPerformed) + throw new RuntimeException("Clicking on the left top of button did not trigger action event"); + + actionPerformed = false; + robot.mouseMove(bottomRightX, bottomRightY); + robot.delay(500); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.delay(500); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + robot.waitForIdle(3000); + + if(!actionPerformed) + throw new RuntimeException("Clicking on the bottom right of button did not trigger action event"); + } + + private void doTest() throws Exception { + robot.waitForIdle(); + resizeFrame(); + + int availableWidth = width - frame.getInsets().left - + frame.getInsets().right; + int componentWidth = (availableWidth + hGap) / columns - hGap; + int availableHeight = height - frame.getInsets().top - + frame.getInsets().bottom; + int componentHeight = (availableHeight + vGap) / rows - vGap; + + for (int i = 0; i < buttons.length; i++) { + if (buttons[i].getSize().width != componentWidth || + buttons[i].getSize().height != componentHeight) { + throw new RuntimeException( + "FAIL: Button " + i + " not of proper size" + + "Expected: " + componentWidth + "*" + componentHeight + + "Actual: " + buttons[i].getSize().width + "*" + buttons[i].getSize().height); + } + } + + // Components are visible. They should trigger events. + // Now you can check for the actual size shown. + int currentRow = 1; + int currentColumn = 0; + for (int i = 0; i < buttons.length; i++) { + currentColumn++; + if (currentColumn > columns) { + currentColumn = 1; + currentRow++; + } + + int topPosX = frame.getLocationOnScreen().x + + frame.getInsets().left + + (currentColumn - 1) * (componentWidth + hGap); + int topPosY = frame.getLocationOnScreen().y + + frame.getInsets().top + + (currentRow - 1) * (componentHeight + vGap); + + int bottomPosX = topPosX + componentWidth - 1; + int bottomPosY = topPosY + componentHeight - 1; + testBoundaries(topPosX, topPosY, bottomPosX, bottomPosY); + } + + frame.dispose(); + } +} diff --git a/jdk/test/java/awt/Robot/ModifierRobotKey/ModifierRobotKeyTest.java b/jdk/test/java/awt/Robot/ModifierRobotKey/ModifierRobotKeyTest.java new file mode 100644 index 00000000000..5cdc8085255 --- /dev/null +++ b/jdk/test/java/awt/Robot/ModifierRobotKey/ModifierRobotKeyTest.java @@ -0,0 +1,230 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +import java.awt.*; +import java.awt.event.*; + +import static jdk.testlibrary.Asserts.assertTrue; + +/* + * @test + * @summary Make sure that modifier key mask is set when robot press + * some key with one or more modifiers. + * + * @library ../../../../lib/testlibrary/ + * @build ExtendedRobot + * @run main ModifierRobotKeyTest + */ + +public class ModifierRobotKeyTest extends KeyAdapter { + + private boolean focusGained = false; + private boolean startTest = false; + private ExtendedRobot robot; + private Frame frame; + private Canvas canvas; + + private volatile boolean tempPress = false; + + private int[] textKeys, modifierKeys, inputMasks; + private boolean[] modifierStatus, textStatus; + + private final static int waitDelay = 5000; + private Object tempLock = new Object(); + private Object keyLock = new Object(); + + public static void main(String[] args) throws Exception { + ModifierRobotKeyTest test = new ModifierRobotKeyTest(); + test.doTest(); + } + + public ModifierRobotKeyTest() throws Exception { + modifierKeys = new int[3]; + modifierKeys[0] = KeyEvent.VK_SHIFT; + modifierKeys[1] = KeyEvent.VK_CONTROL; + modifierKeys[2] = KeyEvent.VK_ALT; + + inputMasks = new int[3]; + inputMasks[0] = InputEvent.SHIFT_MASK; + inputMasks[1] = InputEvent.CTRL_MASK; + inputMasks[2] = InputEvent.ALT_MASK; + + modifierStatus = new boolean[modifierKeys.length]; + + textKeys = new int[2]; + textKeys[0] = KeyEvent.VK_A; + + String os = System.getProperty("os.name").toLowerCase(); + + if (os.contains("solaris") || os.contains("sunos")) + textKeys[1] = KeyEvent.VK_S; + else if (os.contains("os x")) + textKeys[1] = KeyEvent.VK_K; + else + textKeys[1] = KeyEvent.VK_I; + + textStatus = new boolean[textKeys.length]; + + EventQueue.invokeAndWait( () -> { initializeGUI(); }); + } + + public void keyPressed(KeyEvent event) { + + tempPress = true; + synchronized (tempLock) { tempLock.notifyAll(); } + + if (! startTest) { + return; + } + for (int x = 0; x < inputMasks.length; x++) { + if ((event.getModifiers() & inputMasks[x]) != 0) { + System.out.println("Modifier set: " + event.getKeyModifiersText(inputMasks[x])); + modifierStatus[x] = true; + } + } + for (int x = 0; x < textKeys.length; x++) { + if (event.getKeyCode() == textKeys[x]) { + System.out.println("Text set: " + event.getKeyText(textKeys[x])); + textStatus[x] = true; + } + } + + synchronized (keyLock) { keyLock.notifyAll(); } + } + + private void initializeGUI() { + frame = new Frame("Test frame"); + canvas = new Canvas(); + canvas.addFocusListener(new FocusAdapter() { + public void focusGained(FocusEvent event) { focusGained = true; } + }); + canvas.addKeyListener(this); + frame.setLayout(new BorderLayout()); + frame.add(canvas); + frame.setSize(200, 200); + frame.setVisible(true); + } + + public void doTest() throws Exception { + robot = new ExtendedRobot(); + + robot.mouseMove((int) frame.getLocationOnScreen().getX() + frame.getSize().width / 2, + (int) frame.getLocationOnScreen().getY() + frame.getSize().height / 2); + robot.click(MouseEvent.BUTTON1_MASK); + robot.waitForIdle(); + + assertTrue(focusGained, "FAIL: Canvas gained focus!"); + + for (int i = 0; i < modifierKeys.length; i++) { + for (int j = 0; j < textKeys.length; j++) { + tempPress = false; + robot.keyPress(modifierKeys[i]); + robot.waitForIdle(); + if (! tempPress) { + synchronized (tempLock) { tempLock.wait(waitDelay); } + } + assertTrue(tempPress, "FAIL: keyPressed triggered for i=" + i); + + resetStatus(); + startTest = true; + robot.keyPress(textKeys[j]); + robot.waitForIdle(); + if (! modifierStatus[i] || ! textStatus[j]) { + synchronized (keyLock) { keyLock.wait(waitDelay); } + } + + + assertTrue(modifierStatus[i] && textStatus[j], + "FAIL: KeyEvent not proper!"+ + "Key checked: i=" + i + "; j=" + j+ + "ModifierStatus = " + modifierStatus[i]+ + "TextStatus = " + textStatus[j]); + startTest = false; + robot.keyRelease(textKeys[j]); + robot.waitForIdle(); + robot.keyRelease(modifierKeys[i]); + robot.waitForIdle(); + } + } + + for (int i = 0; i < modifierKeys.length; i++) { + for (int j = i + 1; j < modifierKeys.length; j++) { + for (int k = 0; k < textKeys.length; k++) { + tempPress = false; + robot.keyPress(modifierKeys[i]); + robot.waitForIdle(); + if (! tempPress) { + synchronized (tempLock) { tempLock.wait(waitDelay); } + } + + assertTrue(tempPress, "FAIL: MultiKeyTest: keyPressed triggered for i=" + i); + + tempPress = false; + robot.keyPress(modifierKeys[j]); + robot.waitForIdle(); + if (! tempPress) { + synchronized (tempLock) { tempLock.wait(waitDelay); } + } + assertTrue(tempPress, "FAIL: MultiKeyTest keyPressed triggered for j=" + j); + + resetStatus(); + startTest = true; + robot.keyPress(textKeys[k]); + robot.waitForIdle(); + if (! modifierStatus[i] || ! modifierStatus[j] || ! textStatus[k]) { + synchronized (keyLock) { + keyLock.wait(waitDelay); + } + } + assertTrue(modifierStatus[i] && modifierStatus[j] && textStatus[k], + "FAIL: KeyEvent not proper!"+ + "Key checked: i=" + i + "; j=" + j + "; k=" + k+ + "Modifier1Status = " + modifierStatus[i]+ + "Modifier2Status = " + modifierStatus[j]+ + "TextStatus = " + textStatus[k]); + + startTest = false; + robot.keyRelease(textKeys[k]); + robot.waitForIdle(); + robot.keyRelease(modifierKeys[j]); + robot.waitForIdle(); + robot.keyRelease(modifierKeys[i]); + robot.waitForIdle(); + } + } + } + + frame.dispose(); + } + + private void resetStatus() { + for (int i = 0; i < modifierStatus.length; i++) { + modifierStatus[i] = false; + } + for (int i = 0; i < textStatus.length; i++) { + textStatus[i] = false; + } + } + +} diff --git a/jdk/test/java/awt/Toolkit/LockingKeyStateTest/LockingKeyStateTest.java b/jdk/test/java/awt/Toolkit/LockingKeyStateTest/LockingKeyStateTest.java new file mode 100644 index 00000000000..37aef352a15 --- /dev/null +++ b/jdk/test/java/awt/Toolkit/LockingKeyStateTest/LockingKeyStateTest.java @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.*; +import java.awt.event.KeyEvent; + +/* + @test + @summary verify LOCK buttons toogle + @author Yuri.Nesterenko, Dmitriy.Ermashov + @library ../../../../lib/testlibrary + @build ExtendedRobot + @run main LockingKeyStateTest +*/ + +public class LockingKeyStateTest { + + Frame frame; + ExtendedRobot robot; + + // Note that Kana lock you may actually toggle only if you have one. + static int[] lockingKeys = { KeyEvent.VK_CAPS_LOCK, KeyEvent.VK_NUM_LOCK, + KeyEvent.VK_SCROLL_LOCK, KeyEvent.VK_KANA_LOCK }; + boolean[] getSupported = new boolean[lockingKeys.length]; + boolean[] setSupported = new boolean[lockingKeys.length]; + boolean[] state0 = new boolean[lockingKeys.length]; + + Toolkit toolkit = Toolkit.getDefaultToolkit(); + + LockingKeyStateTest() throws Exception { + robot = new ExtendedRobot(); + EventQueue.invokeAndWait( this::createGui ); + } + + void toggleAllTrue(){toggleAll(true);} + void toggleAllFalse(){toggleAll(false);} + void toggleAll(boolean b) { + for(int i = 0; i < lockingKeys.length; i++) { + if(setSupported[i]) { + toolkit.setLockingKeyState(lockingKeys[i], b); + } + } + } + + void checkAllTrue(){checkAll(true);} + void checkAllFalse(){checkAll(false);} + void checkAll(boolean b) { + for(int i = 0; i < lockingKeys.length; i++) { + if(getSupported[i] && setSupported[i]) { + if (!(toolkit.getLockingKeyState(lockingKeys[i]) == b)) + throw new RuntimeException("State of "+KeyEvent.getKeyText(lockingKeys[i])+" is not "+b); + System.out.println("OK, state of "+KeyEvent.getKeyText(lockingKeys[i])+" is "+b); + } + } + } + + void restoreAll() { + for(int i = 0; i < lockingKeys.length; i++) { + if(setSupported[i] && getSupported[i]) { + toolkit.setLockingKeyState(lockingKeys[i], state0[i]); + } + } + } + + public void createGui() { + for(int i = 0; i < lockingKeys.length; i++) { + getSupported[i] = false; + setSupported[i] = false; + try { + state0[i] = toolkit.getLockingKeyState(lockingKeys[i]); + getSupported[i] = true; + toolkit.setLockingKeyState(lockingKeys[i], state0[i]); + setSupported[i] = true; + } catch (UnsupportedOperationException uoe) { + } + System.out.println(" State get/set of "+KeyEvent.getKeyText(lockingKeys[i])+" is supported? "+ + getSupported[i]+", "+setSupported[i]); + } + frame = new Frame("LockingKeyStateTest Title"); + frame.setSize(200,200); + frame.setVisible(true); + } + + void doTest() throws Exception{ + robot.waitForIdle(); + robot.mouseMove(frame.getLocationOnScreen().x + frame.getWidth() / 2, + frame.getLocationOnScreen().y + frame.getHeight() / 2); + robot.click(); + + EventQueue.invokeAndWait( this::toggleAllTrue ); + robot.waitForIdle(2000); + EventQueue.invokeAndWait( this::checkAllTrue ); + EventQueue.invokeAndWait( this::toggleAllFalse ); + robot.waitForIdle(2000); + EventQueue.invokeAndWait( this::checkAllFalse ); + EventQueue.invokeAndWait( this::restoreAll ); + robot.waitForIdle(); + + frame.dispose(); + } + + public static void main(String argv[]) throws Exception { + LockingKeyStateTest af = new LockingKeyStateTest(); + af.doTest(); + } +} From c6886100bee271e778ac99813d655e76b96e2e2d Mon Sep 17 00:00:00 2001 From: Alexey Ivanov Date: Mon, 21 Apr 2014 16:32:41 +0400 Subject: [PATCH 06/50] 8024061: Exception thrown when drag and drop between two components is executed quickly Reviewed-by: pchelko, serb --- .../sun/awt/dnd/SunDropTargetContextPeer.java | 9 +- jdk/test/sun/awt/dnd/8024061/bug8024061.java | 357 ++++++++++++++++++ 2 files changed, 365 insertions(+), 1 deletion(-) create mode 100644 jdk/test/sun/awt/dnd/8024061/bug8024061.java diff --git a/jdk/src/share/classes/sun/awt/dnd/SunDropTargetContextPeer.java b/jdk/src/share/classes/sun/awt/dnd/SunDropTargetContextPeer.java index 2efea8da2de..842b387f6f4 100644 --- a/jdk/src/share/classes/sun/awt/dnd/SunDropTargetContextPeer.java +++ b/jdk/src/share/classes/sun/awt/dnd/SunDropTargetContextPeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -239,6 +239,13 @@ public abstract class SunDropTargetContextPeer implements DropTargetContextPeer, if (localTransferable != null) { return localTransferable.getTransferData(df); + } else if (df.isMimeTypeEqual(DataFlavor.javaJVMLocalObjectMimeType)) { + // Workaround to JDK-8024061: Exception thrown when drag and drop + // between two components is executed quickly. + // It is expected localTransferable is not null if javaJVMLocalObjectMimeType + // is used. Executing further results in ClassCastException, so null is + // returned here as no transfer data is available in this case. + return null; } if (dropStatus != STATUS_ACCEPT || dropComplete) { diff --git a/jdk/test/sun/awt/dnd/8024061/bug8024061.java b/jdk/test/sun/awt/dnd/8024061/bug8024061.java new file mode 100644 index 00000000000..07165c09a61 --- /dev/null +++ b/jdk/test/sun/awt/dnd/8024061/bug8024061.java @@ -0,0 +1,357 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test + * @bug 8024061 + * @summary Checks that no exception is thrown if dragGestureRecognized + * takes a while to complete. + */ +import sun.awt.OSInfo; +import sun.awt.OSInfo.OSType; +import sun.awt.SunToolkit; + +import java.awt.*; +import java.awt.datatransfer.DataFlavor; +import java.awt.datatransfer.Transferable; +import java.awt.datatransfer.UnsupportedFlavorException; +import java.awt.dnd.DnDConstants; +import java.awt.dnd.DragGestureEvent; +import java.awt.dnd.DragGestureListener; +import java.awt.dnd.DragSource; +import java.awt.dnd.DragSourceDragEvent; +import java.awt.dnd.DragSourceDropEvent; +import java.awt.dnd.DragSourceEvent; +import java.awt.dnd.DragSourceListener; +import java.awt.dnd.DropTarget; +import java.awt.dnd.DropTargetDragEvent; +import java.awt.dnd.DropTargetDropEvent; +import java.awt.dnd.DropTargetEvent; +import java.awt.dnd.DropTargetListener; +import java.awt.event.InputEvent; + +import java.io.IOException; +import java.lang.reflect.InvocationTargetException; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; + +import javax.swing.*; + +/** + * If dragGestureRecognized() takes a while to complete and if user performs a drag quickly, + * an exception is thrown from DropTargetListener.dragEnter when it calls + * DropTargetDragEvent.getTransferable(). + *

+ * This class introduces a delay in dragGestureRecognized() to cause the exception. + */ +public class bug8024061 { + private static final DataFlavor DropObjectFlavor; + private static final int DELAY = 1000; + + private final DnDPanel panel1 = new DnDPanel(Color.yellow); + private final DnDPanel panel2 = new DnDPanel(Color.pink); + private final JFrame frame; + + private static final CountDownLatch lock = new CountDownLatch(1); + private static volatile Exception dragEnterException = null; + + static { + DataFlavor flavor = null; + try { + flavor = new DataFlavor(DataFlavor.javaJVMLocalObjectMimeType); + } catch (ClassNotFoundException e) { + e.printStackTrace(); + } + DropObjectFlavor = flavor; + } + + bug8024061() { + frame = new JFrame("DnDWithRobot"); + frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); + + Dimension d = new Dimension(100, 100); + + panel1.setPreferredSize(d); + panel2.setPreferredSize(d); + + Container content = frame.getContentPane(); + content.setLayout(new GridLayout(1, 2, 5, 5)); + content.add(panel1); + content.add(panel2); + + frame.pack(); + + DropObject drop = new DropObject(); + drop.place(panel1, new Point(10, 10)); + frame.setVisible(true); + } + + public static void main(String[] args) throws AWTException, InvocationTargetException, InterruptedException { + OSType type = OSInfo.getOSType(); + if (type != OSType.LINUX && type != OSType.SOLARIS) { + System.out.println("This test is for Linux and Solaris only... " + + "skipping!"); + return; + } + + final bug8024061[] dnd = {null}; + SwingUtilities.invokeAndWait(new Runnable() { + @Override + public void run() { + dnd[0] = new bug8024061(); + } + }); + final Robot robot = new Robot(); + robot.setAutoDelay(10); + SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit(); + toolkit.realSync(); + + JFrame frame = dnd[0].frame; + Point point = frame.getLocationOnScreen(); + Point here = new Point(point.x + 35, point.y + 45); + Point there = new Point(point.x + 120, point.y + 45); + here.x += 25; + robot.mouseMove(here.x, here.y); + robot.mousePress(InputEvent.BUTTON1_MASK); + while (here.x < there.x) { + here.x += 20; + robot.mouseMove(here.x, here.y); + System.out.println("x = " + here.x); + } + robot.mouseRelease(InputEvent.BUTTON1_MASK); + toolkit.realSync(); + robot.mousePress(InputEvent.BUTTON1_MASK); + robot.mouseRelease(InputEvent.BUTTON1_MASK); + System.out.println("finished"); + + try { + if (lock.await(5, TimeUnit.SECONDS)) { + if (dragEnterException == null) { + System.out.println("Test passed."); + } else { + System.out.println("Test failed."); + dragEnterException.printStackTrace(); + throw new RuntimeException(dragEnterException); + } + } else { + System.out.println("Test failed. Timeout reached"); + throw new RuntimeException("Timed out waiting for dragEnter()"); + } + } finally { + frame.dispose(); + } + } + + class DropObject implements Transferable { + DnDPanel panel; + Color color = Color.CYAN; + int width = 50; + int height = 50; + int x; + int y; + + void draw(Graphics2D g) { + Color savedColor = g.getColor(); + g.setColor(color); + g.fillRect(x, y, width, height); + g.setColor(Color.lightGray); + g.drawRect(x, y, width, height); + g.setColor(savedColor); + } + + boolean contains(int x, int y) { + return (x > this.x && x < this.x + width) + && (y > this.y && y < this.y + height); + } + + @Override + public DataFlavor[] getTransferDataFlavors() { + return new DataFlavor[]{DropObjectFlavor}; + } + + void place(DnDPanel panel, Point location) { + if (panel != this.panel) { + x = location.x; + y = location.y; + if (this.panel != null) { + this.panel.setDropObject(null); + this.panel.repaint(); + } + this.panel = panel; + this.panel.setDropObject(this); + this.panel.repaint(); + } + } + + @Override + public boolean isDataFlavorSupported(DataFlavor flavor) { + return DropObjectFlavor.equals(flavor); + } + + @Override + public Object getTransferData(DataFlavor flavor) + throws UnsupportedFlavorException, IOException { + if (isDataFlavorSupported(flavor)) { + return this; + } else { + throw new UnsupportedFlavorException(flavor); + } + } + } + + class DnDPanel extends JPanel { + DropObject dropObject; + final DragSource dragSource; + final DropTarget dropTarget; + final Color color; + final DragGestureListener dgListener; + final DragSourceListener dsListener; + final DropTargetListener dtListener; + + DnDPanel(Color color) { + this.color = color; + this.dragSource = DragSource.getDefaultDragSource(); + dgListener = new DragGestureListener() { + @Override + public void dragGestureRecognized(DragGestureEvent dge) { + Point location = dge.getDragOrigin(); + if (dropObject != null && dropObject.contains(location.x, location.y)) { + dragSource.startDrag(dge, DragSource.DefaultCopyNoDrop, dropObject, dsListener); + try { + Thread.sleep(DELAY); + } catch (InterruptedException e) { + } + } + } + }; + + dsListener = new DragSourceListener() { + @Override + public void dragEnter(DragSourceDragEvent dsde) { + } + + @Override + public void dragOver(DragSourceDragEvent dsde) { + } + + @Override + public void dropActionChanged(DragSourceDragEvent dsde) { + } + + @Override + public void dragExit(DragSourceEvent dse) { + } + + @Override + public void dragDropEnd(DragSourceDropEvent dsde) { + } + }; + + dtListener = new DropTargetListener() { + @Override + public void dragEnter(DropTargetDragEvent dtde) { + if (dropObject != null) { + dtde.rejectDrag(); + return; + } + dtde.acceptDrag(DnDConstants.ACTION_MOVE); + try { + Transferable t = dtde.getTransferable(); + Object data = t.getTransferData(DropObjectFlavor); + if (data != null) { + throw new Exception("getTransferData returned non-null"); + } + } catch (Exception e) { + dragEnterException = e; + e.printStackTrace(); + } finally { + lock.countDown(); + } + } + + @Override + public void dragOver(DropTargetDragEvent dtde) { + if (dropObject != null) { + dtde.rejectDrag(); + return; + } + dtde.acceptDrag(DnDConstants.ACTION_MOVE); + } + + @Override + public void dropActionChanged(DropTargetDragEvent dtde) { + } + + @Override + public void dragExit(DropTargetEvent dte) { + } + + @Override + public void drop(DropTargetDropEvent dtde) { + if (dropObject != null) { + dtde.rejectDrop(); + return; + } + try { + dtde.acceptDrop(DnDConstants.ACTION_MOVE); + Transferable t = dtde.getTransferable(); + DropObject dropObject = (DropObject) t.getTransferData(DropObjectFlavor); + Point location = dtde.getLocation(); + dropObject.place(DnDPanel.this, location); + dtde.dropComplete(true); + } catch (Exception e) { + e.printStackTrace(); + } + + } + }; + + dragSource.createDefaultDragGestureRecognizer(this, + DnDConstants.ACTION_MOVE, dgListener); + + dropTarget = new DropTarget(this, DnDConstants.ACTION_MOVE, dtListener, true); + + } + + public void paintComponent(Graphics g) { + super.paintComponent(g); + Color savedColor = g.getColor(); + g.setColor(color); + g.fillRect(0, 0, getWidth(), getHeight()); + g.setColor(savedColor); + if (dropObject != null) { + dropObject.draw((Graphics2D) g); + } + } + + void setDropObject(DropObject dropObject) { + this.dropObject = dropObject; + } + + DropObject findDropObject(int x, int y) { + if (dropObject != null && dropObject.contains(x, y)) { + return dropObject; + } + return null; + } + } +} From 1d1194721bbf7749899315b2316a31ad143f083a Mon Sep 17 00:00:00 2001 From: Sergey Malenkov Date: Mon, 21 Apr 2014 20:59:59 +0400 Subject: [PATCH 07/50] 8040656: Classes with overriden methods with covariant returns return random read methods Reviewed-by: alexsch, serb --- .../classes/java/beans/MethodDescriptor.java | 13 +- .../java/beans/Introspector/Test8040656.java | 311 ++++++++++++++++++ 2 files changed, 322 insertions(+), 2 deletions(-) create mode 100644 jdk/test/java/beans/Introspector/Test8040656.java diff --git a/jdk/src/share/classes/java/beans/MethodDescriptor.java b/jdk/src/share/classes/java/beans/MethodDescriptor.java index da2f754c97e..1e169046746 100644 --- a/jdk/src/share/classes/java/beans/MethodDescriptor.java +++ b/jdk/src/share/classes/java/beans/MethodDescriptor.java @@ -162,6 +162,16 @@ public class MethodDescriptor extends FeatureDescriptor { : null; } + private static Method resolve(Method oldMethod, Method newMethod) { + if (oldMethod == null) { + return newMethod; + } + if (newMethod == null) { + return oldMethod; + } + return !oldMethod.isSynthetic() && newMethod.isSynthetic() ? oldMethod : newMethod; + } + /* * Package-private constructor * Merge two method descriptors. Where they conflict, give the @@ -173,8 +183,7 @@ public class MethodDescriptor extends FeatureDescriptor { MethodDescriptor(MethodDescriptor x, MethodDescriptor y) { super(x, y); - Method method = y.methodRef.get(); - this.methodRef.set(null != method ? method : x.methodRef.get()); + this.methodRef.set(resolve(x.methodRef.get(), y.methodRef.get())); params = x.params; if (y.params != null) { params = y.params; diff --git a/jdk/test/java/beans/Introspector/Test8040656.java b/jdk/test/java/beans/Introspector/Test8040656.java new file mode 100644 index 00000000000..73e80ac377f --- /dev/null +++ b/jdk/test/java/beans/Introspector/Test8040656.java @@ -0,0 +1,311 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.beans.Introspector; +import java.beans.MethodDescriptor; + +/* + * @test + * @bug 8040656 + * @summary Tests that a normal method is preferred to a synthetic one + * @author Sergey Malenkov + */ + +public class Test8040656 { + public static void main(String[] args) throws Exception { + test(String.class, C.class); + test(String.class, C1.class); + test(String.class, C2.class); + test(String.class, C3.class); + test(String.class, C4.class); + test(String.class, C5.class); + test(String.class, C6.class); + test(String.class, C7.class); + test(String.class, C8.class); + test(String.class, C9.class); + } + + private static void test(Class type, Class bean) throws Exception { + for (MethodDescriptor md : Introspector.getBeanInfo(bean).getMethodDescriptors()) { + if (md.getName().equals("getFoo")) { + if (type != md.getMethod().getReturnType()) { + throw new Error("unexpected type"); + } + } + } + } + + public interface A { + public Object getFoo(); + } + + public class C implements A { + @Override + public String getFoo() { + return null; + } + } + + public class C1 implements A { + @Override + public String getFoo() { + return null; + } + + public String getFoo1() { + return null; + } + } + + public class C2 implements A { + @Override + public String getFoo() { + return null; + } + + public String getFoo1() { + return null; + } + + public String getFoo2() { + return null; + } + } + + public class C3 implements A { + @Override + public String getFoo() { + return null; + } + + public String getFoo1() { + return null; + } + + public String getFoo2() { + return null; + } + + public String getFoo3() { + return null; + } + } + + public class C4 implements A { + @Override + public String getFoo() { + return null; + } + + public String getFoo1() { + return null; + } + + public String getFoo2() { + return null; + } + + public String getFoo3() { + return null; + } + + public String getFoo4() { + return null; + } + } + + public class C5 implements A { + @Override + public String getFoo() { + return null; + } + + public String getFoo1() { + return null; + } + + public String getFoo2() { + return null; + } + + public String getFoo3() { + return null; + } + + public String getFoo4() { + return null; + } + + public String getFoo5() { + return null; + } + } + + public class C6 implements A { + @Override + public String getFoo() { + return null; + } + + public String getFoo1() { + return null; + } + + public String getFoo2() { + return null; + } + + public String getFoo3() { + return null; + } + + public String getFoo4() { + return null; + } + + public String getFoo5() { + return null; + } + + public String getFoo6() { + return null; + } + } + + public class C7 implements A { + @Override + public String getFoo() { + return null; + } + + public String getFoo1() { + return null; + } + + public String getFoo2() { + return null; + } + + public String getFoo3() { + return null; + } + + public String getFoo4() { + return null; + } + + public String getFoo5() { + return null; + } + + public String getFoo6() { + return null; + } + + public String getFoo7() { + return null; + } + } + + public class C8 implements A { + @Override + public String getFoo() { + return null; + } + + public String getFoo1() { + return null; + } + + public String getFoo2() { + return null; + } + + public String getFoo3() { + return null; + } + + public String getFoo4() { + return null; + } + + public String getFoo5() { + return null; + } + + public String getFoo6() { + return null; + } + + public String getFoo7() { + return null; + } + + public String getFoo8() { + return null; + } + } + + public class C9 implements A { + @Override + public String getFoo() { + return null; + } + + public String getFoo1() { + return null; + } + + public String getFoo2() { + return null; + } + + public String getFoo3() { + return null; + } + + public String getFoo4() { + return null; + } + + public String getFoo5() { + return null; + } + + public String getFoo6() { + return null; + } + + public String getFoo7() { + return null; + } + + public String getFoo8() { + return null; + } + + public String getFoo9() { + return null; + } + } +} From 7025bc84e60aab89f5ce8b435273c4f763c90d95 Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Mon, 21 Apr 2014 23:39:30 -0700 Subject: [PATCH 08/50] 8039862: Fix fallthrough lint warnings in 2d Reviewed-by: flar --- jdk/src/share/classes/sun/font/SunFontManager.java | 1 + jdk/src/share/classes/sun/font/TrueTypeGlyphMapper.java | 2 ++ jdk/src/solaris/classes/sun/java2d/x11/X11SurfaceData.java | 1 + 3 files changed, 4 insertions(+) diff --git a/jdk/src/share/classes/sun/font/SunFontManager.java b/jdk/src/share/classes/sun/font/SunFontManager.java index 04df414365c..998713b4494 100644 --- a/jdk/src/share/classes/sun/font/SunFontManager.java +++ b/jdk/src/share/classes/sun/font/SunFontManager.java @@ -1161,6 +1161,7 @@ public abstract class SunFontManager implements FontSupport, FontManagerForSGE { case FONTFORMAT_NATIVE: NativeFont nf = new NativeFont(fileName, false); physicalFont = addToFontList(nf, fontRank); + break; default: } diff --git a/jdk/src/share/classes/sun/font/TrueTypeGlyphMapper.java b/jdk/src/share/classes/sun/font/TrueTypeGlyphMapper.java index febaf6a5eb7..4ebee6cd280 100644 --- a/jdk/src/share/classes/sun/font/TrueTypeGlyphMapper.java +++ b/jdk/src/share/classes/sun/font/TrueTypeGlyphMapper.java @@ -109,6 +109,7 @@ public class TrueTypeGlyphMapper extends CharToGlyphMapper { cmap = CMap.theNullCmap; } + @SuppressWarnings("fallthrough") private final char remapJAChar(char unicode) { switch (unicode) { case REVERSE_SOLIDUS: @@ -123,6 +124,7 @@ public class TrueTypeGlyphMapper extends CharToGlyphMapper { default: return unicode; } } + @SuppressWarnings("fallthrough") private final int remapJAIntChar(int unicode) { switch (unicode) { case REVERSE_SOLIDUS: diff --git a/jdk/src/solaris/classes/sun/java2d/x11/X11SurfaceData.java b/jdk/src/solaris/classes/sun/java2d/x11/X11SurfaceData.java index 4e6c24f2e23..1d83b65a876 100644 --- a/jdk/src/solaris/classes/sun/java2d/x11/X11SurfaceData.java +++ b/jdk/src/solaris/classes/sun/java2d/x11/X11SurfaceData.java @@ -515,6 +515,7 @@ public abstract class X11SurfaceData extends XSurfaceData { return getSurfaceType(gc, transparency, false); } + @SuppressWarnings("fallthrough") public static SurfaceType getSurfaceType(X11GraphicsConfig gc, int transparency, boolean pixmapSurface) From f341bacaf3da00f13c04a1bd03480ae1266eb05c Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Tue, 22 Apr 2014 17:55:25 -0700 Subject: [PATCH 09/50] 8039860: Fix fallthrough lint warnings in swing Reviewed-by: malenkov --- .../com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java | 1 + .../java/swing/plaf/windows/WindowsLookAndFeel.java | 1 + .../java/swing/plaf/windows/WindowsTableHeaderUI.java | 2 +- .../javax/swing/plaf/metal/MetalLookAndFeel.java | 3 ++- .../share/classes/javax/swing/text/JTextComponent.java | 1 + .../classes/javax/swing/text/html/StyleSheet.java | 1 + .../swing/text/html/parser/ContentModelState.java | 4 +++- .../classes/javax/swing/text/html/parser/Parser.java | 10 ++++++++++ .../classes/javax/swing/text/rtf/RTFGenerator.java | 3 ++- .../share/classes/javax/swing/text/rtf/RTFParser.java | 3 ++- 10 files changed, 24 insertions(+), 5 deletions(-) diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java index d86b4ec92ac..b35e60d7ec6 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java @@ -1683,6 +1683,7 @@ public class GTKLookAndFeel extends SynthLookAndFeel { * adjustments that windows/metal do. This is because gtk doesn't * provide margins/insets for checkbox/radiobuttons. */ + @SuppressWarnings("fallthrough") private static class GnomeLayoutStyle extends DefaultLayoutStyle { private static GnomeLayoutStyle INSTANCE = new GnomeLayoutStyle(); diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java index 00530fa19ea..a6c1c895757 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java @@ -2409,6 +2409,7 @@ public class WindowsLookAndFeel extends BasicLookAndFeel // Windows LayoutStyle. From: // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwue/html/ch14e.asp + @SuppressWarnings("fallthrough") private class WindowsLayoutStyle extends DefaultLayoutStyle { @Override public int getPreferredGap(JComponent component1, diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsTableHeaderUI.java b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsTableHeaderUI.java index c5101177f40..117e9d7b7b1 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsTableHeaderUI.java +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsTableHeaderUI.java @@ -182,7 +182,6 @@ public class WindowsTableHeaderUI extends BasicTableHeaderUI { if (sortOrder != null) { switch(sortOrder) { case ASCENDING: - /* falls through */ case DESCENDING: switch (state) { case NORMAL: @@ -197,6 +196,7 @@ public class WindowsTableHeaderUI extends BasicTableHeaderUI { default: /* do nothing */ } + break; default : /* do nothing */ } diff --git a/jdk/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java b/jdk/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java index 6a64676673b..b1aea28c79f 100644 --- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java +++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java @@ -2271,6 +2271,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel // From the JLF Design Guidelines: // http://www.oracle.com/technetwork/java/jlf-135985.html + @SuppressWarnings("fallthrough") private static class MetalLayoutStyle extends DefaultLayoutStyle { private static MetalLayoutStyle INSTANCE = new MetalLayoutStyle(); @@ -2407,4 +2408,4 @@ public class MetalLookAndFeel extends BasicLookAndFeel return 0; } } -} \ No newline at end of file +} diff --git a/jdk/src/share/classes/javax/swing/text/JTextComponent.java b/jdk/src/share/classes/javax/swing/text/JTextComponent.java index 94f950eb88b..ca3c9ebef1a 100644 --- a/jdk/src/share/classes/javax/swing/text/JTextComponent.java +++ b/jdk/src/share/classes/javax/swing/text/JTextComponent.java @@ -4473,6 +4473,7 @@ public abstract class JTextComponent extends JComponent implements Scrollable, A // composed(uncommitted) text is done here after all input // method listeners get called for stealing the events. // + @SuppressWarnings("fallthrough") protected void processInputMethodEvent(InputMethodEvent e) { // let listeners handle the events super.processInputMethodEvent(e); diff --git a/jdk/src/share/classes/javax/swing/text/html/StyleSheet.java b/jdk/src/share/classes/javax/swing/text/html/StyleSheet.java index de0f2b91fe5..4c5d8d95ce5 100644 --- a/jdk/src/share/classes/javax/swing/text/html/StyleSheet.java +++ b/jdk/src/share/classes/javax/swing/text/html/StyleSheet.java @@ -2324,6 +2324,7 @@ public class StyleSheet extends StyleContext { * @param itemNum number to format * @param type type of ordered list */ + @SuppressWarnings("fallthrough") String formatItemNum(int itemNum, char type) { String numStyle = "1"; diff --git a/jdk/src/share/classes/javax/swing/text/html/parser/ContentModelState.java b/jdk/src/share/classes/javax/swing/text/html/parser/ContentModelState.java index fb623981fcc..3bc9825d9c0 100644 --- a/jdk/src/share/classes/javax/swing/text/html/parser/ContentModelState.java +++ b/jdk/src/share/classes/javax/swing/text/html/parser/ContentModelState.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -92,12 +92,14 @@ class ContentModelState { * tokens required in the input stream. * @return true if the model can terminate without further input */ + @SuppressWarnings("fallthrough") public boolean terminate() { switch (model.type) { case '+': if ((value == 0) && !(model).empty()) { return false; } + // Fall through case '*': case '?': return (next == null) || next.terminate(); diff --git a/jdk/src/share/classes/javax/swing/text/html/parser/Parser.java b/jdk/src/share/classes/javax/swing/text/html/parser/Parser.java index 79124461f9c..0963b4b6dc9 100644 --- a/jdk/src/share/classes/javax/swing/text/html/parser/Parser.java +++ b/jdk/src/share/classes/javax/swing/text/html/parser/Parser.java @@ -852,6 +852,7 @@ class Parser implements DTDConstants { if (lower) { ch = 'a' + (ch - 'A'); } + break; case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': case 'h': case 'i': case 'j': case 'k': case 'l': @@ -876,6 +877,7 @@ class Parser implements DTDConstants { if (lower) { ch = 'a' + (ch - 'A'); } + break; case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': case 'h': case 'i': case 'j': case 'k': case 'l': @@ -1214,6 +1216,7 @@ class Parser implements DTDConstants { /** * Parse attribute value. [33] 331:1 */ + @SuppressWarnings("fallthrough") String parseAttributeValue(boolean lower) throws IOException { int delim = -1; @@ -1258,6 +1261,7 @@ class Parser implements DTDConstants { case '\t': if (delim < 0) c = ' '; + // Fall through case ' ': ch = readCh(); if (delim < 0) { @@ -1559,6 +1563,7 @@ class Parser implements DTDConstants { /** * Parse a start or end tag. */ + @SuppressWarnings("fallthrough") void parseTag() throws IOException { Element elem; boolean net = false; @@ -1602,6 +1607,7 @@ class Parser implements DTDConstants { continue; case '>': ch = readCh(); + return; case -1: return; default: @@ -1626,6 +1632,7 @@ class Parser implements DTDConstants { switch(ch) { case '>': ch = readCh(); + // Fall through case -1: error("invalid.markup"); return; @@ -1657,6 +1664,7 @@ class Parser implements DTDConstants { switch (ch = readCh()) { case '>': ch = readCh(); + // Fall through case '<': // empty end tag. either or ': ch = readCh(); + break; case '<': break; @@ -1875,6 +1884,7 @@ class Parser implements DTDConstants { switch (ch) { case '/': net = true; + // Fall through case '>': ch = readCh(); if (ch == '>' && net) { diff --git a/jdk/src/share/classes/javax/swing/text/rtf/RTFGenerator.java b/jdk/src/share/classes/javax/swing/text/rtf/RTFGenerator.java index 38b2b7ad864..7aba1408039 100644 --- a/jdk/src/share/classes/javax/swing/text/rtf/RTFGenerator.java +++ b/jdk/src/share/classes/javax/swing/text/rtf/RTFGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -868,6 +868,7 @@ public void writeEndgroup() afterKeyword = false; } +@SuppressWarnings("fallthrough") public void writeCharacter(char ch) throws IOException { diff --git a/jdk/src/share/classes/javax/swing/text/rtf/RTFParser.java b/jdk/src/share/classes/javax/swing/text/rtf/RTFParser.java index a251552d76c..2b4969dda1e 100644 --- a/jdk/src/share/classes/javax/swing/text/rtf/RTFParser.java +++ b/jdk/src/share/classes/javax/swing/text/rtf/RTFParser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -148,6 +148,7 @@ abstract class RTFParser extends AbstractFilter handleText(s); } + @SuppressWarnings("fallthrough") public void write(char ch) throws IOException { From 1b4d763c777d1ba965d002892051b9a249055b2d Mon Sep 17 00:00:00 2001 From: Petr Pchelko Date: Wed, 23 Apr 2014 17:56:05 +0400 Subject: [PATCH 10/50] 8027148: SystemFlavorMap.getNativesForFlavor returns list of native formats in incorrect order Reviewed-by: anthony, serb --- .../awt/datatransfer/SystemFlavorMap.java | 359 ++++++++---------- .../sun/awt/datatransfer/DataTransferer.java | 25 +- .../classes/sun/awt/X11/XDataTransferer.java | 9 +- .../MappingGenerationTest.java | 183 +++++++++ 4 files changed, 344 insertions(+), 232 deletions(-) create mode 100644 jdk/test/java/awt/datatransfer/MappingGenerationTest/MappingGenerationTest.java diff --git a/jdk/src/share/classes/java/awt/datatransfer/SystemFlavorMap.java b/jdk/src/share/classes/java/awt/datatransfer/SystemFlavorMap.java index bc6e1642001..fd54c9414a0 100644 --- a/jdk/src/share/classes/java/awt/datatransfer/SystemFlavorMap.java +++ b/jdk/src/share/classes/java/awt/datatransfer/SystemFlavorMap.java @@ -38,13 +38,14 @@ import java.net.URL; import java.net.MalformedURLException; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedHashSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; -import java.util.WeakHashMap; import sun.awt.AppContext; import sun.awt.datatransfer.DataTransferer; @@ -101,20 +102,12 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { */ private static final String HTML_TEXT_BASE_TYPE = "text/html"; - /** - * This constant is passed to flavorToNativeLookup() to indicate that a - * a native should be synthesized, stored, and returned by encoding the - * DataFlavor's MIME type in case if the DataFlavor is not found in - * 'flavorToNative' map. - */ - private static final boolean SYNTHESIZE_IF_NOT_FOUND = true; - /** * Maps native Strings to Lists of DataFlavors (or base type Strings for * text DataFlavors). * Do not use the field directly, use getNativeToFlavor() instead. */ - private final Map> nativeToFlavor = new HashMap<>(); + private final Map> nativeToFlavor = new HashMap<>(); /** * Accessor to nativeToFlavor map. Since we use lazy initialization we must @@ -123,7 +116,7 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { * * @return nativeToFlavor */ - private Map> getNativeToFlavor() { + private Map> getNativeToFlavor() { if (!isMapInitialized) { initSystemFlavorMap(); } @@ -135,7 +128,7 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { * native Strings. * Do not use the field directly, use getFlavorToNative() instead. */ - private final Map> flavorToNative = new HashMap<>(); + private final Map> flavorToNative = new HashMap<>(); /** * Accessor to flavorToNative map. Since we use lazy initialization we must @@ -144,29 +137,52 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { * * @return flavorToNative */ - private synchronized Map> getFlavorToNative() { + private synchronized Map> getFlavorToNative() { if (!isMapInitialized) { initSystemFlavorMap(); } return flavorToNative; } + /** + * Maps a text DataFlavor primary mime-type to the native. Used only to store + * standard mappings registered in the flavormap.properties + * Do not use this field directly, use getTextTypeToNative() instead. + */ + private Map> textTypeToNative = new HashMap<>(); + /** * Shows if the object has been initialized. */ private boolean isMapInitialized = false; /** - * Caches the result of getNativesForFlavor(). Maps DataFlavors to - * SoftReferences which reference Lists of String natives. + * An accessor to textTypeToNative map. Since we use lazy initialization we + * must use this accessor instead of direct access to the field which may not + * be initialized yet. This method will initialize the field if needed. + * + * @return textTypeToNative */ - private Map>> getNativesForFlavorCache = new HashMap<>(); + private synchronized Map> getTextTypeToNative() { + if (!isMapInitialized) { + initSystemFlavorMap(); + // From this point the map should not be modified + textTypeToNative = Collections.unmodifiableMap(textTypeToNative); + } + return textTypeToNative; + } + + /** + * Caches the result of getNativesForFlavor(). Maps DataFlavors to + * SoftReferences which reference LinkedHashSet of String natives. + */ + private final SoftCache nativesForFlavorCache = new SoftCache<>(); /** * Caches the result getFlavorsForNative(). Maps String natives to - * SoftReferences which reference Lists of DataFlavors. + * SoftReferences which reference LinkedHashSet of DataFlavors. */ - private Map>> getFlavorsForNativeCache = new HashMap<>(); + private final SoftCache flavorsForNativeCache = new SoftCache<>(); /** * Dynamic mapping generation used for text mappings should not be applied @@ -174,7 +190,7 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { * explicitly specified with setFlavorsForNative() or * setNativesForFlavor(). This keeps all such keys. */ - private Set disabledMappingGenerationKeys = new HashSet(); + private Set disabledMappingGenerationKeys = new HashSet<>(); /** * Returns the default FlavorMap for this thread's ClassLoader. @@ -404,7 +420,7 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { flavor = new DataFlavor(value); } catch (Exception e) { try { - flavor = new DataFlavor(value, (String)null); + flavor = new DataFlavor(value, null); } catch (Exception ee) { ee.printStackTrace(); continue; @@ -412,11 +428,11 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { } final LinkedHashSet dfs = new LinkedHashSet<>(); - dfs.add(flavor); if ("text".equals(flavor.getPrimaryType())) { dfs.addAll(convertMimeTypeToDataFlavors(value)); + store(flavor.mimeType.getBaseType(), key, getTextTypeToNative()); } for (DataFlavor df : dfs) { @@ -505,10 +521,10 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { * the appropriate Map location, but rather will be appended to a List * stored in that location. */ - private void store(H hashed, L listed, Map> map) { - List list = map.get(hashed); + private void store(H hashed, L listed, Map> map) { + LinkedHashSet list = map.get(hashed); if (list == null) { - list = new ArrayList<>(1); + list = new LinkedHashSet<>(1); map.put(hashed, list); } if (!list.contains(listed)) { @@ -522,17 +538,16 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { * case, a new DataFlavor is synthesized, stored, and returned, if and * only if the specified native is encoded as a Java MIME type. */ - private List nativeToFlavorLookup(String nat) { - List flavors = getNativeToFlavor().get(nat); + private LinkedHashSet nativeToFlavorLookup(String nat) { + LinkedHashSet flavors = getNativeToFlavor().get(nat); if (nat != null && !disabledMappingGenerationKeys.contains(nat)) { DataTransferer transferer = DataTransferer.getInstance(); if (transferer != null) { - List platformFlavors = + LinkedHashSet platformFlavors = transferer.getPlatformMappingsForNative(nat); if (!platformFlavors.isEmpty()) { if (flavors != null) { - platformFlavors.removeAll(new HashSet<>(flavors)); // Prepending the platform-specific mappings ensures // that the flavors added with // addFlavorForUnencodedNative() are at the end of @@ -558,24 +573,22 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { } if (flavor != null) { - flavors = new ArrayList<>(1); + flavors = new LinkedHashSet<>(1); getNativeToFlavor().put(nat, flavors); flavors.add(flavor); - getFlavorsForNativeCache.remove(nat); - getFlavorsForNativeCache.remove(null); + flavorsForNativeCache.remove(nat); - List natives = getFlavorToNative().get(flavor); + LinkedHashSet natives = getFlavorToNative().get(flavor); if (natives == null) { - natives = new ArrayList<>(1); + natives = new LinkedHashSet<>(1); getFlavorToNative().put(flavor, natives); } natives.add(nat); - getNativesForFlavorCache.remove(flavor); - getNativesForFlavorCache.remove(null); + nativesForFlavorCache.remove(flavor); } } - return (flavors != null) ? flavors : new ArrayList<>(0); + return (flavors != null) ? flavors : new LinkedHashSet<>(0); } /** @@ -586,18 +599,18 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { * encoding the DataFlavor's MIME type. Otherwise an empty List is returned * and 'flavorToNative' remains unaffected. */ - private List flavorToNativeLookup(final DataFlavor flav, - final boolean synthesize) { - List natives = getFlavorToNative().get(flav); + private LinkedHashSet flavorToNativeLookup(final DataFlavor flav, + final boolean synthesize) { + + LinkedHashSet natives = getFlavorToNative().get(flav); if (flav != null && !disabledMappingGenerationKeys.contains(flav)) { DataTransferer transferer = DataTransferer.getInstance(); if (transferer != null) { - List platformNatives = + LinkedHashSet platformNatives = transferer.getPlatformMappingsForFlavor(flav); if (!platformNatives.isEmpty()) { if (natives != null) { - platformNatives.removeAll(new HashSet<>(natives)); // Prepend the platform-specific mappings to ensure // that the natives added with // addUnencodedNativeForFlavor() are at the end of @@ -612,26 +625,25 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { if (natives == null) { if (synthesize) { String encoded = encodeDataFlavor(flav); - natives = new ArrayList<>(1); + natives = new LinkedHashSet<>(1); getFlavorToNative().put(flav, natives); natives.add(encoded); - getNativesForFlavorCache.remove(flav); - getNativesForFlavorCache.remove(null); - List flavors = getNativeToFlavor().get(encoded); + LinkedHashSet flavors = getNativeToFlavor().get(encoded); if (flavors == null) { - flavors = new ArrayList<>(1); + flavors = new LinkedHashSet<>(1); getNativeToFlavor().put(encoded, flavors); } flavors.add(flav); - getFlavorsForNativeCache.remove(encoded); - getFlavorsForNativeCache.remove(null); + + nativesForFlavorCache.remove(flav); + flavorsForNativeCache.remove(encoded); } else { - natives = new ArrayList<>(0); + natives = new LinkedHashSet<>(0); } } - return natives; + return new LinkedHashSet<>(natives); } /** @@ -659,103 +671,63 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { * @see #encodeDataFlavor * @since 1.4 */ + @Override public synchronized List getNativesForFlavor(DataFlavor flav) { - List retval = null; - - // Check cache, even for null flav - SoftReference> ref = getNativesForFlavorCache.get(flav); - if (ref != null) { - retval = ref.get(); - if (retval != null) { - // Create a copy, because client code can modify the returned - // list. - return new ArrayList<>(retval); - } + LinkedHashSet retval = nativesForFlavorCache.check(flav); + if (retval != null) { + return new ArrayList<>(retval); } if (flav == null) { - retval = new ArrayList<>(getNativeToFlavor().keySet()); + retval = new LinkedHashSet<>(getNativeToFlavor().keySet()); } else if (disabledMappingGenerationKeys.contains(flav)) { // In this case we shouldn't synthesize a native for this flavor, // since its mappings were explicitly specified. - retval = flavorToNativeLookup(flav, !SYNTHESIZE_IF_NOT_FOUND); + retval = flavorToNativeLookup(flav, false); } else if (DataTransferer.isFlavorCharsetTextType(flav)) { + retval = new LinkedHashSet<>(0); // For text/* flavors, flavor-to-native mappings specified in // flavormap.properties are stored per flavor's base type. if ("text".equals(flav.getPrimaryType())) { - retval = getAllNativesForType(flav.mimeType.getBaseType()); - if (retval != null) { - // To prevent the List stored in the map from modification. - retval = new ArrayList(retval); + LinkedHashSet textTypeNatives = + getTextTypeToNative().get(flav.mimeType.getBaseType()); + if (textTypeNatives != null) { + retval.addAll(textTypeNatives); } } // Also include text/plain natives, but don't duplicate Strings - List textPlainList = getAllNativesForType(TEXT_PLAIN_BASE_TYPE); - - if (textPlainList != null && !textPlainList.isEmpty()) { - // To prevent the List stored in the map from modification. - // This also guarantees that removeAll() is supported. - textPlainList = new ArrayList<>(textPlainList); - if (retval != null && !retval.isEmpty()) { - // Use HashSet to get constant-time performance for search. - textPlainList.removeAll(new HashSet<>(retval)); - retval.addAll(textPlainList); - } else { - retval = textPlainList; - } + LinkedHashSet textTypeNatives = + getTextTypeToNative().get(TEXT_PLAIN_BASE_TYPE); + if (textTypeNatives != null) { + retval.addAll(textTypeNatives); } - if (retval == null || retval.isEmpty()) { - retval = flavorToNativeLookup(flav, SYNTHESIZE_IF_NOT_FOUND); + if (retval.isEmpty()) { + retval = flavorToNativeLookup(flav, true); } else { // In this branch it is guaranteed that natives explicitly // listed for flav's MIME type were added with // addUnencodedNativeForFlavor(), so they have lower priority. - List explicitList = - flavorToNativeLookup(flav, !SYNTHESIZE_IF_NOT_FOUND); - - // flavorToNativeLookup() never returns null. - // It can return an empty List, however. - if (!explicitList.isEmpty()) { - // To prevent the List stored in the map from modification. - // This also guarantees that removeAll() is supported. - explicitList = new ArrayList<>(explicitList); - // Use HashSet to get constant-time performance for search. - explicitList.removeAll(new HashSet<>(retval)); - retval.addAll(explicitList); - } + retval.addAll(flavorToNativeLookup(flav, false)); } } else if (DataTransferer.isFlavorNoncharsetTextType(flav)) { - retval = getAllNativesForType(flav.mimeType.getBaseType()); + retval = getTextTypeToNative().get(flav.mimeType.getBaseType()); if (retval == null || retval.isEmpty()) { - retval = flavorToNativeLookup(flav, SYNTHESIZE_IF_NOT_FOUND); + retval = flavorToNativeLookup(flav, true); } else { // In this branch it is guaranteed that natives explicitly // listed for flav's MIME type were added with // addUnencodedNativeForFlavor(), so they have lower priority. - List explicitList = - flavorToNativeLookup(flav, !SYNTHESIZE_IF_NOT_FOUND); - - // flavorToNativeLookup() never returns null. - // It can return an empty List, however. - if (!explicitList.isEmpty()) { - // To prevent the List stored in the map from modification. - // This also guarantees that add/removeAll() are supported. - retval = new ArrayList<>(retval); - explicitList = new ArrayList<>(explicitList); - // Use HashSet to get constant-time performance for search. - explicitList.removeAll(new HashSet<>(retval)); - retval.addAll(explicitList); - } + retval.addAll(flavorToNativeLookup(flav, false)); } } else { - retval = flavorToNativeLookup(flav, SYNTHESIZE_IF_NOT_FOUND); + retval = flavorToNativeLookup(flav, true); } - getNativesForFlavorCache.put(flav, new SoftReference<>(retval)); + nativesForFlavorCache.put(flav, retval); // Create a copy, because client code can modify the returned list. return new ArrayList<>(retval); } @@ -791,62 +763,38 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { * @see #encodeJavaMIMEType * @since 1.4 */ + @Override public synchronized List getFlavorsForNative(String nat) { - - // Check cache, even for null nat - SoftReference> ref = getFlavorsForNativeCache.get(nat); - if (ref != null) { - List retval = ref.get(); - if (retval != null) { - return new ArrayList<>(retval); - } + LinkedHashSet returnValue = flavorsForNativeCache.check(nat); + if (returnValue != null) { + return new ArrayList<>(returnValue); + } else { + returnValue = new LinkedHashSet<>(); } - final LinkedHashSet returnValue = - new LinkedHashSet<>(); - if (nat == null) { - final List natives = getNativesForFlavor(null); - - for (String n : natives) - { - final List flavors = getFlavorsForNative(n); - - for (DataFlavor df : flavors) - { - returnValue.add(df); - } + for (String n : getNativesForFlavor(null)) { + returnValue.addAll(getFlavorsForNative(n)); } } else { - - final List flavors = nativeToFlavorLookup(nat); - + final LinkedHashSet flavors = nativeToFlavorLookup(nat); if (disabledMappingGenerationKeys.contains(nat)) { - return flavors; + return new ArrayList<>(flavors); } - final List flavorsAndBaseTypes = - nativeToFlavorLookup(nat); + final LinkedHashSet flavorsWithSynthesized = + nativeToFlavorLookup(nat); - for (DataFlavor df : flavorsAndBaseTypes) { + for (DataFlavor df : flavorsWithSynthesized) { returnValue.add(df); if ("text".equals(df.getPrimaryType())) { - try { - returnValue.addAll( - convertMimeTypeToDataFlavors( - new MimeType(df.getMimeType() - ).getBaseType())); - } catch (MimeTypeParseException e) { - e.printStackTrace(); - } + String baseType = df.mimeType.getBaseType(); + returnValue.addAll(convertMimeTypeToDataFlavors(baseType)); } } - } - - final List arrayList = new ArrayList<>(returnValue); - getFlavorsForNativeCache.put(nat, new SoftReference<>(arrayList)); - return new ArrayList<>(arrayList); + flavorsForNativeCache.put(nat, returnValue); + return new ArrayList<>(returnValue); } private static Set convertMimeTypeToDataFlavors( @@ -862,7 +810,6 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { } catch (MimeTypeParseException mtpe) { // Cannot happen, since we checked all mappings // on load from flavormap.properties. - assert(false); } if (DataTransferer.doesSubtypeSupportCharset(subType, null)) { @@ -941,10 +888,10 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { } private static final String [] htmlDocumntTypes = - new String [] {"all", "selection", "fragment"}; + new String [] {"all", "selection", "fragment"}; - private static LinkedHashSet handleHtmlMimeTypes( - String baseType, String mimeType) { + private static LinkedHashSet handleHtmlMimeTypes(String baseType, + String mimeType) { LinkedHashSet returnValues = new LinkedHashSet<>(); @@ -981,14 +928,14 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { * @see #getNativesForFlavor * @see #encodeDataFlavor */ - public synchronized Map - getNativesForFlavors(DataFlavor[] flavors) + @Override + public synchronized Map getNativesForFlavors(DataFlavor[] flavors) { // Use getNativesForFlavor to generate extra natives for text flavors // and stringFlavor if (flavors == null) { - List flavor_list = getFlavorsForNative(null); + List flavor_list = getFlavorsForNative(null); flavors = new DataFlavor[flavor_list.size()]; flavor_list.toArray(flavors); } @@ -1027,15 +974,14 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { * @see #getFlavorsForNative * @see #encodeJavaMIMEType */ - public synchronized Map - getFlavorsForNatives(String[] natives) + @Override + public synchronized Map getFlavorsForNatives(String[] natives) { // Use getFlavorsForNative to generate extra flavors for text natives - if (natives == null) { - List native_list = getNativesForFlavor(null); - natives = new String[native_list.size()]; - native_list.toArray(natives); + List nativesList = getNativesForFlavor(null); + natives = new String[nativesList.size()]; + nativesList.toArray(natives); } Map retval = new HashMap<>(natives.length, 1.0f); @@ -1044,7 +990,6 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { DataFlavor flav = (flavors.isEmpty())? null : flavors.get(0); retval.put(aNative, flav); } - return retval; } @@ -1070,20 +1015,16 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { */ public synchronized void addUnencodedNativeForFlavor(DataFlavor flav, String nat) { - if (flav == null || nat == null) { - throw new NullPointerException("null arguments not permitted"); - } + Objects.requireNonNull(nat, "Null native not permitted"); + Objects.requireNonNull(flav, "Null flavor not permitted"); - List natives = getFlavorToNative().get(flav); + LinkedHashSet natives = getFlavorToNative().get(flav); if (natives == null) { - natives = new ArrayList<>(1); + natives = new LinkedHashSet<>(1); getFlavorToNative().put(flav, natives); - } else if (natives.contains(nat)) { - return; } natives.add(nat); - getNativesForFlavorCache.remove(flav); - getNativesForFlavorCache.remove(null); + nativesForFlavorCache.remove(flav); } /** @@ -1116,18 +1057,15 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { */ public synchronized void setNativesForFlavor(DataFlavor flav, String[] natives) { - if (flav == null || natives == null) { - throw new NullPointerException("null arguments not permitted"); - } + Objects.requireNonNull(natives, "Null natives not permitted"); + Objects.requireNonNull(flav, "Null flavors not permitted"); getFlavorToNative().remove(flav); for (String aNative : natives) { addUnencodedNativeForFlavor(flav, aNative); } disabledMappingGenerationKeys.add(flav); - // Clear the cache to handle the case of empty natives. - getNativesForFlavorCache.remove(flav); - getNativesForFlavorCache.remove(null); + nativesForFlavorCache.remove(flav); } /** @@ -1150,20 +1088,16 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { */ public synchronized void addFlavorForUnencodedNative(String nat, DataFlavor flav) { - if (nat == null || flav == null) { - throw new NullPointerException("null arguments not permitted"); - } + Objects.requireNonNull(nat, "Null native not permitted"); + Objects.requireNonNull(flav, "Null flavor not permitted"); - List flavors = getNativeToFlavor().get(nat); + LinkedHashSet flavors = getNativeToFlavor().get(nat); if (flavors == null) { - flavors = new ArrayList<>(1); + flavors = new LinkedHashSet<>(1); getNativeToFlavor().put(nat, flavors); - } else if (flavors.contains(flav)) { - return; } flavors.add(flav); - getFlavorsForNativeCache.remove(nat); - getFlavorsForNativeCache.remove(null); + flavorsForNativeCache.remove(nat); } /** @@ -1195,18 +1129,15 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { */ public synchronized void setFlavorsForNative(String nat, DataFlavor[] flavors) { - if (nat == null || flavors == null) { - throw new NullPointerException("null arguments not permitted"); - } + Objects.requireNonNull(nat, "Null native not permitted"); + Objects.requireNonNull(flavors, "Null flavors not permitted"); getNativeToFlavor().remove(nat); for (DataFlavor flavor : flavors) { addFlavorForUnencodedNative(nat, flavor); } disabledMappingGenerationKeys.add(nat); - // Clear the cache to handle the case of empty flavors. - getFlavorsForNativeCache.remove(nat); - getFlavorsForNativeCache.remove(null); + flavorsForNativeCache.remove(nat); } /** @@ -1307,17 +1238,29 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { : null; } - private List getAllNativesForType(String type) { - Set retval = null; - for (DataFlavor dataFlavor : convertMimeTypeToDataFlavors(type)) { - List natives = getFlavorToNative().get(dataFlavor); - if (natives != null && !natives.isEmpty()) { - if (retval == null) { - retval = new LinkedHashSet<>(); - } - retval.addAll(natives); + private static final class SoftCache { + Map>> cache; + + public void put(K key, LinkedHashSet value) { + if (cache == null) { + cache = new HashMap<>(1); } + cache.put(key, new SoftReference<>(value)); + } + + public void remove(K key) { + if (cache == null) return; + cache.remove(null); + cache.remove(key); + } + + public LinkedHashSet check(K key) { + if (cache == null) return null; + SoftReference> ref = cache.get(key); + if (ref != null) { + return ref.get(); + } + return null; } - return retval == null ? null : new ArrayList<>(retval); } } diff --git a/jdk/src/share/classes/sun/awt/datatransfer/DataTransferer.java b/jdk/src/share/classes/sun/awt/datatransfer/DataTransferer.java index b4b658a6166..3f22bd86fe9 100644 --- a/jdk/src/share/classes/sun/awt/datatransfer/DataTransferer.java +++ b/jdk/src/share/classes/sun/awt/datatransfer/DataTransferer.java @@ -70,22 +70,7 @@ import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; import java.security.ProtectionDomain; -import java.util.AbstractMap; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.SortedMap; -import java.util.SortedSet; -import java.util.Set; -import java.util.Stack; -import java.util.TreeMap; -import java.util.TreeSet; +import java.util.*; import sun.util.logging.PlatformLogger; @@ -2267,8 +2252,8 @@ search: * If there are no platform-specific mappings for this native, the method * returns an empty List. */ - public List getPlatformMappingsForNative(String nat) { - return new ArrayList<>(); + public LinkedHashSet getPlatformMappingsForNative(String nat) { + return new LinkedHashSet<>(); } /** @@ -2276,8 +2261,8 @@ search: * If there are no platform-specific mappings for this flavor, the method * returns an empty List. */ - public List getPlatformMappingsForFlavor(DataFlavor df) { - return new ArrayList<>(); + public LinkedHashSet getPlatformMappingsForFlavor(DataFlavor df) { + return new LinkedHashSet<>(); } /** diff --git a/jdk/src/solaris/classes/sun/awt/X11/XDataTransferer.java b/jdk/src/solaris/classes/sun/awt/X11/XDataTransferer.java index f54bc87c337..554e19507dc 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XDataTransferer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XDataTransferer.java @@ -45,6 +45,7 @@ import java.net.URISyntaxException; import java.util.ArrayList; import java.util.Iterator; +import java.util.LinkedHashSet; import java.util.List; import javax.imageio.ImageIO; @@ -330,8 +331,8 @@ public class XDataTransferer extends DataTransferer { * type can be translated by the Data Transfer subsystem. */ @Override - public List getPlatformMappingsForNative(String nat) { - List flavors = new ArrayList<>(); + public LinkedHashSet getPlatformMappingsForNative(String nat) { + LinkedHashSet flavors = new LinkedHashSet<>(); if (nat == null) { return flavors; @@ -392,8 +393,8 @@ public class XDataTransferer extends DataTransferer { * Transfer subsystem. */ @Override - public List getPlatformMappingsForFlavor(DataFlavor df) { - List natives = new ArrayList<>(1); + public LinkedHashSet getPlatformMappingsForFlavor(DataFlavor df) { + LinkedHashSet natives = new LinkedHashSet<>(1); if (df == null) { return natives; diff --git a/jdk/test/java/awt/datatransfer/MappingGenerationTest/MappingGenerationTest.java b/jdk/test/java/awt/datatransfer/MappingGenerationTest/MappingGenerationTest.java new file mode 100644 index 00000000000..b0d8587afa3 --- /dev/null +++ b/jdk/test/java/awt/datatransfer/MappingGenerationTest/MappingGenerationTest.java @@ -0,0 +1,183 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.datatransfer.DataFlavor; +import java.awt.datatransfer.SystemFlavorMap; +import java.util.List; + +/* + @test + @bug 4512530 8027148 + @summary tests that mappings for text flavors are generated properly + @author das@sparc.spb.su area=datatransfer +*/ + +public class MappingGenerationTest { + + private static final SystemFlavorMap fm = + (SystemFlavorMap)SystemFlavorMap.getDefaultFlavorMap(); + + public static void main(String[] args) { + test1(); + test2(); + test3(); + test4(); + test5(); + test6(); + } + + /** + * Verifies that Lists returned from getNativesForFlavor() and + * getFlavorsForNative() are not modified with a subsequent call + * to addUnencodedNativeForFlavor() and addFlavorForUnencodedNative() + * respectively. + */ + public static void test1() { + DataFlavor df = new DataFlavor("text/plain-test1", null); + String nat = "native1"; + + List natives = fm.getNativesForFlavor(df); + fm.addUnencodedNativeForFlavor(df, nat); + List nativesNew = fm.getNativesForFlavor(df); + if (natives.equals(nativesNew)) { + System.err.println("orig=" + natives); + System.err.println("new=" + nativesNew); + throw new RuntimeException("Test failed"); + } + + List flavors = fm.getFlavorsForNative(nat); + fm.addFlavorForUnencodedNative(nat, df); + List flavorsNew = fm.getFlavorsForNative(nat); + if (flavors.equals(flavorsNew)) { + System.err.println("orig=" + flavors); + System.err.println("new=" + flavorsNew); + throw new RuntimeException("Test failed"); + } + } + + /** + * Verifies that SystemFlavorMap is not affected by modification of + * the Lists returned from getNativesForFlavor() and + * getFlavorsForNative(). + */ + public static void test2() { + DataFlavor df = new DataFlavor("text/plain-test2", null); + String nat = "native2"; + DataFlavor extraDf = new DataFlavor("text/test", null); + + List natives = fm.getNativesForFlavor(df); + natives.add("Should not be here"); + java.util.List nativesNew = fm.getNativesForFlavor(df); + if (natives.equals(nativesNew)) { + System.err.println("orig=" + natives); + System.err.println("new=" + nativesNew); + throw new RuntimeException("Test failed"); + } + + List flavors = fm.getFlavorsForNative(nat); + flavors.add(extraDf); + java.util.List flavorsNew = fm.getFlavorsForNative(nat); + if (flavors.equals(flavorsNew)) { + System.err.println("orig=" + flavors); + System.err.println("new=" + flavorsNew); + throw new RuntimeException("Test failed"); + } + } + + /** + * Verifies that addUnencodedNativeForFlavor() for a particular text flavor + * doesn't affect mappings for other flavors. + */ + public static void test3() { + DataFlavor df1 = new DataFlavor("text/plain-test3", null); + DataFlavor df2 = new DataFlavor("text/plain-test3; charset=Unicode; class=java.io.Reader", null); + String nat = "native3"; + List natives = fm.getNativesForFlavor(df2); + fm.addUnencodedNativeForFlavor(df1, nat); + List nativesNew = fm.getNativesForFlavor(df2); + if (!natives.equals(nativesNew)) { + System.err.println("orig=" + natives); + System.err.println("new=" + nativesNew); + throw new RuntimeException("Test failed"); + } + } + + /** + * Verifies that addUnencodedNativeForFlavor() really adds the specified + * flavor-to-native mapping to the existing mappings. + */ + public static void test4() { + DataFlavor df = new DataFlavor("text/plain-test4; charset=Unicode; class=java.io.Reader", null); + String nat = "native4"; + List natives = fm.getNativesForFlavor(df); + if (!natives.contains(nat)) { + fm.addUnencodedNativeForFlavor(df, nat); + List nativesNew = fm.getNativesForFlavor(df); + natives.add(nat); + if (!natives.equals(nativesNew)) { + System.err.println("orig=" + natives); + System.err.println("new=" + nativesNew); + throw new RuntimeException("Test failed"); + } + } + } + + /** + * Verifies that a flavor doesn't have any flavor-to-native mappings after + * a call to setNativesForFlavor() with this flavor and an empty native + * array as arguments. + */ + public static void test5() { + final DataFlavor flavor = + new DataFlavor("text/plain-TEST5; charset=Unicode", null); + + fm.getNativesForFlavor(flavor); + + fm.setNativesForFlavor(flavor, new String[0]); + + List natives = fm.getNativesForFlavor(flavor); + + if (!natives.isEmpty()) { + System.err.println("natives=" + natives); + throw new RuntimeException("Test failed"); + } + } + + /** + * Verifies that a native doesn't have any native-to-flavor mappings after + * a call to setFlavorsForNative() with this native and an empty flavor + * array as arguments. + */ + public static void test6() { + final String nat = "STRING"; + fm.getFlavorsForNative(nat); + fm.setFlavorsForNative(nat, new DataFlavor[0]); + + List flavors = fm.getFlavorsForNative(nat); + + if (!flavors.isEmpty()) { + System.err.println("flavors=" + flavors); + throw new RuntimeException("Test failed"); + } + } +} From 39ba3c9ea6f296f0dd966bf69808e3a7c9c68bbc Mon Sep 17 00:00:00 2001 From: Petr Pchelko Date: Wed, 23 Apr 2014 18:07:12 +0400 Subject: [PATCH 11/50] 8039567: Duplicated code in DataTransferer Reviewed-by: serb, azvegint --- .../sun/lwawt/macosx/CDataTransferer.java | 3 +- .../sun/awt/datatransfer/DataTransferer.java | 65 ++++--------------- .../classes/sun/awt/X11/XDataTransferer.java | 28 +------- .../sun/awt/windows/WDataTransferer.java | 7 +- 4 files changed, 22 insertions(+), 81 deletions(-) diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CDataTransferer.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CDataTransferer.java index 26d2347ff15..c07356057ee 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CDataTransferer.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CDataTransferer.java @@ -31,6 +31,7 @@ import sun.awt.image.ImageRepresentation; import java.io.*; import java.net.URL; +import java.nio.charset.Charset; import java.text.Normalizer; import java.text.Normalizer.Form; import java.util.*; @@ -126,7 +127,7 @@ public class CDataTransferer extends DataTransferer { if (format == CF_URL && URL.class.equals(flavor.getRepresentationClass())) { - String charset = getDefaultTextCharset(); + String charset = Charset.defaultCharset().name(); if (transferable != null && transferable.isDataFlavorSupported(javaTextEncodingFlavor)) { try { charset = new String((byte[])transferable.getTransferData(javaTextEncodingFlavor), "UTF-8"); diff --git a/jdk/src/share/classes/sun/awt/datatransfer/DataTransferer.java b/jdk/src/share/classes/sun/awt/datatransfer/DataTransferer.java index 3f22bd86fe9..d9c8334df8a 100644 --- a/jdk/src/share/classes/sun/awt/datatransfer/DataTransferer.java +++ b/jdk/src/share/classes/sun/awt/datatransfer/DataTransferer.java @@ -57,6 +57,7 @@ import java.nio.CharBuffer; import java.nio.charset.Charset; import java.nio.charset.CharsetEncoder; import java.nio.charset.IllegalCharsetNameException; +import java.nio.charset.StandardCharsets; import java.nio.charset.UnsupportedCharsetException; import java.lang.reflect.Constructor; @@ -149,7 +150,7 @@ public abstract class DataTransferer { tempSet.add("UTF-16BE"); tempSet.add("UTF-16LE"); tempSet.add("UTF-16"); - tempSet.add(getDefaultTextCharset()); + tempSet.add(Charset.defaultCharset().name()); return Collections.unmodifiableSortedSet(tempSet); } } @@ -162,12 +163,6 @@ public abstract class DataTransferer { */ private static final Map textMIMESubtypeCharsetSupport; - /** - * Cache of the platform default encoding as specified in the - * "file.encoding" system property. - */ - private static String defaultEncoding; - /** * A collection of all natives listed in flavormap.properties with * a primary MIME type of "text". @@ -266,17 +261,7 @@ public abstract class DataTransferer { String encoding = flavor.getParameter("charset"); - return (encoding != null) ? encoding : getDefaultTextCharset(); - } - - /** - * Returns the platform's default character encoding. - */ - public static String getDefaultTextCharset() { - if (defaultEncoding != null) { - return defaultEncoding; - } - return defaultEncoding = Charset.defaultCharset().name(); + return (encoding != null) ? encoding : Charset.defaultCharset().name(); } /** @@ -470,7 +455,7 @@ public abstract class DataTransferer { textNatives.add(format); nativeCharsets.put(format, (charset != null && charset.length() != 0) - ? charset : getDefaultTextCharset()); + ? charset : Charset.defaultCharset().name()); if (eoln != null && eoln.length() != 0 && !eoln.equals("\n")) { nativeEOLNs.put(format, eoln); } @@ -771,19 +756,17 @@ public abstract class DataTransferer { * clipboard string encoding/decoding, basing on clipboard * format and localeTransferable(on decoding, if available) */ - private String getBestCharsetForTextFormat(Long lFormat, + protected String getBestCharsetForTextFormat(Long lFormat, Transferable localeTransferable) throws IOException { String charset = null; if (localeTransferable != null && isLocaleDependentTextFormat(lFormat) && - localeTransferable.isDataFlavorSupported(javaTextEncodingFlavor)) - { + localeTransferable.isDataFlavorSupported(javaTextEncodingFlavor)) { try { - charset = new String( - (byte[])localeTransferable.getTransferData(javaTextEncodingFlavor), - "UTF-8" - ); + byte[] charsetNameBytes = (byte[])localeTransferable + .getTransferData(javaTextEncodingFlavor); + charset = new String(charsetNameBytes, StandardCharsets.UTF_8); } catch (UnsupportedFlavorException cannotHappen) { } } else { @@ -791,7 +774,7 @@ public abstract class DataTransferer { } if (charset == null) { // Only happens when we have a custom text type. - charset = getDefaultTextCharset(); + charset = Charset.defaultCharset().name(); } return charset; } @@ -1716,28 +1699,8 @@ search: { Long lFormat = format; - String sourceEncoding = null; - if (isLocaleDependentTextFormat(format) && - localeTransferable != null && - localeTransferable. - isDataFlavorSupported(javaTextEncodingFlavor)) - { - try { - sourceEncoding = new String((byte[])localeTransferable. - getTransferData(javaTextEncodingFlavor), - "UTF-8"); - } catch (UnsupportedFlavorException cannotHappen) { - } - } else { - sourceEncoding = getCharsetForTextFormat(lFormat); - } - - if (sourceEncoding == null) { - // Only happens when we have a custom text type. - sourceEncoding = getDefaultTextCharset(); - } - wrapped = new BufferedReader - (new InputStreamReader(bytestream, sourceEncoding)); + String sourceEncoding = getBestCharsetForTextFormat(format, localeTransferable); + wrapped = new BufferedReader(new InputStreamReader(bytestream, sourceEncoding)); if (targetEncoding == null) { // Throw NullPointerException for compatibility with the former @@ -2318,7 +2281,6 @@ search: */ public static class CharsetComparator extends IndexedComparator { private static final Map charsets; - private static final String defaultEncoding; private static final Integer DEFAULT_CHARSET_INDEX = 2; private static final Integer OTHER_CHARSET_INDEX = 1; @@ -2339,8 +2301,7 @@ search: // US-ASCII is the worst charset supported charsetsMap.put(canonicalName("US-ASCII"), WORST_CHARSET_INDEX); - defaultEncoding = DataTransferer.canonicalName(DataTransferer.getDefaultTextCharset()); - charsetsMap.putIfAbsent(defaultEncoding, DEFAULT_CHARSET_INDEX); + charsetsMap.putIfAbsent(Charset.defaultCharset().name(), DEFAULT_CHARSET_INDEX); charsetsMap.put(UNSUPPORTED_CHARSET, UNSUPPORTED_CHARSET_INDEX); diff --git a/jdk/src/solaris/classes/sun/awt/X11/XDataTransferer.java b/jdk/src/solaris/classes/sun/awt/X11/XDataTransferer.java index 554e19507dc..fd9cbb8f13c 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XDataTransferer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XDataTransferer.java @@ -259,28 +259,9 @@ public class XDataTransferer extends DataTransferer { Transferable localeTransferable) throws IOException { - String charset = null; - if (localeTransferable != null && - isLocaleDependentTextFormat(format) && - localeTransferable.isDataFlavorSupported(javaTextEncodingFlavor)) { - try { - charset = new String( - (byte[])localeTransferable.getTransferData(javaTextEncodingFlavor), - "UTF-8" - ); - } catch (UnsupportedFlavorException cannotHappen) { - } - } else { - charset = getCharsetForTextFormat(format); - } - if (charset == null) { - // Only happens when we have a custom text type. - charset = getDefaultTextCharset(); - } - - BufferedReader reader = null; - try { - reader = new BufferedReader(new InputStreamReader(stream, charset)); + String charset = getBestCharsetForTextFormat(format, localeTransferable); + try (InputStreamReader isr = new InputStreamReader(stream, charset); + BufferedReader reader = new BufferedReader(isr)) { String line; ArrayList uriList = new ArrayList<>(); URI uri; @@ -293,9 +274,6 @@ public class XDataTransferer extends DataTransferer { uriList.add(uri); } return uriList.toArray(new URI[uriList.size()]); - } finally { - if (reader != null) - reader.close(); } } diff --git a/jdk/src/windows/classes/sun/awt/windows/WDataTransferer.java b/jdk/src/windows/classes/sun/awt/windows/WDataTransferer.java index 4b16e214052..2ccb76462aa 100644 --- a/jdk/src/windows/classes/sun/awt/windows/WDataTransferer.java +++ b/jdk/src/windows/classes/sun/awt/windows/WDataTransferer.java @@ -59,6 +59,7 @@ import java.io.File; import java.net.URL; +import java.nio.charset.Charset; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; @@ -268,9 +269,9 @@ final class WDataTransferer extends DataTransferer { if (format == CFSTR_INETURL && URL.class.equals(flavor.getRepresentationClass())) { - String charset = getDefaultTextCharset(); - if (localeTransferable != null && localeTransferable. - isDataFlavorSupported(javaTextEncodingFlavor)) + String charset = Charset.defaultCharset().name(); + if (localeTransferable != null + && localeTransferable.isDataFlavorSupported(javaTextEncodingFlavor)) { try { charset = new String((byte[])localeTransferable. From 781d6564c91d1a182473da2c9f99c744beadbab6 Mon Sep 17 00:00:00 2001 From: Sergey Malenkov Date: Wed, 23 Apr 2014 21:11:25 +0400 Subject: [PATCH 12/50] 8039464: The scrollbar in JScrollPane has no right border if used WindowsLookAndFeel Reviewed-by: alexsch, serb --- .../plaf/windows/WindowsScrollBarUI.java | 25 ++++- .../swing/JScrollBar/8039464/Test8039464.html | 32 +++++++ .../swing/JScrollBar/8039464/Test8039464.java | 92 +++++++++++++++++++ 3 files changed, 148 insertions(+), 1 deletion(-) create mode 100644 jdk/test/javax/swing/JScrollBar/8039464/Test8039464.html create mode 100644 jdk/test/javax/swing/JScrollBar/8039464/Test8039464.java diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsScrollBarUI.java b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsScrollBarUI.java index 279bdb72b79..418f326165f 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsScrollBarUI.java +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsScrollBarUI.java @@ -51,6 +51,8 @@ import static com.sun.java.swing.plaf.windows.XPStyle.Skin; public class WindowsScrollBarUI extends BasicScrollBarUI { private Grid thumbGrid; private Grid highlightGrid; + private Dimension horizontalThumbSize; + private Dimension verticalThumbSize; /** * Creates a UI for a JScrollBar. @@ -65,11 +67,32 @@ public class WindowsScrollBarUI extends BasicScrollBarUI { protected void installDefaults() { super.installDefaults(); - if (XPStyle.getXP() != null) { + XPStyle xp = XPStyle.getXP(); + if (xp != null) { scrollbar.setBorder(null); + horizontalThumbSize = getSize(scrollbar, xp, Part.SBP_THUMBBTNHORZ); + verticalThumbSize = getSize(scrollbar, xp, Part.SBP_THUMBBTNVERT); + } else { + horizontalThumbSize = null; + verticalThumbSize = null; } } + private static Dimension getSize(Component component, XPStyle xp, Part part) { + Skin skin = xp.getSkin(component, part); + return new Dimension(skin.getWidth(), skin.getHeight()); + } + + @Override + protected Dimension getMinimumThumbSize() { + if ((horizontalThumbSize == null) || (verticalThumbSize == null)) { + return super.getMinimumThumbSize(); + } + return JScrollBar.HORIZONTAL == scrollbar.getOrientation() + ? horizontalThumbSize + : verticalThumbSize; + } + public void uninstallUI(JComponent c) { super.uninstallUI(c); thumbGrid = highlightGrid = null; diff --git a/jdk/test/javax/swing/JScrollBar/8039464/Test8039464.html b/jdk/test/javax/swing/JScrollBar/8039464/Test8039464.html new file mode 100644 index 00000000000..a473b819d1c --- /dev/null +++ b/jdk/test/javax/swing/JScrollBar/8039464/Test8039464.html @@ -0,0 +1,32 @@ + + + + +Choose the variable applet size and try to resize the applet. +The test passes the thumb is painted correctly. + + + + + diff --git a/jdk/test/javax/swing/JScrollBar/8039464/Test8039464.java b/jdk/test/javax/swing/JScrollBar/8039464/Test8039464.java new file mode 100644 index 00000000000..44bb33abd94 --- /dev/null +++ b/jdk/test/javax/swing/JScrollBar/8039464/Test8039464.java @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Container; +import java.awt.Dimension; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; + +import javax.swing.JApplet; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JScrollBar; +import javax.swing.SwingUtilities; +import javax.swing.UIManager; + +/* + * @test + * @bug 8039464 + * @summary Tests enabling/disabling of titled border's caption + * @author Sergey Malenkov + * @run applet/manual=yesno Test8039464.html + */ + +public class Test8039464 extends JApplet { + static { + try { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (Exception exception) { + throw new Error("unexpected", exception); + } + } + + @Override + public void init() { + init(this); + } + + private static void init(Container container) { + container.setLayout(new GridBagLayout()); + GridBagConstraints gbc = new GridBagConstraints(); + gbc.fill = GridBagConstraints.BOTH; + gbc.gridx = 0; + gbc.gridy = 1; + JLabel label = new JLabel(); + Dimension size = new Dimension(111, 0); + label.setPreferredSize(size); + label.setMinimumSize(size); + container.add(label, gbc); + gbc.gridx = 1; + gbc.weightx = 1; + container.add(new JScrollBar(JScrollBar.HORIZONTAL, 1, 111, 1, 1111), gbc); + gbc.gridx = 2; + gbc.gridy = 0; + gbc.weightx = 0; + gbc.weighty = 1; + container.add(new JScrollBar(JScrollBar.VERTICAL, 1, 111, 1, 1111), gbc); + } + + public static void main(String[] args) throws Exception { + SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + JFrame frame = new JFrame("8039464"); + init(frame); + frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); + frame.pack(); + frame.setLocationRelativeTo(null); + frame.setVisible(true); + } + }); + } +} From 6b14d69b604651b081196ddc015311be01bf6bb1 Mon Sep 17 00:00:00 2001 From: Alexander Scherbatiy Date: Thu, 24 Apr 2014 16:15:08 +0400 Subject: [PATCH 13/50] 8040279: [macosx] Do not use the base image in the MultiResolutionBufferedImage Reviewed-by: serb, pchelko --- .../com/apple/laf/AquaImageFactory.java | 24 +--- .../classes/com/apple/laf/AquaPainter.java | 6 +- .../classes/com/apple/laf/AquaUtils.java | 6 +- .../classes/sun/lwawt/macosx/CImage.java | 36 ++--- .../image/AbstractMultiResolutionImage.java | 123 ++++++++++++++++++ ...e.java => MultiResolutionCachedImage.java} | 56 ++++---- .../swing/JMenuItem/8031573/bug8031573.java | 2 +- .../swing/JOptionPane/8024926/bug8024926.java | 2 +- 8 files changed, 177 insertions(+), 78 deletions(-) create mode 100644 jdk/src/share/classes/sun/awt/image/AbstractMultiResolutionImage.java rename jdk/src/share/classes/sun/awt/image/{MultiResolutionBufferedImage.java => MultiResolutionCachedImage.java} (80%) diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaImageFactory.java b/jdk/src/macosx/classes/com/apple/laf/AquaImageFactory.java index be6a787a45b..9e0f34f7a4c 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaImageFactory.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaImageFactory.java @@ -46,10 +46,8 @@ import com.apple.laf.AquaIcon.JRSUIControlSpec; import com.apple.laf.AquaIcon.SystemIcon; import com.apple.laf.AquaUtils.RecyclableObject; import com.apple.laf.AquaUtils.RecyclableSingleton; -import java.util.Arrays; -import java.util.List; -import sun.awt.image.MultiResolutionBufferedImage; import sun.awt.image.MultiResolutionImage; +import sun.awt.image.MultiResolutionCachedImage; public class AquaImageFactory { public static IconUIResource getConfirmImageIcon() { @@ -125,9 +123,9 @@ public class AquaImageFactory { private static final int kAlertIconSize = 64; static IconUIResource getAppIconCompositedOn(final Image background) { - if (background instanceof MultiResolutionBufferedImage) { + if (background instanceof MultiResolutionCachedImage) { int width = background.getWidth(null); - Image mrIconImage = ((MultiResolutionBufferedImage) background).map( + Image mrIconImage = ((MultiResolutionCachedImage) background).map( rv -> getAppIconImageCompositedOn(rv, rv.getWidth(null) / width)); return new IconUIResource(new ImageIcon(mrIconImage)); } @@ -306,21 +304,7 @@ public class AquaImageFactory { private static Image getNSIcon(String imageName) { Image icon = Toolkit.getDefaultToolkit() .getImage("NSImage://" + imageName); - - if (icon instanceof MultiResolutionImage) { - return icon; - } - - int w = icon.getWidth(null); - int h = icon.getHeight(null); - - Dimension[] sizes = new Dimension[]{ - new Dimension(w, h), new Dimension(2 * w, 2 * h) - }; - - return new MultiResolutionBufferedImage(icon, sizes, (width, height) -> - AquaUtils.getCImageCreator().createImageFromName( - imageName, width, height)); + return icon; } public static class NineSliceMetrics { diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaPainter.java b/jdk/src/macosx/classes/com/apple/laf/AquaPainter.java index ee4fcba1a4d..a2ebaf1c920 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaPainter.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaPainter.java @@ -174,11 +174,7 @@ abstract class AquaPainter { bounds, controlState); Image img = cache.getImage(key); if (img == null) { - - Image baseImage = createImage(imgX, imgY, imgW, imgH, bounds, - control, controlState); - - img = new MultiResolutionBufferedImage(baseImage, + img = new MultiResolutionCachedImage(imgW, imgH, (rvWidth, rvHeight) -> createImage(imgX, imgY, rvWidth, rvHeight, bounds, control, controlState)); diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaUtils.java b/jdk/src/macosx/classes/com/apple/laf/AquaUtils.java index a20897f7b31..078435b161b 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaUtils.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaUtils.java @@ -48,7 +48,7 @@ import sun.security.action.GetPropertyAction; import sun.swing.SwingUtilities2; import com.apple.laf.AquaImageFactory.SlicedImageControl; -import sun.awt.image.MultiResolutionBufferedImage; +import sun.awt.image.MultiResolutionCachedImage; final class AquaUtils { @@ -124,8 +124,8 @@ final class AquaUtils { static Image generateLightenedImage(final Image image, final int percent) { final GrayFilter filter = new GrayFilter(true, percent); - return (image instanceof MultiResolutionBufferedImage) - ? ((MultiResolutionBufferedImage) image).map( + return (image instanceof MultiResolutionCachedImage) + ? ((MultiResolutionCachedImage) image).map( rv -> generateLightenedImage(rv, filter)) : generateLightenedImage(image, filter); } diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CImage.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CImage.java index 17815d4882e..69bdab05734 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CImage.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CImage.java @@ -32,7 +32,7 @@ import java.awt.image.*; import java.util.Arrays; import java.util.List; import sun.awt.image.MultiResolutionImage; -import sun.awt.image.MultiResolutionBufferedImage; +import sun.awt.image.MultiResolutionCachedImage; import sun.awt.image.SunWritableRaster; @@ -62,41 +62,41 @@ public class CImage extends CFRetainedResource { // This is used to create a CImage with an NSImage pointer. It MUST be a CFRetained // NSImage, and the CImage takes ownership of the non-GC retain. If callers need the // NSImage themselves, they MUST call retain on the NSImage themselves. - public BufferedImage createImageUsingNativeSize(final long image) { + public Image createImageUsingNativeSize(final long image) { if (image == 0) return null; final Dimension2D size = nativeGetNSImageSize(image); - return createBufferedImage(image, size.getWidth(), size.getHeight()); + return createImage(image, size.getWidth(), size.getHeight()); } // the width and height passed in as a parameter could differ than the width and the height of the NSImage (image), in that case, the image will be scaled - BufferedImage createBufferedImage(long image, double width, double height) { + Image createImage(long image, double width, double height) { if (image == 0) throw new Error("Unable to instantiate CImage with null native image reference."); return createImageWithSize(image, width, height); } - public BufferedImage createImageWithSize(final long image, final double width, final double height) { + public Image createImageWithSize(final long image, final double width, final double height) { final CImage img = new CImage(image); img.resize(width, height); return img.toImage(); } // This is used to create a CImage that represents the icon of the given file. - public BufferedImage createImageOfFile(final String file, final int width, final int height) { - return createBufferedImage(nativeCreateNSImageOfFileFromLaunchServices(file), width, height); + public Image createImageOfFile(final String file, final int width, final int height) { + return createImage(nativeCreateNSImageOfFileFromLaunchServices(file), width, height); } - public BufferedImage createImageFromFile(final String file, final double width, final double height) { + public Image createImageFromFile(final String file, final double width, final double height) { final long image = nativeCreateNSImageFromFileContents(file); nativeSetNSImageSize(image, width, height); - return createBufferedImage(image, width, height); + return createImage(image, width, height); } - public BufferedImage createSystemImageFromSelector(final String iconSelector, final int width, final int height) { - return createBufferedImage(nativeCreateNSImageFromIconSelector(getSelectorAsInt(iconSelector)), width, height); + public Image createSystemImageFromSelector(final String iconSelector, final int width, final int height) { + return createImage(nativeCreateNSImageFromIconSelector(getSelectorAsInt(iconSelector)), width, height); } public Image createImageFromName(final String name, final int width, final int height) { - return createBufferedImage(nativeCreateNSImageFromImageName(name), width, height); + return createImage(nativeCreateNSImageFromImageName(name), width, height); } public Image createImageFromName(final String name) { @@ -232,7 +232,7 @@ public class CImage extends CFRetainedResource { } /** @return A MultiResolution image created from nsImagePtr, or null. */ - private BufferedImage toImage() { + private Image toImage() { if (ptr == 0) return null; final Dimension2D size = nativeGetNSImageSize(ptr); @@ -243,11 +243,11 @@ public class CImage extends CFRetainedResource { = nativeGetNSImageRepresentationSizes(ptr, size.getWidth(), size.getHeight()); - BufferedImage baseImage = toImage(w, h, w, h); - - return sizes == null || sizes.length < 2 ? baseImage - : new MultiResolutionBufferedImage(baseImage, sizes, - (width, height) -> toImage(w, h, width, height)); + return sizes == null || sizes.length < 2 ? + new MultiResolutionCachedImage(w, h, (width, height) + -> toImage(w, h, width, height)) + : new MultiResolutionCachedImage(w, h, sizes, (width, height) + -> toImage(w, h, width, height)); } private BufferedImage toImage(int srcWidth, int srcHeight, int dstWidth, int dstHeight) { diff --git a/jdk/src/share/classes/sun/awt/image/AbstractMultiResolutionImage.java b/jdk/src/share/classes/sun/awt/image/AbstractMultiResolutionImage.java new file mode 100644 index 00000000000..5116f517ff0 --- /dev/null +++ b/jdk/src/share/classes/sun/awt/image/AbstractMultiResolutionImage.java @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package sun.awt.image; + +import java.awt.Graphics; +import java.awt.Image; +import java.awt.image.*; + +/** + * This class provides default implementations for the + * MultiResolutionImage interface. The developer needs only + * to subclass this abstract class and define the getResolutionVariant, + * getResolutionVariants, and getBaseImage methods. + * + * + * For example, + * {@code + * public class CustomMultiResolutionImage extends AbstractMultiResolutionImage { + * + * int baseImageIndex; + * Image[] resolutionVariants; + * + * public CustomMultiResolutionImage(int baseImageIndex, + * Image... resolutionVariants) { + * this.baseImageIndex = baseImageIndex; + * this.resolutionVariants = resolutionVariants; + * } + * + * @Override + * public Image getResolutionVariant(float logicalDPIX, float logicalDPIY, + * float baseImageWidth, float baseImageHeight, + * float destImageWidth, float destImageHeight) { + * // return a resolution variant based on the given logical DPI, + * // base image size, or destination image size + * } + * + * @Override + * public List getResolutionVariants() { + * return Arrays.asList(resolutionVariants); + * } + * + * protected Image getBaseImage() { + * return resolutionVariants[baseImageIndex]; + * } + * } + * } + * + * @see java.awt.Image + * @see java.awt.image.MultiResolutionImage + * + * @since 1.9 + */ +public abstract class AbstractMultiResolutionImage extends java.awt.Image + implements MultiResolutionImage { + + /** + * @inheritDoc + */ + @Override + public int getWidth(ImageObserver observer) { + return getBaseImage().getWidth(null); + } + + /** + * @inheritDoc + */ + @Override + public int getHeight(ImageObserver observer) { + return getBaseImage().getHeight(null); + } + + /** + * @inheritDoc + */ + @Override + public ImageProducer getSource() { + return getBaseImage().getSource(); + } + + /** + * @inheritDoc + */ + @Override + public Graphics getGraphics() { + return getBaseImage().getGraphics(); + + } + + /** + * @inheritDoc + */ + @Override + public Object getProperty(String name, ImageObserver observer) { + return getBaseImage().getProperty(name, observer); + } + + /** + * @return base image + */ + protected abstract Image getBaseImage(); +} diff --git a/jdk/src/share/classes/sun/awt/image/MultiResolutionBufferedImage.java b/jdk/src/share/classes/sun/awt/image/MultiResolutionCachedImage.java similarity index 80% rename from jdk/src/share/classes/sun/awt/image/MultiResolutionBufferedImage.java rename to jdk/src/share/classes/sun/awt/image/MultiResolutionCachedImage.java index 74db8273416..376827c0885 100644 --- a/jdk/src/share/classes/sun/awt/image/MultiResolutionBufferedImage.java +++ b/jdk/src/share/classes/sun/awt/image/MultiResolutionCachedImage.java @@ -26,9 +26,7 @@ package sun.awt.image; import java.awt.Dimension; import java.awt.Image; -import java.awt.Graphics; import java.awt.geom.Dimension2D; -import java.awt.image.BufferedImage; import java.awt.image.ImageObserver; import java.util.Arrays; import java.util.List; @@ -36,50 +34,39 @@ import java.util.function.Function; import java.util.function.BiFunction; import java.util.stream.Collectors; -public class MultiResolutionBufferedImage extends BufferedImage - implements MultiResolutionImage { +public class MultiResolutionCachedImage extends AbstractMultiResolutionImage { - private final BiFunction mapper; + private final int baseImageWidth; + private final int baseImageHeight; private final Dimension2D[] sizes; + private final BiFunction mapper; private int availableInfo; - public MultiResolutionBufferedImage(Image baseImage, + public MultiResolutionCachedImage(int baseImageWidth, int baseImageHeight, BiFunction mapper) { - this(baseImage, new Dimension[]{new Dimension( - baseImage.getWidth(null), baseImage.getHeight(null)) + this(baseImageWidth, baseImageHeight, new Dimension[]{new Dimension( + baseImageWidth, baseImageHeight) }, mapper); } - public MultiResolutionBufferedImage(Image baseImage, + public MultiResolutionCachedImage(int baseImageWidth, int baseImageHeight, Dimension2D[] sizes, BiFunction mapper) { - super(baseImage.getWidth(null), baseImage.getHeight(null), - BufferedImage.TYPE_INT_ARGB_PRE); + this.baseImageWidth = baseImageWidth; + this.baseImageHeight = baseImageHeight; this.sizes = sizes; this.mapper = mapper; - this.availableInfo = getInfo(baseImage); - Graphics g = getGraphics(); - g.drawImage(baseImage, 0, 0, null); - g.dispose(); } @Override public Image getResolutionVariant(int width, int height) { - int baseWidth = getWidth(); - int baseHeight = getHeight(); - - if (baseWidth == width && baseHeight == height) { - return this; - } - ImageCache cache = ImageCache.getInstance(); ImageCacheKey key = new ImageCacheKey(this, width, height); Image resolutionVariant = cache.getImage(key); if (resolutionVariant == null) { resolutionVariant = mapper.apply(width, height); cache.setImage(key, resolutionVariant); - preload(resolutionVariant, availableInfo); } - + preload(resolutionVariant, availableInfo); return resolutionVariant; } @@ -90,30 +77,39 @@ public class MultiResolutionBufferedImage extends BufferedImage (int) size.getHeight())).collect(Collectors.toList()); } - public MultiResolutionBufferedImage map(Function mapper) { - return new MultiResolutionBufferedImage(mapper.apply(this), sizes, - (width, height) -> + public MultiResolutionCachedImage map(Function mapper) { + return new MultiResolutionCachedImage(baseImageWidth, baseImageHeight, + sizes, (width, height) -> mapper.apply(getResolutionVariant(width, height))); } @Override public int getWidth(ImageObserver observer) { - availableInfo |= ImageObserver.WIDTH; + updateInfo(observer, ImageObserver.WIDTH); return super.getWidth(observer); } @Override public int getHeight(ImageObserver observer) { - availableInfo |= ImageObserver.HEIGHT; + updateInfo(observer, ImageObserver.HEIGHT); return super.getHeight(observer); } @Override public Object getProperty(String name, ImageObserver observer) { - availableInfo |= ImageObserver.PROPERTIES; + updateInfo(observer, ImageObserver.PROPERTIES); return super.getProperty(name, observer); } + @Override + protected Image getBaseImage() { + return getResolutionVariant(baseImageWidth, baseImageHeight); + } + + private void updateInfo(ImageObserver observer, int info) { + availableInfo |= (observer == null) ? ImageObserver.ALLBITS : info; + } + private static int getInfo(Image image) { if (image instanceof ToolkitImage) { return ((ToolkitImage) image).getImageRep().check( diff --git a/jdk/test/javax/swing/JMenuItem/8031573/bug8031573.java b/jdk/test/javax/swing/JMenuItem/8031573/bug8031573.java index 5cb1dc5047f..2d36db7a171 100644 --- a/jdk/test/javax/swing/JMenuItem/8031573/bug8031573.java +++ b/jdk/test/javax/swing/JMenuItem/8031573/bug8031573.java @@ -28,7 +28,7 @@ import javax.swing.JMenuBar; import javax.swing.SwingUtilities; /* @test - * @bug 8031573 + * @bug 8031573 8040279 * @summary [macosx] Checkmarks of JCheckBoxMenuItems aren't rendered * in high resolution on Retina * @author Alexander Scherbatiy diff --git a/jdk/test/javax/swing/JOptionPane/8024926/bug8024926.java b/jdk/test/javax/swing/JOptionPane/8024926/bug8024926.java index 42f976b03c0..185537f3b5b 100644 --- a/jdk/test/javax/swing/JOptionPane/8024926/bug8024926.java +++ b/jdk/test/javax/swing/JOptionPane/8024926/bug8024926.java @@ -31,7 +31,7 @@ import sun.awt.OSInfo; /** * @test - * @bug 8024926 + * @bug 8024926 8040279 * @summary [macosx] AquaIcon HiDPI support * @author Alexander Scherbatiy * @run applet/manual=yesno bug8024926.html From 7059ba15c3e1fbfffcb883b96cbbca5574507fcd Mon Sep 17 00:00:00 2001 From: Petr Pchelko Date: Thu, 24 Apr 2014 20:22:58 +0400 Subject: [PATCH 14/50] 7124250: [macosx] JOptionPane dialogs show wrong icons Reviewed-by: serb, leonidr --- .../com/apple/laf/AquaImageFactory.java | 24 +++---------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaImageFactory.java b/jdk/src/macosx/classes/com/apple/laf/AquaImageFactory.java index 9e0f34f7a4c..4838ba48879 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaImageFactory.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaImageFactory.java @@ -55,7 +55,7 @@ public class AquaImageFactory { return new IconUIResource(new AquaIcon.CachingScalingIcon(kAlertIconSize, kAlertIconSize) { Image createImage() { - return getThisApplicationsIcon(kAlertIconSize, kAlertIconSize); + return getGenericJavaIcon(); } }); } @@ -81,24 +81,6 @@ public class AquaImageFactory { return getAppIconCompositedOn(lockIcon); } - static Image getThisApplicationsIcon(final int width, final int height) { - final String path = getPathToThisApplication(); - - if (path == null) { - return getGenericJavaIcon(); - } - - if (path.endsWith("/Home/bin")) { - return getGenericJavaIcon(); - } - - if (path.startsWith("/usr/bin")) { - return getGenericJavaIcon(); - } - - return AquaUtils.getCImageCreator().createImageOfFile(path, height, width); - } - static Image getGenericJavaIcon() { return java.security.AccessController.doPrivileged(new PrivilegedAction() { public Image run() { @@ -142,7 +124,7 @@ public class AquaImageFactory { final Icon smallAppIconScaled = new AquaIcon.CachingScalingIcon( kAlertSubIconSize, kAlertSubIconSize) { Image createImage() { - return getThisApplicationsIcon(kAlertSubIconSize, kAlertSubIconSize); + return getGenericJavaIcon(); } }; @@ -514,4 +496,4 @@ public class AquaImageFactory { public static Color getSelectionInactiveForegroundColorUIResource() { return new SystemColorProxy(LWCToolkit.getAppleColor(LWCToolkit.INACTIVE_SELECTION_FOREGROUND_COLOR)); } -} \ No newline at end of file +} From c25473bb3827e3b8e53694d148a615c7cd14e6ae Mon Sep 17 00:00:00 2001 From: Petr Pchelko Date: Fri, 25 Apr 2014 16:27:30 +0400 Subject: [PATCH 15/50] 8041572: [macosx] huge native memory leak in AWTWindow.m Reviewed-by: serb, anthony --- jdk/src/macosx/native/sun/awt/AWTWindow.m | 9 ++++++--- jdk/src/macosx/native/sun/awt/CGraphicsDevice.m | 4 +++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/jdk/src/macosx/native/sun/awt/AWTWindow.m b/jdk/src/macosx/native/sun/awt/AWTWindow.m index c2577584886..6a9c1166e84 100644 --- a/jdk/src/macosx/native/sun/awt/AWTWindow.m +++ b/jdk/src/macosx/native/sun/awt/AWTWindow.m @@ -261,7 +261,8 @@ AWT_ASSERT_APPKIT_THREAD; // returns id for the topmost window under mouse + (NSInteger) getTopmostWindowUnderMouseID { - + NSInteger result = -1; + NSRect screenRect = [[NSScreen mainScreen] frame]; NSPoint nsMouseLocation = [NSEvent mouseLocation]; CGPoint cgMouseLocation = CGPointMake(nsMouseLocation.x, screenRect.size.height - nsMouseLocation.y); @@ -274,11 +275,13 @@ AWT_ASSERT_APPKIT_THREAD; CGRect rect; CGRectMakeWithDictionaryRepresentation((CFDictionaryRef)[window objectForKey:(id)kCGWindowBounds], &rect); if (CGRectContainsPoint(rect, cgMouseLocation)) { - return [[window objectForKey:(id)kCGWindowNumber] integerValue]; + result = [[window objectForKey:(id)kCGWindowNumber] integerValue]; + break; } } } - return -1; + [windows release]; + return result; } // checks that this window is under the mouse cursor and this point is not overlapped by others windows diff --git a/jdk/src/macosx/native/sun/awt/CGraphicsDevice.m b/jdk/src/macosx/native/sun/awt/CGraphicsDevice.m index 9b94b82abbc..4d3b587c174 100644 --- a/jdk/src/macosx/native/sun/awt/CGraphicsDevice.m +++ b/jdk/src/macosx/native/sun/awt/CGraphicsDevice.m @@ -66,7 +66,8 @@ static CFMutableArrayRef getAllValidDisplayModes(jint displayID){ CFArrayAppendValue(validModes, cRef); } } - + CFRelease(allModes); + CGDisplayModeRef currentMode = CGDisplayCopyDisplayMode(displayID); BOOL containsCurrentMode = NO; @@ -81,6 +82,7 @@ static CFMutableArrayRef getAllValidDisplayModes(jint displayID){ if (!containsCurrentMode) { CFArrayAppendValue(validModes, currentMode); } + CGDisplayModeRelease(currentMode); return validModes; } From 844cf2d704ada1bbf613504d6c2d21c058b9af44 Mon Sep 17 00:00:00 2001 From: Petr Pchelko Date: Fri, 25 Apr 2014 16:39:13 +0400 Subject: [PATCH 16/50] 8041490: PIT: [macosx] Crash in system tray functionality check test Reviewed-by: anthony, serb --- .../sun/lwawt/macosx/CWarningWindow.java | 4 ++ .../WarningWindowDisposeCrashTest.java | 54 +++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 jdk/test/java/awt/security/WarningWindowDisposeTest/WarningWindowDisposeCrashTest.java diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CWarningWindow.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CWarningWindow.java index fc72ef79474..0acc67feed6 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CWarningWindow.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CWarningWindow.java @@ -309,6 +309,10 @@ public final class CWarningWindow extends CPlatformWindow @Override public void dispose() { cancelTasks(); + SurfaceData surfaceData = contentView.getSurfaceData(); + if (surfaceData != null) { + surfaceData.invalidate(); + } super.dispose(); } diff --git a/jdk/test/java/awt/security/WarningWindowDisposeTest/WarningWindowDisposeCrashTest.java b/jdk/test/java/awt/security/WarningWindowDisposeTest/WarningWindowDisposeCrashTest.java new file mode 100644 index 00000000000..298059054d9 --- /dev/null +++ b/jdk/test/java/awt/security/WarningWindowDisposeTest/WarningWindowDisposeCrashTest.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + @test + @bug 8041490 + @summary tests that the WarningWindow's surface is invalidated on dispose + @author Petr Pchelko + @run main/othervm WarningWindowDisposeCrashTest +*/ + + +import sun.applet.AppletSecurity; +import sun.awt.SunToolkit; + +import java.awt.*; + +public class WarningWindowDisposeCrashTest { + public static void main(String[] args) throws Exception { + System.setSecurityManager(new AppletSecurity() { + @Override + public void checkPackageAccess (String s){ + } + }); + + Frame f = new Frame(); + f.setVisible(true); + ((SunToolkit) Toolkit.getDefaultToolkit()).realSync(); + Thread.sleep(1000); + f.dispose(); + // If the bug is present VM could crash after this call + for (int i = 0; i < 1000; i++) Toolkit.getDefaultToolkit().sync(); + } +} From 01e8b57668fb27fbc9ef52627db027d5edcf5ab4 Mon Sep 17 00:00:00 2001 From: Petr Pchelko Date: Mon, 28 Apr 2014 16:45:43 +0400 Subject: [PATCH 17/50] 8041987: [macosx] setDisplayMode crashes Reviewed-by: anthony, serb --- .../macosx/native/sun/awt/CGraphicsDevice.m | 9 +- .../DisplayChangeVITest.java | 245 ++++++++++++++++++ 2 files changed, 250 insertions(+), 4 deletions(-) create mode 100644 jdk/test/java/awt/FullScreen/DisplayChangeVITest/DisplayChangeVITest.java diff --git a/jdk/src/macosx/native/sun/awt/CGraphicsDevice.m b/jdk/src/macosx/native/sun/awt/CGraphicsDevice.m index 4d3b587c174..e20792a231d 100644 --- a/jdk/src/macosx/native/sun/awt/CGraphicsDevice.m +++ b/jdk/src/macosx/native/sun/awt/CGraphicsDevice.m @@ -237,17 +237,19 @@ Java_sun_awt_CGraphicsDevice_nativeSetDisplayMode { JNF_COCOA_ENTER(env); CFArrayRef allModes = getAllValidDisplayModes(displayID); - CGDisplayModeRef closestMatch = getBestModeForParameters(allModes, (int)w, (int)h, (int)bpp, (int)refrate); + __block CGError retCode = kCGErrorSuccess; if (closestMatch != NULL) { - [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){ + CGDisplayModeRetain(closestMatch); + [ThreadUtilities performOnMainThreadWaiting:YES block:^(){ CGDisplayConfigRef config; retCode = CGBeginDisplayConfiguration(&config); if (retCode == kCGErrorSuccess) { CGConfigureDisplayWithDisplayMode(config, displayID, closestMatch, NULL); retCode = CGCompleteDisplayConfiguration(config, kCGConfigureForAppOnly); } + CGDisplayModeRelease(closestMatch); }]; } else { [JNFException raise:env as:kIllegalArgumentException reason:"Invalid display mode"]; @@ -255,8 +257,7 @@ Java_sun_awt_CGraphicsDevice_nativeSetDisplayMode if (retCode != kCGErrorSuccess){ [JNFException raise:env as:kIllegalArgumentException reason:"Unable to set display mode!"]; - } - + } CFRelease(allModes); JNF_COCOA_EXIT(env); } diff --git a/jdk/test/java/awt/FullScreen/DisplayChangeVITest/DisplayChangeVITest.java b/jdk/test/java/awt/FullScreen/DisplayChangeVITest/DisplayChangeVITest.java new file mode 100644 index 00000000000..ae7ab9f1908 --- /dev/null +++ b/jdk/test/java/awt/FullScreen/DisplayChangeVITest/DisplayChangeVITest.java @@ -0,0 +1,245 @@ +/* + * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 6366359 + * @summary Test that we don't crash when changing from 8 to 16/32 bit modes + * @author Dmitri.Trembovetski@Sun.COM area=FullScreen + * @run main/othervm/timeout=200 DisplayChangeVITest + * @run main/othervm/timeout=200 -Dsun.java2d.d3d=false DisplayChangeVITest + * @run main/othervm/timeout=200 -Dsun.java2d.opengl=true DisplayChangeVITest + */ + +import java.awt.Color; +import java.awt.DisplayMode; +import java.awt.Graphics; +import java.awt.GraphicsDevice; +import java.awt.GraphicsEnvironment; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.awt.image.BufferedImage; +import java.awt.image.VolatileImage; +import java.lang.Exception; +import java.lang.Thread; +import java.util.ArrayList; +import java.util.Random; +import javax.swing.JFrame; + +/** + * The test enters fullscreen mode (if it's supported) and then tries + * to switch between display moes with different depths and dimensions + * while doing both rendering to the screen (via a VolatileImage) + * and Swing repainting just to make things more chaotic. + * + * The procedure is repeated TEST_REPS times (3 by default). + * + * Don't pay attention to what happens on the screen, it won't be pretty. + * If the test doesn't crash or throw exceptions, it passes, otherwise + * it fails. + */ +public class DisplayChangeVITest extends JFrame implements Runnable { + + private final Random rnd = new Random(); + private VolatileImage bb; + private BufferedImage sprite; + private VolatileImage volSprite; + + private static boolean done = false; + private static final Object lock = new Object(); + private static final int TEST_REPS = 3; + + private ArrayList dms; + + DisplayChangeVITest() { + selectDisplayModes(); + addKeyListener(new KeyAdapter() { + public void keyPressed(KeyEvent e) { + if (e.getKeyCode() == KeyEvent.VK_ESCAPE) { + synchronized (lock) { + done = true; + } + } + } + }); + sprite = new BufferedImage(200, 200, BufferedImage.TYPE_INT_RGB); + sprite.getRaster().getDataBuffer(); + Graphics g = sprite.getGraphics(); + g.setColor(Color.yellow); + g.fillRect(0, 0, sprite.getWidth(), sprite.getHeight()); + } + + void render(Graphics g) { + do { + // volatile images validated here + initBackbuffer(); + + g.setColor(Color.black); + g.fillRect(0, 0, getWidth(), getHeight()); + + Graphics gg = bb.getGraphics(); + gg.setColor(new Color(rnd.nextInt(0x00ffffff))); + gg.fillRect(0, 0, bb.getWidth(), bb.getHeight()); + for (int x = 0; x < 10; x++) { + gg.drawImage(sprite, x*200, 0, null); + gg.drawImage(volSprite, x*200, 500, null); + } + + g.drawImage(bb, 0, 0, null); + } while (bb.contentsLost()); + } + + private static void sleep(long msec) { + try { Thread.sleep(msec); } catch (InterruptedException e) {} + } + + private int reps = 0; + public void run() { + GraphicsDevice gd = getGraphicsConfiguration().getDevice(); + if (gd.isDisplayChangeSupported() && dms.size() > 0) { + while (!done && reps++ < TEST_REPS) { + for (DisplayMode dm : dms) { + System.err.printf("Entering DisplayMode[%dx%dx%d]\n", + dm.getWidth(), dm.getHeight(), dm.getBitDepth()); + gd.setDisplayMode(dm); + + initBackbuffer(); + for (int i = 0; i < 10; i++) { + // render to the screen + render(getGraphics()); + // ask Swing to repaint + repaint(); + sleep(100); + } + sleep(1500); + } + } + } else { + System.err.println("Display mode change " + + "not supported. Test passed."); + } + dispose(); + synchronized (lock) { + done = true; + lock.notify(); + } + } + + private void createBackbuffer() { + if (bb == null || + bb.getWidth() != getWidth() || bb.getHeight() != getHeight()) + { + bb = createVolatileImage(getWidth(), getHeight()); + } + } + + private void initBackbuffer() { + createBackbuffer(); + + int res = bb.validate(getGraphicsConfiguration()); + if (res == VolatileImage.IMAGE_INCOMPATIBLE) { + bb = null; + createBackbuffer(); + bb.validate(getGraphicsConfiguration()); + res = VolatileImage.IMAGE_RESTORED; + } + if (res == VolatileImage.IMAGE_RESTORED) { + Graphics g = bb.getGraphics(); + g.setColor(new Color(rnd.nextInt(0x00ffffff))); + g.fillRect(0, 0, bb.getWidth(), bb.getHeight()); + + volSprite = createVolatileImage(100, 100); + } + volSprite.validate(getGraphicsConfiguration()); + } + + private void selectDisplayModes() { + GraphicsDevice gd = + GraphicsEnvironment.getLocalGraphicsEnvironment(). + getDefaultScreenDevice(); + dms = new ArrayList(); + DisplayMode dmArray[] = gd.getDisplayModes(); + boolean found8 = false, found16 = false, + found24 = false, found32 = false; + for (DisplayMode dm : dmArray) { + if (!found8 && + (dm.getBitDepth() == 8 || + dm.getBitDepth() == DisplayMode.BIT_DEPTH_MULTI) && + (dm.getWidth() >= 800 && dm.getWidth() < 1024)) + { + dms.add(dm); + found8 = true; + continue; + } + if (!found32 && + (dm.getBitDepth() == 32 || + dm.getBitDepth() == DisplayMode.BIT_DEPTH_MULTI) && + dm.getWidth() >= 1280) + { + dms.add(dm); + found32 = true; + continue; + } + if (!found16 && + dm.getBitDepth() == 16 && + (dm.getWidth() >= 1024 && dm.getWidth() < 1280)) + { + dms.add(dm); + found16 = true; + continue; + } + if (found8 && found16 && found32) { + break; + } + } + System.err.println("Found display modes:"); + for (DisplayMode dm : dms) { + System.err.printf("DisplayMode[%dx%dx%d]\n", + dm.getWidth(), dm.getHeight(), dm.getBitDepth()); + } + } + + public static void main(String[] args) throws Exception { + DisplayChangeVITest test = new DisplayChangeVITest(); + GraphicsDevice gd = + GraphicsEnvironment.getLocalGraphicsEnvironment(). + getDefaultScreenDevice(); + if (gd.isFullScreenSupported()) { + gd.setFullScreenWindow(test); + Thread t = new Thread(test); + t.run(); + synchronized (lock) { + while (!done) { + try { + lock.wait(50); + } catch (InterruptedException ex) { + ex.printStackTrace(); + } + } + } + System.err.println("Test Passed."); + } else { + System.err.println("Full screen not supported. Test passed."); + } + } +} From c7f7685c508af7155e1abf6405e4730d6780e1c6 Mon Sep 17 00:00:00 2001 From: Vivi An Date: Mon, 28 Apr 2014 11:03:52 -0700 Subject: [PATCH 18/50] 8036819: JAB: mneumonics not read for textboxes Reviewed-by: alexsch --- .../share/classes/javax/swing/JComponent.java | 13 +- .../swing/JTextField/8036819/bug8036819.java | 132 ++++++++++++++++++ 2 files changed, 144 insertions(+), 1 deletion(-) create mode 100644 jdk/test/javax/swing/JTextField/8036819/bug8036819.java diff --git a/jdk/src/share/classes/javax/swing/JComponent.java b/jdk/src/share/classes/javax/swing/JComponent.java index 98c4d7fb5dd..2d2745957e7 100644 --- a/jdk/src/share/classes/javax/swing/JComponent.java +++ b/jdk/src/share/classes/javax/swing/JComponent.java @@ -3986,7 +3986,18 @@ public abstract class JComponent extends Container implements Serializable, * @see AccessibleKeyBinding * @since 1.4 */ - public AccessibleKeyBinding getAccessibleKeyBinding() { + public AccessibleKeyBinding getAccessibleKeyBinding(){ + // Try to get the linked label's mnemonic if it exists + Object o = getClientProperty(JLabel.LABELED_BY_PROPERTY); + if (o instanceof Accessible){ + AccessibleContext ac = ((Accessible) o).getAccessibleContext(); + if (ac != null){ + AccessibleComponent comp = ac.getAccessibleComponent(); + if (! (comp instanceof AccessibleExtendedComponent)) + return null; + return ((AccessibleExtendedComponent)comp).getAccessibleKeyBinding(); + } + } return null; } } // inner class AccessibleJComponent diff --git a/jdk/test/javax/swing/JTextField/8036819/bug8036819.java b/jdk/test/javax/swing/JTextField/8036819/bug8036819.java new file mode 100644 index 00000000000..558be4c9769 --- /dev/null +++ b/jdk/test/javax/swing/JTextField/8036819/bug8036819.java @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @library ../../regtesthelpers + * @build Util + * @bug 8036819 + * @summary JAB: mnemonics not read for textboxes + * @author Vivi An + * @run main bug8036819 + */ + +import javax.swing.*; +import javax.swing.event.*; +import java.awt.event.*; +import java.awt.*; +import sun.awt.SunToolkit; +import javax.accessibility.*; + +public class bug8036819 { + + public static volatile Boolean passed = false; + + public static void main(String args[]) throws Throwable { + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + createAndShowGUI(); + } + }); + + SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit(); + toolkit.realSync(); + + Robot robo = new Robot(); + robo.setAutoDelay(300); + + // Using mnemonic key to focus on the textfield + Util.hitMnemonics(robo, KeyEvent.VK_P); + toolkit.realSync(); + + if (!passed){ + throw new RuntimeException("Test failed."); + } + } + + private static void createAndShowGUI() { + JFrame mainFrame = new JFrame("bug 8036819"); + + JLabel usernameLabel = new JLabel("Username: "); + JTextField usernameField = new JTextField(20); + usernameLabel.setDisplayedMnemonic(KeyEvent.VK_U); + usernameLabel.setLabelFor(usernameField); + + JLabel pwdLabel = new JLabel("Password: "); + JTextField pwdField = new JTextField(20); + pwdLabel.setDisplayedMnemonic(KeyEvent.VK_P); + pwdLabel.setLabelFor(pwdField); + + pwdField.addKeyListener( + new KeyListener(){ + @Override + public void keyPressed(KeyEvent keyEvent) { + } + + @Override + public void keyTyped(KeyEvent keyEvent) { + } + + @Override + public void keyReleased(KeyEvent keyEvent){ + JComponent comp = (JComponent) pwdField; + AccessibleContext ac = comp.getAccessibleContext(); + AccessibleExtendedComponent aec = (AccessibleExtendedComponent)ac.getAccessibleComponent(); + AccessibleKeyBinding akb = aec.getAccessibleKeyBinding(); + if (akb != null){ + int count = akb.getAccessibleKeyBindingCount(); + if (count != 1){ + passed = false; + return; + } + + // there is 1 accessible key for the text field + System.out.println("Retrieved AccessibleKeyBinding for textfield " + count); + + // the key code is KeyEvent.VK_P + Object o = akb.getAccessibleKeyBinding(0); + if (o instanceof KeyStroke){ + javax.swing.KeyStroke key = (javax.swing.KeyStroke)o; + System.out.println("keystroke is " + key.getKeyCode()); + if (key.getKeyCode() == KeyEvent.VK_P) + passed = true; + } + } + } + } + ); + + mainFrame.getContentPane().add(usernameLabel); + mainFrame.getContentPane().add(usernameField); + mainFrame.getContentPane().add(pwdLabel); + mainFrame.getContentPane().add(pwdField); + + mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + mainFrame.setLayout(new FlowLayout(FlowLayout.LEFT)); + + mainFrame.setSize(200, 200); + mainFrame.setLocation(200, 200); + mainFrame.setVisible(true); + mainFrame.toFront(); + } + } From cb91afdb8cb3561f6bbf68ab116d5732f4139dc4 Mon Sep 17 00:00:00 2001 From: Henry Jen Date: Mon, 28 Apr 2014 19:05:49 -0700 Subject: [PATCH 19/50] 8039642: Fix raw and unchecked warnings in sun.awt.* Reviewed-by: darcy, prr, flar --- jdk/src/share/classes/java/awt/Menu.java | 8 +- .../share/classes/sun/awt/AWTAccessor.java | 4 +- jdk/src/share/classes/sun/awt/AppContext.java | 1 + .../classes/sun/awt/FontConfiguration.java | 44 ++++----- jdk/src/share/classes/sun/awt/HToolkit.java | 3 +- .../classes/sun/awt/HeadlessToolkit.java | 3 +- .../share/classes/sun/awt/PlatformFont.java | 11 +-- jdk/src/share/classes/sun/awt/SunToolkit.java | 2 + .../sun/awt/datatransfer/DataTransferer.java | 45 ++++----- .../sun/awt/datatransfer/SunClipboard.java | 6 +- .../awt/datatransfer/TransferableProxy.java | 20 ++-- .../sun/awt/dnd/SunDragSourceContextPeer.java | 2 +- .../sun/awt/dnd/SunDropTargetContextPeer.java | 8 +- .../share/classes/sun/awt/geom/AreaOp.java | 56 +++++------ .../share/classes/sun/awt/geom/Crossings.java | 16 ++-- jdk/src/share/classes/sun/awt/geom/Curve.java | 8 +- .../share/classes/sun/awt/geom/Order2.java | 4 +- .../share/classes/sun/awt/geom/Order3.java | 4 +- .../sun/awt/image/BufImgSurfaceData.java | 2 +- .../sun/awt/image/GifImageDecoder.java | 2 +- .../classes/sun/awt/image/ImageDecoder.java | 4 +- .../classes/sun/awt/image/ImageFetcher.java | 41 ++++---- .../sun/awt/image/ImageRepresentation.java | 2 +- .../classes/sun/awt/image/ImagingLib.java | 4 +- .../sun/awt/image/JPEGImageDecoder.java | 6 +- .../sun/awt/image/OffScreenImageSource.java | 6 +- .../sun/awt/image/PNGImageDecoder.java | 4 +- .../classes/sun/awt/image/ToolkitImage.java | 6 +- .../classes/sun/awt/shell/ShellFolder.java | 12 ++- .../sun/awt/shell/ShellFolderColumnInfo.java | 10 +- .../sun/awt/util/IdentityArrayList.java | 7 +- .../sun/awt/util/IdentityLinkedList.java | 11 ++- .../classes/sun/awt/X11/InfoWindow.java | 5 +- .../classes/sun/awt/X11/ListHelper.java | 16 ++-- .../awt/X11/MotifDnDDragSourceProtocol.java | 3 +- .../solaris/classes/sun/awt/X11/Native.java | 21 ++--- .../classes/sun/awt/X11/XAWTXSettings.java | 8 +- .../classes/sun/awt/X11/XAtomList.java | 2 +- .../classes/sun/awt/X11/XAwtState.java | 12 +-- .../classes/sun/awt/X11/XBaseMenuWindow.java | 6 +- .../classes/sun/awt/X11/XComponentPeer.java | 14 +-- .../sun/awt/X11/XCreateWindowParams.java | 6 +- .../classes/sun/awt/X11/XDataTransferer.java | 3 +- .../sun/awt/X11/XDnDDragSourceProtocol.java | 3 +- .../sun/awt/X11/XDragAndDropProtocols.java | 24 ++--- .../sun/awt/X11/XDragSourceContextPeer.java | 24 +++-- .../sun/awt/X11/XDragSourceProtocol.java | 6 +- .../sun/awt/X11/XDropTargetContextPeer.java | 17 ++-- .../awt/X11/XDropTargetEventProcessor.java | 5 +- .../sun/awt/X11/XDropTargetProtocol.java | 6 +- .../sun/awt/X11/XDropTargetRegistry.java | 53 +++++------ .../sun/awt/X11/XEmbeddingContainer.java | 2 +- .../classes/sun/awt/X11/XFileDialogPeer.java | 6 +- .../classes/sun/awt/X11/XListPeer.java | 16 ++-- .../classes/sun/awt/X11/XMSelection.java | 24 ++--- .../classes/sun/awt/X11/XMenuBarPeer.java | 6 +- .../classes/sun/awt/X11/XMenuPeer.java | 2 +- .../classes/sun/awt/X11/XMenuWindow.java | 4 +- .../classes/sun/awt/X11/XPopupMenuPeer.java | 4 +- .../classes/sun/awt/X11/XSelection.java | 6 +- .../solaris/classes/sun/awt/X11/XToolkit.java | 94 +++++++++---------- .../classes/sun/awt/X11/XTrayIconPeer.java | 2 +- jdk/src/solaris/classes/sun/awt/X11/XWM.java | 5 +- .../solaris/classes/sun/awt/X11/XWindow.java | 8 +- .../classes/sun/awt/X11/XWindowPeer.java | 2 +- .../classes/sun/awt/X11CustomCursor.java | 6 +- .../classes/sun/awt/X11FontManager.java | 42 ++++----- .../classes/sun/awt/X11GraphicsDevice.java | 8 +- .../sun/awt/X11GraphicsEnvironment.java | 14 +-- .../classes/sun/awt/X11InputMethod.java | 28 +++--- .../solaris/classes/sun/awt/XSettings.java | 8 +- .../sun/awt/motif/MFontConfiguration.java | 6 +- 72 files changed, 452 insertions(+), 437 deletions(-) diff --git a/jdk/src/share/classes/java/awt/Menu.java b/jdk/src/share/classes/java/awt/Menu.java index 629371868d1..ae8e50ea7e1 100644 --- a/jdk/src/share/classes/java/awt/Menu.java +++ b/jdk/src/share/classes/java/awt/Menu.java @@ -66,7 +66,7 @@ public class Menu extends MenuItem implements MenuContainer, Accessible { AWTAccessor.setMenuAccessor( new AWTAccessor.MenuAccessor() { - public Vector getItems(Menu menu) { + public Vector getItems(Menu menu) { return menu.items; } }); @@ -78,7 +78,7 @@ public class Menu extends MenuItem implements MenuContainer, Accessible { * @serial * @see #countItems() */ - Vector items = new Vector<>(); + Vector items = new Vector<>(); /** * This field indicates whether the menu has the @@ -252,7 +252,7 @@ public class Menu extends MenuItem implements MenuContainer, Accessible { * be called on the toolkit thread. */ final MenuItem getItemImpl(int index) { - return (MenuItem)items.elementAt(index); + return items.elementAt(index); } /** @@ -544,7 +544,7 @@ public class Menu extends MenuItem implements MenuContainer, Accessible { // HeadlessException will be thrown from MenuComponent's readObject s.defaultReadObject(); for(int i = 0; i < items.size(); i++) { - MenuItem item = (MenuItem)items.elementAt(i); + MenuItem item = items.elementAt(i); item.parent = this; } } diff --git a/jdk/src/share/classes/sun/awt/AWTAccessor.java b/jdk/src/share/classes/sun/awt/AWTAccessor.java index b99ccdfe2ee..1d60a1c332d 100644 --- a/jdk/src/share/classes/sun/awt/AWTAccessor.java +++ b/jdk/src/share/classes/sun/awt/AWTAccessor.java @@ -621,7 +621,7 @@ public final class AWTAccessor { /** * Returns menus */ - Vector getMenus(MenuBar menuBar); + Vector getMenus(MenuBar menuBar); } /** @@ -663,7 +663,7 @@ public final class AWTAccessor { /** * Returns vector of the items that are part of the Menu */ - Vector getItems(Menu menu); + Vector getItems(Menu menu); } /** diff --git a/jdk/src/share/classes/sun/awt/AppContext.java b/jdk/src/share/classes/sun/awt/AppContext.java index 5959e54dea4..23653ba7387 100644 --- a/jdk/src/share/classes/sun/awt/AppContext.java +++ b/jdk/src/share/classes/sun/awt/AppContext.java @@ -890,6 +890,7 @@ public final class AppContext { Supplier supplier) { final AppContext appContext = AppContext.getAppContext(); + @SuppressWarnings("unchecked") SoftReference ref = (SoftReference) appContext.get(key); if (ref != null) { final T object = ref.get(); diff --git a/jdk/src/share/classes/sun/awt/FontConfiguration.java b/jdk/src/share/classes/sun/awt/FontConfiguration.java index f95b36805df..c234b534633 100644 --- a/jdk/src/share/classes/sun/awt/FontConfiguration.java +++ b/jdk/src/share/classes/sun/awt/FontConfiguration.java @@ -64,7 +64,7 @@ public abstract class FontConfiguration { protected static String osName; protected static String encoding; // canonical name of default nio charset protected static Locale startupLocale = null; - protected static Hashtable localeMap = null; + protected static Hashtable localeMap = null; private static FontConfiguration fontConfig; private static PlatformLogger logger; protected static boolean isProperties = true; @@ -159,15 +159,15 @@ public abstract class FontConfiguration { short fontNameID = compFontNameIDs[0][0][0]; short fileNameID = getComponentFileID(fontNameID); final String fileName = mapFileName(getComponentFileName(fileNameID)); - Boolean exists = (Boolean)java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction() { - public Object run() { + Boolean exists = java.security.AccessController.doPrivileged( + new java.security.PrivilegedAction() { + public Boolean run() { try { File f = new File(fileName); return Boolean.valueOf(f.exists()); } catch (Exception e) { - return false; + return Boolean.FALSE; } } }); @@ -534,11 +534,11 @@ public abstract class FontConfiguration { private short remapLocaleMap(int fontIndex, int styleIndex, short scriptID, short fontID) { String scriptName = getString(table_scriptIDs[scriptID]); - String value = (String)localeMap.get(scriptName); + String value = localeMap.get(scriptName); if (value == null) { String fontName = fontNames[fontIndex]; String styleName = styleNames[styleIndex]; - value = (String)localeMap.get(fontName + "." + styleName + "." + scriptName); + value = localeMap.get(fontName + "." + styleName + "." + scriptName); } if (value == null) { return fontID; @@ -746,7 +746,7 @@ public abstract class FontConfiguration { /* Mappings from file encoding to font config name for font supporting * the corresponding language. This is filled in by initReorderMap() */ - protected HashMap reorderMap = null; + protected HashMap reorderMap = null; /* Platform-specific mappings */ protected abstract void initReorderMap(); @@ -777,7 +777,7 @@ public abstract class FontConfiguration { if (fontConfig.reorderMap == null) { fontConfig.initReorderMap(); } - HashMap reorderMap = fontConfig.reorderMap; + HashMap reorderMap = fontConfig.reorderMap; /* Find the most specific mapping */ String language = startupLocale.getLanguage(); @@ -817,9 +817,9 @@ public abstract class FontConfiguration { } } - private static Vector splitSequence(String sequence) { + private static Vector splitSequence(String sequence) { //String.split would be more convenient, but incurs big performance penalty - Vector parts = new Vector(); + Vector parts = new Vector<>(); int start = 0; int end; while ((end = sequence.indexOf(',', start)) >= 0) { @@ -833,14 +833,14 @@ public abstract class FontConfiguration { } protected String[] split(String sequence) { - Vector v = splitSequence(sequence); - return (String[])v.toArray(new String[0]); + Vector v = splitSequence(sequence); + return v.toArray(new String[0]); } //////////////////////////////////////////////////////////////////////// // Methods for extracting information from the fontconfig data for AWT// //////////////////////////////////////////////////////////////////////// - private Hashtable charsetRegistry = new Hashtable(5); + private Hashtable charsetRegistry = new Hashtable<>(5); /** * Returns FontDescriptors describing the physical fonts used for the @@ -932,9 +932,9 @@ public abstract class FontConfiguration { Charset fc = null; if (charsetName.equals("default")) { - fc = (Charset) charsetRegistry.get(fontName); + fc = charsetRegistry.get(fontName); } else { - fc = (Charset) charsetRegistry.get(charsetName); + fc = charsetRegistry.get(charsetName); } if (fc != null) { return fc.newEncoder(); @@ -943,8 +943,8 @@ public abstract class FontConfiguration { if (!charsetName.startsWith("sun.awt.") && !charsetName.equals("default")) { fc = Charset.forName(charsetName); } else { - Class fcc = (Class) AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { + Class fcc = AccessController.doPrivileged(new PrivilegedAction>() { + public Class run() { try { return Class.forName(charsetName, true, ClassLoader.getSystemClassLoader()); @@ -1377,9 +1377,9 @@ public abstract class FontConfiguration { //This method will only be called during build time, do we //need do PrivilegedAction? - String osName = (String)java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction() { - public Object run() { + String osName = java.security.AccessController.doPrivileged( + new java.security.PrivilegedAction() { + public String run() { return System.getProperty("os.name"); } }); @@ -2139,7 +2139,7 @@ public abstract class FontConfiguration { boolean has1252 = false; //get the scriptID list - String[] ss = (String[])splitSequence(value).toArray(EMPTY_STRING_ARRAY); + String[] ss = splitSequence(value).toArray(EMPTY_STRING_ARRAY); short [] sa = new short[ss.length]; for (int i = 0; i < ss.length; i++) { if ("alphabetic/default".equals(ss[i])) { diff --git a/jdk/src/share/classes/sun/awt/HToolkit.java b/jdk/src/share/classes/sun/awt/HToolkit.java index fdce8ccdcfc..81edd5ef641 100644 --- a/jdk/src/share/classes/sun/awt/HToolkit.java +++ b/jdk/src/share/classes/sun/awt/HToolkit.java @@ -214,7 +214,8 @@ public class HToolkit extends SunToolkit throw new HeadlessException(); } - public Map mapInputMethodHighlight(InputMethodHighlight highlight) + public Map mapInputMethodHighlight( + InputMethodHighlight highlight) throws HeadlessException { throw new HeadlessException(); } diff --git a/jdk/src/share/classes/sun/awt/HeadlessToolkit.java b/jdk/src/share/classes/sun/awt/HeadlessToolkit.java index 9d68bd48b1e..08890486486 100644 --- a/jdk/src/share/classes/sun/awt/HeadlessToolkit.java +++ b/jdk/src/share/classes/sun/awt/HeadlessToolkit.java @@ -29,6 +29,7 @@ import java.awt.*; import java.awt.dnd.*; import java.awt.dnd.peer.DragSourceContextPeer; import java.awt.event.*; +import java.awt.font.TextAttribute; import java.awt.im.InputMethodHighlight; import java.awt.image.*; import java.awt.datatransfer.Clipboard; @@ -224,7 +225,7 @@ public class HeadlessToolkit extends Toolkit throw new HeadlessException(); } - public Map mapInputMethodHighlight(InputMethodHighlight highlight) + public Map mapInputMethodHighlight(InputMethodHighlight highlight) throws HeadlessException { throw new HeadlessException(); } diff --git a/jdk/src/share/classes/sun/awt/PlatformFont.java b/jdk/src/share/classes/sun/awt/PlatformFont.java index f88b192715f..02596457d6f 100644 --- a/jdk/src/share/classes/sun/awt/PlatformFont.java +++ b/jdk/src/share/classes/sun/awt/PlatformFont.java @@ -143,7 +143,7 @@ public abstract class PlatformFont implements FontPeer { if (len < 1) { return new CharsetString[0]; } - Vector mcs = null; + Vector mcs = null; char[] tmpStr = new char[len]; char tmpChar = defaultChar; boolean encoded = false; @@ -198,7 +198,7 @@ public abstract class PlatformFont implements FontPeer { } if (currentFont != fd){ if (mcs == null) { - mcs = new Vector(3); + mcs = new Vector<>(3); } mcs.addElement(new CharsetString(tmpStr, lastIndex, i-lastIndex, currentFont)); @@ -209,16 +209,13 @@ public abstract class PlatformFont implements FontPeer { } CharsetString[] result; CharsetString cs = new CharsetString(tmpStr, lastIndex, - len-lastIndex, currentFont); + len-lastIndex, currentFont); if (mcs == null) { result = new CharsetString[1]; result[0] = cs; } else { mcs.addElement(cs); - result = new CharsetString[mcs.size()]; - for (int i = 0; i < mcs.size(); i++){ - result[i] = (CharsetString)mcs.elementAt(i); - } + result = mcs.toArray(new CharsetString[mcs.size()]); } return result; } diff --git a/jdk/src/share/classes/sun/awt/SunToolkit.java b/jdk/src/share/classes/sun/awt/SunToolkit.java index 1cb15b78a01..6739a603c5d 100644 --- a/jdk/src/share/classes/sun/awt/SunToolkit.java +++ b/jdk/src/share/classes/sun/awt/SunToolkit.java @@ -1915,6 +1915,7 @@ public abstract class SunToolkit extends Toolkit public synchronized void setWindowDeactivationTime(Window w, long time) { AppContext ctx = getAppContext(w); + @SuppressWarnings("unchecked") WeakHashMap map = (WeakHashMap)ctx.get(DEACTIVATION_TIMES_MAP_KEY); if (map == null) { map = new WeakHashMap(); @@ -1925,6 +1926,7 @@ public abstract class SunToolkit extends Toolkit public synchronized long getWindowDeactivationTime(Window w) { AppContext ctx = getAppContext(w); + @SuppressWarnings("unchecked") WeakHashMap map = (WeakHashMap)ctx.get(DEACTIVATION_TIMES_MAP_KEY); if (map == null) { return -1; diff --git a/jdk/src/share/classes/sun/awt/datatransfer/DataTransferer.java b/jdk/src/share/classes/sun/awt/datatransfer/DataTransferer.java index d9c8334df8a..367d90e0b90 100644 --- a/jdk/src/share/classes/sun/awt/datatransfer/DataTransferer.java +++ b/jdk/src/share/classes/sun/awt/datatransfer/DataTransferer.java @@ -324,7 +324,7 @@ public abstract class DataTransferer { return false; } - Class rep_class = flavor.getRepresentationClass(); + Class rep_class = flavor.getRepresentationClass(); if (flavor.isRepresentationClassReader() || String.class.equals(rep_class) || @@ -696,7 +696,7 @@ public abstract class DataTransferer { * DataFlavors and data formats * @throws NullPointerException if formats or map is null */ - public Set getFlavorsForFormatsAsSet(long[] formats, FlavorTable map) { + public Set getFlavorsForFormatsAsSet(long[] formats, FlavorTable map) { Set flavorSet = new HashSet<>(formats.length); for (long format : formats) { @@ -1085,7 +1085,7 @@ search: throw new IOException("data translation failed"); } - final List list = (List)obj; + final List list = (List)obj; final ProtectionDomain userProtectionDomain = getUserProtectionDomain(contents); @@ -1113,7 +1113,7 @@ search: if (targetCharset == null) { targetCharset = "UTF-8"; } - final List list = (List)obj; + final List list = (List)obj; final ProtectionDomain userProtectionDomain = getUserProtectionDomain(contents); final ArrayList fileList = castToFiles(list, userProtectionDomain); final ArrayList uriList = new ArrayList<>(fileList.size()); @@ -1258,7 +1258,7 @@ search: return true; } - private ArrayList castToFiles(final List files, + private ArrayList castToFiles(final List files, final ProtectionDomain userProtectionDomain) throws IOException { try { return AccessController.doPrivileged((PrivilegedExceptionAction>) () -> { @@ -1636,7 +1636,7 @@ search: * instance of the Class as its sole parameter. */ private Object constructFlavoredObject(Object arg, DataFlavor flavor, - Class clazz) + Class clazz) throws IOException { final Class dfrc = flavor.getRepresentationClass(); @@ -1644,19 +1644,19 @@ search: if (clazz.equals(dfrc)) { return arg; // simple case } else { - Constructor[] constructors; + Constructor[] constructors; try { constructors = AccessController.doPrivileged( - (PrivilegedAction) dfrc::getConstructors); + (PrivilegedAction[]>) dfrc::getConstructors); } catch (SecurityException se) { throw new IOException(se.getMessage()); } - Constructor constructor = Stream.of(constructors) + Constructor constructor = Stream.of(constructors) .filter(c -> Modifier.isPublic(c.getModifiers())) .filter(c -> { - Class[] ptypes = c.getParameterTypes(); + Class[] ptypes = c.getParameterTypes(); return ptypes != null && ptypes.length == 1 && clazz.equals(ptypes[0]); @@ -1865,7 +1865,8 @@ search: byte[] bytes, String mimeType) throws IOException { - Iterator readerIterator = ImageIO.getImageReadersByMIMEType(mimeType); + Iterator readerIterator = + ImageIO.getImageReadersByMIMEType(mimeType); if (!readerIterator.hasNext()) { throw new IOException("No registered service provider can decode " + @@ -1875,7 +1876,7 @@ search: IOException ioe = null; while (readerIterator.hasNext()) { - ImageReader imageReader = (ImageReader)readerIterator.next(); + ImageReader imageReader = readerIterator.next(); try (ByteArrayInputStream bais = new ByteArrayInputStream(bytes)) { try (ImageInputStream imageInputStream = ImageIO.createImageInputStream(bais)) { ImageReadParam param = imageReader.getDefaultReadParam(); @@ -1918,7 +1919,8 @@ search: throws IOException { IOException originalIOE = null; - Iterator writerIterator = ImageIO.getImageWritersByMIMEType(mimeType); + Iterator writerIterator = + ImageIO.getImageWritersByMIMEType(mimeType); if (!writerIterator.hasNext()) { throw new IOException("No registered service provider can encode " + @@ -1977,7 +1979,8 @@ search: String mimeType) throws IOException { - Iterator writerIterator = ImageIO.getImageWritersByMIMEType(mimeType); + Iterator writerIterator = + ImageIO.getImageWritersByMIMEType(mimeType); ImageTypeSpecifier typeSpecifier = new ImageTypeSpecifier(renderedImage); @@ -1986,7 +1989,7 @@ search: IOException ioe = null; while (writerIterator.hasNext()) { - ImageWriter imageWriter = (ImageWriter)writerIterator.next(); + ImageWriter imageWriter = writerIterator.next(); ImageWriterSpi writerSpi = imageWriter.getOriginatingProvider(); if (!writerSpi.canEncodeImage(typeSpecifier)) { @@ -2070,7 +2073,7 @@ search: public byte[] convertData(final Object source, final Transferable contents, final long format, - final Map formatMap, + final Map formatMap, final boolean isToolkitThread) throws IOException { @@ -2093,7 +2096,7 @@ search: } byte[] data = null; try { - DataFlavor flavor = (DataFlavor)formatMap.get(format); + DataFlavor flavor = formatMap.get(format); if (flavor != null) { data = translateTransferable(contents, flavor, format); } @@ -2134,7 +2137,7 @@ search: } finally { getToolkitThreadBlockedHandler().unlock(); } else { - DataFlavor flavor = (DataFlavor)formatMap.get(format); + DataFlavor flavor = formatMap.get(format); if (flavor != null) { ret = translateTransferable(contents, flavor, format); } @@ -2183,7 +2186,7 @@ search: * Helper function to convert a Set of DataFlavors to a sorted array. * The array will be sorted according to DataFlavorComparator. */ - public static DataFlavor[] setToSortedDataFlavorArray(Set flavorsSet) { + public static DataFlavor[] setToSortedDataFlavorArray(Set flavorsSet) { DataFlavor[] flavors = new DataFlavor[flavorsSet.size()]; flavorsSet.toArray(flavors); final Comparator comparator = @@ -2544,12 +2547,12 @@ search: String primaryType1 = flavor1.getPrimaryType(); String subType1 = flavor1.getSubType(); String mimeType1 = primaryType1 + "/" + subType1; - Class class1 = flavor1.getRepresentationClass(); + Class class1 = flavor1.getRepresentationClass(); String primaryType2 = flavor2.getPrimaryType(); String subType2 = flavor2.getSubType(); String mimeType2 = primaryType2 + "/" + subType2; - Class class2 = flavor2.getRepresentationClass(); + Class class2 = flavor2.getRepresentationClass(); if (flavor1.isFlavorTextType() && flavor2.isFlavorTextType()) { // First, compare MIME types diff --git a/jdk/src/share/classes/sun/awt/datatransfer/SunClipboard.java b/jdk/src/share/classes/sun/awt/datatransfer/SunClipboard.java index 77162cbadd3..258a298adbe 100644 --- a/jdk/src/share/classes/sun/awt/datatransfer/SunClipboard.java +++ b/jdk/src/share/classes/sun/awt/datatransfer/SunClipboard.java @@ -78,7 +78,7 @@ public abstract class SunClipboard extends Clipboard * this clipboard. It is used for tracking changes * of DataFlavors available on this clipboard. */ - private volatile Set currentDataFlavors; + private volatile Set currentDataFlavors; public SunClipboard(String name) { @@ -338,7 +338,7 @@ public abstract class SunClipboard extends Clipboard protected abstract byte[] getClipboardData(long format) throws IOException; - private static Set formatArrayAsDataFlavorSet(long[] formats) { + private static Set formatArrayAsDataFlavorSet(long[] formats) { return (formats == null) ? null : DataTransferer.getInstance(). getFlavorsForFormatsAsSet(formats, getDefaultFlavorTable()); @@ -417,7 +417,7 @@ public abstract class SunClipboard extends Clipboard * this clipboard */ public void checkChange(long[] formats) { - Set prevDataFlavors = currentDataFlavors; + Set prevDataFlavors = currentDataFlavors; currentDataFlavors = formatArrayAsDataFlavorSet(formats); if (Objects.equals(prevDataFlavors, currentDataFlavors)) { diff --git a/jdk/src/share/classes/sun/awt/datatransfer/TransferableProxy.java b/jdk/src/share/classes/sun/awt/datatransfer/TransferableProxy.java index ac79ecf7127..39ba273ec54 100644 --- a/jdk/src/share/classes/sun/awt/datatransfer/TransferableProxy.java +++ b/jdk/src/share/classes/sun/awt/datatransfer/TransferableProxy.java @@ -111,9 +111,9 @@ final class ClassLoaderObjectOutputStream extends ObjectOutputStream { } protected void annotateClass(final Class cl) throws IOException { - ClassLoader classLoader = - (ClassLoader)AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { + ClassLoader classLoader = AccessController.doPrivileged( + new PrivilegedAction() { + public ClassLoader run() { return cl.getClassLoader(); } }); @@ -124,14 +124,14 @@ final class ClassLoaderObjectOutputStream extends ObjectOutputStream { map.put(s, classLoader); } protected void annotateProxyClass(final Class cl) throws IOException { - ClassLoader classLoader = - (ClassLoader)AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { + ClassLoader classLoader = AccessController.doPrivileged( + new PrivilegedAction() { + public ClassLoader run() { return cl.getClassLoader(); } }); - Class[] interfaces = cl.getInterfaces(); + Class[] interfaces = cl.getInterfaces(); Set s = new HashSet(interfaces.length); for (int i = 0; i < interfaces.length; i++) { s.add(interfaces[i].getName()); @@ -141,7 +141,7 @@ final class ClassLoaderObjectOutputStream extends ObjectOutputStream { } Map, ClassLoader> getClassLoaderMap() { - return new HashMap(map); + return new HashMap<>(map); } } @@ -191,9 +191,9 @@ final class ClassLoaderObjectInputStream extends ObjectInputStream { boolean hasNonPublicInterface = false; // define proxy in class loader of non-public interface(s), if any - Class[] classObjs = new Class[interfaces.length]; + Class[] classObjs = new Class[interfaces.length]; for (int i = 0; i < interfaces.length; i++) { - Class cl = Class.forName(interfaces[i], false, classLoader); + Class cl = Class.forName(interfaces[i], false, classLoader); if ((cl.getModifiers() & Modifier.PUBLIC) == 0) { if (hasNonPublicInterface) { if (nonPublicLoader != cl.getClassLoader()) { diff --git a/jdk/src/share/classes/sun/awt/dnd/SunDragSourceContextPeer.java b/jdk/src/share/classes/sun/awt/dnd/SunDragSourceContextPeer.java index ae0a642dcb2..8baa689296f 100644 --- a/jdk/src/share/classes/sun/awt/dnd/SunDragSourceContextPeer.java +++ b/jdk/src/share/classes/sun/awt/dnd/SunDragSourceContextPeer.java @@ -146,7 +146,7 @@ public abstract class SunDragSourceContextPeer implements DragSourceContextPeer } protected abstract void startDrag(Transferable trans, - long[] formats, Map formatMap); + long[] formats, Map formatMap); /** * set cursor diff --git a/jdk/src/share/classes/sun/awt/dnd/SunDropTargetContextPeer.java b/jdk/src/share/classes/sun/awt/dnd/SunDropTargetContextPeer.java index 842b387f6f4..a880f1235f6 100644 --- a/jdk/src/share/classes/sun/awt/dnd/SunDropTargetContextPeer.java +++ b/jdk/src/share/classes/sun/awt/dnd/SunDropTargetContextPeer.java @@ -252,11 +252,11 @@ public abstract class SunDropTargetContextPeer implements DropTargetContextPeer, throw new InvalidDnDOperationException("No drop current"); } - Map flavorMap = DataTransferer.getInstance().getFlavorsForFormats - (currentT, DataTransferer.adaptFlavorMap + Map flavorMap = DataTransferer.getInstance() + .getFlavorsForFormats(currentT, DataTransferer.adaptFlavorMap (currentDT.getFlavorMap())); - lFormat = (Long)flavorMap.get(df); + lFormat = flavorMap.get(df); if (lFormat == null) { throw new UnsupportedFlavorException(df); } @@ -745,7 +745,7 @@ public abstract class SunDropTargetContextPeer implements DropTargetContextPeer, // dispatcher state fields private int returnValue = 0; // set of events to be dispatched by this dispatcher - private final HashSet eventSet = new HashSet(3); + private final HashSet eventSet = new HashSet<>(3); static final ToolkitThreadBlockedHandler handler = DataTransferer.getInstance().getToolkitThreadBlockedHandler(); diff --git a/jdk/src/share/classes/sun/awt/geom/AreaOp.java b/jdk/src/share/classes/sun/awt/geom/AreaOp.java index dd9e957cc28..bdbf2cb2b7e 100644 --- a/jdk/src/share/classes/sun/awt/geom/AreaOp.java +++ b/jdk/src/share/classes/sun/awt/geom/AreaOp.java @@ -152,36 +152,36 @@ public abstract class AreaOp { public abstract int getState(); - public Vector calculate(Vector left, Vector right) { - Vector edges = new Vector(); + public Vector calculate(Vector left, Vector right) { + Vector edges = new Vector<>(); addEdges(edges, left, AreaOp.CTAG_LEFT); addEdges(edges, right, AreaOp.CTAG_RIGHT); - edges = pruneEdges(edges); + Vector curves = pruneEdges(edges); if (false) { System.out.println("result: "); - int numcurves = edges.size(); - Curve[] curvelist = (Curve[]) edges.toArray(new Curve[numcurves]); + int numcurves = curves.size(); + Curve[] curvelist = curves.toArray(new Curve[numcurves]); for (int i = 0; i < numcurves; i++) { System.out.println("curvelist["+i+"] = "+curvelist[i]); } } - return edges; + return curves; } - private static void addEdges(Vector edges, Vector curves, int curvetag) { - Enumeration enum_ = curves.elements(); + private static void addEdges(Vector edges, Vector curves, int curvetag) { + Enumeration enum_ = curves.elements(); while (enum_.hasMoreElements()) { - Curve c = (Curve) enum_.nextElement(); + Curve c = enum_.nextElement(); if (c.getOrder() > 0) { edges.add(new Edge(c, curvetag)); } } } - private static Comparator YXTopComparator = new Comparator() { - public int compare(Object o1, Object o2) { - Curve c1 = ((Edge) o1).getCurve(); - Curve c2 = ((Edge) o2).getCurve(); + private static Comparator YXTopComparator = new Comparator() { + public int compare(Edge o1, Edge o2) { + Curve c1 = o1.getCurve(); + Curve c2 = o2.getCurve(); double v1, v2; if ((v1 = c1.getYTop()) == (v2 = c2.getYTop())) { if ((v1 = c1.getXTop()) == (v2 = c2.getXTop())) { @@ -195,12 +195,13 @@ public abstract class AreaOp { } }; - private Vector pruneEdges(Vector edges) { + private Vector pruneEdges(Vector edges) { int numedges = edges.size(); if (numedges < 2) { - return edges; + // empty vector is expected with less than 2 edges + return new Vector<>(); } - Edge[] edgelist = (Edge[]) edges.toArray(new Edge[numedges]); + Edge[] edgelist = edges.toArray(new Edge[numedges]); Arrays.sort(edgelist, YXTopComparator); if (false) { System.out.println("pruning: "); @@ -214,9 +215,9 @@ public abstract class AreaOp { int cur = 0; int next = 0; double yrange[] = new double[2]; - Vector subcurves = new Vector(); - Vector chains = new Vector(); - Vector links = new Vector(); + Vector subcurves = new Vector<>(); + Vector chains = new Vector<>(); + Vector links = new Vector<>(); // Active edges are between left (inclusive) and right (exclusive) while (left < numedges) { double y = yrange[0]; @@ -385,7 +386,7 @@ public abstract class AreaOp { if (false) { System.out.println("new links:"); for (int i = 0; i < links.size(); i++) { - CurveLink link = (CurveLink) links.elementAt(i); + CurveLink link = links.elementAt(i); System.out.println(" "+link.getSubCurve()); } } @@ -396,10 +397,10 @@ public abstract class AreaOp { yrange[0] = yend; } finalizeSubCurves(subcurves, chains); - Vector ret = new Vector(); - Enumeration enum_ = subcurves.elements(); + Vector ret = new Vector<>(); + Enumeration enum_ = subcurves.elements(); while (enum_.hasMoreElements()) { - CurveLink link = (CurveLink) enum_.nextElement(); + CurveLink link = enum_.nextElement(); ret.add(link.getMoveto()); CurveLink nextlink = link; while ((nextlink = nextlink.getNext()) != null) { @@ -413,7 +414,8 @@ public abstract class AreaOp { return ret; } - public static void finalizeSubCurves(Vector subcurves, Vector chains) { + public static void finalizeSubCurves(Vector subcurves, + Vector chains) { int numchains = chains.size(); if (numchains == 0) { return; @@ -437,9 +439,9 @@ public abstract class AreaOp { private static CurveLink[] EmptyLinkList = new CurveLink[2]; private static ChainEnd[] EmptyChainList = new ChainEnd[2]; - public static void resolveLinks(Vector subcurves, - Vector chains, - Vector links) + public static void resolveLinks(Vector subcurves, + Vector chains, + Vector links) { int numlinks = links.size(); CurveLink[] linklist; diff --git a/jdk/src/share/classes/sun/awt/geom/Crossings.java b/jdk/src/share/classes/sun/awt/geom/Crossings.java index 7ab97bce80c..76a29a15d45 100644 --- a/jdk/src/share/classes/sun/awt/geom/Crossings.java +++ b/jdk/src/share/classes/sun/awt/geom/Crossings.java @@ -77,14 +77,14 @@ public abstract class Crossings { public abstract boolean covers(double ystart, double yend); - public static Crossings findCrossings(Vector curves, + public static Crossings findCrossings(Vector curves, double xlo, double ylo, double xhi, double yhi) { Crossings cross = new EvenOdd(xlo, ylo, xhi, yhi); - Enumeration enum_ = curves.elements(); + Enumeration enum_ = curves.elements(); while (enum_.hasMoreElements()) { - Curve c = (Curve) enum_.nextElement(); + Curve c = enum_.nextElement(); if (c.accumulateCrossings(cross)) { return null; } @@ -237,7 +237,7 @@ public abstract class Crossings { return false; } - private Vector tmp = new Vector(); + private Vector tmp = new Vector<>(); public boolean accumulateQuad(double x0, double y0, double coords[]) { if (y0 < ylo && coords[1] < ylo && coords[3] < ylo) { @@ -258,9 +258,9 @@ public abstract class Crossings { return false; } Curve.insertQuad(tmp, x0, y0, coords); - Enumeration enum_ = tmp.elements(); + Enumeration enum_ = tmp.elements(); while (enum_.hasMoreElements()) { - Curve c = (Curve) enum_.nextElement(); + Curve c = enum_.nextElement(); if (c.accumulateCrossings(this)) { return true; } @@ -296,9 +296,9 @@ public abstract class Crossings { return false; } Curve.insertCubic(tmp, x0, y0, coords); - Enumeration enum_ = tmp.elements(); + Enumeration enum_ = tmp.elements(); while (enum_.hasMoreElements()) { - Curve c = (Curve) enum_.nextElement(); + Curve c = enum_.nextElement(); if (c.accumulateCrossings(this)) { return true; } diff --git a/jdk/src/share/classes/sun/awt/geom/Curve.java b/jdk/src/share/classes/sun/awt/geom/Curve.java index 871be17f4c8..bc478da02b3 100644 --- a/jdk/src/share/classes/sun/awt/geom/Curve.java +++ b/jdk/src/share/classes/sun/awt/geom/Curve.java @@ -38,11 +38,11 @@ public abstract class Curve { protected int direction; - public static void insertMove(Vector curves, double x, double y) { + public static void insertMove(Vector curves, double x, double y) { curves.add(new Order0(x, y)); } - public static void insertLine(Vector curves, + public static void insertLine(Vector curves, double x0, double y0, double x1, double y1) { @@ -59,7 +59,7 @@ public abstract class Curve { } } - public static void insertQuad(Vector curves, + public static void insertQuad(Vector curves, double x0, double y0, double coords[]) { @@ -82,7 +82,7 @@ public abstract class Curve { } } - public static void insertCubic(Vector curves, + public static void insertCubic(Vector curves, double x0, double y0, double coords[]) { diff --git a/jdk/src/share/classes/sun/awt/geom/Order2.java b/jdk/src/share/classes/sun/awt/geom/Order2.java index 69218f5a95e..64d37c88e27 100644 --- a/jdk/src/share/classes/sun/awt/geom/Order2.java +++ b/jdk/src/share/classes/sun/awt/geom/Order2.java @@ -47,7 +47,7 @@ final class Order2 extends Curve { private double ycoeff1; private double ycoeff2; - public static void insert(Vector curves, double tmp[], + public static void insert(Vector curves, double tmp[], double x0, double y0, double cx0, double cy0, double x1, double y1, @@ -74,7 +74,7 @@ final class Order2 extends Curve { tmp[i1 + 4], tmp[i1 + 5], direction); } - public static void addInstance(Vector curves, + public static void addInstance(Vector curves, double x0, double y0, double cx0, double cy0, double x1, double y1, diff --git a/jdk/src/share/classes/sun/awt/geom/Order3.java b/jdk/src/share/classes/sun/awt/geom/Order3.java index ad49c676db3..9c9e5962aea 100644 --- a/jdk/src/share/classes/sun/awt/geom/Order3.java +++ b/jdk/src/share/classes/sun/awt/geom/Order3.java @@ -53,7 +53,7 @@ final class Order3 extends Curve { private double ycoeff2; private double ycoeff3; - public static void insert(Vector curves, double tmp[], + public static void insert(Vector curves, double tmp[], double x0, double y0, double cx0, double cy0, double cx1, double cy1, @@ -105,7 +105,7 @@ final class Order3 extends Curve { } } - public static void addInstance(Vector curves, + public static void addInstance(Vector curves, double x0, double y0, double cx0, double cy0, double cx1, double cy1, diff --git a/jdk/src/share/classes/sun/awt/image/BufImgSurfaceData.java b/jdk/src/share/classes/sun/awt/image/BufImgSurfaceData.java index efc4bc97ec4..ac26802b027 100644 --- a/jdk/src/share/classes/sun/awt/image/BufImgSurfaceData.java +++ b/jdk/src/share/classes/sun/awt/image/BufImgSurfaceData.java @@ -51,7 +51,7 @@ public class BufImgSurfaceData extends SurfaceData { private BufferedImageGraphicsConfig graphicsConfig; RenderLoops solidloops; - private static native void initIDs(Class ICM, Class ICMColorData); + private static native void initIDs(Class ICM, Class ICMColorData); private static final int DCM_RGBX_RED_MASK = 0xff000000; private static final int DCM_RGBX_GREEN_MASK = 0x00ff0000; diff --git a/jdk/src/share/classes/sun/awt/image/GifImageDecoder.java b/jdk/src/share/classes/sun/awt/image/GifImageDecoder.java index bd8efa8d1a3..33640165fb2 100644 --- a/jdk/src/share/classes/sun/awt/image/GifImageDecoder.java +++ b/jdk/src/share/classes/sun/awt/image/GifImageDecoder.java @@ -61,7 +61,7 @@ public class GifImageDecoder extends ImageDecoder { int trans_pixel = -1; IndexColorModel global_model; - Hashtable props = new Hashtable(); + Hashtable props = new Hashtable<>(); byte[] saved_image; IndexColorModel saved_model; diff --git a/jdk/src/share/classes/sun/awt/image/ImageDecoder.java b/jdk/src/share/classes/sun/awt/image/ImageDecoder.java index 643ec638f11..7f4bbd85efa 100644 --- a/jdk/src/share/classes/sun/awt/image/ImageDecoder.java +++ b/jdk/src/share/classes/sun/awt/image/ImageDecoder.java @@ -83,7 +83,7 @@ public abstract class ImageDecoder { return count; } - protected int setProperties(Hashtable props) { + protected int setProperties(Hashtable props) { ImageConsumerQueue cq = null; int count = 0; while ((cq = nextConsumer(cq)) != null) { @@ -164,7 +164,7 @@ public abstract class ImageDecoder { source.doneDecoding(this); close(); java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction() { + new java.security.PrivilegedAction() { public Object run() { feeder.interrupt(); return null; diff --git a/jdk/src/share/classes/sun/awt/image/ImageFetcher.java b/jdk/src/share/classes/sun/awt/image/ImageFetcher.java index a5af63512c7..eaccf335db0 100644 --- a/jdk/src/share/classes/sun/awt/image/ImageFetcher.java +++ b/jdk/src/share/classes/sun/awt/image/ImageFetcher.java @@ -152,7 +152,7 @@ class ImageFetcher extends Thread { info.numWaiting--; } } - src = (ImageFetchable) info.waitList.elementAt(0); + src = info.waitList.elementAt(0); info.waitList.removeElement(src); } return src; @@ -303,26 +303,25 @@ class ImageFetcher extends Thread { final ThreadGroup fetcherGroup = fetcherThreadGroup; java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction() { - public Object run() { - for (int i = 0; i < info.fetchers.length; i++) { - if (info.fetchers[i] == null) { - ImageFetcher f = new ImageFetcher( - fetcherGroup, i); - try { - f.start(); - info.fetchers[i] = f; - info.numFetchers++; - break; - } catch (Error e) { + new java.security.PrivilegedAction() { + public Object run() { + for (int i = 0; i < info.fetchers.length; i++) { + if (info.fetchers[i] == null) { + ImageFetcher f = new ImageFetcher(fetcherGroup, i); + try { + f.start(); + info.fetchers[i] = f; + info.numFetchers++; + break; + } catch (Error e) { + } } + } + return null; } - } - return null; - } - }); - return; - } + }); + return; + } } @@ -337,13 +336,13 @@ class FetcherInfo { Thread[] fetchers; int numFetchers; int numWaiting; - Vector waitList; + Vector waitList; private FetcherInfo() { fetchers = new Thread[MAX_NUM_FETCHERS_PER_APPCONTEXT]; numFetchers = 0; numWaiting = 0; - waitList = new Vector(); + waitList = new Vector<>(); } /* The key to put()/get() the FetcherInfo into/from the AppContext. */ diff --git a/jdk/src/share/classes/sun/awt/image/ImageRepresentation.java b/jdk/src/share/classes/sun/awt/image/ImageRepresentation.java index 77ee7339a59..90bb2ac6388 100644 --- a/jdk/src/share/classes/sun/awt/image/ImageRepresentation.java +++ b/jdk/src/share/classes/sun/awt/image/ImageRepresentation.java @@ -185,7 +185,7 @@ public class ImageRepresentation extends ImageWatched implements ImageConsumer protected BufferedImage createImage(ColorModel cm, WritableRaster raster, boolean isRasterPremultiplied, - Hashtable properties) + Hashtable properties) { BufferedImage bi = new BufferedImage(cm, raster, isRasterPremultiplied, null); diff --git a/jdk/src/share/classes/sun/awt/image/ImagingLib.java b/jdk/src/share/classes/sun/awt/image/ImagingLib.java index 90ad81836c8..683b8fe7e75 100644 --- a/jdk/src/share/classes/sun/awt/image/ImagingLib.java +++ b/jdk/src/share/classes/sun/awt/image/ImagingLib.java @@ -61,7 +61,7 @@ public class ImagingLib { private static final int AFFINE_OP = 1; private static final int CONVOLVE_OP = 2; - private static Class[] nativeOpClass = new Class[NUM_NATIVE_OPS]; + private static Class[] nativeOpClass = new Class[NUM_NATIVE_OPS]; /** * Returned value indicates whether the library initailization was @@ -134,7 +134,7 @@ public class ImagingLib { } - private static int getNativeOpIndex(Class opClass) { + private static int getNativeOpIndex(Class opClass) { // // Search for this class in cached list of // classes supplying native acceleration diff --git a/jdk/src/share/classes/sun/awt/image/JPEGImageDecoder.java b/jdk/src/share/classes/sun/awt/image/JPEGImageDecoder.java index 872ffc01974..70dacb195c3 100644 --- a/jdk/src/share/classes/sun/awt/image/JPEGImageDecoder.java +++ b/jdk/src/share/classes/sun/awt/image/JPEGImageDecoder.java @@ -47,8 +47,8 @@ public class JPEGImageDecoder extends ImageDecoder { private static ColorModel ARGBcolormodel; private static ColorModel Graycolormodel; - private static final Class InputStreamClass = InputStream.class; - private static native void initIDs(Class InputStreamClass); + private static final Class InputStreamClass = InputStream.class; + private static native void initIDs(Class InputStreamClass); private ColorModel colormodel; @@ -73,7 +73,7 @@ public class JPEGImageDecoder extends ImageDecoder { private native void readImage(InputStream is, byte buf[]) throws ImageFormatException, IOException; - Hashtable props = new Hashtable(); + Hashtable props = new Hashtable<>(); public JPEGImageDecoder(InputStreamImageSource src, InputStream is) { super(src, is); diff --git a/jdk/src/share/classes/sun/awt/image/OffScreenImageSource.java b/jdk/src/share/classes/sun/awt/image/OffScreenImageSource.java index c1b0453a65b..3dcdde01574 100644 --- a/jdk/src/share/classes/sun/awt/image/OffScreenImageSource.java +++ b/jdk/src/share/classes/sun/awt/image/OffScreenImageSource.java @@ -40,15 +40,15 @@ public class OffScreenImageSource implements ImageProducer { BufferedImage image; int width; int height; - Hashtable properties; + Hashtable properties; public OffScreenImageSource(BufferedImage image, - Hashtable properties) { + Hashtable properties) { this.image = image; if (properties != null) { this.properties = properties; } else { - this.properties = new Hashtable(); + this.properties = new Hashtable(); } width = image.getWidth(); height = image.getHeight(); diff --git a/jdk/src/share/classes/sun/awt/image/PNGImageDecoder.java b/jdk/src/share/classes/sun/awt/image/PNGImageDecoder.java index adbdb766da1..7f78de6e982 100644 --- a/jdk/src/share/classes/sun/awt/image/PNGImageDecoder.java +++ b/jdk/src/share/classes/sun/awt/image/PNGImageDecoder.java @@ -68,7 +68,7 @@ public class PNGImageDecoder extends ImageDecoder private int filterMethod; private int interlaceMethod; private int gamma = 100000; - private java.util.Hashtable properties; + private java.util.Hashtable properties; /* this is not needed ImageConsumer target; */ @@ -83,7 +83,7 @@ public class PNGImageDecoder extends ImageDecoder private void property(String key,Object value) { if(value==null) return; - if(properties==null) properties=new java.util.Hashtable(); + if(properties==null) properties=new java.util.Hashtable<>(); properties.put(key,value); } private void property(String key,float value) { diff --git a/jdk/src/share/classes/sun/awt/image/ToolkitImage.java b/jdk/src/share/classes/sun/awt/image/ToolkitImage.java index 885648d2265..b1f5873f106 100644 --- a/jdk/src/share/classes/sun/awt/image/ToolkitImage.java +++ b/jdk/src/share/classes/sun/awt/image/ToolkitImage.java @@ -79,7 +79,7 @@ public class ToolkitImage extends Image { private int width = -1; private int height = -1; - private Hashtable properties; + private Hashtable properties; private int availinfo; @@ -254,9 +254,9 @@ public class ToolkitImage extends Image { addInfo(ImageObserver.WIDTH | ImageObserver.HEIGHT); } - void setProperties(Hashtable props) { + void setProperties(Hashtable props) { if (props == null) { - props = new Hashtable(); + props = new Hashtable(); } properties = props; addInfo(ImageObserver.PROPERTIES); diff --git a/jdk/src/share/classes/sun/awt/shell/ShellFolder.java b/jdk/src/share/classes/sun/awt/shell/ShellFolder.java index e8a9407276d..3795e146f2a 100644 --- a/jdk/src/share/classes/sun/awt/shell/ShellFolder.java +++ b/jdk/src/share/classes/sun/awt/shell/ShellFolder.java @@ -127,14 +127,14 @@ public abstract class ShellFolder extends File { File[] files = super.listFiles(); if (!includeHiddenFiles) { - Vector v = new Vector(); + Vector v = new Vector<>(); int nameCount = (files == null) ? 0 : files.length; for (int i = 0; i < nameCount; i++) { if (!files[i].isHidden()) { v.addElement(files[i]); } } - files = (File[])v.toArray(new File[v.size()]); + files = v.toArray(new File[v.size()]); } return files; @@ -208,7 +208,7 @@ public abstract class ShellFolder extends File { static { String managerClassName = (String)Toolkit.getDefaultToolkit(). getDesktopProperty("Shell.shellFolderManager"); - Class managerClass = null; + Class managerClass = null; try { managerClass = ReflectUtil.forName(managerClassName); // swallow the exceptions below and use default shell folder @@ -554,7 +554,7 @@ public abstract class ShellFolder extends File { /** * Provides a default comparator for the default column set */ - private static final Comparator DEFAULT_COMPARATOR = new Comparator() { + private static final Comparator DEFAULT_COMPARATOR = new Comparator() { public int compare(Object o1, Object o2) { int gt; @@ -565,7 +565,9 @@ public abstract class ShellFolder extends File { } else if (o1 == null && o2 != null) { gt = -1; } else if (o1 instanceof Comparable) { - gt = ((Comparable) o1).compareTo(o2); + @SuppressWarnings("unchecked") + Comparable o = (Comparable) o1; + gt = o.compareTo(o2); } else { gt = 0; } diff --git a/jdk/src/share/classes/sun/awt/shell/ShellFolderColumnInfo.java b/jdk/src/share/classes/sun/awt/shell/ShellFolderColumnInfo.java index 3836b04eb32..88dffacec2b 100644 --- a/jdk/src/share/classes/sun/awt/shell/ShellFolderColumnInfo.java +++ b/jdk/src/share/classes/sun/awt/shell/ShellFolderColumnInfo.java @@ -38,7 +38,7 @@ public class ShellFolderColumnInfo { */ private Integer alignment; private SortOrder sortOrder; - private Comparator comparator; + private Comparator comparator; /** * false (default) if the {@link comparator} expects folders as arguments, * and true if folder's column values. The first option is used default for comparison @@ -49,7 +49,7 @@ public class ShellFolderColumnInfo { public ShellFolderColumnInfo(String title, Integer width, Integer alignment, boolean visible, - SortOrder sortOrder, Comparator comparator, + SortOrder sortOrder, Comparator comparator, boolean compareByColumn) { this.title = title; this.width = width; @@ -62,7 +62,7 @@ public class ShellFolderColumnInfo { public ShellFolderColumnInfo(String title, Integer width, Integer alignment, boolean visible, - SortOrder sortOrder, Comparator comparator) { + SortOrder sortOrder, Comparator comparator) { this(title, width, alignment, visible, sortOrder, comparator, false); } @@ -115,11 +115,11 @@ public class ShellFolderColumnInfo { this.sortOrder = sortOrder; } - public Comparator getComparator() { + public Comparator getComparator() { return comparator; } - public void setComparator(Comparator comparator) { + public void setComparator(Comparator comparator) { this.comparator = comparator; } diff --git a/jdk/src/share/classes/sun/awt/util/IdentityArrayList.java b/jdk/src/share/classes/sun/awt/util/IdentityArrayList.java index bf66f427d72..c88452289cb 100644 --- a/jdk/src/share/classes/sun/awt/util/IdentityArrayList.java +++ b/jdk/src/share/classes/sun/awt/util/IdentityArrayList.java @@ -285,6 +285,7 @@ public class IdentityArrayList extends AbstractList * this list * @throws NullPointerException if the specified array is null */ + @SuppressWarnings("unchecked") public T[] toArray(T[] a) { if (a.length < size) // Make a new array of a's runtime type, but my contents: @@ -307,7 +308,9 @@ public class IdentityArrayList extends AbstractList public E get(int index) { rangeCheck(index); - return (E) elementData[index]; + @SuppressWarnings("unchecked") + E rv = (E) elementData[index]; + return rv; } /** @@ -322,6 +325,7 @@ public class IdentityArrayList extends AbstractList public E set(int index, E element) { rangeCheck(index); + @SuppressWarnings("unchecked") E oldValue = (E) elementData[index]; elementData[index] = element; return oldValue; @@ -371,6 +375,7 @@ public class IdentityArrayList extends AbstractList rangeCheck(index); modCount++; + @SuppressWarnings("unchecked") E oldValue = (E) elementData[index]; int numMoved = size - index - 1; diff --git a/jdk/src/share/classes/sun/awt/util/IdentityLinkedList.java b/jdk/src/share/classes/sun/awt/util/IdentityLinkedList.java index 77e0f0062aa..690264ab4d9 100644 --- a/jdk/src/share/classes/sun/awt/util/IdentityLinkedList.java +++ b/jdk/src/share/classes/sun/awt/util/IdentityLinkedList.java @@ -280,7 +280,9 @@ public class IdentityLinkedList Entry successor = (index==size ? header : entry(index)); Entry predecessor = successor.previous; for (int i=0; i e = new Entry((E)a[i], successor, predecessor); + @SuppressWarnings("unchecked") + E tmp = (E) a[i]; + Entry e = new Entry(tmp, successor, predecessor); predecessor.next = e; predecessor = e; } @@ -396,7 +398,7 @@ public class IdentityLinkedList */ public int indexOf(Object o) { int index = 0; - for (Entry e = header.next; e != header; e = e.next) { + for (Entry e = header.next; e != header; e = e.next) { if (o == e.element) { return index; } @@ -418,7 +420,7 @@ public class IdentityLinkedList */ public int lastIndexOf(Object o) { int index = size; - for (Entry e = header.previous; e != header; e = e.previous) { + for (Entry e = header.previous; e != header; e = e.previous) { index--; if (o == e.element) { return index; @@ -787,7 +789,7 @@ public class IdentityLinkedList } /** Adapter to provide descending iterators via ListItr.previous */ - private class DescendingIterator implements Iterator { + private class DescendingIterator implements Iterator { final ListItr itr = new ListItr(size()); public boolean hasNext() { return itr.hasPrevious(); @@ -860,6 +862,7 @@ public class IdentityLinkedList * this list * @throws NullPointerException if the specified array is null */ + @SuppressWarnings("unchecked") public T[] toArray(T[] a) { if (a.length < size) a = (T[])java.lang.reflect.Array.newInstance( diff --git a/jdk/src/solaris/classes/sun/awt/X11/InfoWindow.java b/jdk/src/solaris/classes/sun/awt/X11/InfoWindow.java index 334d1d1c036..fb8b050a7e8 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/InfoWindow.java +++ b/jdk/src/solaris/classes/sun/awt/X11/InfoWindow.java @@ -207,8 +207,9 @@ public abstract class InfoWindow extends Window { textLabel.setText(tooltipString); } - Point pointer = (Point)AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { + Point pointer = AccessController.doPrivileged( + new PrivilegedAction() { + public Point run() { if (!isPointerOverTrayIcon(liveArguments.getBounds())) { return null; } diff --git a/jdk/src/solaris/classes/sun/awt/X11/ListHelper.java b/jdk/src/solaris/classes/sun/awt/X11/ListHelper.java index 0a83eaaf829..caf1c2df5ae 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/ListHelper.java +++ b/jdk/src/solaris/classes/sun/awt/X11/ListHelper.java @@ -55,10 +55,10 @@ public class ListHelper implements XScrollbarClient { private final int SCROLLBAR_WIDTH; // Width of a scrollbar - private java.util.List items; // List of items + private java.util.List items; // List of items // TODO: maybe this would be better as a simple int[] - private java.util.List selected; // List of selected items + private java.util.List selected; // List of selected items private boolean multiSelect; // Can multiple items be selected // at once? private int focusedIndex; @@ -100,8 +100,8 @@ public class ListHelper implements XScrollbarClient { this.peer = peer; this.colors = colors; this.multiSelect = multiSelect; - items = new ArrayList(initialSize); - selected = new ArrayList(1); + items = new ArrayList<>(initialSize); + selected = new ArrayList<>(1); selected.add(Integer.valueOf(-1)); this.maxVisItems = maxVisItems; @@ -190,7 +190,7 @@ public class ListHelper implements XScrollbarClient { /* if called for multiselect, return -1 */ public int getSelectedIndex() { if (!multiSelect) { - Integer val = (Integer)selected.get(0); + Integer val = selected.get(0); return val.intValue(); } return -1; @@ -217,7 +217,7 @@ public class ListHelper implements XScrollbarClient { } public String getItem(int index) { - return (String) items.get(index); + return items.get(index); } /**********************************************************************/ @@ -576,9 +576,9 @@ public class ListHelper implements XScrollbarClient { } boolean isItemSelected(int index) { - Iterator itr = selected.iterator(); + Iterator itr = selected.iterator(); while (itr.hasNext()) { - Integer val = (Integer)itr.next(); + Integer val = itr.next(); if (val.intValue() == index) { return true; } diff --git a/jdk/src/solaris/classes/sun/awt/X11/MotifDnDDragSourceProtocol.java b/jdk/src/solaris/classes/sun/awt/X11/MotifDnDDragSourceProtocol.java index 35109ebac70..6acc9d683ea 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/MotifDnDDragSourceProtocol.java +++ b/jdk/src/solaris/classes/sun/awt/X11/MotifDnDDragSourceProtocol.java @@ -26,6 +26,7 @@ package sun.awt.X11; import java.awt.datatransfer.Transferable; +import java.awt.datatransfer.DataFlavor; import java.awt.dnd.DnDConstants; import java.awt.dnd.InvalidDnDOperationException; @@ -65,7 +66,7 @@ class MotifDnDDragSourceProtocol extends XDragSourceProtocol } protected void initializeDragImpl(int actions, Transferable contents, - Map formatMap, long[] formats) + Map formatMap, long[] formats) throws InvalidDnDOperationException, IllegalArgumentException, XException { diff --git a/jdk/src/solaris/classes/sun/awt/X11/Native.java b/jdk/src/solaris/classes/sun/awt/X11/Native.java index 14628b833ec..f61654643f2 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/Native.java +++ b/jdk/src/solaris/classes/sun/awt/X11/Native.java @@ -43,13 +43,12 @@ class Native { static int dataModel; static { - String dataModelProp = (String)AccessController. - doPrivileged( - new PrivilegedAction() { - public Object run() { - return System.getProperty("sun.arch.data.model"); - } - }); + String dataModelProp = AccessController.doPrivileged( + new PrivilegedAction() { + public String run() { + return System.getProperty("sun.arch.data.model"); + } + }); try { dataModel = Integer.parseInt(dataModelProp); } catch (Exception e) { @@ -333,9 +332,9 @@ class Native { * Stores Java Vector of Longs into memory. Memory location is treated as array * of native longs */ - static void putLong(long ptr, Vector arr) { + static void putLong(long ptr, Vector arr) { for (int i = 0; i < arr.size(); i ++, ptr += getLongSize()) { - putLong(ptr, ((Long)arr.elementAt(i)).longValue()); + putLong(ptr, arr.elementAt(i).longValue()); } } @@ -343,9 +342,9 @@ class Native { * Stores Java Vector of Longs into memory. Memory location is treated as array * of native longs. Array is stored in reverse order */ - static void putLongReverse(long ptr, Vector arr) { + static void putLongReverse(long ptr, Vector arr) { for (int i = arr.size()-1; i >= 0; i--, ptr += getLongSize()) { - putLong(ptr, ((Long)arr.elementAt(i)).longValue()); + putLong(ptr, arr.elementAt(i).longValue()); } } /** diff --git a/jdk/src/solaris/classes/sun/awt/X11/XAWTXSettings.java b/jdk/src/solaris/classes/sun/awt/X11/XAWTXSettings.java index 48fcae52f0b..4c7b19c14cc 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XAWTXSettings.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XAWTXSettings.java @@ -98,7 +98,7 @@ class XAWTXSettings extends XSettings implements XMSelectionListener { * should be "good enough" for most cases. */ - Map updatedSettings = null; + Map updatedSettings = null; XToolkit.awtLock(); try { long display = XToolkit.getDisplay(); @@ -112,7 +112,7 @@ class XAWTXSettings extends XSettings implements XMSelectionListener { } private void updateXSettings(int screen, long owner) { - final Map updatedSettings = getUpdatedSettings(owner); + final Map updatedSettings = getUpdatedSettings(owner); // this method is called under awt lock and usually on toolkit thread // but parseXSettings() causes public code execution, so we need to transfer // this to EDT @@ -123,7 +123,7 @@ class XAWTXSettings extends XSettings implements XMSelectionListener { }); } - private Map getUpdatedSettings(final long owner) { + private Map getUpdatedSettings(final long owner) { if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("owner =" + owner); } @@ -131,7 +131,7 @@ class XAWTXSettings extends XSettings implements XMSelectionListener { return null; } - Map settings = null; + Map settings = null; try { WindowPropertyGetter getter = new WindowPropertyGetter(owner, xSettingsPropertyAtom, 0, MAX_LENGTH, diff --git a/jdk/src/solaris/classes/sun/awt/X11/XAtomList.java b/jdk/src/solaris/classes/sun/awt/X11/XAtomList.java index 7b53b6d2e95..a998850eb4c 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XAtomList.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XAtomList.java @@ -157,7 +157,7 @@ class XAtomList { public String toString() { StringBuffer buf = new StringBuffer(); buf.append("["); - Iterator iter = atoms.iterator(); + Iterator iter = atoms.iterator(); while (iter.hasNext()) { buf.append(iter.next().toString()); if (iter.hasNext()) { diff --git a/jdk/src/solaris/classes/sun/awt/X11/XAwtState.java b/jdk/src/solaris/classes/sun/awt/X11/XAwtState.java index 872f9ea851b..b0a8186c77a 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XAwtState.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XAwtState.java @@ -40,7 +40,7 @@ class XAwtState { * The mouse is over this component. * If the component is not disabled, it received MOUSE_ENTERED but no MOUSE_EXITED. */ - private static WeakReference componentMouseEnteredRef = null; + private static WeakReference componentMouseEnteredRef = null; static void setComponentMouseEntered(Component component) { XToolkit.awtLock(); @@ -50,7 +50,7 @@ class XAwtState { return; } if (component != getComponentMouseEntered()) { - componentMouseEnteredRef = new WeakReference(component); + componentMouseEnteredRef = new WeakReference<>(component); } } finally { XToolkit.awtUnlock(); @@ -63,7 +63,7 @@ class XAwtState { if (componentMouseEnteredRef == null) { return null; } - return (Component)componentMouseEnteredRef.get(); + return componentMouseEnteredRef.get(); } finally { XToolkit.awtUnlock(); } @@ -83,7 +83,7 @@ class XAwtState { return inManualGrab; } - private static WeakReference grabWindowRef = null; + private static WeakReference grabWindowRef = null; /** * The X Active Grab overrides any other active grab by the same @@ -112,7 +112,7 @@ class XAwtState { return; } if (grabWindow != getGrabWindow()) { - grabWindowRef = new WeakReference(grabWindow); + grabWindowRef = new WeakReference<>(grabWindow); } } finally { XToolkit.awtUnlock(); @@ -125,7 +125,7 @@ class XAwtState { if (grabWindowRef == null) { return null; } - XBaseWindow xbw = (XBaseWindow)grabWindowRef.get(); + XBaseWindow xbw = grabWindowRef.get(); if( xbw != null && xbw.isDisposed() ) { xbw = null; grabWindowRef = null; diff --git a/jdk/src/solaris/classes/sun/awt/X11/XBaseMenuWindow.java b/jdk/src/solaris/classes/sun/awt/X11/XBaseMenuWindow.java index 1d82f04a78c..53aae040883 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XBaseMenuWindow.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XBaseMenuWindow.java @@ -231,7 +231,7 @@ abstract public class XBaseMenuWindow extends XWindow { */ void instantPreInit(XCreateWindowParams params) { super.instantPreInit(params); - items = new ArrayList(); + items = new ArrayList<>(); } /************************************************ @@ -367,10 +367,10 @@ abstract public class XBaseMenuWindow extends XWindow { * Clears items vector and loads specified vector * @param items vector to be loaded */ - public void reloadItems(Vector items) { + public void reloadItems(Vector items) { synchronized(getMenuTreeLock()) { this.items.clear(); - MenuItem[] itemArray = (MenuItem[])items.toArray(new MenuItem[] {}); + MenuItem[] itemArray = items.toArray(new MenuItem[] {}); int itemCnt = itemArray.length; for(int i = 0; i < itemCnt; i++) { addItem(itemArray[i]); diff --git a/jdk/src/solaris/classes/sun/awt/X11/XComponentPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XComponentPeer.java index 6d3385cef46..6cc706278fc 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XComponentPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XComponentPeer.java @@ -236,8 +236,8 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget return false; } - private static Class seClass; - private static Constructor seCtor; + private static Class seClass; + private static Constructor seCtor; final static AWTEvent wrapInSequenced(AWTEvent event) { try { @@ -246,9 +246,11 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget } if (seCtor == null) { - seCtor = (Constructor) AccessController.doPrivileged(new PrivilegedExceptionAction() { - public Object run() throws Exception { - Constructor ctor = seClass.getConstructor(new Class[] { AWTEvent.class }); + seCtor = AccessController.doPrivileged(new + PrivilegedExceptionAction>() { + public Constructor run() throws Exception { + Constructor ctor = seClass.getConstructor( + new Class[] { AWTEvent.class }); ctor.setAccessible(true); return ctor; } @@ -1322,7 +1324,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget } } - private void addTree(Collection order, Set set, Container cont) { + private void addTree(Collection order, Set set, Container cont) { for (int i = 0; i < cont.getComponentCount(); i++) { Component comp = cont.getComponent(i); ComponentPeer peer = comp.getPeer(); diff --git a/jdk/src/solaris/classes/sun/awt/X11/XCreateWindowParams.java b/jdk/src/solaris/classes/sun/awt/X11/XCreateWindowParams.java index 32d83f193ce..da263eb4890 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XCreateWindowParams.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XCreateWindowParams.java @@ -30,7 +30,7 @@ import java.util.Iterator; import java.util.Map; @SuppressWarnings("serial") // JDK-implementation class -public class XCreateWindowParams extends HashMap { +public class XCreateWindowParams extends HashMap { public XCreateWindowParams() { } public XCreateWindowParams(Object[] map) { @@ -82,9 +82,9 @@ public class XCreateWindowParams extends HashMap { } public String toString() { StringBuffer buf = new StringBuffer(); - Iterator eIter = entrySet().iterator(); + Iterator> eIter = entrySet().iterator(); while (eIter.hasNext()) { - Map.Entry entry = (Map.Entry)eIter.next(); + Map.Entry entry = eIter.next(); buf.append(entry.getKey() + ": " + entry.getValue() + "\n"); } return buf.toString(); diff --git a/jdk/src/solaris/classes/sun/awt/X11/XDataTransferer.java b/jdk/src/solaris/classes/sun/awt/X11/XDataTransferer.java index fd9cbb8f13c..36204203c23 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XDataTransferer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XDataTransferer.java @@ -49,6 +49,7 @@ import java.util.LinkedHashSet; import java.util.List; import javax.imageio.ImageIO; +import javax.imageio.ImageReader; import javax.imageio.ImageTypeSpecifier; import javax.imageio.ImageWriter; import javax.imageio.spi.ImageWriterSpi; @@ -333,7 +334,7 @@ public class XDataTransferer extends DataTransferer { // flavors to enable dynamic text native-to-flavor mapping generation. // See SystemFlavorMap.getFlavorsForNative() for details. if ("image".equals(primaryType)) { - Iterator readers = ImageIO.getImageReadersByMIMEType(baseType); + Iterator readers = ImageIO.getImageReadersByMIMEType(baseType); if (readers.hasNext()) { flavors.add(DataFlavor.imageFlavor); } diff --git a/jdk/src/solaris/classes/sun/awt/X11/XDnDDragSourceProtocol.java b/jdk/src/solaris/classes/sun/awt/X11/XDnDDragSourceProtocol.java index b1e6f2ad041..4648a836679 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XDnDDragSourceProtocol.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XDnDDragSourceProtocol.java @@ -26,6 +26,7 @@ package sun.awt.X11; import java.awt.datatransfer.Transferable; +import java.awt.datatransfer.DataFlavor; import java.awt.dnd.DnDConstants; import java.awt.dnd.InvalidDnDOperationException; @@ -70,7 +71,7 @@ class XDnDDragSourceProtocol extends XDragSourceProtocol { * @returns true if the initialized successfully. */ protected void initializeDragImpl(int actions, Transferable contents, - Map formatMap, long[] formats) + Map formatMap, long[] formats) throws InvalidDnDOperationException, IllegalArgumentException, XException { assert XToolkit.isAWTLockHeldByCurrentThread(); diff --git a/jdk/src/solaris/classes/sun/awt/X11/XDragAndDropProtocols.java b/jdk/src/solaris/classes/sun/awt/X11/XDragAndDropProtocols.java index b236881aec4..161fc285a02 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XDragAndDropProtocols.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XDragAndDropProtocols.java @@ -36,8 +36,8 @@ import java.util.List; * @since 1.5 */ final class XDragAndDropProtocols { - private final static List dragProtocols; - private final static List dropProtocols; + private final static List dragProtocols; + private final static List dropProtocols; public static final String XDnD = "XDnD"; public static final String MotifDnD = "MotifDnD"; @@ -50,7 +50,7 @@ final class XDragAndDropProtocols { XDropTargetProtocolListener dropTargetProtocolListener = XDropTargetContextPeer.getXDropTargetProtocolListener(); - List tDragSourceProtocols = new ArrayList(); + List tDragSourceProtocols = new ArrayList<>(); XDragSourceProtocol xdndDragSourceProtocol = XDnDDragSourceProtocol.createInstance(dragSourceProtocolListener); tDragSourceProtocols.add(xdndDragSourceProtocol); @@ -58,7 +58,7 @@ final class XDragAndDropProtocols { MotifDnDDragSourceProtocol.createInstance(dragSourceProtocolListener); tDragSourceProtocols.add(motifdndDragSourceProtocol); - List tDropTargetProtocols = new ArrayList(); + List tDropTargetProtocols = new ArrayList<>(); XDropTargetProtocol xdndDropTargetProtocol = XDnDDropTargetProtocol.createInstance(dropTargetProtocolListener); tDropTargetProtocols.add(xdndDropTargetProtocol); @@ -70,11 +70,11 @@ final class XDragAndDropProtocols { dropProtocols = Collections.unmodifiableList(tDropTargetProtocols); } - static Iterator getDragSourceProtocols() { + static Iterator getDragSourceProtocols() { return dragProtocols.iterator(); } - static Iterator getDropTargetProtocols() { + static Iterator getDropTargetProtocols() { return dropProtocols.iterator(); } @@ -88,10 +88,10 @@ final class XDragAndDropProtocols { return null; } - Iterator dragProtocols = XDragAndDropProtocols.getDragSourceProtocols(); + Iterator dragProtocols = + XDragAndDropProtocols.getDragSourceProtocols(); while (dragProtocols.hasNext()) { - XDragSourceProtocol dragProtocol = - (XDragSourceProtocol)dragProtocols.next(); + XDragSourceProtocol dragProtocol = dragProtocols.next(); if (dragProtocol.getProtocolName().equals(name)) { return dragProtocol; } @@ -110,10 +110,10 @@ final class XDragAndDropProtocols { return null; } - Iterator dropProtocols = XDragAndDropProtocols.getDropTargetProtocols(); + Iterator dropProtocols = + XDragAndDropProtocols.getDropTargetProtocols(); while (dropProtocols.hasNext()) { - XDropTargetProtocol dropProtocol = - (XDropTargetProtocol)dropProtocols.next(); + XDropTargetProtocol dropProtocol = dropProtocols.next(); if (dropProtocol.getProtocolName().equals(name)) { return dropProtocol; } diff --git a/jdk/src/solaris/classes/sun/awt/X11/XDragSourceContextPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XDragSourceContextPeer.java index f376b395823..2d67a31a036 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XDragSourceContextPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XDragSourceContextPeer.java @@ -29,6 +29,7 @@ import java.awt.Component; import java.awt.Cursor; import java.awt.Window; +import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.Transferable; import java.awt.dnd.DnDConstants; @@ -110,7 +111,7 @@ public final class XDragSourceContextPeer } protected void startDrag(Transferable transferable, - long[] formats, Map formatMap) { + long[] formats, Map formatMap) { Component component = getTrigger().getComponent(); Component c = null; XWindowPeer wpeer = null; @@ -161,9 +162,10 @@ public final class XDragSourceContextPeer int dropActions = getDragSourceContext().getSourceActions(); - Iterator dragProtocols = XDragAndDropProtocols.getDragSourceProtocols(); + Iterator dragProtocols = + XDragAndDropProtocols.getDragSourceProtocols(); while (dragProtocols.hasNext()) { - XDragSourceProtocol dragProtocol = (XDragSourceProtocol)dragProtocols.next(); + XDragSourceProtocol dragProtocol = dragProtocols.next(); try { dragProtocol.initializeDrag(dropActions, transferable, formatMap, formats); @@ -313,9 +315,10 @@ public final class XDragSourceContextPeer dragDropFinished(false, DnDConstants.ACTION_NONE, xRoot, yRoot); } - Iterator dragProtocols = XDragAndDropProtocols.getDragSourceProtocols(); + Iterator dragProtocols = + XDragAndDropProtocols.getDragSourceProtocols(); while (dragProtocols.hasNext()) { - XDragSourceProtocol dragProtocol = (XDragSourceProtocol)dragProtocols.next(); + XDragSourceProtocol dragProtocol = dragProtocols.next(); try { dragProtocol.cleanup(); } catch (XException xe) { @@ -418,9 +421,10 @@ public final class XDragSourceContextPeer } if (clientWindow != 0) { - Iterator dragProtocols = XDragAndDropProtocols.getDragSourceProtocols(); + Iterator dragProtocols = + XDragAndDropProtocols.getDragSourceProtocols(); while (dragProtocols.hasNext()) { - XDragSourceProtocol dragProtocol = (XDragSourceProtocol)dragProtocols.next(); + XDragSourceProtocol dragProtocol = dragProtocols.next(); if (dragProtocol.attachTargetWindow(clientWindow, time)) { protocol = dragProtocol; break; @@ -550,10 +554,10 @@ public final class XDragSourceContextPeer XClientMessageEvent xclient = ev.get_xclient(); - Iterator dragProtocols = XDragAndDropProtocols.getDragSourceProtocols(); + Iterator dragProtocols = + XDragAndDropProtocols.getDragSourceProtocols(); while (dragProtocols.hasNext()) { - XDragSourceProtocol dragProtocol = - (XDragSourceProtocol)dragProtocols.next(); + XDragSourceProtocol dragProtocol = dragProtocols.next(); if (dragProtocol.processProxyModeEvent(xclient, getProxyModeSourceWindow())) { return true; diff --git a/jdk/src/solaris/classes/sun/awt/X11/XDragSourceProtocol.java b/jdk/src/solaris/classes/sun/awt/X11/XDragSourceProtocol.java index 6779a156688..20e16f4954e 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XDragSourceProtocol.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XDragSourceProtocol.java @@ -26,6 +26,7 @@ package sun.awt.X11; import java.awt.datatransfer.Transferable; +import java.awt.datatransfer.DataFlavor; import java.awt.dnd.DnDConstants; import java.awt.dnd.InvalidDnDOperationException; @@ -84,7 +85,7 @@ abstract class XDragSourceProtocol { * @throws XException if some X call failed. */ public final void initializeDrag(int actions, Transferable contents, - Map formatMap, long[] formats) + Map formatMap, long[] formats) throws InvalidDnDOperationException, IllegalArgumentException, XException { XToolkit.awtLock(); @@ -110,7 +111,8 @@ abstract class XDragSourceProtocol { /* The caller must hold AWT_LOCK. */ protected abstract void initializeDragImpl(int actions, Transferable contents, - Map formatMap, long[] formats) + Map formatMap, + long[] formats) throws InvalidDnDOperationException, IllegalArgumentException, XException; /** diff --git a/jdk/src/solaris/classes/sun/awt/X11/XDropTargetContextPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XDropTargetContextPeer.java index 4b5818ab9de..26daceff51a 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XDropTargetContextPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XDropTargetContextPeer.java @@ -89,12 +89,12 @@ final class XDropTargetContextPeer extends SunDropTargetContextPeer { /* If the event was not consumed, send a response to the source. */ try { if (ctxt != 0 && !e.isConsumed()) { - Iterator dropTargetProtocols = + Iterator dropTargetProtocols = XDragAndDropProtocols.getDropTargetProtocols(); while (dropTargetProtocols.hasNext()) { XDropTargetProtocol dropTargetProtocol = - (XDropTargetProtocol)dropTargetProtocols.next(); + dropTargetProtocols.next(); if (dropTargetProtocol.sendResponse(ctxt, e.getID(), returnValue)) { break; @@ -116,12 +116,12 @@ final class XDropTargetContextPeer extends SunDropTargetContextPeer { if (ctxt != 0) { try { - Iterator dropTargetProtocols = + Iterator dropTargetProtocols = XDragAndDropProtocols.getDropTargetProtocols(); while (dropTargetProtocols.hasNext()) { XDropTargetProtocol dropTargetProtocol = - (XDropTargetProtocol)dropTargetProtocols.next(); + dropTargetProtocols.next(); if (dropTargetProtocol.sendDropDone(ctxt, success, dropAction)) { break; @@ -140,12 +140,12 @@ final class XDropTargetContextPeer extends SunDropTargetContextPeer { long ctxt = getNativeDragContext(); if (ctxt != 0) { - Iterator dropTargetProtocols = + Iterator dropTargetProtocols = XDragAndDropProtocols.getDropTargetProtocols(); while (dropTargetProtocols.hasNext()) { XDropTargetProtocol dropTargetProtocol = - (XDropTargetProtocol)dropTargetProtocols.next(); + dropTargetProtocols.next(); // getData throws IAE if ctxt is not for this protocol. try { return dropTargetProtocol.getData(ctxt, format); @@ -221,12 +221,11 @@ final class XDropTargetContextPeer extends SunDropTargetContextPeer { public void forwardEventToEmbedded(long embedded, long ctxt, int eventID) { - Iterator dropTargetProtocols = + Iterator dropTargetProtocols = XDragAndDropProtocols.getDropTargetProtocols(); while (dropTargetProtocols.hasNext()) { - XDropTargetProtocol dropTargetProtocol = - (XDropTargetProtocol)dropTargetProtocols.next(); + XDropTargetProtocol dropTargetProtocol = dropTargetProtocols.next(); if (dropTargetProtocol.forwardEventToEmbedded(embedded, ctxt, eventID)) { break; diff --git a/jdk/src/solaris/classes/sun/awt/X11/XDropTargetEventProcessor.java b/jdk/src/solaris/classes/sun/awt/X11/XDropTargetEventProcessor.java index 26a4941788d..a3d9e2fec1c 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XDropTargetEventProcessor.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XDropTargetEventProcessor.java @@ -79,12 +79,11 @@ final class XDropTargetEventProcessor { } if (protocol == null) { - Iterator dropTargetProtocols = + Iterator dropTargetProtocols = XDragAndDropProtocols.getDropTargetProtocols(); while (dropTargetProtocols.hasNext()) { - XDropTargetProtocol dropTargetProtocol = - (XDropTargetProtocol)dropTargetProtocols.next(); + XDropTargetProtocol dropTargetProtocol = dropTargetProtocols.next(); // Don't try to process it again with the current protocol. if (dropTargetProtocol == curProtocol) { continue; diff --git a/jdk/src/solaris/classes/sun/awt/X11/XDropTargetProtocol.java b/jdk/src/solaris/classes/sun/awt/X11/XDropTargetProtocol.java index 2ba4cf2af8d..d4526c993fe 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XDropTargetProtocol.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XDropTargetProtocol.java @@ -295,7 +295,8 @@ abstract class XDropTargetProtocol { } /* Access to HashMap is synchronized on this XDropTargetProtocol instance. */ - private final HashMap embedderRegistry = new HashMap(); + private final HashMap embedderRegistry = + new HashMap<>(); protected final void putEmbedderRegistryEntry(long embedder, boolean overriden, @@ -310,8 +311,7 @@ abstract class XDropTargetProtocol { protected final EmbedderRegistryEntry getEmbedderRegistryEntry(long embedder) { synchronized (this) { - return - (EmbedderRegistryEntry)embedderRegistry.get(Long.valueOf(embedder)); + return embedderRegistry.get(Long.valueOf(embedder)); } } diff --git a/jdk/src/solaris/classes/sun/awt/X11/XDropTargetRegistry.java b/jdk/src/solaris/classes/sun/awt/X11/XDropTargetRegistry.java index b8a8441379e..aa3d2da55bb 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XDropTargetRegistry.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XDropTargetRegistry.java @@ -141,10 +141,10 @@ final class XDropTargetRegistry { } public long[] getSites() { long[] ret = new long[sites.size()]; - Iterator iter = sites.iterator(); + Iterator iter = sites.iterator(); int index = 0; while (iter.hasNext()) { - Long l = (Long)iter.next(); + Long l = iter.next(); ret[index++] = l.longValue(); } return ret; @@ -199,14 +199,13 @@ final class XDropTargetRegistry { private EmbeddedDropSiteEntry registerEmbedderDropSite(long embedder) { assert XToolkit.isAWTLockHeldByCurrentThread(); - Iterator dropTargetProtocols = + Iterator dropTargetProtocols = XDragAndDropProtocols.getDropTargetProtocols(); // The list of protocols supported by the embedder. - List embedderProtocols = new ArrayList(); + List embedderProtocols = new ArrayList<>(); while (dropTargetProtocols.hasNext()) { - XDropTargetProtocol dropTargetProtocol = - (XDropTargetProtocol)dropTargetProtocols.next(); + XDropTargetProtocol dropTargetProtocol = dropTargetProtocols.next(); if (dropTargetProtocol.isProtocolSupported(embedder)) { embedderProtocols.add(dropTargetProtocol); } @@ -262,7 +261,7 @@ final class XDropTargetRegistry { private void registerProtocols(long embedder, boolean protocols, List supportedProtocols) { - Iterator dropTargetProtocols = null; + Iterator dropTargetProtocols = null; /* * By default, we register a drop site that supports all dnd @@ -289,8 +288,7 @@ final class XDropTargetRegistry { XlibWrapper.XGrabServer(XToolkit.getDisplay()); try { while (dropTargetProtocols.hasNext()) { - XDropTargetProtocol dropTargetProtocol = - (XDropTargetProtocol)dropTargetProtocols.next(); + XDropTargetProtocol dropTargetProtocol = dropTargetProtocols.next(); if ((protocols == XEMBED_PROTOCOLS) == dropTargetProtocol.isXEmbedSupported()) { dropTargetProtocol.registerEmbedderDropSite(embedder); @@ -310,14 +308,13 @@ final class XDropTargetRegistry { assert XToolkit.isAWTLockHeldByCurrentThread(); - Iterator dropTargetProtocols = + Iterator dropTargetProtocols = XDragAndDropProtocols.getDropTargetProtocols(); // The list of protocols supported by the embedder. - List embedderProtocols = new ArrayList(); + List embedderProtocols = new ArrayList<>(); while (dropTargetProtocols.hasNext()) { - XDropTargetProtocol dropTargetProtocol = - (XDropTargetProtocol)dropTargetProtocols.next(); + XDropTargetProtocol dropTargetProtocol = dropTargetProtocols.next(); if (dropTargetProtocol.isProtocolSupported(embedder)) { embedderProtocols.add(dropTargetProtocol); } @@ -361,8 +358,7 @@ final class XDropTargetRegistry { XlibWrapper.XGrabServer(XToolkit.getDisplay()); try { while (dropTargetProtocols.hasNext()) { - XDropTargetProtocol dropTargetProtocol = - (XDropTargetProtocol)dropTargetProtocols.next(); + XDropTargetProtocol dropTargetProtocol = dropTargetProtocols.next(); if (!isXEmbedServer || !dropTargetProtocol.isXEmbedSupported()) { dropTargetProtocol.registerEmbedderDropSite(embedder); } @@ -376,7 +372,7 @@ final class XDropTargetRegistry { EmbeddedDropSiteEntry entry) { assert XToolkit.isAWTLockHeldByCurrentThread(); - Iterator dropTargetProtocols = + Iterator dropTargetProtocols = XDragAndDropProtocols.getDropTargetProtocols(); /* Grab server, since we are working with the window that belongs to @@ -384,8 +380,7 @@ final class XDropTargetRegistry { XlibWrapper.XGrabServer(XToolkit.getDisplay()); try { while (dropTargetProtocols.hasNext()) { - XDropTargetProtocol dropTargetProtocol = - (XDropTargetProtocol)dropTargetProtocols.next(); + XDropTargetProtocol dropTargetProtocol = dropTargetProtocols.next(); dropTargetProtocol.unregisterEmbedderDropSite(embedder); } @@ -470,14 +465,14 @@ final class XDropTargetRegistry { registerProtocols(toplevel, XEMBED_PROTOCOLS, entry.getSupportedProtocols()); } else { - Iterator dropTargetProtocols = + Iterator dropTargetProtocols = XDragAndDropProtocols.getDropTargetProtocols(); // Register the embedded window as a plain drop site with // all DnD protocols that are supported by XEmbed. while (dropTargetProtocols.hasNext()) { XDropTargetProtocol dropTargetProtocol = - (XDropTargetProtocol)dropTargetProtocols.next(); + dropTargetProtocols.next(); if (dropTargetProtocol.isXEmbedSupported()) { dropTargetProtocol.registerEmbedderDropSite(window); } @@ -558,12 +553,12 @@ final class XDropTargetRegistry { } if (toplevel == window) { - Iterator dropTargetProtocols = + Iterator dropTargetProtocols = XDragAndDropProtocols.getDropTargetProtocols(); while (dropTargetProtocols.hasNext()) { XDropTargetProtocol dropTargetProtocol = - (XDropTargetProtocol)dropTargetProtocols.next(); + dropTargetProtocols.next(); dropTargetProtocol.registerDropTarget(toplevel); } } else { @@ -584,13 +579,13 @@ final class XDropTargetRegistry { long toplevel = getToplevelWindow(window); if (toplevel == window) { - Iterator dropProtocols = + Iterator dropProtocols = XDragAndDropProtocols.getDropTargetProtocols(); removeDelayedRegistrationEntry(window); while (dropProtocols.hasNext()) { - XDropTargetProtocol dropProtocol = (XDropTargetProtocol)dropProtocols.next(); + XDropTargetProtocol dropProtocol = dropProtocols.next(); dropProtocol.unregisterDropTarget(window); } } else { @@ -615,12 +610,11 @@ final class XDropTargetRegistry { } registerEmbeddedDropSite(canvasWindow, clientWindow); - Iterator dropTargetProtocols = + Iterator dropTargetProtocols = XDragAndDropProtocols.getDropTargetProtocols(); while (dropTargetProtocols.hasNext()) { - XDropTargetProtocol dropTargetProtocol = - (XDropTargetProtocol)dropTargetProtocols.next(); + XDropTargetProtocol dropTargetProtocol = dropTargetProtocols.next(); dropTargetProtocol.registerEmbeddedDropSite(clientWindow); } @@ -634,12 +628,11 @@ final class XDropTargetRegistry { if (logger.isLoggable(PlatformLogger.Level.FINE)) { logger.fine(" XEmbed drop site will be unregistered for " + Long.toHexString(clientWindow)); } - Iterator dropTargetProtocols = + Iterator dropTargetProtocols = XDragAndDropProtocols.getDropTargetProtocols(); while (dropTargetProtocols.hasNext()) { - XDropTargetProtocol dropTargetProtocol = - (XDropTargetProtocol)dropTargetProtocols.next(); + XDropTargetProtocol dropTargetProtocol = dropTargetProtocols.next(); dropTargetProtocol.unregisterEmbeddedDropSite(clientWindow); } diff --git a/jdk/src/solaris/classes/sun/awt/X11/XEmbeddingContainer.java b/jdk/src/solaris/classes/sun/awt/X11/XEmbeddingContainer.java index e23fb93aef8..4096f435e33 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XEmbeddingContainer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XEmbeddingContainer.java @@ -32,7 +32,7 @@ import java.lang.reflect.*; import sun.awt.AWTAccessor; public class XEmbeddingContainer extends XEmbedHelper implements XEventDispatcher { - HashMap children = new HashMap(); + HashMap children = new HashMap<>(); XEmbeddingContainer() { } diff --git a/jdk/src/solaris/classes/sun/awt/X11/XFileDialogPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XFileDialogPeer.java index b3d0731d5f0..bb13ffda5df 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XFileDialogPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XFileDialogPeer.java @@ -146,9 +146,9 @@ class XFileDialogPeer extends XDialogPeer implements FileDialogPeer, ActionListe savedDir = target.getDirectory(); // Shouldn't save 'user.dir' to 'savedDir' // since getDirectory() will be incorrect after handleCancel - userDir = (String)AccessController.doPrivileged( - new PrivilegedAction() { - public Object run() { + userDir = AccessController.doPrivileged( + new PrivilegedAction() { + public String run() { return System.getProperty("user.dir"); } }); diff --git a/jdk/src/solaris/classes/sun/awt/X11/XListPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XListPeer.java index 91b02d797b8..77545589889 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XListPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XListPeer.java @@ -70,7 +70,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient { ListPainter painter; // TODO: ick - Vector? - Vector items; + Vector items; boolean multipleSelections; int active = NONE; @@ -139,7 +139,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient { super.preInit(params); // Stuff that must be initialized before layout() is called - items = new Vector(); + items = new Vector<>(); createVerScrollbar(); createHorScrollbar(); @@ -281,7 +281,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient { int m = 0; int end = items.size(); for(int i = 0 ; i < end ; i++) { - int l = fm.stringWidth(((String)items.elementAt(i))); + int l = fm.stringWidth(items.elementAt(i)); m = Math.max(m, l); } return m; @@ -292,7 +292,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient { */ int getItemWidth(int i) { FontMetrics fm = getFontMetrics(getFont()); - return fm.stringWidth((String)items.elementAt(i)); + return fm.stringWidth(items.elementAt(i)); } /** @@ -659,7 +659,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient { ( clickCount % 2 == 0 ) ) { postEvent(new ActionEvent(target, ActionEvent.ACTION_PERFORMED, - (String)items.elementAt(currentIndex), + items.elementAt(currentIndex), mouseEvent.getWhen(), mouseEvent.getModifiers())); // No ext mods } else if (active == WINDOW) { @@ -986,7 +986,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient { if (selected.length > 0) { postEvent(new ActionEvent((List)target, ActionEvent.ACTION_PERFORMED, - (String)items.elementAt(getFocusIndex()), + items.elementAt(getFocusIndex()), e.getWhen(), e.getModifiers())); // ActionEvent doesn't have // extended modifiers. @@ -1343,7 +1343,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient { */ public void clear() { selected = new int[0]; - items = new Vector(); + items = new Vector<>(); currentIndex = -1; // Fixed 6291736: ITEM_STATE_CHANGED triggered after List.removeAll(), XToolkit // We should update 'focusIndex' variable more carefully @@ -1926,7 +1926,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient { } else { g.setColor(getListForeground()); } - String str = (String)items.elementAt(index); + String str = items.elementAt(index); g.drawString(str, x - hsb.getValue(), y + fontAscent); } else { // Clear the remaining area around the item - focus area and the rest of border diff --git a/jdk/src/solaris/classes/sun/awt/X11/XMSelection.java b/jdk/src/solaris/classes/sun/awt/X11/XMSelection.java index a74dad630e7..066a83aae8c 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XMSelection.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XMSelection.java @@ -60,7 +60,7 @@ public class XMSelection { String selectionName; /* list of listeners to be called for events */ - Vector listeners; + Vector listeners; /* X atom array (one per screen) for this selection */ XAtom atoms[]; @@ -75,7 +75,7 @@ public class XMSelection { static XAtom XA_MANAGER; - static HashMap selectionMap; + static HashMap selectionMap; static { long display = XToolkit.getDisplay(); @@ -90,7 +90,7 @@ public class XMSelection { initScreen(display,screen); } - selectionMap = new HashMap(); + selectionMap = new HashMap<>(); } static void initScreen(long display, final int screen) { @@ -227,7 +227,7 @@ public class XMSelection { static XMSelection getInstance(long selection) { - return (XMSelection) selectionMap.get(Long.valueOf(selection)); + return selectionMap.get(Long.valueOf(selection)); } @@ -259,7 +259,7 @@ public class XMSelection { public synchronized void addSelectionListener(XMSelectionListener listener) { if (listeners == null) { - listeners = new Vector(); + listeners = new Vector<>(); } listeners.add(listener); } @@ -270,7 +270,7 @@ public class XMSelection { } } - synchronized Collection getListeners() { + synchronized Collection getListeners() { return listeners; } @@ -310,9 +310,9 @@ public class XMSelection { log.fine("Selection Changed : Screen = " + screen + "Event =" + ev); } if (listeners != null) { - Iterator iter = listeners.iterator(); + Iterator iter = listeners.iterator(); while (iter.hasNext()) { - XMSelectionListener disp = (XMSelectionListener) iter.next(); + XMSelectionListener disp = iter.next(); disp.selectionChanged(screen, this, ev.get_window(), ev); } } @@ -323,9 +323,9 @@ public class XMSelection { log.fine("Owner dead : Screen = " + screen + "Event =" + de); } if (listeners != null) { - Iterator iter = listeners.iterator(); + Iterator iter = listeners.iterator(); while (iter.hasNext()) { - XMSelectionListener disp = (XMSelectionListener) iter.next(); + XMSelectionListener disp = iter.next(); disp.ownerDeath(screen, this, de.get_window()); } @@ -349,9 +349,9 @@ public class XMSelection { synchronized void dispatchOwnerChangedEvent(XEvent ev, int screen, long owner, long data, long timestamp) { if (listeners != null) { - Iterator iter = listeners.iterator(); + Iterator iter = listeners.iterator(); while (iter.hasNext()) { - XMSelectionListener disp = (XMSelectionListener) iter.next(); + XMSelectionListener disp = iter.next(); disp.ownerChanged(screen,this, owner, data, timestamp); } } diff --git a/jdk/src/solaris/classes/sun/awt/X11/XMenuBarPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XMenuBarPeer.java index c1b568bc0fb..d8f3f17655b 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XMenuBarPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XMenuBarPeer.java @@ -195,10 +195,10 @@ public class XMenuBarPeer extends XBaseMenuWindow implements MenuBarPeer { void postInit(XCreateWindowParams params) { super.postInit(params); // Get menus from the target. - Vector targetMenuVector = AWTAccessor.getMenuBarAccessor() - .getMenus(menuBarTarget); + Vector targetMenuVector = AWTAccessor.getMenuBarAccessor() + .getMenus(menuBarTarget); Menu targetHelpMenu = AWTAccessor.getMenuBarAccessor() - .getHelpMenu(menuBarTarget); + .getHelpMenu(menuBarTarget); reloadItems(targetMenuVector); if (targetHelpMenu != null) { addHelpMenu(targetHelpMenu); diff --git a/jdk/src/solaris/classes/sun/awt/X11/XMenuPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XMenuPeer.java index 067efa13d3a..6aea4c9eacc 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XMenuPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XMenuPeer.java @@ -143,7 +143,7 @@ public class XMenuPeer extends XMenuItemPeer implements MenuPeer { * Access to target's fields * ************************************************/ - Vector getTargetItems() { + Vector getTargetItems() { return AWTAccessor.getMenuAccessor().getItems((Menu)getTarget()); } diff --git a/jdk/src/solaris/classes/sun/awt/X11/XMenuWindow.java b/jdk/src/solaris/classes/sun/awt/X11/XMenuWindow.java index 9863c983873..b5fbfca919c 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XMenuWindow.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XMenuWindow.java @@ -164,7 +164,7 @@ public class XMenuWindow extends XBaseMenuWindow { this.menuPeer = menuPeer; this.target = menuPeer.getContainer().target; // Get menus from the target. - Vector targetItemVector = null; + Vector targetItemVector = null; targetItemVector = getMenuTargetItems(); reloadItems(targetItemVector); } @@ -356,7 +356,7 @@ public class XMenuWindow extends XBaseMenuWindow { * Reads vector of items from target * This function is overriden in XPopupMenuPeer */ - Vector getMenuTargetItems() { + Vector getMenuTargetItems() { return menuPeer.getTargetItems(); } diff --git a/jdk/src/solaris/classes/sun/awt/X11/XPopupMenuPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XPopupMenuPeer.java index 81c60dd55b2..03a4db3f9f9 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XPopupMenuPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XPopupMenuPeer.java @@ -134,7 +134,7 @@ public class XPopupMenuPeer extends XMenuWindow implements PopupMenuPeer { public void show(Event e) { target = (Component)e.target; // Get menus from the target. - Vector targetItemVector = getMenuTargetItems(); + Vector targetItemVector = getMenuTargetItems(); if (targetItemVector != null) { reloadItems(targetItemVector); //Fix for 6287092: JCK15a: api/java_awt/interactive/event/EventTests.html#EventTest0015 fails, mustang @@ -188,7 +188,7 @@ public class XPopupMenuPeer extends XMenuWindow implements PopupMenuPeer { return AWTAccessor.getMenuItemAccessor().isEnabled(popupMenuTarget); } - Vector getMenuTargetItems() { + Vector getMenuTargetItems() { if (popupMenuTarget == null) { return null; } diff --git a/jdk/src/solaris/classes/sun/awt/X11/XSelection.java b/jdk/src/solaris/classes/sun/awt/X11/XSelection.java index 36ebc8e6dba..33f792d7a0b 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XSelection.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XSelection.java @@ -25,6 +25,7 @@ package sun.awt.X11; +import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.Transferable; import java.io.ByteArrayOutputStream; @@ -87,7 +88,7 @@ public final class XSelection { /* The contents supplied by the current owner. */ private Transferable contents = null; /* The format-to-flavor map for the current owner. */ - private Map formatMap = null; + private Map formatMap = null; /* The formats supported by the current owner was set. */ private long[] formats = null; /* The AppContext in which the current owner was set. */ @@ -134,7 +135,8 @@ public final class XSelection { return selectionAtom; } - public synchronized boolean setOwner(Transferable contents, Map formatMap, + public synchronized boolean setOwner(Transferable contents, + Map formatMap, long[] formats, long time) { long owner = XWindow.getXAWTRootWindow().getWindow(); diff --git a/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java b/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java index 3648e874b6a..6ae75161b10 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java @@ -36,6 +36,7 @@ import java.awt.dnd.DragGestureRecognizer; import java.awt.dnd.MouseDragGestureRecognizer; import java.awt.dnd.InvalidDnDOperationException; import java.awt.dnd.peer.DragSourceContextPeer; +import java.awt.font.TextAttribute; import java.awt.im.InputMethodHighlight; import java.awt.im.spi.InputMethodDescriptor; import java.awt.image.ColorModel; @@ -99,9 +100,9 @@ public final class XToolkit extends UNIXToolkit implements Runnable { private FontConfigManager fcManager = new FontConfigManager(); static int arrowCursor; - static TreeMap winMap = new TreeMap(); - static HashMap specialPeerMap = new HashMap(); - static HashMap winToDispatcher = new HashMap(); + static TreeMap winMap = new TreeMap<>(); + static HashMap specialPeerMap = new HashMap<>(); + static HashMap> winToDispatcher = new HashMap<>(); private static long _display; static UIDefaults uidefaults; static X11GraphicsEnvironment localEnv; @@ -358,16 +359,16 @@ public final class XToolkit extends UNIXToolkit implements Runnable { } static XBaseWindow windowToXWindow(long window) { synchronized(winMap) { - return (XBaseWindow) winMap.get(Long.valueOf(window)); + return winMap.get(Long.valueOf(window)); } } static void addEventDispatcher(long window, XEventDispatcher dispatcher) { synchronized(winToDispatcher) { Long key = Long.valueOf(window); - Collection dispatchers = (Collection)winToDispatcher.get(key); + Collection dispatchers = winToDispatcher.get(key); if (dispatchers == null) { - dispatchers = new Vector(); + dispatchers = new Vector<>(); winToDispatcher.put(key, dispatchers); } dispatchers.add(dispatcher); @@ -376,7 +377,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable { static void removeEventDispatcher(long window, XEventDispatcher dispatcher) { synchronized(winToDispatcher) { Long key = Long.valueOf(window); - Collection dispatchers = (Collection)winToDispatcher.get(key); + Collection dispatchers = winToDispatcher.get(key); if (dispatchers != null) { dispatchers.remove(dispatcher); } @@ -493,18 +494,18 @@ public final class XToolkit extends UNIXToolkit implements Runnable { } XBaseWindow.dispatchToWindow(ev); - Collection dispatchers = null; + Collection dispatchers = null; synchronized(winToDispatcher) { Long key = Long.valueOf(xany.get_window()); - dispatchers = (Collection)winToDispatcher.get(key); + dispatchers = winToDispatcher.get(key); if (dispatchers != null) { // Clone it to avoid synchronization during dispatching - dispatchers = new Vector(dispatchers); + dispatchers = new Vector<>(dispatchers); } } if (dispatchers != null) { - Iterator iter = dispatchers.iterator(); + Iterator iter = dispatchers.iterator(); while (iter.hasNext()) { - XEventDispatcher disp = (XEventDispatcher)iter.next(); + XEventDispatcher disp = iter.next(); disp.dispatchEvent(ev); } } @@ -764,7 +765,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable { Insets insets = new Insets(0, 0, 0, 0); - java.util.List search = new LinkedList(); + java.util.List search = new LinkedList<>(); search.add(root); search.add(0); while (!search.isEmpty()) @@ -929,6 +930,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable { return XDragSourceContextPeer.createDragSourceContextPeer(dge); } + @SuppressWarnings("unchecked") public T createDragGestureRecognizer(Class recognizerClass, DragSource ds, @@ -1147,7 +1149,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable { return 2; // Black and white. } - public Map mapInputMethodHighlight(InputMethodHighlight highlight) { + public Map mapInputMethodHighlight( InputMethodHighlight highlight) { return XInputMethod.mapInputMethodHighlight(highlight); } @Override @@ -1338,31 +1340,25 @@ public final class XToolkit extends UNIXToolkit implements Runnable { static void dumpPeers() { if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Mapped windows:"); - Iterator iter = winMap.entrySet().iterator(); - while (iter.hasNext()) { - Map.Entry entry = (Map.Entry)iter.next(); - log.fine(entry.getKey() + "->" + entry.getValue()); - if (entry.getValue() instanceof XComponentPeer) { - Component target = (Component)((XComponentPeer)entry.getValue()).getTarget(); + winMap.forEach((k, v) -> { + log.fine(k + "->" + v); + if (v instanceof XComponentPeer) { + Component target = (Component)((XComponentPeer)v).getTarget(); log.fine("\ttarget: " + target); } - } + }); SunToolkit.dumpPeers(log); log.fine("Mapped special peers:"); - iter = specialPeerMap.entrySet().iterator(); - while (iter.hasNext()) { - Map.Entry entry = (Map.Entry)iter.next(); - log.fine(entry.getKey() + "->" + entry.getValue()); - } + specialPeerMap.forEach((k, v) -> { + log.fine(k + "->" + v); + }); log.fine("Mapped dispatchers:"); - iter = winToDispatcher.entrySet().iterator(); - while (iter.hasNext()) { - Map.Entry entry = (Map.Entry)iter.next(); - log.fine(entry.getKey() + "->" + entry.getValue()); - } + winToDispatcher.forEach((k, v) -> { + log.fine(k + "->" + v); + }); } } @@ -1586,16 +1582,16 @@ public final class XToolkit extends UNIXToolkit implements Runnable { * loadXSettings. It is called from the System EDT * if triggered by an XSETTINGS change. */ - void parseXSettings(int screen_XXX_ignored,Map updatedSettings) { + void parseXSettings(int screen_XXX_ignored,Map updatedSettings) { if (updatedSettings == null || updatedSettings.isEmpty()) { return; } - Iterator i = updatedSettings.entrySet().iterator(); + Iterator> i = updatedSettings.entrySet().iterator(); while (i.hasNext()) { - Map.Entry e = (Map.Entry)i.next(); - String name = (String)e.getKey(); + Map.Entry e = i.next(); + String name = e.getKey(); name = "gnome." + name; setDesktopProperty(name, e.getValue()); @@ -1692,7 +1688,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable { long window = 0; try{ // get any application window - window = ((Long)(winMap.firstKey())).longValue(); + window = winMap.firstKey().longValue(); }catch(NoSuchElementException nex) { // get root window window = getDefaultRootWindow(); @@ -1798,7 +1794,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable { } - private static SortedMap timeoutTasks; + private static SortedMap> timeoutTasks; /** * Removed the task from the list of waiting-to-be called tasks. @@ -1819,10 +1815,10 @@ public final class XToolkit extends UNIXToolkit implements Runnable { } return; } - Collection values = timeoutTasks.values(); - Iterator iter = values.iterator(); + Collection> values = timeoutTasks.values(); + Iterator> iter = values.iterator(); while (iter.hasNext()) { - java.util.List list = (java.util.List)iter.next(); + java.util.List list = iter.next(); boolean removed = false; if (list.contains(task)) { list.remove(task); @@ -1869,13 +1865,13 @@ public final class XToolkit extends UNIXToolkit implements Runnable { } if (timeoutTasks == null) { - timeoutTasks = new TreeMap(); + timeoutTasks = new TreeMap<>(); } Long time = Long.valueOf(System.currentTimeMillis() + interval); - java.util.List tasks = (java.util.List)timeoutTasks.get(time); + java.util.List tasks = timeoutTasks.get(time); if (tasks == null) { - tasks = new ArrayList(1); + tasks = new ArrayList<>(1); timeoutTasks.put(time, tasks); } tasks.add(task); @@ -1897,7 +1893,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable { if (timeoutTasks == null || timeoutTasks.isEmpty()) { return -1L; } - return (Long)timeoutTasks.firstKey(); + return timeoutTasks.firstKey(); } finally { awtUnlock(); } @@ -1918,13 +1914,13 @@ public final class XToolkit extends UNIXToolkit implements Runnable { } Long currentTime = Long.valueOf(System.currentTimeMillis()); - Long time = (Long)timeoutTasks.firstKey(); + Long time = timeoutTasks.firstKey(); while (time.compareTo(currentTime) <= 0) { - java.util.List tasks = (java.util.List)timeoutTasks.remove(time); + java.util.List tasks = timeoutTasks.remove(time); - for (Iterator iter = tasks.iterator(); iter.hasNext();) { - Runnable task = (Runnable)iter.next(); + for (Iterator iter = tasks.iterator(); iter.hasNext();) { + Runnable task = iter.next(); if (timeoutTaskLog.isLoggable(PlatformLogger.Level.FINER)) { timeoutTaskLog.finer("XToolkit.callTimeoutTasks(): current time={0}" + @@ -1943,7 +1939,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable { if (timeoutTasks.isEmpty()) { break; } - time = (Long)timeoutTasks.firstKey(); + time = timeoutTasks.firstKey(); } } diff --git a/jdk/src/solaris/classes/sun/awt/X11/XTrayIconPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XTrayIconPeer.java index 86e6e064fc0..4b0a1aec85d 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XTrayIconPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XTrayIconPeer.java @@ -85,7 +85,7 @@ public class XTrayIconPeer implements TrayIconPeer, // Fix for 6317038: as EmbeddedFrame is instance of Frame, it is blocked // by modal dialogs, but in the case of TrayIcon it shouldn't. So we // set ModalExclusion property on it. - AccessController.doPrivileged(new PrivilegedAction() { + AccessController.doPrivileged(new PrivilegedAction() { public Object run() { eframe.setModalExclusionType(Dialog.ModalExclusionType.TOOLKIT_EXCLUDE); return null; diff --git a/jdk/src/solaris/classes/sun/awt/X11/XWM.java b/jdk/src/solaris/classes/sun/awt/X11/XWM.java index 26c4b472883..dd98eb01279 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XWM.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XWM.java @@ -1072,6 +1072,7 @@ final class XWM * Returns all protocols supporting given protocol interface */ Collection getProtocols(Class protocolInterface) { + @SuppressWarnings("unchecked") Collection res = (Collection) protocolsMap.get(protocolInterface); if (res != null) { return res; @@ -1322,9 +1323,9 @@ final class XWM } } - HashMap storedInsets = new HashMap(); + HashMap, Insets> storedInsets = new HashMap<>(); Insets guessInsets(XDecoratedPeer window) { - Insets res = (Insets)storedInsets.get(window.getClass()); + Insets res = storedInsets.get(window.getClass()); if (res == null) { switch (WMID) { case ENLIGHTEN_WM: diff --git a/jdk/src/solaris/classes/sun/awt/X11/XWindow.java b/jdk/src/solaris/classes/sun/awt/X11/XWindow.java index d59ac88d3a0..b7d2a7488f4 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XWindow.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XWindow.java @@ -59,7 +59,7 @@ public class XWindow extends XBaseWindow implements X11ComponentPeer { static int lastX = 0, lastY = 0; static long lastTime = 0; static long lastButton = 0; - static WeakReference lastWindowRef = null; + static WeakReference lastWindowRef = null; static int clickCount = 0; // used to check if we need to re-create surfaceData. @@ -692,7 +692,7 @@ public class XWindow extends XBaseWindow implements X11ComponentPeer { if (type == XConstants.ButtonPress) { //Allow this mouse button to generate CLICK event on next ButtonRelease mouseButtonClickAllowed |= XlibUtil.getButtonMask(lbutton); - XWindow lastWindow = (lastWindowRef != null) ? ((XWindow)lastWindowRef.get()):(null); + XWindow lastWindow = (lastWindowRef != null) ? (lastWindowRef.get()):(null); /* multiclick checking */ @@ -705,7 +705,7 @@ public class XWindow extends XBaseWindow implements X11ComponentPeer { clickCount++; } else { clickCount = 1; - lastWindowRef = new WeakReference(this); + lastWindowRef = new WeakReference<>(this); lastButton = lbutton; lastX = x; lastY = y; @@ -820,7 +820,7 @@ public class XWindow extends XBaseWindow implements X11ComponentPeer { */ int x = xme.get_x(); int y = xme.get_y(); - XWindow lastWindow = (lastWindowRef != null) ? ((XWindow)lastWindowRef.get()):(null); + XWindow lastWindow = (lastWindowRef != null) ? (lastWindowRef.get()):(null); if (!(lastWindow == this && (xme.get_time() - lastTime) < XToolkit.getMultiClickTime() && diff --git a/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java index 521bbc145b3..bebd7212e9e 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java @@ -950,7 +950,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, // make new hash of toplevels of all windows from 'windows' hash. // FIXME: do not call them "toplevel" as it is misleading. // - HashSet toplevels = new HashSet(); + HashSet toplevels = new HashSet<>(); long topl = 0, mytopl = 0; for (XWindowPeer xp : windows) { diff --git a/jdk/src/solaris/classes/sun/awt/X11CustomCursor.java b/jdk/src/solaris/classes/sun/awt/X11CustomCursor.java index 969e7c5116e..c39fcbacda7 100644 --- a/jdk/src/solaris/classes/sun/awt/X11CustomCursor.java +++ b/jdk/src/solaris/classes/sun/awt/X11CustomCursor.java @@ -47,7 +47,7 @@ public abstract class X11CustomCursor extends CustomCursor { protected void createNativeCursor(Image im, int[] pixels, int width, int height, int xHotSpot, int yHotSpot) { - class CCount implements Comparable { + class CCount implements Comparable { int color; int count; @@ -56,8 +56,8 @@ public abstract class X11CustomCursor extends CustomCursor { count = ct; } - public int compareTo(Object cc) { - return ((CCount)cc).count - count; + public int compareTo(CCount cc) { + return cc.count - count; } } diff --git a/jdk/src/solaris/classes/sun/awt/X11FontManager.java b/jdk/src/solaris/classes/sun/awt/X11FontManager.java index c9d2ebc9ba4..987f669cc38 100644 --- a/jdk/src/solaris/classes/sun/awt/X11FontManager.java +++ b/jdk/src/solaris/classes/sun/awt/X11FontManager.java @@ -59,7 +59,7 @@ public class X11FontManager extends SunFontManager { * E.g., the -0-0-0-0-p-0- reported by X is -*-%d-*-*-p-*- in the font * configuration files. We need to remove that part for comparisons. */ - private static Map fontNameMap = new HashMap(); + private static Map fontNameMap = new HashMap<>(); /* * xlfdMap is a map from a platform path like @@ -72,7 +72,7 @@ public class X11FontManager extends SunFontManager { * the full XLFD string like :- * "-ricoh-hg gothic b-medium-r-normal--0-0-0-0-m-0-jisx0201.1976-0" */ - private static Map xlfdMap = new HashMap(); + private static Map> xlfdMap = new HashMap<>(); /* xFontDirsMap is also a map from a font ID to a font filepath. * The difference from fontNameMap is just that it does not have @@ -88,7 +88,7 @@ public class X11FontManager extends SunFontManager { * X11 font directory, then precautions must be taken to include both * directories. */ - private static Map xFontDirsMap; + private static Map xFontDirsMap; /* * This is the set of font directories needed to be on the X font path @@ -121,7 +121,7 @@ public class X11FontManager extends SunFontManager { * of the singleton GE instance is already synchronised and that is * the only code path that accesses this map. */ - private static HashMap registeredDirs = new HashMap(); + private static HashMap registeredDirs = new HashMap<>(); /* Array of directories to be added to the X11 font path. * Used by static method called from Toolkits which use X11 fonts. @@ -183,7 +183,7 @@ public class X11FontManager extends SunFontManager { * Add this XLFD (platform name) to the list of known * ones for this file. */ - Vector xVal = (Vector) xlfdMap.get(fileName); + Vector xVal = xlfdMap.get(fileName); if (xVal == null) { /* Try to be robust on Linux distros which move fonts * around by verifying that the fileName represents a @@ -194,7 +194,7 @@ public class X11FontManager extends SunFontManager { fileName = null; } if (fileName != null) { - xVal = new Vector(); + xVal = new Vector<>(); xVal.add(platName); xlfdMap.put(fileName, xVal); } @@ -211,7 +211,7 @@ public class X11FontManager extends SunFontManager { } if (fontID != null) { - fileName = (String)fontNameMap.get(fontID); + fileName = fontNameMap.get(fontID); /* On Linux check for the Lucida Oblique fonts */ if (fileName == null && FontUtilities.isLinux && !isOpenJDK()) { if (oblmap == null) { @@ -235,7 +235,7 @@ public class X11FontManager extends SunFontManager { FontUtilities.getLogger() .warning("** Finished registering all font paths"); } - fileName = (String)fontNameMap.get(fontID); + fileName = fontNameMap.get(fontID); } if (fileName == null && !isHeadless()) { /* Query X11 directly to see if this font is available @@ -245,7 +245,7 @@ public class X11FontManager extends SunFontManager { } if (fileName == null) { fontID = switchFontIDForName(platName); - fileName = (String)fontNameMap.get(fontID); + fileName = fontNameMap.get(fontID); } if (fileName != null) { fontNameMap.put(fontID, fileName); @@ -257,8 +257,8 @@ public class X11FontManager extends SunFontManager { @Override protected String[] getNativeNames(String fontFileName, String platformName) { - Vector nativeNames; - if ((nativeNames=(Vector)xlfdMap.get(fontFileName))==null) { + Vector nativeNames; + if ((nativeNames=xlfdMap.get(fontFileName))==null) { if (platformName == null) { return null; } else { @@ -271,7 +271,7 @@ public class X11FontManager extends SunFontManager { } } else { int len = nativeNames.size(); - return (String[])nativeNames.toArray(new String[len]); + return nativeNames.toArray(new String[len]); } } @@ -366,7 +366,7 @@ public class X11FontManager extends SunFontManager { } String fontPart = st.sval.substring(breakPos+1); String fontID = specificFontIDForName(fontPart); - String sVal = (String) fontNameMap.get(fontID); + String sVal = fontNameMap.get(fontID); if (FontUtilities.debugFonts()) { PlatformLogger logger = FontUtilities.getLogger(); @@ -386,14 +386,14 @@ public class X11FontManager extends SunFontManager { * wants to use the native rasteriser. */ if (xFontDirsMap == null) { - xFontDirsMap = new HashMap(); + xFontDirsMap = new HashMap<>(); } xFontDirsMap.put(fontID, path); fullPath = file.getCanonicalPath(); } catch (IOException e) { fullPath = path + File.separator + fileName; } - Vector xVal = (Vector) xlfdMap.get(fullPath); + Vector xVal = xlfdMap.get(fullPath); if (FontUtilities.debugFonts()) { FontUtilities.getLogger() .info("fullPath=" + fullPath + @@ -408,7 +408,7 @@ public class X11FontManager extends SunFontManager { } fontNameMap.put(fontID, fullPath); if (xVal == null) { - xVal = new Vector(); + xVal = new Vector<>(); xlfdMap.put (fullPath, xVal); } xVal.add(fontPart); @@ -447,8 +447,8 @@ public class X11FontManager extends SunFontManager { * will typically not ever need to initialise it so it can be null. */ xFontDirsMap = null; - xlfdMap = new HashMap(1); - fontNameMap = new HashMap(1); + xlfdMap = new HashMap<>(1); + fontNameMap = new HashMap<>(1); } private String getObliqueLucidaFontID(String fontID) { @@ -579,10 +579,10 @@ public class X11FontManager extends SunFontManager { String fileName = null; String fontID = specificFontIDForName(name); if (fontID != null) { - fileName = (String)fontNameMap.get(fontID); + fileName = fontNameMap.get(fontID); if (fileName == null) { fontID = switchFontIDForName(name); - fileName = (String)fontNameMap.get(fontID); + fileName = fontNameMap.get(fontID); } if (fileName == null) { fileName = getDefaultFontFile(); @@ -685,7 +685,7 @@ public class X11FontManager extends SunFontManager { getPlatformFontPathFromFontConfig(); if (xFontDirsMap != null) { String fontID = specificFontIDForName(platformName); - String dirName = (String)xFontDirsMap.get(fontID); + String dirName = xFontDirsMap.get(fontID); if (dirName != null) { fontConfigDirs.add(dirName); } diff --git a/jdk/src/solaris/classes/sun/awt/X11GraphicsDevice.java b/jdk/src/solaris/classes/sun/awt/X11GraphicsDevice.java index 10365f9a647..4e5bb1bd3d9 100644 --- a/jdk/src/solaris/classes/sun/awt/X11GraphicsDevice.java +++ b/jdk/src/solaris/classes/sun/awt/X11GraphicsDevice.java @@ -56,7 +56,7 @@ public class X11GraphicsDevice implements DisplayChangedListener { int screen; - HashMap x11ProxyKeyMap = new HashMap(); + HashMap x11ProxyKeyMap = new HashMap<>(); private static AWTPermission fullScreenExclusivePermission; private static Boolean xrandrExtSupported; @@ -127,7 +127,7 @@ public class X11GraphicsDevice GraphicsConfiguration[] configs; GraphicsConfiguration defaultConfig; - HashSet doubleBufferVisuals; + HashSet doubleBufferVisuals; /** * Returns all of the graphics @@ -159,7 +159,7 @@ public class X11GraphicsDevice boolean dbeSupported = isDBESupported(); if (dbeSupported && doubleBufferVisuals == null) { - doubleBufferVisuals = new HashSet(); + doubleBufferVisuals = new HashSet<>(); getDoubleBufferVisuals(screen); } for ( ; i < num; i++) { @@ -249,7 +249,7 @@ public class X11GraphicsDevice int depth = getConfigDepth(0, screen); boolean doubleBuffer = false; if (isDBESupported() && doubleBufferVisuals == null) { - doubleBufferVisuals = new HashSet(); + doubleBufferVisuals = new HashSet<>(); getDoubleBufferVisuals(screen); doubleBuffer = doubleBufferVisuals.contains(Integer.valueOf(visNum)); diff --git a/jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java b/jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java index 547af9c3bed..02f491d6707 100644 --- a/jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java +++ b/jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java @@ -72,7 +72,7 @@ public class X11GraphicsEnvironment static { java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction() { + new java.security.PrivilegedAction() { public Object run() { System.loadLibrary("awt"); @@ -254,12 +254,12 @@ public class X11GraphicsEnvironment return true; } - Boolean result = (Boolean)java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction() { - public Object run() { + Boolean result = java.security.AccessController.doPrivileged( + new java.security.PrivilegedAction() { + public Boolean run() { InetAddress remAddr[] = null; - Enumeration locals = null; - Enumeration interfaces = null; + Enumeration locals = null; + Enumeration interfaces = null; try { interfaces = NetworkInterface.getNetworkInterfaces(); remAddr = InetAddress.getAllByName(hostName); @@ -275,7 +275,7 @@ public class X11GraphicsEnvironment } for (; interfaces.hasMoreElements();) { - locals = ((NetworkInterface)interfaces.nextElement()).getInetAddresses(); + locals = interfaces.nextElement().getInetAddresses(); for (; locals.hasMoreElements();) { for (int i = 0; i < remAddr.length; i++) { if (locals.nextElement().equals(remAddr[i])) { diff --git a/jdk/src/solaris/classes/sun/awt/X11InputMethod.java b/jdk/src/solaris/classes/sun/awt/X11InputMethod.java index 29135e1a37c..444a2a66aaf 100644 --- a/jdk/src/solaris/classes/sun/awt/X11InputMethod.java +++ b/jdk/src/solaris/classes/sun/awt/X11InputMethod.java @@ -100,7 +100,7 @@ public abstract class X11InputMethod extends InputMethodAdapter { private boolean isLastTemporary = false; private boolean isActive = false; private boolean isActiveClient = false; - private static Map[] highlightStyles; + private static Map[] highlightStyles; private boolean disposed = false; //reset the XIC if necessary @@ -136,31 +136,29 @@ public abstract class X11InputMethod extends InputMethodAdapter { // Initialize highlight mapping table static { - Map styles[] = new Map[4]; - HashMap map; + @SuppressWarnings({"unchecked", "rawtypes"}) + Map styles[] = new Map[4]; + HashMap map; // UNSELECTED_RAW_TEXT_HIGHLIGHT - map = new HashMap(1); - map.put(TextAttribute.WEIGHT, - TextAttribute.WEIGHT_BOLD); + map = new HashMap<>(1); + map.put(TextAttribute.WEIGHT, TextAttribute.WEIGHT_BOLD); styles[0] = Collections.unmodifiableMap(map); // SELECTED_RAW_TEXT_HIGHLIGHT - map = new HashMap(1); - map.put(TextAttribute.SWAP_COLORS, - TextAttribute.SWAP_COLORS_ON); + map = new HashMap<>(1); + map.put(TextAttribute.SWAP_COLORS, TextAttribute.SWAP_COLORS_ON); styles[1] = Collections.unmodifiableMap(map); // UNSELECTED_CONVERTED_TEXT_HIGHLIGHT - map = new HashMap(1); + map = new HashMap<>(1); map.put(TextAttribute.INPUT_METHOD_UNDERLINE, - TextAttribute.UNDERLINE_LOW_ONE_PIXEL); + TextAttribute.UNDERLINE_LOW_ONE_PIXEL); styles[2] = Collections.unmodifiableMap(map); // SELECTED_CONVERTED_TEXT_HIGHLIGHT - map = new HashMap(1); - map.put(TextAttribute.SWAP_COLORS, - TextAttribute.SWAP_COLORS_ON); + map = new HashMap<>(1); + map.put(TextAttribute.SWAP_COLORS, TextAttribute.SWAP_COLORS_ON); styles[3] = Collections.unmodifiableMap(map); highlightStyles = styles; @@ -433,7 +431,7 @@ public abstract class X11InputMethod extends InputMethodAdapter { /** * @see java.awt.Toolkit#mapInputMethodHighlight */ - public static Map mapInputMethodHighlight(InputMethodHighlight highlight) { + public static Map mapInputMethodHighlight(InputMethodHighlight highlight) { int index; int state = highlight.getState(); if (state == InputMethodHighlight.RAW_TEXT) { diff --git a/jdk/src/solaris/classes/sun/awt/XSettings.java b/jdk/src/solaris/classes/sun/awt/XSettings.java index 987b80ba778..59fb9a08ad2 100644 --- a/jdk/src/solaris/classes/sun/awt/XSettings.java +++ b/jdk/src/solaris/classes/sun/awt/XSettings.java @@ -52,7 +52,7 @@ public class XSettings { * settings manager. * @return a Map of changed settings. */ - public Map update(byte[] data) { + public Map update(byte[] data) { return (new Update(data)).update(); } @@ -79,7 +79,7 @@ public class XSettings { private int nsettings = 0; private boolean isValid; - private HashMap updatedSettings; + private HashMap updatedSettings; /** @@ -113,7 +113,7 @@ public class XSettings { idx = 8; nsettings = getINT32(); - updatedSettings = new HashMap(); + updatedSettings = new HashMap<>(); isValid = true; } @@ -213,7 +213,7 @@ public class XSettings { /** * Update settings. */ - public Map update() { + public Map update() { if (!isValid) { return null; } diff --git a/jdk/src/solaris/classes/sun/awt/motif/MFontConfiguration.java b/jdk/src/solaris/classes/sun/awt/motif/MFontConfiguration.java index 6c28d201779..b1d05fa671a 100644 --- a/jdk/src/solaris/classes/sun/awt/motif/MFontConfiguration.java +++ b/jdk/src/solaris/classes/sun/awt/motif/MFontConfiguration.java @@ -67,7 +67,7 @@ public class MFontConfiguration extends FontConfiguration { * the fontconfig files. */ protected void initReorderMap() { - reorderMap = new HashMap(); + reorderMap = new HashMap<>(); if (osName == null) { /* null means SunOS */ initReorderMapForSolaris(); } else { @@ -240,7 +240,7 @@ public class MFontConfiguration extends FontConfiguration { return "sun.awt.Symbol"; } } - String encoding = (String) encodingMap.get(xlfdEncoding); + String encoding = encodingMap.get(xlfdEncoding); if (encoding == null) { encoding = "default"; } @@ -288,7 +288,7 @@ public class MFontConfiguration extends FontConfiguration { /* methods for table setup ***********************************************/ - private static HashMap encodingMap = new HashMap(); + private static HashMap encodingMap = new HashMap<>(); private void initTables() { // encodingMap maps XLFD encoding component to From 0224281ecb9eeb69639851c53592c664e51798f4 Mon Sep 17 00:00:00 2001 From: Yuri Nesterenko Date: Tue, 29 Apr 2014 14:32:38 +0400 Subject: [PATCH 20/50] 8041592: [TEST_BUG] Move 42 AWT hw/lw mixing tests to jdk Reviewed-by: anthony, pchelko --- .../Mixing/AWT_Mixing/FrameBorderCounter.java | 95 +++ .../GlassPaneOverlappingTestBase.java | 144 ++++ .../HierarchyBoundsListenerMixingTest.java | 692 +++++++++++++++ .../JButtonInGlassPaneOverlapping.java | 51 ++ .../Mixing/AWT_Mixing/JButtonOverlapping.java | 51 ++ .../AWT_Mixing/JColorChooserOverlapping.java | 54 ++ .../AWT_Mixing/JComboBoxOverlapping.java | 99 +++ .../JEditorPaneInGlassPaneOverlapping.java | 53 ++ .../AWT_Mixing/JEditorPaneOverlapping.java | 50 ++ .../JGlassPaneInternalFrameOverlapping.java | 127 +++ .../AWT_Mixing/JGlassPaneMoveOverlapping.java | 167 ++++ .../JInternalFrameMoveOverlapping.java | 124 +++ .../AWT_Mixing/JInternalFrameOverlapping.java | 102 +++ .../JLabelInGlassPaneOverlapping.java | 53 ++ .../Mixing/AWT_Mixing/JLabelOverlapping.java | 52 ++ .../JListInGlassPaneOverlapping.java | 50 ++ .../Mixing/AWT_Mixing/JListOverlapping.java | 49 ++ .../AWT_Mixing/JMenuBarOverlapping.java | 149 ++++ .../JPanelInGlassPaneOverlapping.java | 53 ++ .../Mixing/AWT_Mixing/JPanelOverlapping.java | 52 ++ .../AWT_Mixing/JPopupMenuOverlapping.java | 124 +++ .../JProgressBarInGlassPaneOverlapping.java | 53 ++ .../AWT_Mixing/JProgressBarOverlapping.java | 52 ++ .../JScrollBarInGlassPaneOverlapping.java | 67 ++ .../AWT_Mixing/JScrollBarOverlapping.java | 66 ++ .../AWT_Mixing/JScrollPaneOverlapping.java | 129 +++ .../JSliderInGlassPaneOverlapping.java | 52 ++ .../Mixing/AWT_Mixing/JSliderOverlapping.java | 51 ++ .../JSpinnerInGlassPaneOverlapping.java | 67 ++ .../AWT_Mixing/JSpinnerOverlapping.java | 64 ++ .../AWT_Mixing/JSplitPaneOverlapping.java | 130 +++ .../JTableInGlassPaneOverlapping.java | 87 ++ .../Mixing/AWT_Mixing/JTableOverlapping.java | 73 ++ .../JTextAreaInGlassPaneOverlapping.java | 53 ++ .../AWT_Mixing/JTextAreaOverlapping.java | 52 ++ .../JTextFieldInGlassPaneOverlapping.java | 53 ++ .../AWT_Mixing/JTextFieldOverlapping.java | 52 ++ .../JToggleButtonInGlassPaneOverlapping.java | 51 ++ .../AWT_Mixing/JToggleButtonOverlapping.java | 50 ++ .../AWT_Mixing/MixingFrameResizing.java | 127 +++ .../AWT_Mixing/MixingPanelsResizing.java | 462 ++++++++++ .../Mixing/AWT_Mixing/OpaqueOverlapping.java | 164 ++++ .../AWT_Mixing/OpaqueOverlappingChoice.java | 48 ++ .../AWT_Mixing/OverlappingTestBase.java | 800 ++++++++++++++++++ .../AWT_Mixing/SimpleOverlappingTestBase.java | 160 ++++ jdk/test/java/awt/Mixing/AWT_Mixing/Util.java | 601 +++++++++++++ .../AWT_Mixing/ViewportOverlapping.java | 151 ++++ 47 files changed, 6106 insertions(+) create mode 100644 jdk/test/java/awt/Mixing/AWT_Mixing/FrameBorderCounter.java create mode 100644 jdk/test/java/awt/Mixing/AWT_Mixing/GlassPaneOverlappingTestBase.java create mode 100644 jdk/test/java/awt/Mixing/AWT_Mixing/HierarchyBoundsListenerMixingTest.java create mode 100644 jdk/test/java/awt/Mixing/AWT_Mixing/JButtonInGlassPaneOverlapping.java create mode 100644 jdk/test/java/awt/Mixing/AWT_Mixing/JButtonOverlapping.java create mode 100644 jdk/test/java/awt/Mixing/AWT_Mixing/JColorChooserOverlapping.java create mode 100644 jdk/test/java/awt/Mixing/AWT_Mixing/JComboBoxOverlapping.java create mode 100644 jdk/test/java/awt/Mixing/AWT_Mixing/JEditorPaneInGlassPaneOverlapping.java create mode 100644 jdk/test/java/awt/Mixing/AWT_Mixing/JEditorPaneOverlapping.java create mode 100644 jdk/test/java/awt/Mixing/AWT_Mixing/JGlassPaneInternalFrameOverlapping.java create mode 100644 jdk/test/java/awt/Mixing/AWT_Mixing/JGlassPaneMoveOverlapping.java create mode 100644 jdk/test/java/awt/Mixing/AWT_Mixing/JInternalFrameMoveOverlapping.java create mode 100644 jdk/test/java/awt/Mixing/AWT_Mixing/JInternalFrameOverlapping.java create mode 100644 jdk/test/java/awt/Mixing/AWT_Mixing/JLabelInGlassPaneOverlapping.java create mode 100644 jdk/test/java/awt/Mixing/AWT_Mixing/JLabelOverlapping.java create mode 100644 jdk/test/java/awt/Mixing/AWT_Mixing/JListInGlassPaneOverlapping.java create mode 100644 jdk/test/java/awt/Mixing/AWT_Mixing/JListOverlapping.java create mode 100644 jdk/test/java/awt/Mixing/AWT_Mixing/JMenuBarOverlapping.java create mode 100644 jdk/test/java/awt/Mixing/AWT_Mixing/JPanelInGlassPaneOverlapping.java create mode 100644 jdk/test/java/awt/Mixing/AWT_Mixing/JPanelOverlapping.java create mode 100644 jdk/test/java/awt/Mixing/AWT_Mixing/JPopupMenuOverlapping.java create mode 100644 jdk/test/java/awt/Mixing/AWT_Mixing/JProgressBarInGlassPaneOverlapping.java create mode 100644 jdk/test/java/awt/Mixing/AWT_Mixing/JProgressBarOverlapping.java create mode 100644 jdk/test/java/awt/Mixing/AWT_Mixing/JScrollBarInGlassPaneOverlapping.java create mode 100644 jdk/test/java/awt/Mixing/AWT_Mixing/JScrollBarOverlapping.java create mode 100644 jdk/test/java/awt/Mixing/AWT_Mixing/JScrollPaneOverlapping.java create mode 100644 jdk/test/java/awt/Mixing/AWT_Mixing/JSliderInGlassPaneOverlapping.java create mode 100644 jdk/test/java/awt/Mixing/AWT_Mixing/JSliderOverlapping.java create mode 100644 jdk/test/java/awt/Mixing/AWT_Mixing/JSpinnerInGlassPaneOverlapping.java create mode 100644 jdk/test/java/awt/Mixing/AWT_Mixing/JSpinnerOverlapping.java create mode 100644 jdk/test/java/awt/Mixing/AWT_Mixing/JSplitPaneOverlapping.java create mode 100644 jdk/test/java/awt/Mixing/AWT_Mixing/JTableInGlassPaneOverlapping.java create mode 100644 jdk/test/java/awt/Mixing/AWT_Mixing/JTableOverlapping.java create mode 100644 jdk/test/java/awt/Mixing/AWT_Mixing/JTextAreaInGlassPaneOverlapping.java create mode 100644 jdk/test/java/awt/Mixing/AWT_Mixing/JTextAreaOverlapping.java create mode 100644 jdk/test/java/awt/Mixing/AWT_Mixing/JTextFieldInGlassPaneOverlapping.java create mode 100644 jdk/test/java/awt/Mixing/AWT_Mixing/JTextFieldOverlapping.java create mode 100644 jdk/test/java/awt/Mixing/AWT_Mixing/JToggleButtonInGlassPaneOverlapping.java create mode 100644 jdk/test/java/awt/Mixing/AWT_Mixing/JToggleButtonOverlapping.java create mode 100644 jdk/test/java/awt/Mixing/AWT_Mixing/MixingFrameResizing.java create mode 100644 jdk/test/java/awt/Mixing/AWT_Mixing/MixingPanelsResizing.java create mode 100644 jdk/test/java/awt/Mixing/AWT_Mixing/OpaqueOverlapping.java create mode 100644 jdk/test/java/awt/Mixing/AWT_Mixing/OpaqueOverlappingChoice.java create mode 100644 jdk/test/java/awt/Mixing/AWT_Mixing/OverlappingTestBase.java create mode 100644 jdk/test/java/awt/Mixing/AWT_Mixing/SimpleOverlappingTestBase.java create mode 100644 jdk/test/java/awt/Mixing/AWT_Mixing/Util.java create mode 100644 jdk/test/java/awt/Mixing/AWT_Mixing/ViewportOverlapping.java diff --git a/jdk/test/java/awt/Mixing/AWT_Mixing/FrameBorderCounter.java b/jdk/test/java/awt/Mixing/AWT_Mixing/FrameBorderCounter.java new file mode 100644 index 00000000000..a7380cece35 --- /dev/null +++ b/jdk/test/java/awt/Mixing/AWT_Mixing/FrameBorderCounter.java @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +import java.awt.Dimension; +import java.awt.EventQueue; +import java.awt.Frame; +import java.awt.Point; +import java.awt.Robot; +import java.awt.event.MouseEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.WindowEvent; +import java.awt.event.WindowAdapter; + +public class FrameBorderCounter { + + private static Frame frame; + private static Frame background; + private static Dimension size; + private static Point location; + private static Point entered; + + public static void main(String[] args) throws Exception { + final Robot robot = new Robot(); + EventQueue.invokeAndWait(new Runnable() { + public void run() { + robot.mouseMove(0, 0); + } + }); + EventQueue.invokeAndWait(new Runnable() { + public void run() { + background = new Frame(); + background.setBounds(100, 100, 300, 300); + background.addMouseListener(new MouseAdapter() { + @Override + public void mouseEntered(MouseEvent e) { + entered = e.getLocationOnScreen(); + System.err.println("[ENTERED] : " + entered); + } + }); + background.setVisible(true); + } + }); + EventQueue.invokeAndWait(new Runnable() { + public void run() { + frame = new Frame("Frame"); + frame.setBounds(200, 200, 100, 100); + frame.addWindowListener(new WindowAdapter() { + public void windowClosing(WindowEvent e) { + System.exit(0); + } + }); + frame.setVisible(true); + } + }); + Thread.sleep(1000); + EventQueue.invokeAndWait(new Runnable() { + public void run() { + location = frame.getLocationOnScreen(); + size = frame.getSize(); + } + }); + int out = 20; + for (int x = location.x + size.width - out; x <= location.x + size.width + out; ++x) { + robot.mouseMove(x, location.y + size.height / 2); + Thread.sleep(50); + } + System.err.println("[LOCATION] : " + location); + System.err.println("[SIZE] : " + size); + Thread.sleep(250); + int shift = entered.x - location.x - size.width - 1; + System.err.println("Done"); + System.out.println(shift); + frame.dispose(); + background.dispose(); + } +} diff --git a/jdk/test/java/awt/Mixing/AWT_Mixing/GlassPaneOverlappingTestBase.java b/jdk/test/java/awt/Mixing/AWT_Mixing/GlassPaneOverlappingTestBase.java new file mode 100644 index 00000000000..6b7ba1cc60e --- /dev/null +++ b/jdk/test/java/awt/Mixing/AWT_Mixing/GlassPaneOverlappingTestBase.java @@ -0,0 +1,144 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Container; +import java.awt.Point; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.InputEvent; +import java.lang.reflect.InvocationTargetException; +import javax.swing.JFrame; +import javax.swing.SpringLayout; +import javax.swing.SwingUtilities; + +/** + * Base class for testing overlapping of Swing and AWT component put into GlassPane. + * Validates drawing and event delivery at the components intersection. + *

See {@link OverlappingTestBase} for usage + * + * @author Sergey Grinev + */ +public abstract class GlassPaneOverlappingTestBase extends SimpleOverlappingTestBase { + + /** + * If true components is additionally tested to be correctly drawn after resize. + */ + protected boolean testResize = true; + private JFrame f = null; + private volatile Point ancestorLoc; + + /** + * Setups GlassPane with lightweight component returned by {@link SimpleOverlappingTestBase#getSwingComponent() } + * Called by base class. + */ + @Override + protected void prepareControls() { + wasLWClicked = false; + + if(f != null) { + f.setVisible(false); + } + f = new JFrame("Mixing : GlassPane Overlapping test"); + f.setLayout(new SpringLayout()); + f.setSize(200, 200); + + propagateAWTControls(f); + + f.getGlassPane().setVisible(true); + Container glassPane = (Container) f.getGlassPane(); + glassPane.setLayout(null); + + testedComponent = getSwingComponent(); + if (useDefaultClickValidation) { + testedComponent.addMouseListener(new MouseAdapter() { + + @Override + public void mouseClicked(MouseEvent e) { + //System.err.println("lw mouse clicked"); + wasLWClicked = true; + } + }); + } + testedComponent.setBounds(0, 0, testedComponent.getPreferredSize().width, testedComponent.getPreferredSize().height); + glassPane.add(testedComponent); + + f.setVisible(true); + } + + public GlassPaneOverlappingTestBase() { + super(); + } + + public GlassPaneOverlappingTestBase(boolean defaultClickValidation) { + super(defaultClickValidation); + } + + /** + * Run test by {@link OverlappingTestBase#clickAndBlink(java.awt.Robot, java.awt.Point) } validation for current lightweight component. + *

Also resize component and repeat validation in the resized area. + *

Called by base class. + * @return true if test passed + * @see GlassPaneOverlappingTestBase#testResize + */ + @Override + protected boolean performTest() { + if (!super.performTest()) { + return false; + } + if (testResize) { + wasLWClicked = false; + try { + SwingUtilities.invokeAndWait(new Runnable() { + + public void run() { + testedComponent.setBounds(0, 0, testedComponent.getPreferredSize().width, testedComponent.getPreferredSize().height + 20); + ancestorLoc = f.getLocationOnScreen(); + } + }); + } catch (InterruptedException ex) { + fail(ex.getMessage()); + } catch (InvocationTargetException ex) { + fail(ex.getMessage()); + } + Point lLoc = testedComponent.getLocationOnScreen(); + lLoc.translate(1, testedComponent.getPreferredSize().height + 1); + + /* this is a workaround for certain jtreg(?) focus issue: + tests fail starting after failing mixing tests but always pass alone. + */ + Util.waitForIdle(robot); + ancestorLoc.translate(f.getWidth()/2-15, 2); + robot.mouseMove(ancestorLoc.x, ancestorLoc.y); + Util.waitForIdle(robot); + robot.mousePress(InputEvent.BUTTON1_MASK); + robot.delay(50); + robot.mouseRelease(InputEvent.BUTTON1_MASK); + Util.waitForIdle(robot); + + clickAndBlink(robot, lLoc); + return wasLWClicked; + } else { + return true; + } + } +} diff --git a/jdk/test/java/awt/Mixing/AWT_Mixing/HierarchyBoundsListenerMixingTest.java b/jdk/test/java/awt/Mixing/AWT_Mixing/HierarchyBoundsListenerMixingTest.java new file mode 100644 index 00000000000..13e600b30e5 --- /dev/null +++ b/jdk/test/java/awt/Mixing/AWT_Mixing/HierarchyBoundsListenerMixingTest.java @@ -0,0 +1,692 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +import java.awt.*; +import java.awt.event.*; +import java.lang.reflect.InvocationTargetException; +import javax.swing.SwingUtilities; +import java.io.*; + +/** + * AWT Mixing test for HierarchyBoundsListener ancestors. + *

See CR6768230 for details. + */ +/* +@test +@bug 6768230 +@summary Mixing test for HierarchyBoundsListener ancestors +@build FrameBorderCounter +@run main HierarchyBoundsListenerMixingTest + */ +public class HierarchyBoundsListenerMixingTest { + + protected void prepareControls() { + dummy = new Frame(); + dummy.setSize(100, 100); + dummy.setLocation(0, 350); + dummy.setVisible(true); + + frame = new Frame("Test Frame"); + frame.setLayout(new FlowLayout()); + + panel = new Panel(); + button = new Button("Button"); + label = new Label("Label"); + list = new List(); + list.add("One"); + list.add("Two"); + list.add("Three"); + choice = new Choice(); + choice.add("Red"); + choice.add("Orange"); + choice.add("Yellow"); + checkbox = new Checkbox("Checkbox"); + scrollbar = new Scrollbar(Scrollbar.HORIZONTAL, 0, 1, 0, 255); + textfield = new TextField(15); + textarea = new TextArea(5, 15); + + components = new Component[] { + panel, button, label, list, choice, checkbox, scrollbar, textfield, textarea + }; + ancestorResized = new boolean[components.length]; + ancestorMoved = new boolean[components.length]; + + frame.addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent event) { + System.err.println("User closed the window"); + System.exit(1); + } + }); + + HierarchyBoundsListener listener = new HierarchyBoundsListenerImpl(); + for (int i = 0; i < components.length; i++) { + components[i].addHierarchyBoundsListener(listener); + frame.add(components[i]); + } + frame.setSize(300, 300); + frame.setVisible(true); + } + + private int frameBorderCounter() { + String JAVA_HOME = System.getProperty("java.home"); + + try { + Process p = Runtime.getRuntime().exec(JAVA_HOME + "/bin/java FrameBorderCounter"); + try { + p.waitFor(); + } catch (InterruptedException e) { + e.printStackTrace(); + throw new RuntimeException(e); + } + if (p.exitValue() != 0) { + throw new RuntimeException("FrameBorderCounter exited with not null code!\n" + readInputStream(p.getErrorStream())); + } + return Integer.parseInt(readInputStream(p.getInputStream()).trim()); + } catch (IOException e) { + e.printStackTrace(); + throw new RuntimeException(e); + } + } + + private String readInputStream(InputStream is) throws IOException { + byte[] buffer = new byte[4096]; + int len = 0; + StringBuilder sb = new StringBuilder(); + try (InputStreamReader isr = new InputStreamReader(is)) { + while ((len = is.read(buffer)) > 0) { + sb.append(new String(buffer, 0, len)); + } + } + return sb.toString(); + } + + protected boolean performTest() { + int BORDER_SHIFT = frameBorderCounter(); + BORDER_SHIFT = Math.abs(BORDER_SHIFT) == 1 ? BORDER_SHIFT : BORDER_SHIFT / 2; + Robot robot = null; + try { + robot = new Robot(); + Thread.sleep(delay * 10); + } catch (Exception e) { + e.printStackTrace(); + System.exit(1); + } + + robot.mouseMove((int) components[0].getLocationOnScreen().x + components[0].getSize().width / 2, + (int) components[0].getLocationOnScreen().y + components[0].getSize().height / 2); + robot.delay(delay); + robot.mousePress(InputEvent.BUTTON1_MASK); + robot.delay(delay); + robot.mouseRelease(InputEvent.BUTTON1_MASK); + robot.delay(delay); + + resetValues(); + try { + EventQueue.invokeAndWait(new Runnable() { + public void run() { + frame.setSize(new Dimension(frame.getSize().width + 10, frame.getSize().height + 10)); + frame.invalidate(); + frame.validate(); + } + }); + } catch (Exception e) { + e.printStackTrace(); + passed = false; + } + if (! resizeTriggered) { + synchronized (resizeLock) { + try { + resizeLock.wait(delay * 10); + } catch (Exception e) { + } + } + } + for (int i = 0; i < components.length; i++) { + if (! ancestorResized[i]) { + System.err.println("FAIL: Frame resized using API call. " + + "Ancestor resized event did not occur for " + components[i].getClass()); + passed = false; + } + } + if (moveCount > 0) { + System.err.println("FAIL: Ancestor moved event occured when Frame resized using API"); + passed = false; + } + robot.delay(delay * 5); + + resetValues(); + int x = (int) frame.getLocationOnScreen().x; + int y = (int) frame.getLocationOnScreen().y; + int w = frame.getSize().width; + int h = frame.getSize().height; + + robot.mouseMove(x + w + BORDER_SHIFT, y + h / 2); + robot.delay(delay); + robot.mousePress(InputEvent.BUTTON1_MASK); + robot.delay(delay); + for (int i = 0; i < 20; i++) { + robot.mouseMove(x + w + i + BORDER_SHIFT, y + h / 2); + robot.delay(50); + } + robot.delay(delay); + robot.mouseRelease(InputEvent.BUTTON1_MASK); + + if (! resizeTriggered) { + synchronized (resizeLock) { + try { + resizeLock.wait(delay * 10); + } catch (Exception e) { + } + } + } + + for (int i = 0; i < components.length; i++) { + if (! ancestorResized[i]) { + System.err.println("FAIL: Frame resized using mouse action. " + + "Ancestor resized event did not occur for " + + components[i].getClass()); + passed = false; + } + } + if (moveCount > 0) { + System.err.println("FAIL: Ancestor moved event occured when Frame resized using mouse"); + passed = false; + } + + resetValues(); + try { + EventQueue.invokeAndWait(new Runnable() { + public void run() { + frame.setLocation(frame.getLocation().x + 20, frame.getLocation().y + 20); + frame.invalidate(); + frame.validate(); + } + }); + } catch (Exception e) { + e.printStackTrace(); + passed = false; + } + if (! moveTriggered) { + synchronized (moveLock) { + try { + moveLock.wait(delay * 10); + } catch (Exception e) { + } + } + } + for (int i = 0; i < components.length; i++) { + if (! ancestorMoved[i]) { + System.err.println("FAIL: Frame moved using API call. " + + "Ancestor moved event did not occur for " + components[i].getClass()); + passed = false; + } + } + if (resizeCount > 0) { + System.err.println("FAIL: Ancestor resized event occured when Frame moved using API"); + passed = false; + } + robot.delay(delay * 10); + + resetValues(); + x = (int) frame.getLocationOnScreen().x; + y = (int) frame.getLocationOnScreen().y; + w = frame.getSize().width; + h = frame.getSize().height; + + //Click on the dummy frame so that the test frame loses focus. This is to workaround + //a bug in Linux AS. + robot.mouseMove((int) dummy.getLocationOnScreen().x + dummy.getSize().width / 2, + (int) dummy.getLocationOnScreen().y + dummy.getSize().height / 2); + robot.delay(delay); + robot.mousePress(InputEvent.BUTTON1_MASK); + robot.delay(delay); + robot.mouseRelease(InputEvent.BUTTON1_MASK); + robot.delay(delay); + + robot.mouseMove(x + w / 2, y + 10); + robot.delay(delay); + robot.mousePress(InputEvent.BUTTON1_MASK); + robot.delay(delay); + for (int i = 1; i <= 20; i++) { + robot.mouseMove(x + w / 2 + i, y + 10); + robot.delay(50); + } + robot.delay(delay); + robot.mouseRelease(InputEvent.BUTTON1_MASK); + + if (! moveTriggered) { + synchronized (moveLock) { + try { + moveLock.wait(delay * 10); + } catch (Exception e) { + } + } + } + + for (int i = 0; i < components.length; i++) { + if (! ancestorMoved[i]) { + System.err.println("FAIL: Frame moved using mouse action. " + + "Ancestor moved event did not occur for " + components[i].getClass()); + passed = false; + } + } + if (resizeCount > 0) { + System.err.println("FAIL: Ancestor resized event occured when Frame moved using mouse"); + passed = false; + } + + return passed; + } + + private void resetValues() { + moveTriggered = false; + resizeTriggered = false; + moveCount = 0; + resizeCount = 0; + for (int i = 0; i < ancestorResized.length; i++) { + ancestorResized[i] = false; + ancestorMoved[i] = false; + } + } + + private void keyType(int key, Robot robot) throws Exception { + robot.keyPress(key); + robot.delay(keyDelay); + robot.keyRelease(key); + robot.delay(keyDelay); + } + + class HierarchyBoundsListenerImpl implements HierarchyBoundsListener { + // checks for Ancestor_Moved events + public void ancestorMoved(HierarchyEvent ce) { + if (check) { + System.out.println("Moved " + ce.getComponent()); + } + for (int i = 0; i < components.length; i++) { + if (components[i].equals(ce.getComponent())) { + //setting this array for purpose of checking ancestor_moved. + ancestorMoved[i] = true; + moveCount++; + if (moveCount == components.length) { + moveTriggered = true; + synchronized (moveLock) { + try { + moveLock.notifyAll(); + } catch (Exception e) { + } + } + } + } + } + } + // checks for Ancestor_Moved events + public void ancestorResized(HierarchyEvent ce) { + if (check) { + System.out.println("Resized " + ce.getComponent()); + } + for (int i = 0; i < components.length; i++) { + if (components[i].equals(ce.getComponent())) { + if (! frame.equals(ce.getChanged()) || ce.getChangedParent() != null) { + System.err.println("FAIL: Invalid value of HierarchyEvent.getXXX"); + System.err.println("ce.getChanged() : " + ce.getChanged()); + System.err.println("ce.getChangedParent() : " + ce.getChangedParent()); + passed = false; + } + //setting this array for purpose of checking ancestor_resized + ancestorResized[i] = true; + resizeCount++; + if (resizeCount == components.length) { + resizeTriggered = true; + synchronized (resizeLock) { + try { + resizeLock.notifyAll(); + } catch (Exception e) { + } + } + } + } + } + } + } + + private Frame frame, dummy; + private Panel panel; + private Button button; + private Label label; + private List list; + private Choice choice; + private Checkbox checkbox; + private Scrollbar scrollbar; + private TextField textfield; + private TextArea textarea; + private Component[] components; + private boolean[] ancestorResized; + private boolean[] ancestorMoved; + + private int delay = 500; + private int keyDelay = 50; + private int moveCount = 0; + private int resizeCount = 0; + + private boolean passed = true; + private boolean moveTriggered = false; + private boolean resizeTriggered = false; + private final Object moveLock = new Object(); + private final Object resizeLock = new Object(); + + private boolean check = false; + + private void invoke() throws InterruptedException { + try { + SwingUtilities.invokeAndWait(new Runnable() { + + public void run() { + prepareControls(); + } + }); + try { + Thread.sleep(1000); // wait for graphic effects on systems like Win7 + } catch (InterruptedException ex) { + } + if (!performTest()) { + fail("Test failed"); + } + } catch (InvocationTargetException ex) { + fail(ex.getMessage()); + } + } + + /***************************************************** + * Standard Test Machinery Section + * DO NOT modify anything in this section -- it's a + * standard chunk of code which has all of the + * synchronisation necessary for the test harness. + * By keeping it the same in all tests, it is easier + * to read and understand someone else's test, as + * well as insuring that all tests behave correctly + * with the test harness. + * There is a section following this for test- + * classes + ******************************************************/ + private static void init() throws InterruptedException { + //*** Create instructions for the user here *** + //System.setProperty("sun.awt.disableMixing", "true"); + + String[] instructions = { + "This is an AUTOMATIC test, simply wait until it is done.", + "The result (passed or failed) will be shown in the", + "message window below." + }; + Sysout.createDialog(); + Sysout.printInstructions(instructions); + + HierarchyBoundsListenerMixingTest instance = new HierarchyBoundsListenerMixingTest(); + + instance.invoke(); + + pass(); + }//End init() + private static boolean theTestPassed = false; + private static boolean testGeneratedInterrupt = false; + private static String failureMessage = ""; + private static Thread mainThread = null; + private static int sleepTime = 300000; + + // Not sure about what happens if multiple of this test are + // instantiated in the same VM. Being static (and using + // static vars), it aint gonna work. Not worrying about + // it for now. + public static void main(String args[]) throws InterruptedException { + mainThread = Thread.currentThread(); + try { + init(); + } catch (TestPassedException e) { + //The test passed, so just return from main and harness will + // interepret this return as a pass + return; + } + //At this point, neither test pass nor test fail has been + // called -- either would have thrown an exception and ended the + // test, so we know we have multiple threads. + + //Test involves other threads, so sleep and wait for them to + // called pass() or fail() + try { + Thread.sleep(sleepTime); + //Timed out, so fail the test + throw new RuntimeException("Timed out after " + sleepTime / 1000 + " seconds"); + } catch (InterruptedException e) { + //The test harness may have interrupted the test. If so, rethrow the exception + // so that the harness gets it and deals with it. + if (!testGeneratedInterrupt) { + throw e; + } + + //reset flag in case hit this code more than once for some reason (just safety) + testGeneratedInterrupt = false; + + if (theTestPassed == false) { + throw new RuntimeException(failureMessage); + } + } + + }//main + + public static synchronized void setTimeoutTo(int seconds) { + sleepTime = seconds * 1000; + } + + public static synchronized void pass() { + Sysout.println("The test passed."); + Sysout.println("The test is over, hit Ctl-C to stop Java VM"); + //first check if this is executing in main thread + if (mainThread == Thread.currentThread()) { + //Still in the main thread, so set the flag just for kicks, + // and throw a test passed exception which will be caught + // and end the test. + theTestPassed = true; + throw new TestPassedException(); + } + theTestPassed = true; + testGeneratedInterrupt = true; + mainThread.interrupt(); + }//pass() + + public static synchronized void fail() { + //test writer didn't specify why test failed, so give generic + fail("it just plain failed! :-)"); + } + + public static synchronized void fail(String whyFailed) { + Sysout.println("The test failed: " + whyFailed); + Sysout.println("The test is over, hit Ctl-C to stop Java VM"); + //check if this called from main thread + if (mainThread == Thread.currentThread()) { + //If main thread, fail now 'cause not sleeping + throw new RuntimeException(whyFailed); + } + theTestPassed = false; + testGeneratedInterrupt = true; + failureMessage = whyFailed; + mainThread.interrupt(); + }//fail() +}// class LWComboBox +class TestPassedException extends RuntimeException { +} + +//*********** End Standard Test Machinery Section ********** +//************ Begin classes defined for the test **************** +// if want to make listeners, here is the recommended place for them, then instantiate +// them in init() + +/* Example of a class which may be written as part of a test +class NewClass implements anInterface +{ +static int newVar = 0; + +public void eventDispatched(AWTEvent e) +{ +//Counting events to see if we get enough +eventCount++; + +if( eventCount == 20 ) +{ +//got enough events, so pass + +LWComboBox.pass(); +} +else if( tries == 20 ) +{ +//tried too many times without getting enough events so fail + +LWComboBox.fail(); +} + +}// eventDispatched() + +}// NewClass class + + */ +//************** End classes defined for the test ******************* +/**************************************************** +Standard Test Machinery +DO NOT modify anything below -- it's a standard +chunk of code whose purpose is to make user +interaction uniform, and thereby make it simpler +to read and understand someone else's test. + ****************************************************/ +/** +This is part of the standard test machinery. +It creates a dialog (with the instructions), and is the interface +for sending text messages to the user. +To print the instructions, send an array of strings to Sysout.createDialog +WithInstructions method. Put one line of instructions per array entry. +To display a message for the tester to see, simply call Sysout.println +with the string to be displayed. +This mimics System.out.println but works within the test harness as well +as standalone. + */ +class Sysout { + + private static TestDialog dialog; + + public static void createDialogWithInstructions(String[] instructions) { + dialog = new TestDialog(new Frame(), "Instructions"); + dialog.printInstructions(instructions); + dialog.setVisible(true); + println("Any messages for the tester will display here."); + } + + public static void createDialog() { + dialog = new TestDialog(new Frame(), "Instructions"); + String[] defInstr = {"Instructions will appear here. ", ""}; + dialog.printInstructions(defInstr); + dialog.setVisible(true); + println("Any messages for the tester will display here."); + } + + public static void printInstructions(String[] instructions) { + dialog.printInstructions(instructions); + } + + public static void println(String messageIn) { + dialog.displayMessage(messageIn); + System.out.println(messageIn); + } +}// Sysout class + +/** +This is part of the standard test machinery. It provides a place for the +test instructions to be displayed, and a place for interactive messages +to the user to be displayed. +To have the test instructions displayed, see Sysout. +To have a message to the user be displayed, see Sysout. +Do not call anything in this dialog directly. + */ +class TestDialog extends Dialog { + + TextArea instructionsText; + TextArea messageText; + int maxStringLength = 80; + + //DO NOT call this directly, go through Sysout + public TestDialog(Frame frame, String name) { + super(frame, name); + int scrollBoth = TextArea.SCROLLBARS_BOTH; + instructionsText = new TextArea("", 15, maxStringLength, scrollBoth); + add("North", instructionsText); + + messageText = new TextArea("", 5, maxStringLength, scrollBoth); + add("Center", messageText); + + pack(); + + setVisible(true); + }// TestDialog() + + //DO NOT call this directly, go through Sysout + public void printInstructions(String[] instructions) { + //Clear out any current instructions + instructionsText.setText(""); + + //Go down array of instruction strings + + String printStr, remainingStr; + for (int i = 0; i < instructions.length; i++) { + //chop up each into pieces maxSringLength long + remainingStr = instructions[i]; + while (remainingStr.length() > 0) { + //if longer than max then chop off first max chars to print + if (remainingStr.length() >= maxStringLength) { + //Try to chop on a word boundary + int posOfSpace = remainingStr.lastIndexOf(' ', maxStringLength - 1); + + if (posOfSpace <= 0) { + posOfSpace = maxStringLength - 1; + } + + printStr = remainingStr.substring(0, posOfSpace + 1); + remainingStr = remainingStr.substring(posOfSpace + 1); + } //else just print + else { + printStr = remainingStr; + remainingStr = ""; + } + + instructionsText.append(printStr + "\n"); + + }// while + + }// for + + }//printInstructions() + + //DO NOT call this directly, go through Sysout + public void displayMessage(String messageIn) { + messageText.append(messageIn + "\n"); + System.out.println(messageIn); + } +}// TestDialog class + diff --git a/jdk/test/java/awt/Mixing/AWT_Mixing/JButtonInGlassPaneOverlapping.java b/jdk/test/java/awt/Mixing/AWT_Mixing/JButtonInGlassPaneOverlapping.java new file mode 100644 index 00000000000..11aef8209bd --- /dev/null +++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JButtonInGlassPaneOverlapping.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +import javax.swing.*; + +/** + * AWT/Swing overlapping test for {@link javax.swing.JButton } component in GlassPane. + *

See base class for details. + */ +/* +@test +@summary Simple Overlapping test for javax.swing.JButton +@author sergey.grinev@oracle.com: area=awt.mixing +@run main JButtonInGlassPaneOverlapping + */ +public class JButtonInGlassPaneOverlapping extends GlassPaneOverlappingTestBase { + + @Override + protected JComponent getSwingComponent() { + JButton ch = new JButton(); + ch.setText("Swing component"); + return ch; + } + + // this strange plumbing stuff is required due to "Standard Test Machinery" in base class + public static void main(String args[]) throws InterruptedException { + instance = new JButtonInGlassPaneOverlapping(); + OverlappingTestBase.doMain(args); + } +} diff --git a/jdk/test/java/awt/Mixing/AWT_Mixing/JButtonOverlapping.java b/jdk/test/java/awt/Mixing/AWT_Mixing/JButtonOverlapping.java new file mode 100644 index 00000000000..119c131cc85 --- /dev/null +++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JButtonOverlapping.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +import javax.swing.*; + +/** + * AWT/Swing overlapping test for {@link javax.swing.JButton } component. + *

See base class for details. + */ +/* +@test +@summary Simple Overlapping test for javax.swing.JButton +@author sergey.grinev@oracle.com: area=awt.mixing +@run main JButtonOverlapping + */ +public class JButtonOverlapping extends SimpleOverlappingTestBase { + + @Override + protected JComponent getSwingComponent() { + JButton ch = new JButton(); + ch.setText("Swing component"); + return ch; + } + + // this strange plumbing stuff is required due to "Standard Test Machinery" in base class + public static void main(String args[]) throws InterruptedException { + instance = new JButtonOverlapping(); + OverlappingTestBase.doMain(args); + } +} diff --git a/jdk/test/java/awt/Mixing/AWT_Mixing/JColorChooserOverlapping.java b/jdk/test/java/awt/Mixing/AWT_Mixing/JColorChooserOverlapping.java new file mode 100644 index 00000000000..c756041db65 --- /dev/null +++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JColorChooserOverlapping.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import javax.swing.*; + +/** + * AWT/Swing overlapping test for {@link javax.swing.JColorChooser } component. + *

See base class for details. + */ +/* +@test +@summary Simple Overlapping test for javax.swing.JColorChooser +@author sergey.grinev@oracle.com: area=awt.mixing +@run main JColorChooserOverlapping + */ +public class JColorChooserOverlapping extends SimpleOverlappingTestBase { + + public JColorChooserOverlapping() { + super(false); + } + + @Override + protected JComponent getSwingComponent() { + wasLWClicked = true; + JColorChooser ch = new JColorChooser(); + return ch; + } + + // this strange plumbing stuff is required due to "Standard Test Machinery" in base class + public static void main(String args[]) throws InterruptedException { + instance = new JColorChooserOverlapping(); + OverlappingTestBase.doMain(args); + } +} diff --git a/jdk/test/java/awt/Mixing/AWT_Mixing/JComboBoxOverlapping.java b/jdk/test/java/awt/Mixing/AWT_Mixing/JComboBoxOverlapping.java new file mode 100644 index 00000000000..b0887068a09 --- /dev/null +++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JComboBoxOverlapping.java @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Point; +import java.awt.Robot; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import javax.swing.BoxLayout; +import javax.swing.JComboBox; +import javax.swing.JFrame; + +/** + * AWT/Swing overlapping test for {@link javax.swing.JCombobox } component. + *

This test creates combobox and test if heavyweight component is drawn correctly then dropdown is shown. + *

See base class for details. + */ +/* +@test +@summary Overlapping test for javax.swing.JScrollPane +@author sergey.grinev@oracle.com: area=awt.mixing +@run main JComboBoxOverlapping + */ +public class JComboBoxOverlapping extends OverlappingTestBase { + + private boolean lwClicked = false; + private Point loc; + private Point loc2; + + {testEmbeddedFrame = true;} + + protected void prepareControls() { + final JFrame frame = new JFrame("Mixing : Dropdown Overlapping test"); + frame.getContentPane().setLayout(new BoxLayout(frame.getContentPane(), BoxLayout.Y_AXIS)); + frame.setSize(200, 200); + frame.setVisible(true); + + final JComboBox cb = new JComboBox(petStrings); + cb.setPreferredSize(new Dimension(frame.getContentPane().getWidth(), 20)); + cb.addActionListener(new ActionListener() { + + public void actionPerformed(ActionEvent e) { + if (e.getSource() == cb) { + lwClicked = true; + } + } + }); + + frame.add(cb); + propagateAWTControls(frame); + frame.setVisible(true); + loc = cb.getLocationOnScreen(); + loc2 = frame.getContentPane().getLocationOnScreen(); + } + + @Override + protected boolean performTest() { + // run robot + Robot robot = Util.createRobot(); + robot.setAutoDelay(ROBOT_DELAY); + + loc2.translate(75, 75); + pixelPreCheck(robot, loc2, currentAwtControl); + + loc.translate(3, 3); + clickAndBlink(robot, loc, false); + + clickAndBlink(robot, loc2, false); + + return lwClicked; + } + + // this strange plumbing stuff is required due to "Standard Test Machinery" in base class + public static void main(String args[]) throws InterruptedException { + instance = new JComboBoxOverlapping(); + OverlappingTestBase.doMain(args); + } +} diff --git a/jdk/test/java/awt/Mixing/AWT_Mixing/JEditorPaneInGlassPaneOverlapping.java b/jdk/test/java/awt/Mixing/AWT_Mixing/JEditorPaneInGlassPaneOverlapping.java new file mode 100644 index 00000000000..d14f078aa2d --- /dev/null +++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JEditorPaneInGlassPaneOverlapping.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +import java.awt.Point; +import javax.swing.*; + +/** + * AWT/Swing overlapping test for {@link javax.swing.JBEditorPane } component in GlassPane. + *

See base class for details. + */ +/* +@test +@summary Simple Overlapping test for javax.swing.JLabel +@author sergey.grinev@oracle.com: area=awt.mixing +@run main JEditorPaneInGlassPaneOverlapping + */ +public class JEditorPaneInGlassPaneOverlapping extends GlassPaneOverlappingTestBase { + + @Override + protected JComponent getSwingComponent() { + JEditorPane ch = new JEditorPane(); + ch.setText("Swing component"); + OverlappingTestBase.shift = new Point(12, 12); + return ch; + } + + // this strange plumbing stuff is required due to "Standard Test Machinery" in base class + public static void main(String args[]) throws InterruptedException { + instance = new JEditorPaneInGlassPaneOverlapping(); + OverlappingTestBase.doMain(args); + } +} diff --git a/jdk/test/java/awt/Mixing/AWT_Mixing/JEditorPaneOverlapping.java b/jdk/test/java/awt/Mixing/AWT_Mixing/JEditorPaneOverlapping.java new file mode 100644 index 00000000000..513ca0dce7f --- /dev/null +++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JEditorPaneOverlapping.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import javax.swing.*; + +/** + * AWT/Swing overlapping test for {@link javax.swing.JEditorPane } component. + *

See base class for details. + */ +/* +@test +@summary Simple Overlapping test for javax.swing.JLabel +@author sergey.grinev@oracle.com: area=awt.mixing +@run main JEditorPaneOverlapping + */ +public class JEditorPaneOverlapping extends SimpleOverlappingTestBase { + + @Override + protected JComponent getSwingComponent() { + JEditorPane ch = new JEditorPane(); + ch.setText("Swing component"); + return ch; + } + + // this strange plumbing stuff is required due to "Standard Test Machinery" in base class + public static void main(String args[]) throws InterruptedException { + instance = new JEditorPaneOverlapping(); + OverlappingTestBase.doMain(args); + } +} diff --git a/jdk/test/java/awt/Mixing/AWT_Mixing/JGlassPaneInternalFrameOverlapping.java b/jdk/test/java/awt/Mixing/AWT_Mixing/JGlassPaneInternalFrameOverlapping.java new file mode 100644 index 00000000000..3e2575375e8 --- /dev/null +++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JGlassPaneInternalFrameOverlapping.java @@ -0,0 +1,127 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Container; +import java.awt.Point; +import java.awt.Robot; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import javax.swing.JFrame; +import javax.swing.JInternalFrame; +import javax.swing.SwingUtilities; + +/** + * AWT/Swing overlapping test with JInternalFrame being put in GlassPane. + * See JDK-6637655 and + * JDK-6985776. + *

See base class for details. + */ +/* +@test +@bug 6637655 6985776 +@summary Overlapping test for javax.swing.JScrollPane +@author sergey.grinev@oracle.com: area=awt.mixing +@run main JGlassPaneInternalFrameOverlapping + */ +public class JGlassPaneInternalFrameOverlapping extends OverlappingTestBase { + + private boolean lwClicked = true; + private Point lLoc; + private Point lLoc2; + private JInternalFrame internalFrame; + + protected boolean performTest() { + try { + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + lLoc = internalFrame.getContentPane().getLocationOnScreen(); + lLoc2 = lLoc.getLocation(); + lLoc2.translate(0, internalFrame.getContentPane().getHeight() + 10); + } + }); + } catch (Exception e) { + e.printStackTrace(); + System.exit(1); + } + // run robot + Robot robot = Util.createRobot(); + robot.setAutoDelay(ROBOT_DELAY); + + clickAndBlink(robot, lLoc); + + Color c = robot.getPixelColor(lLoc2.x, lLoc2.y); + robot.mouseMove(lLoc2.x, lLoc2.y); + if (!c.equals(AWT_BACKGROUND_COLOR) && + currentAwtControl.getClass() != java.awt.Scrollbar.class && + currentAwtControl.getClass() != java.awt.Choice.class) { + fail("The HW component did not pass pixel color check and is not drawn correctly"); + } + + return lwClicked; + } + + // {debugClassName = "Choice";} + + @Override + protected void prepareControls() { + JFrame frame = new JFrame("Glass Pane children test"); + frame.setLayout(null); + + Container contentPane = frame.getContentPane(); + contentPane.setLayout(new BorderLayout()); + super.propagateAWTControls(contentPane); + + Container glassPane = (Container) frame.getRootPane().getGlassPane(); + glassPane.setVisible(true); + glassPane.setLayout(null); + + internalFrame = new JInternalFrame("Internal Frame", true); + internalFrame.setBounds(50, 0, 200, 100); + internalFrame.setVisible(true); + glassPane.add(internalFrame); + + internalFrame.addMouseListener(new MouseAdapter() { + + @Override + public void mouseClicked(MouseEvent e) { + lwClicked = true; + } + }); + + frame.setSize(300, 180); + frame.setLocationRelativeTo(null); + frame.setVisible(true); + } + + // this strange plumbing stuff is required due to "Standard Test Machinery" in base class + public static void main(String args[]) throws InterruptedException { + if (System.getProperty("os.name").toLowerCase().contains("os x")) { + System.out.println("Aqua L&F ignores setting color to component. Test passes on Mac OS X."); + return; + } + instance = new JGlassPaneInternalFrameOverlapping(); + OverlappingTestBase.doMain(args); + } +} diff --git a/jdk/test/java/awt/Mixing/AWT_Mixing/JGlassPaneMoveOverlapping.java b/jdk/test/java/awt/Mixing/AWT_Mixing/JGlassPaneMoveOverlapping.java new file mode 100644 index 00000000000..43e060a2438 --- /dev/null +++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JGlassPaneMoveOverlapping.java @@ -0,0 +1,167 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Container; +import java.awt.Point; +import java.awt.Robot; +import java.awt.event.InputEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import javax.swing.JFrame; +import javax.swing.JInternalFrame; +import javax.swing.SwingUtilities; + +/** + * AWT/Swing overlapping test with JInternalFrame being moved in GlassPane. + * See JDK-6637655 and + * JDK-6981919. + *

See base class for details. + */ +/* +@test +@bug 6637655 6981919 +@summary Overlapping test for javax.swing.JScrollPane +@author sergey.grinev@oracle.com: area=awt.mixing +@run main JGlassPaneMoveOverlapping + */ +public class JGlassPaneMoveOverlapping extends OverlappingTestBase { + + private boolean lwClicked = true; + private volatile Point lLoc; + private volatile Point lLoc2; + + private JInternalFrame internalFrame; + private JFrame frame = null; + private volatile Point frameLoc; + + protected boolean performTest() { + + try { + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + lLoc = internalFrame.getContentPane().getLocationOnScreen(); + lLoc2 = lLoc.getLocation(); + lLoc2.translate(0, internalFrame.getHeight()); + frameLoc = frame.getLocationOnScreen(); + frameLoc.translate(frame.getWidth()/2, 3); + } + }); + } catch (Exception e) { + e.printStackTrace(); + System.exit(1); + } + + // run robot + Robot robot = Util.createRobot(); + robot.setAutoDelay(ROBOT_DELAY); + + // force focus on JFrame (jtreg workaround) + robot.mouseMove(frameLoc.x, frameLoc.y); + Util.waitForIdle(robot); + robot.mousePress(InputEvent.BUTTON1_MASK); + robot.delay(50); + robot.mouseRelease(InputEvent.BUTTON1_MASK); + Util.waitForIdle(robot); + + + //slow move + robot.mouseMove(lLoc.x + 25, lLoc.y - 5); + robot.mousePress(InputEvent.BUTTON1_MASK); + robot.delay(100); + robot.mouseMove(lLoc.x + 45, lLoc.y - 5); + robot.delay(100); + robot.mouseMove(lLoc.x + internalWidth - 75, lLoc.y - 5); + robot.delay(100); + robot.mouseMove(lLoc.x + internalWidth - 55, lLoc.y - 5); + robot.delay(100); + robot.mouseRelease(InputEvent.BUTTON1_MASK); + + Color c2 = robot.getPixelColor(lLoc.x + internalWidth + 15, lLoc.y - 5); + if (c2.equals(AWT_BACKGROUND_COLOR)) { + error("Foreground frame is not drawn properly"); + } + Color c = robot.getPixelColor(lLoc.x + internalWidth - 95, lLoc.y + 5); + robot.mouseMove(lLoc.x + internalWidth - 95, lLoc.y + 5); + System.out.println("color: " + c + " " + AWT_BACKGROUND_COLOR); + if (!c.equals(AWT_BACKGROUND_COLOR) && currentAwtControl.getClass() != java.awt.Scrollbar.class) { + error("Background AWT component is not drawn properly"); + } + + return true; + } + + // {debugClassName = "Choice";} + + private static void error(String st) { + //System.out.println(st); + fail(st); + } + + private static final int internalWidth = 200; + + @Override + protected void prepareControls() { + if(frame != null) { + frame.setVisible(false); + } + frame = new JFrame("Glass Pane children test"); + frame.setLayout(null); + + Container contentPane = frame.getContentPane(); + contentPane.setLayout(new BorderLayout()); + super.propagateAWTControls(contentPane); + + Container glassPane = (Container) frame.getRootPane().getGlassPane(); + glassPane.setVisible(true); + glassPane.setLayout(null); + + internalFrame = new JInternalFrame("Internal Frame", true); + internalFrame.setBounds(50, 0, internalWidth, 100); + internalFrame.setVisible(true); + glassPane.add(internalFrame); + + internalFrame.addMouseListener(new MouseAdapter() { + + @Override + public void mouseClicked(MouseEvent e) { + lwClicked = true; + } + }); + + frame.setSize(400, 180); + frame.setLocationRelativeTo(null); + frame.setVisible(true); + } + + // this strange plumbing stuff is required due to "Standard Test Machinery" in base class + public static void main(String args[]) throws InterruptedException { + if (System.getProperty("os.name").toLowerCase().contains("os x")) { + System.out.println("Aqua L&F ignores setting color to component. Test passes on Mac OS X."); + return; + } + instance = new JGlassPaneMoveOverlapping(); + OverlappingTestBase.doMain(args); + } +} diff --git a/jdk/test/java/awt/Mixing/AWT_Mixing/JInternalFrameMoveOverlapping.java b/jdk/test/java/awt/Mixing/AWT_Mixing/JInternalFrameMoveOverlapping.java new file mode 100644 index 00000000000..99a9e015921 --- /dev/null +++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JInternalFrameMoveOverlapping.java @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Point; +import java.awt.Robot; +import java.awt.event.InputEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import javax.swing.JButton; +import javax.swing.JDesktopPane; +import javax.swing.JFrame; +import javax.swing.JInternalFrame; + +/** + * AWT/Swing overlapping test for {@link javax.swing.JInternalFrame } component during move. + *

See CR6768230 for details and base class for test info. + */ +/* +@test +@bug 6985399 +@summary Overlapping test for javax.swing.JScrollPane +@author sergey.grinev@oracle.com: area=awt.mixing +@run main JInternalFrameMoveOverlapping + */ +public class JInternalFrameMoveOverlapping extends OverlappingTestBase { + + private boolean lwClicked = true; + private Point locTopFrame; + private Point locTarget; + + protected boolean performTest() { + // run robot + Robot robot = Util.createRobot(); + robot.setAutoDelay(ROBOT_DELAY); + + robot.mouseMove(locTopFrame.x + 25, locTopFrame.y + 25); + robot.mousePress(InputEvent.BUTTON1_MASK); + try { + Thread.sleep(500); + } catch (InterruptedException ex) { + } + robot.mouseMove(locTopFrame.x + (locTarget.x - locTopFrame.x)/2, locTopFrame.y + (locTarget.y - locTopFrame.y)/2); + try { + Thread.sleep(500); + } catch (InterruptedException ex) { + } + robot.mouseMove(locTarget.x, locTarget.y); + try { + Thread.sleep(500); + } catch (InterruptedException ex) { + } + robot.mouseRelease(InputEvent.BUTTON1_MASK); + + clickAndBlink(robot, locTarget); + + return lwClicked; + } + + //static {debugClassName = "Choice";} + + @Override + protected void prepareControls() { + + + JDesktopPane desktopPane = new JDesktopPane(); + + JInternalFrame bottomFrame = new JInternalFrame("bottom frame", false, false, false, false); + bottomFrame.setSize(220, 220); + super.propagateAWTControls(bottomFrame); + desktopPane.add(bottomFrame); + bottomFrame.setVisible(true); + + JInternalFrame topFrame = new JInternalFrame("top frame", false, false, false, false); + topFrame.setSize(200, 200); + topFrame.add(new JButton("LW Button") { + + { + addMouseListener(new MouseAdapter() { + + @Override + public void mouseClicked(MouseEvent e) { + lwClicked = true; + } + }); + } + }); + desktopPane.add(topFrame); + topFrame.setVisible(true); + + JFrame frame = new JFrame("Test Window"); + frame.setSize(300, 300); + frame.setContentPane(desktopPane); + frame.setVisible(true); + + locTopFrame = topFrame.getLocationOnScreen(); + locTarget = new Point(locTopFrame.x + bottomFrame.getWidth() / 2, locTopFrame.y + bottomFrame.getHeight()/2); + } + + // this strange plumbing stuff is required due to "Standard Test Machinery" in base class + public static void main(String args[]) throws InterruptedException { + instance = new JInternalFrameMoveOverlapping(); + OverlappingTestBase.doMain(args); + } +} diff --git a/jdk/test/java/awt/Mixing/AWT_Mixing/JInternalFrameOverlapping.java b/jdk/test/java/awt/Mixing/AWT_Mixing/JInternalFrameOverlapping.java new file mode 100644 index 00000000000..320a82adcce --- /dev/null +++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JInternalFrameOverlapping.java @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +import java.awt.Point; +import java.awt.Robot; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import javax.swing.JButton; +import javax.swing.JDesktopPane; +import javax.swing.JFrame; +import javax.swing.JInternalFrame; + +/** + * AWT/Swing overlapping test for {@link javax.swing.JInternalFrame } component. + *

See base class for test info. + */ +/* +@test +@summary Overlapping test for javax.swing.JScrollPane +@author sergey.grinev@oracle.com: area=awt.mixing +@run main JInternalFrameOverlapping + */ +public class JInternalFrameOverlapping extends OverlappingTestBase { + + private boolean lwClicked = true; + private Point lLoc; + + protected boolean performTest() { + + + // run robot + Robot robot = Util.createRobot(); + robot.setAutoDelay(ROBOT_DELAY); + + clickAndBlink(robot, lLoc); + + return lwClicked; + } + + /** + * Creating two JInternalFrames in JDesktopPanes. Put lightweight component into one frame and heavyweight into another. + */ + @Override + protected void prepareControls() { + JDesktopPane desktopPane = new JDesktopPane(); + + JFrame frame = new JFrame("Test Window"); + frame.setSize(300, 300); + frame.setContentPane(desktopPane); + frame.setVisible(true); + JInternalFrame bottomFrame = new JInternalFrame("bottom frame", false, false, false, false); + bottomFrame.setSize(220, 220); + desktopPane.add(bottomFrame); + bottomFrame.setVisible(true); + + super.propagateAWTControls(bottomFrame); + JInternalFrame topFrame = new JInternalFrame("top frame", false, false, false, false); + topFrame.setSize(200, 200); + JButton jbutton = new JButton("LW Button") {{ + addMouseListener(new MouseAdapter() { + + @Override + public void mouseClicked(MouseEvent e) { + lwClicked = true; + } + }); + }}; + topFrame.add(jbutton); + desktopPane.add(topFrame); + topFrame.setVisible(true); + lLoc = jbutton.getLocationOnScreen(); + lLoc.translate(jbutton.getWidth()/2, jbutton.getWidth()/2); //click at middle of the button + } + + // this strange plumbing stuff is required due to "Standard Test Machinery" in base class + public static void main(String args[]) throws InterruptedException { + instance = new JInternalFrameOverlapping(); + OverlappingTestBase.doMain(args); + } + +} diff --git a/jdk/test/java/awt/Mixing/AWT_Mixing/JLabelInGlassPaneOverlapping.java b/jdk/test/java/awt/Mixing/AWT_Mixing/JLabelInGlassPaneOverlapping.java new file mode 100644 index 00000000000..bdde7409344 --- /dev/null +++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JLabelInGlassPaneOverlapping.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +import java.awt.Dimension; +import javax.swing.*; + +/** + * AWT/Swing overlapping test for {@link javax.swing.JLabel } component in GlassPane. + *

See base class for details. + */ +/* +@test +@summary Simple Overlapping test for javax.swing.JLabel +@author sergey.grinev@oracle.com: area=awt.mixing +@run main JLabelInGlassPaneOverlapping + */ +public class JLabelInGlassPaneOverlapping extends GlassPaneOverlappingTestBase { + + @Override + protected JComponent getSwingComponent() { + JLabel ch = new JLabel(); + ch.setPreferredSize(new Dimension(50, 50)); + ch.setText("Swing component"); + return ch; + } + + // this strange plumbing stuff is required due to "Standard Test Machinery" in base class + public static void main(String args[]) throws InterruptedException { + instance = new JLabelInGlassPaneOverlapping(); + OverlappingTestBase.doMain(args); + } +} diff --git a/jdk/test/java/awt/Mixing/AWT_Mixing/JLabelOverlapping.java b/jdk/test/java/awt/Mixing/AWT_Mixing/JLabelOverlapping.java new file mode 100644 index 00000000000..e6038bc8038 --- /dev/null +++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JLabelOverlapping.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dimension; +import javax.swing.*; + +/** + * AWT/Swing overlapping test for {@link javax.swing.JLabel } component. + *

See base class for details. + */ +/* +@test +@summary Simple Overlapping test for javax.swing.JLabel +@author sergey.grinev@oracle.com: area=awt.mixing +@run main JLabelOverlapping + */ +public class JLabelOverlapping extends SimpleOverlappingTestBase { + + @Override + protected JComponent getSwingComponent() { + JLabel ch = new JLabel(); + ch.setPreferredSize(new Dimension(50, 50)); + ch.setText("Swing component"); + return ch; + } + + // this strange plumbing stuff is required due to "Standard Test Machinery" in base class + public static void main(String args[]) throws InterruptedException { + instance = new JLabelOverlapping(); + OverlappingTestBase.doMain(args); + } +} diff --git a/jdk/test/java/awt/Mixing/AWT_Mixing/JListInGlassPaneOverlapping.java b/jdk/test/java/awt/Mixing/AWT_Mixing/JListInGlassPaneOverlapping.java new file mode 100644 index 00000000000..4a2e1419bae --- /dev/null +++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JListInGlassPaneOverlapping.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +import javax.swing.*; + +/** + * AWT/Swing overlapping test for {@link javax.swing.JList } component in GlassPane. + *

See base class for details. + */ +/* +@test +@summary Simple Overlapping test for javax.swing.JList +@author sergey.grinev@oracle.com: area=awt.mixing +@run main JListInGlassPaneOverlapping + */ +public class JListInGlassPaneOverlapping extends GlassPaneOverlappingTestBase { + + @Override + protected JComponent getSwingComponent() { + JList ch = new JList(new String[] {"one", "two", "three"}); + return ch; + } + + // this strange plumbing stuff is required due to "Standard Test Machinery" in base class + public static void main(String args[]) throws InterruptedException { + instance = new JListInGlassPaneOverlapping(); + OverlappingTestBase.doMain(args); + } +} diff --git a/jdk/test/java/awt/Mixing/AWT_Mixing/JListOverlapping.java b/jdk/test/java/awt/Mixing/AWT_Mixing/JListOverlapping.java new file mode 100644 index 00000000000..76ee46ccbfa --- /dev/null +++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JListOverlapping.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import javax.swing.*; + +/** + * AWT/Swing overlapping test for {@link javax.swing.JList } component. + *

See base class for details. + */ +/* +@test +@summary Simple Overlapping test for javax.swing.JList +@author sergey.grinev@oracle.com: area=awt.mixing +@run main JListOverlapping + */ +public class JListOverlapping extends SimpleOverlappingTestBase { + + @Override + protected JComponent getSwingComponent() { + JList ch = new JList(new String[] {"one", "two", "three", "four"}); + return ch; + } + + // this strange plumbing stuff is required due to "Standard Test Machinery" in base class + public static void main(String args[]) throws InterruptedException { + instance = new JListOverlapping(); + OverlappingTestBase.doMain(args); + } +} diff --git a/jdk/test/java/awt/Mixing/AWT_Mixing/JMenuBarOverlapping.java b/jdk/test/java/awt/Mixing/AWT_Mixing/JMenuBarOverlapping.java new file mode 100644 index 00000000000..5ae75bd55b7 --- /dev/null +++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JMenuBarOverlapping.java @@ -0,0 +1,149 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +import java.awt.Color; +import java.awt.GridLayout; +import java.awt.Point; +import java.awt.Robot; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import javax.swing.JFrame; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JSeparator; +import javax.swing.SwingUtilities; + +/** + * AWT/Swing overlapping test for {@link javax.swing.JMenuBar } and {@link javax.swing.JSeparator} components. + *

This test creates menu bar and test if heavyweight component is drawn correctly then menu dropdown is shown. + *

See base class for test info. + */ +/* +@test +@summary Overlapping test for javax.swing.JScrollPane +@author sergey.grinev@oracle.com: area=awt.mixing +@run main JMenuBarOverlapping + */ +public class JMenuBarOverlapping extends OverlappingTestBase { + + {testEmbeddedFrame = true;} + + private boolean lwClicked = false; + private boolean spClicked = false; + private Point loc; + private Point loc2; + private Point sepLoc; + private JFrame frame; + private JMenuBar menuBar; + JSeparator separator; + + protected void prepareControls() { + frame = new JFrame("Mixing : Dropdown Overlapping test"); + frame.setLayout(new GridLayout(0,1)); + frame.setSize(200, 200); + frame.setVisible(true); + + menuBar = new JMenuBar(); + JMenu menu = new JMenu("Test Menu"); + ActionListener menuListener = new ActionListener() { + + public void actionPerformed(ActionEvent event) { + lwClicked = true; + } + }; + + JMenuItem item; + menu.add(item = new JMenuItem("first")); + item.addActionListener(menuListener); + separator = new JSeparator(); + separator.addMouseListener(new MouseAdapter() { + + @Override + public void mouseClicked(MouseEvent e) { + spClicked = true; + } + }); + menu.add(separator); + + for (int i = 0; i < petStrings.length; i++) { + menu.add(item = new JMenuItem(petStrings[i])); + item.addActionListener(menuListener); + } + menuBar.add(menu); + frame.setJMenuBar(menuBar); + + propagateAWTControls(frame); + frame.setVisible(true); + } + + @Override + protected boolean performTest() { + try { + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + loc = menuBar.getLocationOnScreen(); + loc2 = frame.getContentPane().getLocationOnScreen(); + } + }); + } catch (Exception e) { + } + // run robot + Robot robot = Util.createRobot(); + robot.setAutoDelay(ROBOT_DELAY); + + loc2.translate(75, 75); + pixelPreCheck(robot, loc2, currentAwtControl); + + loc.translate(3, 3); + clickAndBlink(robot, loc, false); + + clickAndBlink(robot, loc2, false); + + clickAndBlink(robot, loc, false); + try { + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + sepLoc = separator.getLocationOnScreen(); + } + }); + } catch (Exception e) { + e.printStackTrace(); + System.exit(1); + } + sepLoc.translate(20, 1); + clickAndBlink(robot, sepLoc, false); + + clickAndBlink(robot, loc, false); // close menu before running next step + return lwClicked && spClicked; + } + + // this strange plumbing stuff is required due to "Standard Test Machinery" in base class + public static void main(String args[]) throws InterruptedException { + instance = new JMenuBarOverlapping(); + OverlappingTestBase.doMain(args); + } +} diff --git a/jdk/test/java/awt/Mixing/AWT_Mixing/JPanelInGlassPaneOverlapping.java b/jdk/test/java/awt/Mixing/AWT_Mixing/JPanelInGlassPaneOverlapping.java new file mode 100644 index 00000000000..189a17b000f --- /dev/null +++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JPanelInGlassPaneOverlapping.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +import java.awt.Dimension; +import javax.swing.*; + +/** + * AWT/Swing overlapping test for {@link javax.swing.JPanel } component in GlassPane. + *

See base class for details. + */ +/* +@test +@summary Simple Overlapping test for javax.swing.JPanel +@author sergey.grinev@oracle.com: area=awt.mixing +@run main JPanelInGlassPaneOverlapping + */ +public class JPanelInGlassPaneOverlapping extends GlassPaneOverlappingTestBase { + + @Override + protected JComponent getSwingComponent() { + JPanel ch = new JPanel(); + ch.setPreferredSize(new Dimension(50, 50)); + ch.setBorder(BorderFactory.createTitledBorder("Swing Component")); + return ch; + } + + // this strange plumbing stuff is required due to "Standard Test Machinery" in base class + public static void main(String args[]) throws InterruptedException { + instance = new JPanelInGlassPaneOverlapping(); + OverlappingTestBase.doMain(args); + } +} diff --git a/jdk/test/java/awt/Mixing/AWT_Mixing/JPanelOverlapping.java b/jdk/test/java/awt/Mixing/AWT_Mixing/JPanelOverlapping.java new file mode 100644 index 00000000000..5decd49d461 --- /dev/null +++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JPanelOverlapping.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dimension; +import javax.swing.*; + +/** + * AWT/Swing overlapping test for {@link javax.swing.JPanel } component. + *

See base class for details. + */ +/* +@test +@summary Simple Overlapping test for javax.swing.JPanel +@author sergey.grinev@oracle.com: area=awt.mixing +@run main JPanelOverlapping + */ +public class JPanelOverlapping extends SimpleOverlappingTestBase { + + @Override + protected JComponent getSwingComponent() { + JPanel ch = new JPanel(); + ch.setPreferredSize(new Dimension(50, 50)); + ch.setBorder(BorderFactory.createTitledBorder("Swing Component")); + return ch; + } + + // this strange plumbing stuff is required due to "Standard Test Machinery" in base class + public static void main(String args[]) throws InterruptedException { + instance = new JPanelOverlapping(); + OverlappingTestBase.doMain(args); + } +} diff --git a/jdk/test/java/awt/Mixing/AWT_Mixing/JPopupMenuOverlapping.java b/jdk/test/java/awt/Mixing/AWT_Mixing/JPopupMenuOverlapping.java new file mode 100644 index 00000000000..fead4e441fd --- /dev/null +++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JPopupMenuOverlapping.java @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +import java.awt.Color; +import java.awt.Point; +import java.awt.Robot; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.lang.reflect.InvocationTargetException; +import javax.swing.JFrame; +import javax.swing.JMenuItem; +import javax.swing.JPopupMenu; +import javax.swing.SpringLayout; +import javax.swing.SwingUtilities; + +/** + * AWT/Swing overlapping test for {@link javax.swing.JPopupMenu } component. + *

This test creates menu and test if heavyweight component is drawn correctly then menu dropdown is shown. + *

See base class for test info. + */ +/* +@test +@summary Overlapping test for javax.swing.JScrollPane +@author sergey.grinev@oracle.com: area=awt.mixing +@run main JPopupMenuOverlapping + */ +public class JPopupMenuOverlapping extends OverlappingTestBase { + + {testEmbeddedFrame = true;} + + private boolean lwClicked = false; + private Point loc; + private JPopupMenu popup; + private JFrame frame=null; + + protected void prepareControls() { + if(frame != null) { + frame.setVisible(false); + } + frame = new JFrame("Mixing : Dropdown Overlapping test"); + frame.setLayout(new SpringLayout()); + frame.setSize(200, 200); + + popup = new JPopupMenu(); + ActionListener menuListener = new ActionListener() { + + public void actionPerformed(ActionEvent event) { + lwClicked = true; + } + }; + JMenuItem item; + for (int i = 0; i < petStrings.length; i++) { + popup.add(item = new JMenuItem(petStrings[i])); + item.addActionListener(menuListener); + } + propagateAWTControls(frame); + frame.setVisible(true); + loc = frame.getContentPane().getLocationOnScreen(); + } + + @Override + protected boolean performTest() { + // run robot + Robot robot = Util.createRobot(); + robot.setAutoDelay(ROBOT_DELAY); + + loc.translate(75, 75); + + pixelPreCheck(robot, loc, currentAwtControl); + + try { + SwingUtilities.invokeAndWait(new Runnable() { + + public void run() { + popup.show(frame.getContentPane(), 15, 15); + } + }); + + robot.waitForIdle(); + + clickAndBlink(robot, loc, false); + + SwingUtilities.invokeAndWait(new Runnable() { + + public void run() { + popup.setVisible(false); + } + }); + } catch (InterruptedException ex) { + fail(ex.getMessage()); + } catch (InvocationTargetException ex) { + fail(ex.getMessage()); + } + + return lwClicked; + } + + // this strange plumbing stuff is required due to "Standard Test Machinery" in base class + public static void main(String args[]) throws InterruptedException { + instance = new JPopupMenuOverlapping(); + OverlappingTestBase.doMain(args); + } +} diff --git a/jdk/test/java/awt/Mixing/AWT_Mixing/JProgressBarInGlassPaneOverlapping.java b/jdk/test/java/awt/Mixing/AWT_Mixing/JProgressBarInGlassPaneOverlapping.java new file mode 100644 index 00000000000..1f60eefe5d6 --- /dev/null +++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JProgressBarInGlassPaneOverlapping.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +import java.awt.Dimension; +import javax.swing.*; + +/** + * AWT/Swing overlapping test for {@link javax.swing.JProgressBar } component in GlassPane. + *

See base class for details. + */ +/* +@test +@summary Simple Overlapping test for javax.swing.JProgressBar +@author sergey.grinev@oracle.com: area=awt.mixing +@run main JProgressBarInGlassPaneOverlapping + */ +public class JProgressBarInGlassPaneOverlapping extends GlassPaneOverlappingTestBase { + + @Override + protected JComponent getSwingComponent() { + JProgressBar ch = new JProgressBar(); + ch.setValue(50); + ch.setPreferredSize(new Dimension(50, 50)); + return ch; + } + + // this strange plumbing stuff is required due to "Standard Test Machinery" in base class + public static void main(String args[]) throws InterruptedException { + instance = new JProgressBarInGlassPaneOverlapping(); + OverlappingTestBase.doMain(args); + } +} diff --git a/jdk/test/java/awt/Mixing/AWT_Mixing/JProgressBarOverlapping.java b/jdk/test/java/awt/Mixing/AWT_Mixing/JProgressBarOverlapping.java new file mode 100644 index 00000000000..3db75cc6e4d --- /dev/null +++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JProgressBarOverlapping.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dimension; +import javax.swing.*; + +/** + * AWT/Swing overlapping test for {@link javax.swing.JProgressBar } component. + *

See base class for details. + */ +/* +@test +@summary Simple Overlapping test for javax.swing.JProgressBar +@author sergey.grinev@oracle.com: area=awt.mixing +@run main JProgressBarOverlapping + */ +public class JProgressBarOverlapping extends SimpleOverlappingTestBase { + + @Override + protected JComponent getSwingComponent() { + JProgressBar ch = new JProgressBar(); + ch.setValue(50); + ch.setPreferredSize(new Dimension(50, 50)); + return ch; + } + + // this strange plumbing stuff is required due to "Standard Test Machinery" in base class + public static void main(String args[]) throws InterruptedException { + instance = new JProgressBarOverlapping(); + OverlappingTestBase.doMain(args); + } +} diff --git a/jdk/test/java/awt/Mixing/AWT_Mixing/JScrollBarInGlassPaneOverlapping.java b/jdk/test/java/awt/Mixing/AWT_Mixing/JScrollBarInGlassPaneOverlapping.java new file mode 100644 index 00000000000..a12a6f8b5af --- /dev/null +++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JScrollBarInGlassPaneOverlapping.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +import java.awt.Point; +import java.awt.Dimension; +import java.awt.event.AdjustmentEvent; +import java.awt.event.AdjustmentListener; +import javax.swing.*; + +/** + * AWT/Swing overlapping test for {@link javax.swing.JScrollBar } component in GlassPane. + *

See base class for details. + */ +/* +@test +@summary Simple Overlapping test for javax.swing.JScrollBar +@author sergey.grinev@oracle.com: area=awt.mixing +@run main JScrollBarInGlassPaneOverlapping + */ +public class JScrollBarInGlassPaneOverlapping extends GlassPaneOverlappingTestBase { + + public JScrollBarInGlassPaneOverlapping() { + super(false); + } + + @Override + protected JComponent getSwingComponent() { + JScrollBar ch = new JScrollBar(JScrollBar.VERTICAL); + ch.setPreferredSize(new Dimension(50, 50)); + ch.setValue(50); + ch.addAdjustmentListener(new AdjustmentListener() { + + public void adjustmentValueChanged(AdjustmentEvent e) { + wasLWClicked = true; + } + }); + OverlappingTestBase.shift = new Point(20, 16); + return ch; + } + + // this strange plumbing stuff is required due to "Standard Test Machinery" in base class + public static void main(String args[]) throws InterruptedException { + instance = new JScrollBarInGlassPaneOverlapping(); + OverlappingTestBase.doMain(args); + } +} diff --git a/jdk/test/java/awt/Mixing/AWT_Mixing/JScrollBarOverlapping.java b/jdk/test/java/awt/Mixing/AWT_Mixing/JScrollBarOverlapping.java new file mode 100644 index 00000000000..9a3dd8e0a8a --- /dev/null +++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JScrollBarOverlapping.java @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Point; +import java.awt.Dimension; +import java.awt.event.AdjustmentEvent; +import java.awt.event.AdjustmentListener; +import javax.swing.*; + +/** + * AWT/Swing overlapping test for {@link javax.swing.JScrollBar } component. + *

See base class for details. + */ +/* +@test +@summary Simple Overlapping test for javax.swing.JScrollBar +@author sergey.grinev@oracle.com: area=awt.mixing +@run main JScrollBarOverlapping + */ +public class JScrollBarOverlapping extends SimpleOverlappingTestBase { + + public JScrollBarOverlapping() { + super(false); + } + + @Override + protected JComponent getSwingComponent() { + JScrollBar ch = new JScrollBar(JScrollBar.VERTICAL); + ch.setPreferredSize(new Dimension(50, 50)); + ch.setValue(50); + ch.addAdjustmentListener(new AdjustmentListener() { + + public void adjustmentValueChanged(AdjustmentEvent e) { + wasLWClicked = true; + } + }); + OverlappingTestBase.shift = new Point(20, 16); + return ch; + } + + // this strange plumbing stuff is required due to "Standard Test Machinery" in base class + public static void main(String args[]) throws InterruptedException { + instance = new JScrollBarOverlapping(); + OverlappingTestBase.doMain(args); + } +} diff --git a/jdk/test/java/awt/Mixing/AWT_Mixing/JScrollPaneOverlapping.java b/jdk/test/java/awt/Mixing/AWT_Mixing/JScrollPaneOverlapping.java new file mode 100644 index 00000000000..d4ae51d38e4 --- /dev/null +++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JScrollPaneOverlapping.java @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +import java.awt.Dimension; +import java.awt.GridLayout; +import java.awt.Point; +import java.awt.Robot; +import java.awt.event.AdjustmentEvent; +import java.awt.event.AdjustmentListener; +import javax.swing.JFrame; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.SwingUtilities; + +/** + * AWT/Swing overlapping test for {@link javax.swing.JScrollPane } component. + *

See base class for test info. + */ +/* +@test +@summary Overlapping test for javax.swing.JScrollPane +@author sergey.grinev@oracle.com: area=awt.mixing +@run main JScrollPaneOverlapping + */ +public class JScrollPaneOverlapping extends OverlappingTestBase { + +// {testEmbeddedFrame = true;} + + private boolean horizontalClicked = false; + private boolean verticalClicked = false; + private Point hLoc; + private Point vLoc; + + private JFrame f; + private JPanel p; + private JScrollPane scrollPane; + + protected void prepareControls() { + + f = new JFrame("JScrollPane"); + f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + f.setSize(120, 120); + + p = new JPanel(new GridLayout(0, 1)); + + scrollPane = new JScrollPane(p); + scrollPane.setPreferredSize(new Dimension(300,300)); + scrollPane.setHorizontalScrollBarPolicy( + JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); + scrollPane.setVerticalScrollBarPolicy( + JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); + + scrollPane.getHorizontalScrollBar().setValue(1); + scrollPane.getHorizontalScrollBar().addAdjustmentListener(new AdjustmentListener() { + + public void adjustmentValueChanged(AdjustmentEvent e) { + horizontalClicked = true; + } + }); + + scrollPane.getVerticalScrollBar().setValue(1); + scrollPane.getVerticalScrollBar().addAdjustmentListener(new AdjustmentListener() { + + public void adjustmentValueChanged(AdjustmentEvent e) { + verticalClicked = true; + } + }); + + f.getContentPane().add(scrollPane); + f.setVisible(true); + propagateAWTControls(p); +// JButton b = new JButton("Space extender"); +// b.setPreferredSize(new Dimension(150,150)); +// p.add( b ); + + //b.requestFocus(); // to change the look of AWT component, especially Choice + } + + @Override + protected boolean performTest() { + // run robot + Robot robot = Util.createRobot(); + robot.setAutoDelay(ROBOT_DELAY); + + try { + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + hLoc = scrollPane.getHorizontalScrollBar().getLocationOnScreen(); + vLoc = scrollPane.getVerticalScrollBar().getLocationOnScreen(); + } + }); + } catch (Exception e) { + } + hLoc.translate(2, 2); + vLoc.translate(2, 2); + + clickAndBlink(robot, hLoc, false); + clickAndBlink(robot, vLoc, false); + + return horizontalClicked && verticalClicked; + } + + // this strange plumbing stuff is required due to "Standard Test Machinery" in base class + public static void main(String args[]) throws InterruptedException { + instance = new JScrollPaneOverlapping(); + OverlappingTestBase.doMain(args); + } +} diff --git a/jdk/test/java/awt/Mixing/AWT_Mixing/JSliderInGlassPaneOverlapping.java b/jdk/test/java/awt/Mixing/AWT_Mixing/JSliderInGlassPaneOverlapping.java new file mode 100644 index 00000000000..8cdafc17903 --- /dev/null +++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JSliderInGlassPaneOverlapping.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +import java.awt.Dimension; +import javax.swing.*; + +/** + * AWT/Swing overlapping test for {@link javax.swing.JSlider } component in GlassPane. + *

See base class for details. + */ +/* +@test +@summary Simple Overlapping test for javax.swing.JSlider +@author sergey.grinev@oracle.com: area=awt.mixing +@run main JSliderInGlassPaneOverlapping + */ +public class JSliderInGlassPaneOverlapping extends GlassPaneOverlappingTestBase { + + @Override + protected JComponent getSwingComponent() { + JSlider ch = new JSlider(); + ch.setPreferredSize(new Dimension(50, 50)); + return ch; + } + + // this strange plumbing stuff is required due to "Standard Test Machinery" in base class + public static void main(String args[]) throws InterruptedException { + instance = new JSliderInGlassPaneOverlapping(); + OverlappingTestBase.doMain(args); + } +} diff --git a/jdk/test/java/awt/Mixing/AWT_Mixing/JSliderOverlapping.java b/jdk/test/java/awt/Mixing/AWT_Mixing/JSliderOverlapping.java new file mode 100644 index 00000000000..f6553db0311 --- /dev/null +++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JSliderOverlapping.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dimension; +import javax.swing.*; + +/** + * AWT/Swing overlapping test for {@link javax.swing.JSlider } component. + *

See base class for details. + */ +/* +@test +@summary Simple Overlapping test for javax.swing.JSlider +@author sergey.grinev@oracle.com: area=awt.mixing +@run main JSliderOverlapping + */ +public class JSliderOverlapping extends SimpleOverlappingTestBase { + + @Override + protected JComponent getSwingComponent() { + JSlider ch = new JSlider(); + ch.setPreferredSize(new Dimension(50, 50)); + return ch; + } + + // this strange plumbing stuff is required due to "Standard Test Machinery" in base class + public static void main(String args[]) throws InterruptedException { + instance = new JSliderOverlapping(); + OverlappingTestBase.doMain(args); + } +} diff --git a/jdk/test/java/awt/Mixing/AWT_Mixing/JSpinnerInGlassPaneOverlapping.java b/jdk/test/java/awt/Mixing/AWT_Mixing/JSpinnerInGlassPaneOverlapping.java new file mode 100644 index 00000000000..1c60597c5a2 --- /dev/null +++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JSpinnerInGlassPaneOverlapping.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +import java.awt.Dimension; +import javax.swing.event.ChangeEvent; +import javax.swing.*; +import javax.swing.event.ChangeListener; + +/** + * AWT/Swing overlapping test for {@link javax.swing.JSpinner } component in GlassPane. + *

See base class for details. + */ +/* +@test +@summary Simple Overlapping test for javax.swing.JSpinner +@author sergey.grinev@oracle.com: area=awt.mixing +@run main JSpinnerInGlassPaneOverlapping + */ +public class JSpinnerInGlassPaneOverlapping extends GlassPaneOverlappingTestBase { + + {testResize = false;} + + public JSpinnerInGlassPaneOverlapping() { + super(false); + } + +// static {debugClassName = "Choice";} + @Override + protected JComponent getSwingComponent() { + JSpinner ch = new JSpinner(); + ch.setPreferredSize(new Dimension(30, 50)); + ch.addChangeListener(new ChangeListener() { + + public void stateChanged(ChangeEvent e) { + wasLWClicked = true; + } + }); + return ch; + } + + // this strange plumbing stuff is required due to "Standard Test Machinery" in base class + public static void main(String args[]) throws InterruptedException { + instance = new JSpinnerInGlassPaneOverlapping(); + OverlappingTestBase.doMain(args); + } +} diff --git a/jdk/test/java/awt/Mixing/AWT_Mixing/JSpinnerOverlapping.java b/jdk/test/java/awt/Mixing/AWT_Mixing/JSpinnerOverlapping.java new file mode 100644 index 00000000000..90e4e5b85e9 --- /dev/null +++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JSpinnerOverlapping.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dimension; +import javax.swing.event.ChangeEvent; +import javax.swing.*; +import javax.swing.event.ChangeListener; + +/** + * AWT/Swing overlapping test for {@link javax.swing.JSpinner } component. + *

See base class for details. + */ +/* +@test +@summary Simple Overlapping test for javax.swing.JSpinner +@author sergey.grinev@oracle.com: area=awt.mixing +@run main JSpinnerOverlapping + */ +public class JSpinnerOverlapping extends SimpleOverlappingTestBase { + + public JSpinnerOverlapping() { + super(false); + } + +// static {debugClassName = "Choice";} + @Override + protected JComponent getSwingComponent() { + JSpinner ch = new JSpinner(); + ch.setPreferredSize(new Dimension(30, 50)); + ch.addChangeListener(new ChangeListener() { + + public void stateChanged(ChangeEvent e) { + wasLWClicked = true; + } + }); + return ch; + } + + // this strange plumbing stuff is required due to "Standard Test Machinery" in base class + public static void main(String args[]) throws InterruptedException { + instance = new JSpinnerOverlapping(); + OverlappingTestBase.doMain(args); + } +} diff --git a/jdk/test/java/awt/Mixing/AWT_Mixing/JSplitPaneOverlapping.java b/jdk/test/java/awt/Mixing/AWT_Mixing/JSplitPaneOverlapping.java new file mode 100644 index 00000000000..c4f2265824a --- /dev/null +++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JSplitPaneOverlapping.java @@ -0,0 +1,130 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.GridLayout; +import java.awt.Point; +import java.awt.Robot; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.InputEvent; +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JSplitPane; +import javax.swing.SwingUtilities; + +/** + * AWT/Swing overlapping test for {@link javax.swing.JSplitPane } component. + *

This test creates puts heavyweight and lightweight components into different panels and test if splitter image and components itself are drawn correctly. + *

See base class for test info. + */ +/* +@test +@bug 6986109 +@summary Overlapping test for javax.swing.JSplitPane +@author sergey.grinev@oracle.com: area=awt.mixing +@run main JSplitPaneOverlapping + */ +public class JSplitPaneOverlapping extends OverlappingTestBase { + + private boolean clicked = false; + private Point splitterLoc; + private JScrollPane sp1; + private JScrollPane sp2; + + protected void prepareControls() { + JFrame frame = new JFrame("SplitPane Mixing"); + JPanel p = new JPanel(new GridLayout()); + p.setPreferredSize(new Dimension(500, 500)); + propagateAWTControls(p); + sp1 = new JScrollPane(p); + + JButton button = new JButton("JButton"); + button.setBackground(Color.RED); + button.addActionListener(new ActionListener() { + + public void actionPerformed(ActionEvent e) { + clicked = true; + } + }); + sp2 = new JScrollPane(button); + + JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, sp1, sp2); + splitPane.setOneTouchExpandable(false); + splitPane.setDividerLocation(150); + + splitPane.setPreferredSize(new Dimension(400, 200)); + + frame.getContentPane().add(splitPane); + frame.pack(); + frame.setVisible(true); + } + + private static final boolean ignoreFail = false; + + @Override + protected boolean performTest() { + try { + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + splitterLoc = sp2.getLocationOnScreen(); + Point leftLoc = sp1.getLocationOnScreen(); + leftLoc.translate(sp1.getWidth(), 0); + splitterLoc.translate(-(splitterLoc.x - leftLoc.x) / 2, 30); + } + }); + } catch (Exception e) { + e.printStackTrace(); + System.exit(1); + } + // run robot + Robot robot = Util.createRobot(); + robot.setAutoDelay(ROBOT_DELAY); + + robot.mouseMove(splitterLoc.x, splitterLoc.y); + Util.waitForIdle(robot); + + robot.mousePress(InputEvent.BUTTON1_MASK); + robot.mouseMove(splitterLoc.x - 50, splitterLoc.y); + Color c = robot.getPixelColor(splitterLoc.x - 50, splitterLoc.y); + System.out.println("Actual: "+c+", (not) expected: "+AWT_VERIFY_COLOR+" at "+(splitterLoc.x - 50)+", "+ splitterLoc.y); + if (!ignoreFail && c.equals(AWT_VERIFY_COLOR)) { + fail("The JSplitPane drag-n-drop image did not pass pixel color check and is overlapped"); + } + robot.mouseRelease(InputEvent.BUTTON1_MASK); + + clickAndBlink(robot, splitterLoc); + + return clicked; + } + + // this strange plumbing stuff is required due to "Standard Test Machinery" in base class + public static void main(String args[]) throws InterruptedException { + instance = new JSplitPaneOverlapping(); + OverlappingTestBase.doMain(args); + } +} diff --git a/jdk/test/java/awt/Mixing/AWT_Mixing/JTableInGlassPaneOverlapping.java b/jdk/test/java/awt/Mixing/AWT_Mixing/JTableInGlassPaneOverlapping.java new file mode 100644 index 00000000000..af4803b9c50 --- /dev/null +++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JTableInGlassPaneOverlapping.java @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +import javax.swing.JComponent; +import javax.swing.JTable; +import javax.swing.event.TableModelEvent; +import javax.swing.event.TableModelListener; + +/** + * AWT/Swing overlapping test for {@link javax.swing.JTable } component in GlassPane. + *

See base class for details. + */ +/* +@test +@summary Simple Overlapping test for JTable +@author sergey.grinev@oracle.com: area=awt.mixing +@run main JTableInGlassPaneOverlapping + */ +public class JTableInGlassPaneOverlapping extends GlassPaneOverlappingTestBase { + + { + testResize = false; + } + + @Override + protected JComponent getSwingComponent() { + // Create columns names + String columnNames[] = {"Column 1", "Column 2", "Column 3"}; + + // Create some data + String dataValues[][] = { + {"12", "234", "67"}, + {"-123", "43", "853"}, + {"93", "89.2", "109"}, + {"279", "9033", "3092"}, + {"12", "234", "67"}, + {"-123", "43", "853"}, + {"93", "89.2", "109"}, + {"279", "9033", "3092"}, + {"12", "234", "67"}, + {"-123", "43", "853"}, + {"93", "89.2", "109"}, + {"279", "9033", "3092"}, + {"12", "234", "67"}, + {"-123", "43", "853"}, + {"93", "89.2", "109"}, + {"279", "9033", "3092"} + }; + + // Create a new table instance + JTable jt = new JTable(dataValues, columnNames); + jt.getModel().addTableModelListener(new TableModelListener() { + + public void tableChanged(TableModelEvent e) { + System.err.println("table changed"); + } + }); + return jt; + } + + // this strange plumbing stuff is required due to "Standard Test Machinery" in base class + public static void main(String args[]) throws InterruptedException { + instance = new JTableInGlassPaneOverlapping(); + OverlappingTestBase.doMain(args); + } +} diff --git a/jdk/test/java/awt/Mixing/AWT_Mixing/JTableOverlapping.java b/jdk/test/java/awt/Mixing/AWT_Mixing/JTableOverlapping.java new file mode 100644 index 00000000000..d96732feedc --- /dev/null +++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JTableOverlapping.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import javax.swing.*; + +/** + * AWT/Swing overlapping test for {@link javax.swing.JTable } component. + *

See base class for details. + */ +/* +@test +@summary Simple Overlapping test for JTable +@author sergey.grinev@oracle.com: area=awt.mixing +@run main JTableOverlapping + */ +public class JTableOverlapping extends SimpleOverlappingTestBase { + + @Override + protected JComponent getSwingComponent() { + // Create columns names + String columnNames[] = { "Column 1", "Column 2", "Column 3" }; + + // Create some data + String dataValues[][] = + { + { "12", "234", "67" }, + { "-123", "43", "853" }, + { "93", "89.2", "109" }, + { "279", "9033", "3092" }, + { "12", "234", "67" }, + { "-123", "43", "853" }, + { "93", "89.2", "109" }, + { "279", "9033", "3092" }, + { "12", "234", "67" }, + { "-123", "43", "853" }, + { "93", "89.2", "109" }, + { "279", "9033", "3092" }, + { "12", "234", "67" }, + { "-123", "43", "853" }, + { "93", "89.2", "109" }, + { "279", "9033", "3092" } + }; + + // Create a new table instance + return new JTable( dataValues, columnNames ); + } + + // this strange plumbing stuff is required due to "Standard Test Machinery" in base class + public static void main(String args[]) throws InterruptedException { + instance = new JTableOverlapping(); + OverlappingTestBase.doMain(args); + } +} diff --git a/jdk/test/java/awt/Mixing/AWT_Mixing/JTextAreaInGlassPaneOverlapping.java b/jdk/test/java/awt/Mixing/AWT_Mixing/JTextAreaInGlassPaneOverlapping.java new file mode 100644 index 00000000000..dba86e2747f --- /dev/null +++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JTextAreaInGlassPaneOverlapping.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +import java.awt.Dimension; +import javax.swing.*; + +/** + * AWT/Swing overlapping test for {@link javax.swing.JTextArea } component in GlassPane. + *

See base class for details. + */ +/* +@test +@summary Simple Overlapping test for javax.swing.JLabel +@author sergey.grinev@oracle.com: area=awt.mixing +@run main JTextAreaInGlassPaneOverlapping + */ +public class JTextAreaInGlassPaneOverlapping extends GlassPaneOverlappingTestBase { + + @Override + protected JComponent getSwingComponent() { + JTextArea ch = new JTextArea(); + ch.setPreferredSize(new Dimension(50, 50)); + ch.setText("Swing component"); + return ch; + } + + // this strange plumbing stuff is required due to "Standard Test Machinery" in base class + public static void main(String args[]) throws InterruptedException { + instance = new JTextAreaInGlassPaneOverlapping(); + OverlappingTestBase.doMain(args); + } +} diff --git a/jdk/test/java/awt/Mixing/AWT_Mixing/JTextAreaOverlapping.java b/jdk/test/java/awt/Mixing/AWT_Mixing/JTextAreaOverlapping.java new file mode 100644 index 00000000000..51f2b5ffddb --- /dev/null +++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JTextAreaOverlapping.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dimension; +import javax.swing.*; + +/** + * AWT/Swing overlapping test for {@link javax.swing.JTextArea } component. + *

See base class for details. + */ +/* +@test +@summary Simple Overlapping test for javax.swing.JLabel +@author sergey.grinev@oracle.com: area=awt.mixing +@run main JTextAreaOverlapping + */ +public class JTextAreaOverlapping extends SimpleOverlappingTestBase { + + @Override + protected JComponent getSwingComponent() { + JTextArea ch = new JTextArea(); + ch.setPreferredSize(new Dimension(50, 50)); + ch.setText("Swing component"); + return ch; + } + + // this strange plumbing stuff is required due to "Standard Test Machinery" in base class + public static void main(String args[]) throws InterruptedException { + instance = new JTextAreaOverlapping(); + OverlappingTestBase.doMain(args); + } +} diff --git a/jdk/test/java/awt/Mixing/AWT_Mixing/JTextFieldInGlassPaneOverlapping.java b/jdk/test/java/awt/Mixing/AWT_Mixing/JTextFieldInGlassPaneOverlapping.java new file mode 100644 index 00000000000..d6dd69436ea --- /dev/null +++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JTextFieldInGlassPaneOverlapping.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +import java.awt.Dimension; +import javax.swing.*; + +/** + * AWT/Swing overlapping test for {@link javax.swing.JTextField } component in GlassPane. + *

See base class for details. + */ +/* +@test +@summary Simple Overlapping test for javax.swing.JLabel +@author sergey.grinev@oracle.com: area=awt.mixing +@run main JTextFieldInGlassPaneOverlapping + */ +public class JTextFieldInGlassPaneOverlapping extends GlassPaneOverlappingTestBase { + + @Override + protected JComponent getSwingComponent() { + JTextField ch = new JTextField(); + ch.setPreferredSize(new Dimension(50, 50)); + ch.setText("Swing component"); + return ch; + } + + // this strange plumbing stuff is required due to "Standard Test Machinery" in base class + public static void main(String args[]) throws InterruptedException { + instance = new JTextFieldInGlassPaneOverlapping(); + OverlappingTestBase.doMain(args); + } +} diff --git a/jdk/test/java/awt/Mixing/AWT_Mixing/JTextFieldOverlapping.java b/jdk/test/java/awt/Mixing/AWT_Mixing/JTextFieldOverlapping.java new file mode 100644 index 00000000000..ffaecdcb589 --- /dev/null +++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JTextFieldOverlapping.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dimension; +import javax.swing.*; + +/** + * AWT/Swing overlapping test for {@link javax.swing.JTextField } component. + *

See base class for details. + */ +/* +@test +@summary Simple Overlapping test for javax.swing.JLabel +@author sergey.grinev@oracle.com: area=awt.mixing +@run main JTextFieldOverlapping + */ +public class JTextFieldOverlapping extends SimpleOverlappingTestBase { + + @Override + protected JComponent getSwingComponent() { + JTextField ch = new JTextField(); + ch.setPreferredSize(new Dimension(50, 50)); + ch.setText("Swing component"); + return ch; + } + + // this strange plumbing stuff is required due to "Standard Test Machinery" in base class + public static void main(String args[]) throws InterruptedException { + instance = new JTextFieldOverlapping(); + OverlappingTestBase.doMain(args); + } +} diff --git a/jdk/test/java/awt/Mixing/AWT_Mixing/JToggleButtonInGlassPaneOverlapping.java b/jdk/test/java/awt/Mixing/AWT_Mixing/JToggleButtonInGlassPaneOverlapping.java new file mode 100644 index 00000000000..3c4a62d9f50 --- /dev/null +++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JToggleButtonInGlassPaneOverlapping.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +import javax.swing.*; + +/** + * AWT/Swing overlapping test for {@link javax.swing.JToggleButton } component in GlassPane. + *

See base class for details. + */ +/* +@test +@summary Simple Overlapping test for javax.swing.JToggleButton +@author sergey.grinev@oracle.com: area=awt.mixing +@run main JToggleButtonInGlassPaneOverlapping + */ +public class JToggleButtonInGlassPaneOverlapping extends GlassPaneOverlappingTestBase { + + @Override + protected JComponent getSwingComponent() { + JToggleButton ch = new JToggleButton(); + ch.setText("Swing component"); + return ch; + } + + // this strange plumbing stuff is required due to "Standard Test Machinery" in base class + public static void main(String args[]) throws InterruptedException { + instance = new JToggleButtonInGlassPaneOverlapping(); + OverlappingTestBase.doMain(args); + } +} diff --git a/jdk/test/java/awt/Mixing/AWT_Mixing/JToggleButtonOverlapping.java b/jdk/test/java/awt/Mixing/AWT_Mixing/JToggleButtonOverlapping.java new file mode 100644 index 00000000000..3b311d71e10 --- /dev/null +++ b/jdk/test/java/awt/Mixing/AWT_Mixing/JToggleButtonOverlapping.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import javax.swing.*; + +/** + * AWT/Swing overlapping test for {@link javax.swing.JToggleButton } component. + *

See base class for details. + */ +/* +@test +@summary Simple Overlapping test for javax.swing.JToggleButton +@author sergey.grinev@oracle.com: area=awt.mixing +@run main JToggleButtonOverlapping + */ +public class JToggleButtonOverlapping extends SimpleOverlappingTestBase { + + @Override + protected JComponent getSwingComponent() { + JToggleButton ch = new JToggleButton(); + ch.setText("Swing component"); + return ch; + } + + // this strange plumbing stuff is required due to "Standard Test Machinery" in base class + public static void main(String args[]) throws InterruptedException { + instance = new JToggleButtonOverlapping(); + OverlappingTestBase.doMain(args); + } +} diff --git a/jdk/test/java/awt/Mixing/AWT_Mixing/MixingFrameResizing.java b/jdk/test/java/awt/Mixing/AWT_Mixing/MixingFrameResizing.java new file mode 100644 index 00000000000..fd15ca1dc85 --- /dev/null +++ b/jdk/test/java/awt/Mixing/AWT_Mixing/MixingFrameResizing.java @@ -0,0 +1,127 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Point; +import java.awt.Robot; +import java.awt.event.InputEvent; +import javax.swing.JFrame; +import javax.swing.SpringLayout; +import javax.swing.SwingUtilities; + +/** + * AWT/Swing overlapping test. + *

This test puts heavyweight component into JFrame and verifies that it's being drawn correctly after resizing the frame. + *

See base class for test info. + */ +/* +@test +@bug 6777370 +@summary Issues when resizing the JFrame with HW components +@author sergey.grinev@oracle.com: area=awt.mixing +@run main MixingFrameResizing + */ +public class MixingFrameResizing extends OverlappingTestBase { + + {testEmbeddedFrame = true;} + + private JFrame frame = null; + private Point lLoc; + private Point lLoc2; + private Dimension size; + + protected void prepareControls() { + if(frame != null) { + frame.setVisible(false); + } + frame = new JFrame("Mixing : Frame Resizing test"); + frame.setLayout(new SpringLayout()); + frame.setSize(50, 50); + frame.setVisible(true); + propagateAWTControls(frame); + Util.waitTillShown(frame); + } + + @Override + protected boolean performTest() { + int BORDER_SHIFT = frameBorderCounter(); + BORDER_SHIFT = Math.abs(BORDER_SHIFT) == 1 ? BORDER_SHIFT : (BORDER_SHIFT / 2); + try { + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + lLoc = frame.getLocationOnScreen(); + size = frame.getSize(); + lLoc2 = frame.getContentPane().getLocationOnScreen(); + } + }); + } catch (Exception e) { + e.printStackTrace(); + System.exit(1); + } + Robot robot = Util.createRobot(); + robot.setAutoDelay(ROBOT_DELAY/2); + + // resize window + robot.mouseMove(lLoc.x + size.width / 2 + BORDER_SHIFT, lLoc.y + size.height + BORDER_SHIFT); + Util.waitForIdle(robot); + robot.mousePress(InputEvent.BUTTON1_MASK); + for (int i = 0; i < 10; i++) { + robot.mouseMove(lLoc.x + size.width / 2 + BORDER_SHIFT, lLoc.y + size.height + BORDER_SHIFT + 20 * i); + } + robot.mouseRelease(InputEvent.BUTTON1_MASK); + + robot.mouseMove(lLoc.x + size.width + BORDER_SHIFT, lLoc.y + size.height + BORDER_SHIFT); + Util.waitForIdle(robot); + robot.mousePress(InputEvent.BUTTON1_MASK); + for (int i = 0; i < 10; i++) { + robot.mouseMove(lLoc.x + size.width + BORDER_SHIFT + 20 * i, lLoc.y + size.height + BORDER_SHIFT); + } + robot.mouseRelease(InputEvent.BUTTON1_MASK); + + Util.waitForIdle(robot); + // check if component is visible on the opened space + try { + Thread.sleep(300); //some more wait for Solaris (for some reason) + }catch(Exception ex) {} + lLoc2.translate(75, 75); + Color c = robot.getPixelColor(lLoc2.x, lLoc2.y); + System.out.println("Actual: "+c+", expected: "+AWT_VERIFY_COLOR); + + if (!c.equals(AWT_VERIFY_COLOR)) { + fail("HW component is not visible after resizing"); + } + + return true; + } + + // this strange plumbing stuff is required due to "Standard Test Machinery" in base class + public static void main(String args[]) throws InterruptedException { + if (System.getProperty("os.name").toLowerCase().contains("os x")) { + System.out.println("Aqua L&F ignores setting color to component. Test passes on Mac OS X."); + return; + } + instance = new MixingFrameResizing(); + OverlappingTestBase.doMain(args); + } +} diff --git a/jdk/test/java/awt/Mixing/AWT_Mixing/MixingPanelsResizing.java b/jdk/test/java/awt/Mixing/AWT_Mixing/MixingPanelsResizing.java new file mode 100644 index 00000000000..d7e46b9ffc6 --- /dev/null +++ b/jdk/test/java/awt/Mixing/AWT_Mixing/MixingPanelsResizing.java @@ -0,0 +1,462 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +import java.awt.*; +import java.awt.event.InputEvent; +import javax.swing.*; +import java.io.*; + +/** + * AWT/Swing overlapping test for Panel and JPanel behavior during resizing. + *

See JDK-6786219 for details + */ +/* +@test +@bug 6786219 +@summary Issues when resizing the frame after mixing of heavy weight & light weight components +@author sergey.grinev@oracle.com: area=awt.mixing +@build FrameBorderCounter +@run main MixingPanelsResizing + */ +public class MixingPanelsResizing { + + static volatile boolean failed = false; + + private static JFrame frame; + private static JButton jbutton; + private static Button awtButton; + private static JButton jbutton2; + private static Button awtButton2; + private static final Color jbColor = Color.RED; + private static final Color awtColor = Color.ORANGE; + private static final Color jb2Color = Color.BLUE; + private static final Color awt2Color = Color.CYAN; + private static final int ROBOT_DELAY = 500; + + private static Point lLoc; + private static int borderShift; + + private static int frameBorderCounter() { + String JAVA_HOME = System.getProperty("java.home"); + try { + Process p = Runtime.getRuntime().exec(JAVA_HOME + "/bin/java FrameBorderCounter"); + try { + p.waitFor(); + } catch (InterruptedException e) { + e.printStackTrace(); + throw new RuntimeException(e); + } + if (p.exitValue() != 0) { + throw new RuntimeException("FrameBorderCounter exited with not null code!\n" + readInputStream(p.getErrorStream())); + } + return Integer.parseInt(readInputStream(p.getInputStream()).trim()); + } catch (IOException e) { + e.printStackTrace(); + throw new RuntimeException(e); + } + } + + private static String readInputStream(InputStream is) throws IOException { + byte[] buffer = new byte[4096]; + int len = 0; + StringBuilder sb = new StringBuilder(); + try (InputStreamReader isr = new InputStreamReader(is)) { + while ((len = is.read(buffer)) > 0) { + sb.append(new String(buffer, 0, len)); + } + } + return sb.toString(); + } + + private static void init() throws Exception { + //*** Create instructions for the user here *** + + borderShift = frameBorderCounter(); + borderShift = Math.abs(borderShift) == 1 ? borderShift : (borderShift / 2); + String[] instructions = { + "This is an AUTOMATIC test, simply wait until it is done.", + "The result (passed or failed) will be shown in the", + "message window below." + }; + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + Sysout.createDialog(); + Sysout.printInstructions(instructions); + + // prepare controls + + frame = new JFrame(); + + Panel awtPanel = new Panel(); + awtPanel.setBackground(Color.GREEN); + awtButton = new Button("AWTButton"); + awtPanel.add(awtButton); + awtButton.setForeground(awtColor); + awtButton.setBackground(awtColor); + jbutton = new JButton("SwingButton"); + awtPanel.add(jbutton); + jbutton.setForeground(jbColor); + jbutton.setBackground(jbColor); + + JPanel jPanel = new JPanel(); + jbutton2 = new JButton("SwingButton2"); + jPanel.add(jbutton2); + jbutton2.setForeground(jb2Color); + jbutton2.setBackground(jb2Color); + awtButton2 = new Button("AWT Button2"); + jPanel.add(awtButton2); + awtButton2.setForeground(awt2Color); + awtButton2.setBackground(awt2Color); + jPanel.setBackground(Color.YELLOW); + + frame.add(awtPanel, BorderLayout.SOUTH); + frame.add(jPanel, BorderLayout.NORTH); + + frame.pack(); + frame.setVisible(true); + } + }); + + ///////////////////////// + + final Robot robot = Util.createRobot(); + robot.setAutoDelay(ROBOT_DELAY); + + Util.waitForIdle(robot); + + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + lLoc = frame.getLocationOnScreen(); + lLoc.translate(frame.getWidth() + borderShift, frame.getHeight() + borderShift); + } + }); + + //grow + robot.mouseMove(lLoc.x, lLoc.y); + robot.mousePress(InputEvent.BUTTON1_MASK); + + Runnable test = new Runnable() { + + public void run() { + Point btnLoc = jbutton.getLocationOnScreen(); + Color c = robot.getPixelColor(btnLoc.x + 5, btnLoc.y + 5); + if (!c.equals(jbColor)) { + fail("JButton was not redrawn properly on AWT Panel during move"); + } + + btnLoc = awtButton.getLocationOnScreen(); + c = robot.getPixelColor(btnLoc.x + 5, btnLoc.y + 5); + if (!c.equals(awtColor)) { + fail("AWT Button was not redrawn properly on AWT Panel during move"); + } + + btnLoc = jbutton2.getLocationOnScreen(); + c = robot.getPixelColor(btnLoc.x + 5, btnLoc.y + 5); + if (!c.equals(jb2Color)) { + fail("JButton was not redrawn properly on JPanel during move"); + } + + btnLoc = awtButton2.getLocationOnScreen(); + c = robot.getPixelColor(btnLoc.x + 5, btnLoc.y + 5); + if (!c.equals(awt2Color)) { + fail("ATW Button was not redrawn properly on JPanel during move"); + } + } + }; + + for (int i = 0; i < 30; i++) { + test.run(); + robot.mouseMove(lLoc.x + 20 * i, lLoc.y + 10 * i); + } + robot.mouseRelease(InputEvent.BUTTON1_MASK); + + //back + System.out.println("fast back"); + robot.mousePress(InputEvent.BUTTON1_MASK); + for (int i = 5; i >= 0; i--) { + test.run(); + robot.mouseMove(lLoc.x + 120 * i, lLoc.y + 60 * i); + } + robot.mouseRelease(InputEvent.BUTTON1_MASK); + + pass(); + }//End init() + /***************************************************** + * Standard Test Machinery Section + * DO NOT modify anything in this section -- it's a + * standard chunk of code which has all of the + * synchronisation necessary for the test harness. + * By keeping it the same in all tests, it is easier + * to read and understand someone else's test, as + * well as insuring that all tests behave correctly + * with the test harness. + * There is a section following this for test- + * classes + ******************************************************/ + private static boolean theTestPassed = false; + private static boolean testGeneratedInterrupt = false; + private static String failureMessage = ""; + private static Thread mainThread = null; + private static int sleepTime = 300000; + + // Not sure about what happens if multiple of this test are + // instantiated in the same VM. Being static (and using + // static vars), it aint gonna work. Not worrying about + // it for now. + public static void main(String args[]) throws Exception { + if (!Toolkit.getDefaultToolkit().isDynamicLayoutActive()) { + System.out.println("Dynamic layout is not active. Test passes."); + return; + } + mainThread = Thread.currentThread(); + try { + init(); + } catch (TestPassedException e) { + //The test passed, so just return from main and harness will + // interepret this return as a pass + return; + } + //At this point, neither test pass nor test fail has been + // called -- either would have thrown an exception and ended the + // test, so we know we have multiple threads. + + //Test involves other threads, so sleep and wait for them to + // called pass() or fail() + try { + Thread.sleep(sleepTime); + //Timed out, so fail the test + throw new RuntimeException("Timed out after " + sleepTime / 1000 + " seconds"); + } catch (InterruptedException e) { + //The test harness may have interrupted the test. If so, rethrow the exception + // so that the harness gets it and deals with it. + if (!testGeneratedInterrupt) { + throw e; + } + + //reset flag in case hit this code more than once for some reason (just safety) + testGeneratedInterrupt = false; + + if (theTestPassed == false) { + throw new RuntimeException(failureMessage); + } + } + + }//main + + public static synchronized void setTimeoutTo(int seconds) { + sleepTime = seconds * 1000; + } + + public static synchronized void pass() { + Sysout.println("The test passed."); + Sysout.println("The test is over, hit Ctl-C to stop Java VM"); + //first check if this is executing in main thread + if (mainThread == Thread.currentThread()) { + //Still in the main thread, so set the flag just for kicks, + // and throw a test passed exception which will be caught + // and end the test. + theTestPassed = true; + throw new TestPassedException(); + } + theTestPassed = true; + testGeneratedInterrupt = true; + mainThread.interrupt(); + }//pass() + + public static synchronized void fail() { + //test writer didn't specify why test failed, so give generic + fail("it just plain failed! :-)"); + } + + public static synchronized void fail(String whyFailed) { + Sysout.println("The test failed: " + whyFailed); + Sysout.println("The test is over, hit Ctl-C to stop Java VM"); + //check if this called from main thread + if (mainThread == Thread.currentThread()) { + //If main thread, fail now 'cause not sleeping + throw new RuntimeException(whyFailed); + } + theTestPassed = false; + testGeneratedInterrupt = true; + failureMessage = whyFailed; + mainThread.interrupt(); + }//fail() +}// class JButtonInGlassPane +class TestPassedException extends RuntimeException { +} + +//*********** End Standard Test Machinery Section ********** +//************ Begin classes defined for the test **************** +// if want to make listeners, here is the recommended place for them, then instantiate +// them in init() + +/* Example of a class which may be written as part of a test +class NewClass implements anInterface +{ +static int newVar = 0; + +public void eventDispatched(AWTEvent e) +{ +//Counting events to see if we get enough +eventCount++; + +if( eventCount == 20 ) +{ +//got enough events, so pass + +JButtonInGlassPane.pass(); +} +else if( tries == 20 ) +{ +//tried too many times without getting enough events so fail + +JButtonInGlassPane.fail(); +} + +}// eventDispatched() + +}// NewClass class + + */ +//************** End classes defined for the test ******************* +/**************************************************** +Standard Test Machinery +DO NOT modify anything below -- it's a standard +chunk of code whose purpose is to make user +interaction uniform, and thereby make it simpler +to read and understand someone else's test. + ****************************************************/ +/** +This is part of the standard test machinery. +It creates a dialog (with the instructions), and is the interface +for sending text messages to the user. +To print the instructions, send an array of strings to Sysout.createDialog +WithInstructions method. Put one line of instructions per array entry. +To display a message for the tester to see, simply call Sysout.println +with the string to be displayed. +This mimics System.out.println but works within the test harness as well +as standalone. + */ +class Sysout { + + private static TestDialog dialog; + + public static void createDialogWithInstructions(String[] instructions) { + dialog = new TestDialog(new Frame(), "Instructions"); + dialog.printInstructions(instructions); + dialog.setVisible(true); + println("Any messages for the tester will display here."); + } + + public static void createDialog() { + dialog = new TestDialog(new Frame(), "Instructions"); + String[] defInstr = {"Instructions will appear here. ", ""}; + dialog.printInstructions(defInstr); + dialog.setVisible(true); + println("Any messages for the tester will display here."); + } + + public static void printInstructions(String[] instructions) { + dialog.printInstructions(instructions); + } + + public static void println(String messageIn) { + dialog.displayMessage(messageIn); + System.out.println(messageIn); + } +}// Sysout class + +/** +This is part of the standard test machinery. It provides a place for the +test instructions to be displayed, and a place for interactive messages +to the user to be displayed. +To have the test instructions displayed, see Sysout. +To have a message to the user be displayed, see Sysout. +Do not call anything in this dialog directly. + */ +class TestDialog extends Dialog { + + TextArea instructionsText; + TextArea messageText; + int maxStringLength = 80; + + //DO NOT call this directly, go through Sysout + public TestDialog(Frame frame, String name) { + super(frame, name); + int scrollBoth = TextArea.SCROLLBARS_BOTH; + instructionsText = new TextArea("", 15, maxStringLength, scrollBoth); + add("North", instructionsText); + + messageText = new TextArea("", 5, maxStringLength, scrollBoth); + add("Center", messageText); + + pack(); + + setVisible(true); + }// TestDialog() + + //DO NOT call this directly, go through Sysout + public void printInstructions(String[] instructions) { + //Clear out any current instructions + instructionsText.setText(""); + + //Go down array of instruction strings + + String printStr, remainingStr; + for (int i = 0; i < instructions.length; i++) { + //chop up each into pieces maxSringLength long + remainingStr = instructions[i]; + while (remainingStr.length() > 0) { + //if longer than max then chop off first max chars to print + if (remainingStr.length() >= maxStringLength) { + //Try to chop on a word boundary + int posOfSpace = remainingStr.lastIndexOf(' ', maxStringLength - 1); + + if (posOfSpace <= 0) { + posOfSpace = maxStringLength - 1; + } + + printStr = remainingStr.substring(0, posOfSpace + 1); + remainingStr = remainingStr.substring(posOfSpace + 1); + } //else just print + else { + printStr = remainingStr; + remainingStr = ""; + } + + instructionsText.append(printStr + "\n"); + + }// while + + }// for + + }//printInstructions() + + //DO NOT call this directly, go through Sysout + public void displayMessage(String messageIn) { + messageText.append(messageIn + "\n"); + System.out.println(messageIn); + } +}// TestDialog class + diff --git a/jdk/test/java/awt/Mixing/AWT_Mixing/OpaqueOverlapping.java b/jdk/test/java/awt/Mixing/AWT_Mixing/OpaqueOverlapping.java new file mode 100644 index 00000000000..fcfd9ce12be --- /dev/null +++ b/jdk/test/java/awt/Mixing/AWT_Mixing/OpaqueOverlapping.java @@ -0,0 +1,164 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +import com.sun.awt.AWTUtilities; +import java.awt.Frame; +import java.awt.Panel; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.Robot; +import java.awt.event.InputEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import javax.swing.JButton; +import javax.swing.SwingUtilities; + +/** + * AWT/Swing overlapping test for opaque Swing components. + *

This test verify if AWT components are drawn correctly under opaque components. + *

See JDK-6776743 for details + *

See base class for test info. + */ +/* +@test +@bug 6776743 +@summary Opaque overlapping test for each AWT component +@run main OpaqueOverlapping + */ +public class OpaqueOverlapping extends OverlappingTestBase { + + { + useClickValidation = false; + failMessage = "Opacity test mismatchs"; + + // CR 6994264 (Choice autohides dropdown on Solaris 10) + skipClassNames = new String[] { "Choice" }; + } + private String testSeq; + private final static String checkSeq = "010000101"; + private Point heavyLoc; + private JButton light; + private Frame frame = null; + + protected void prepareControls() { + testSeq = ""; + // Create components + if(frame != null) { + frame.setVisible(false); + } + frame = new Frame("OpaqueOverlapping mixing test"); + final Panel panel = new Panel(); + panel.setLayout(null); + + propagateAWTControls(panel); + + // Overlap the buttons + currentAwtControl.setBounds(30, 30, 200, 200); + + light = new JButton(" LW Button "); + light.setBounds(10, 10, 50, 50); + + // Put the components into the frame + panel.add(light); + frame.add(panel); + frame.setBounds(50, 50, 400, 400); + frame.setVisible(true); + + currentAwtControl.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + panel.setComponentZOrder(light, 0); + frame.validate(); + testSeq = testSeq + "0"; + } + }); + light.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent e) { + panel.setComponentZOrder(currentAwtControl, 0); + frame.validate(); + testSeq = testSeq + "1"; + } + }); + } + + @Override + protected boolean performTest() { + try { + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + heavyLoc = currentAwtControl.getLocationOnScreen(); + } + }); + } catch (Exception e) { + } + Robot robot = Util.createRobot(); + robot.setAutoDelay(ROBOT_DELAY); + + Util.waitForIdle(robot); + + // Move the mouse pointer to the position where both + // components overlap + robot.mouseMove(heavyLoc.x + 5, heavyLoc.y + 5); + + // Now perform the click at this point for 9 times + // In the middle of the process toggle the opaque + // flag value. + for (int i = 0; i < 9; ++i) { + if (i == 3) { + AWTUtilities.setComponentMixingCutoutShape(light, + new Rectangle()); + } + if (i == 6) { + AWTUtilities.setComponentMixingCutoutShape(light, + null); + } + + robot.mousePress(InputEvent.BUTTON1_MASK); + robot.mouseRelease(InputEvent.BUTTON1_MASK); + Util.waitForIdle(robot); + + if (currentAwtControl.getClass() == java.awt.Choice.class && i != 1 && i != 6 && i != 8) { + // due to the fact that Choice doesn't get mouseClicked event if its dropdown is shown + robot.mousePress(InputEvent.BUTTON1_MASK); + robot.mouseRelease(InputEvent.BUTTON1_MASK); + Util.waitForIdle(robot); + } + } + + Util.waitForIdle(robot); + + boolean result = testSeq.equals(checkSeq); + if (!result) { + System.err.println("Expected: " + checkSeq); + System.err.println("Observed: " + testSeq); + } + return result; + } + + // this strange plumbing stuff is required due to "Standard Test Machinery" in base class + public static void main(String args[]) throws InterruptedException { + instance = new OpaqueOverlapping(); + OverlappingTestBase.doMain(args); + } +} diff --git a/jdk/test/java/awt/Mixing/AWT_Mixing/OpaqueOverlappingChoice.java b/jdk/test/java/awt/Mixing/AWT_Mixing/OpaqueOverlappingChoice.java new file mode 100644 index 00000000000..896b096b4bb --- /dev/null +++ b/jdk/test/java/awt/Mixing/AWT_Mixing/OpaqueOverlappingChoice.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +/** + * AWT/Swing overlapping test for opaque Choice. + * + * This test case was separated from {@link OpaqueOverlapping} due to CR 6994264 (Choice autohides dropdown on Solaris 10) + */ +/* +@test +@bug 6994264 +@summary Opaque overlapping test for Choice AWT component +@run main OpaqueOverlappingChoice + */ +public class OpaqueOverlappingChoice extends OpaqueOverlapping { + { + onlyClassName = "Choice"; + skipClassNames = null; + } + + // this strange plumbing stuff is required due to "Standard Test Machinery" in base class + public static void main(String args[]) throws InterruptedException { + instance = new OpaqueOverlappingChoice(); + OverlappingTestBase.doMain(args); + } +} + diff --git a/jdk/test/java/awt/Mixing/AWT_Mixing/OverlappingTestBase.java b/jdk/test/java/awt/Mixing/AWT_Mixing/OverlappingTestBase.java new file mode 100644 index 00000000000..f3730b89302 --- /dev/null +++ b/jdk/test/java/awt/Mixing/AWT_Mixing/OverlappingTestBase.java @@ -0,0 +1,800 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.*; +import java.awt.event.*; +import java.awt.peer.ComponentPeer; +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.ArrayList; +import javax.swing.*; +import sun.awt.*; +import java.io.*; + +/** + *

This class provides basis for AWT Mixing testing. + *

It provides all standard test machinery and should be used by + * extending and overriding next methods: + *

  • {@link OverlappingTestBase#prepareControls()} - setup UI components + *
  • {@link OverlappingTestBase#performTest()} - run particular test + * Those methods would be run in the loop for each AWT component. + *

    Current AWT component should be added to the tested UI by {@link OverlappingTestBase#propagateAWTControls(java.awt.Container) ()}. + * There AWT components are prepared to be tested as being overlayed by other (e.g. Swing) components - they are colored to + * {@link OverlappingTestBase#AWT_BACKGROUND_COLOR} and throws failure on catching mouse event. + *

    Validation of component being overlayed should be tested by {@link OverlappingTestBase#clickAndBlink(java.awt.Robot, java.awt.Point) } + * See each method javadoc for more details. + * + *

    Due to test machinery limitations all test should be run from their own main() by calling next coe + * + * public static void main(String args[]) throws InterruptedException { + * instance = new YourTestInstance(); + * OverlappingTestBase.doMain(args); + * } + * + * + * @author Sergey Grinev + */ +public abstract class OverlappingTestBase { + // working variables + private static volatile boolean wasHWClicked = false; + private static volatile boolean passed = true; + // constants + /** + * Default color for AWT component used for validate correct drawing of overlapping. Never use it for lightweight components. + */ + protected static final Color AWT_BACKGROUND_COLOR = new Color(21, 244, 54); + protected static Color AWT_VERIFY_COLOR = AWT_BACKGROUND_COLOR; + protected static final int ROBOT_DELAY = 500; + private static final String[] simpleAwtControls = {"Button", "Checkbox", "Label", "TextArea"}; + /** + * Generic strings array. To be used for population of List based controls. + */ + protected static final String[] petStrings = {"Bird", "Cat", "Dog", "Rabbit", "Rhynocephalia Granda", "Bear", "Tiger", "Mustang"}; + // "properties" + /** + * Tests customization. Set this variable to test only control from java.awt + *

    Usage of this variable should be marked with CR being the reason. + *

    Do not use this variable simultaneously with {@link OverlappingTestBase#skipClassNames} + */ + protected String onlyClassName = null; + /** + * For customizing tests. List classes' simple names to skip them from testings. + *

    Usage of this variable should be marked with CR being the reason. + */ + protected String[] skipClassNames = null; + /** + * Set to false to avoid event delivery validation + * @see OverlappingTestBase#clickAndBlink(java.awt.Robot, java.awt.Point, boolean) + */ + protected boolean useClickValidation = true; + /** + * Set to false if test doesn't supposed to verify EmbeddedFrame + */ + protected boolean testEmbeddedFrame = false; + /** + * Set this variable to true if testing embedded frame is impossible (on Mac, for instance, for now). + * The testEmbeddedFrame is explicitly set to true in dozen places. + */ + protected boolean skipTestingEmbeddedFrame = false; + + public static final boolean isMac = System.getProperty("os.name").toLowerCase().contains("os x"); + private boolean isFrameBorderCalculated; + private int borderShift; + + { if (Toolkit.getDefaultToolkit().getClass().getName().matches(".*L.*Toolkit")) { + // No EmbeddedFrame in LWToolkit/LWCToolkit, yet + // And it should be programmed some other way, too, in any case + System.err.println("skipTestingEmbeddedFrame"); + skipTestingEmbeddedFrame = true; + }else { + System.err.println("do not skipTestingEmbeddedFrame"); + } + } + + protected int frameBorderCounter() { + if (!isFrameBorderCalculated) { + try { + new FrameBorderCounter(); // force compilation by jtreg + String JAVA_HOME = System.getProperty("java.home"); + Process p = Runtime.getRuntime().exec(JAVA_HOME + "/bin/java FrameBorderCounter"); + try { + p.waitFor(); + } catch (InterruptedException e) { + e.printStackTrace(); + throw new RuntimeException(e); + } + if (p.exitValue() != 0) { + throw new RuntimeException("FrameBorderCounter exited with not null code!\n" + readInputStream(p.getErrorStream())); + } + borderShift = Integer.parseInt(readInputStream(p.getInputStream()).trim()); + isFrameBorderCalculated = true; + } catch (IOException e) { + e.printStackTrace(); + System.exit(1); + } + } + return borderShift; + } + + public void getVerifyColor() { + try { + final int size = 200; + final SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit(); + final Point[] p = new Point[1]; + SwingUtilities.invokeAndWait(new Runnable() { + public void run(){ + JFrame frame = new JFrame("set back"); + frame.getContentPane().setBackground(AWT_BACKGROUND_COLOR); + frame.setSize(size, size); + frame.setUndecorated(true); + frame.setVisible(true); + frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); + p[0] = frame.getLocation(); + } + }); + Robot robot = new Robot(); + toolkit.realSync(); + Thread.sleep(ROBOT_DELAY); + AWT_VERIFY_COLOR = robot.getPixelColor(p[0].x+size/2, p[0].y+size/2); + System.out.println("Color will be compared with " + AWT_VERIFY_COLOR + " instead of " + AWT_BACKGROUND_COLOR); + } catch (Exception e) { + System.err.println("Cannot get verify color: "+e.getMessage()); + } + } + + private String readInputStream(InputStream is) throws IOException { + byte[] buffer = new byte[4096]; + int len = 0; + StringBuilder sb = new StringBuilder(); + try (InputStreamReader isr = new InputStreamReader(is)) { + while ((len = is.read(buffer)) > 0) { + sb.append(new String(buffer, 0, len)); + } + } + return sb.toString(); + } + + private void setupControl(final Component control) { + if (useClickValidation) { + control.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + System.err.println("ERROR: " + control.getClass() + " received mouse click."); + wasHWClicked = true; + } + }); + } + control.setBackground(AWT_BACKGROUND_COLOR); + control.setForeground(AWT_BACKGROUND_COLOR); + control.setPreferredSize(new Dimension(150, 150)); + control.setFocusable(false); + } + + private void addAwtControl(java.util.List container, final Component control) { + String simpleName = control.getClass().getSimpleName(); + if (onlyClassName != null && !simpleName.equals(onlyClassName)) { + return; + } + if (skipClassNames != null) { + for (String skipMe : skipClassNames) { + if (simpleName.equals(skipMe)) { + return; + } + } + } + setupControl(control); + container.add(control); + } + + private void addSimpleAwtControl(java.util.List container, String className) { + try { + Class definition = Class.forName("java.awt." + className); + Constructor constructor = definition.getConstructor(new Class[]{String.class}); + java.awt.Component component = (java.awt.Component) constructor.newInstance(new Object[]{"AWT Component " + className}); + addAwtControl(container, component); + } catch (Exception ex) { + System.err.println(ex.getMessage()); + fail("Setup error, this jdk doesn't have awt conrol " + className); + } + } + + /** + * Adds current AWT control to container + *

    N.B.: if testEmbeddedFrame == true this method will also add EmbeddedFrame over Canvas + * and it should be called after Frame.setVisible(true) call + * @param container container to hold AWT component + */ + protected final void propagateAWTControls(Container container) { + if (currentAwtControl != null) { + container.add(currentAwtControl); + } else { // embedded frame + try { + + //create embedder + Canvas embedder = new Canvas(); + embedder.setBackground(Color.RED); + embedder.setPreferredSize(new Dimension(150, 150)); + container.add(embedder); + container.setVisible(true); // create peer + + long frameWindow = 0; + String getWindowMethodName = "getHWnd"; + if (Toolkit.getDefaultToolkit().getClass().getName().contains("XToolkit")) { + getWindowMethodName = "getWindow"; + } + ComponentPeer peer = embedder.getPeer(); +// System.err.println("Peer: " + peer); + Method getWindowMethod = peer.getClass().getMethod(getWindowMethodName); + frameWindow = (Long) getWindowMethod.invoke(peer); +// System.err.println("frame peer ID: " + frameWindow); + + String eframeClassName = "sun.awt.windows.WEmbeddedFrame"; + if (Toolkit.getDefaultToolkit().getClass().getName().contains("XToolkit")) { + eframeClassName = "sun.awt.X11.XEmbeddedFrame"; + } + Class eframeClass = Class.forName(eframeClassName); + Constructor eframeCtor = eframeClass.getConstructor(long.class); + EmbeddedFrame eframe = (EmbeddedFrame) eframeCtor.newInstance(frameWindow); + setupControl(eframe); + eframe.setSize(new Dimension(150, 150)); + eframe.setVisible(true); +// System.err.println(eframe.getSize()); + } catch (Exception ex) { + ex.printStackTrace(); + fail("Failed to instantiate EmbeddedFrame: " + ex.getMessage()); + } + } + } + private static final Font hugeFont = new Font("Arial", Font.BOLD, 70); + + private java.util.List getAWTControls() { + java.util.List components = new ArrayList(); + + for (String clazz : simpleAwtControls) { + addSimpleAwtControl(components, clazz); + } + + TextField tf = new TextField(); + tf.setFont(hugeFont); + addAwtControl(components, tf); + + // more complex controls + Choice c = new Choice(); + for (int i = 0; i < petStrings.length; i++) { + c.add(petStrings[i]); + } + addAwtControl(components, c); + c.setPreferredSize(null); + c.setFont(hugeFont); // to make control bigger as setPrefferedSize don't do his job here + + List l = new List(petStrings.length); + for (int i = 0; i < petStrings.length; i++) { + l.add(petStrings[i]); + } + addAwtControl(components, l); + + Canvas canvas = new Canvas(); + canvas.setSize(100, 200); + addAwtControl(components, canvas); + + Scrollbar sb = new Scrollbar(Scrollbar.VERTICAL, 500, 1, 0, 500); + addAwtControl(components, sb); + + Scrollbar sb2 = new Scrollbar(Scrollbar.HORIZONTAL, 500, 1, 0, 500); + addAwtControl(components, sb2); + + return components; + } + /** + * Default shift for {@link OverlappingTestBase#clickAndBlink(java.awt.Robot, java.awt.Point) } + */ + protected static Point shift = new Point(16, 16); + + /** + * Verifies point using specified AWT Robot. Supposes defaultShift == true for {@link OverlappingTestBase#clickAndBlink(java.awt.Robot, java.awt.Point, boolean) }. + * This method is used to verify controls by providing just their plain screen coordinates. + * @param robot AWT Robot. Usually created by {@link Util#createRobot() } + * @param lLoc point to verify + * @see OverlappingTestBase#clickAndBlink(java.awt.Robot, java.awt.Point, boolean) + */ + protected void clickAndBlink(Robot robot, Point lLoc) { + clickAndBlink(robot, lLoc, true); + } + /** + * Default failure message for color check + * @see OverlappingTestBase#performTest() + */ + protected String failMessageColorCheck = "The LW component did not pass pixel color check and is overlapped"; + /** + * Default failure message event check + * @see OverlappingTestBase#performTest() + */ + protected String failMessage = "The LW component did not received the click."; + + private static boolean isValidForPixelCheck(Component component) { + if ((component instanceof java.awt.Scrollbar) || isMac && (component instanceof java.awt.Button)) { + return false; + } + return true; + } + + /** + * Preliminary validation - should be run before overlapping happens to ensure test is correct. + * @param robot AWT Robot. Usually created by {@link Util#createRobot() } + * @param lLoc point to validate to be of {@link OverlappingTestBase#AWT_BACKGROUND_COLOR} + * @param component tested component, should be pointed out as not all components are valid for pixel check. + */ + protected void pixelPreCheck(Robot robot, Point lLoc, Component component) { + if (isValidForPixelCheck(component)) { + int tries = 10; + Color c = null; + while (tries-- > 0) { + c = robot.getPixelColor(lLoc.x, lLoc.y); + System.out.println("Precheck. color: "+c+" compare with "+AWT_VERIFY_COLOR); + if (c.equals(AWT_VERIFY_COLOR)) { + return; + } + try { + Thread.sleep(100); + } catch (InterruptedException e) { + } + } + System.err.println(lLoc + ": " + c); + fail("Dropdown test setup failure, colored part of AWT component is not located at click area"); + } + } + + /** + * Verifies point using specified AWT Robot. + *

    Firstly, verifies point by color pixel check + *

    Secondly, verifies event delivery by mouse click + * @param robot AWT Robot. Usually created by {@link Util#createRobot() } + * @param lLoc point to verify + * @param defaultShift if true verified position will be shifted by {@link OverlappingTestBase#shift }. + */ + protected void clickAndBlink(Robot robot, Point lLoc, boolean defaultShift) { + Point loc = lLoc.getLocation(); + //check color + Util.waitForIdle(robot); + try{ + Thread.sleep(500); + }catch(Exception exx){ + exx.printStackTrace(); + } + + if (defaultShift) { + loc.translate(shift.x, shift.y); + } + if (!(System.getProperty("os.name").toLowerCase().contains("os x"))) { + Color c = robot.getPixelColor(loc.x, loc.y); + System.out.println("C&B. color: "+c+" compare with "+AWT_VERIFY_COLOR); + if (c.equals(AWT_VERIFY_COLOR)) { + fail(failMessageColorCheck); + passed = false; + } + + // perform click + Util.waitForIdle(robot); + } + + robot.mouseMove(loc.x, loc.y); + + robot.mousePress(InputEvent.BUTTON1_MASK); + robot.mouseRelease(InputEvent.BUTTON1_MASK); + Util.waitForIdle(robot); + } + + /** + * This method should be overriden with code which setups UI for testing. + * Code in this method will be called only from AWT thread so Swing operations can be called directly. + * + * @see {@link OverlappingTestBase#propagateAWTControls(java.awt.Container) } for instructions about adding tested AWT control to UI + */ + protected abstract void prepareControls(); + + /** + * This method should be overriden with test execution. It will not be called from AWT thread so all Swing operations should be treated accordingly. + * @return true if test passed. Otherwise fail with default fail message. + * @see {@link OverlappingTestBase#failMessage} default fail message + */ + protected abstract boolean performTest(); + /** + * This method can be overriden with cleanup routines. It will be called from AWT thread so all Swing operations should be treated accordingly. + */ + protected void cleanup() { + // intentionally do nothing + } + /** + * Currect tested AWT Control. Usually shouldn't be accessed directly. + * + * @see {@link OverlappingTestBase#propagateAWTControls(java.awt.Container) } for instructions about adding tested AWT control to UI + */ + protected Component currentAwtControl; + + private void testComponent(Component component) throws InterruptedException, InvocationTargetException { + currentAwtControl = component; + System.out.println("Testing " + currentAwtControl.getClass().getSimpleName()); + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + prepareControls(); + } + }); + if (component != null) { + Util.waitTillShown(component); + } + Util.waitForIdle(null); + try { + Thread.sleep(500); // wait for graphic effects on systems like Win7 + } catch (InterruptedException ex) { + } + if (!instance.performTest()) { + fail(failMessage); + passed = false; + } + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + cleanup(); + } + }); + } + + private void testEmbeddedFrame() throws InvocationTargetException, InterruptedException { + System.out.println("Testing EmbeddedFrame"); + currentAwtControl = null; + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + prepareControls(); + } + }); + Util.waitForIdle(null); + try { + Thread.sleep(500); // wait for graphic effects on systems like Win7 + } catch (InterruptedException ex) { + } + if (!instance.performTest()) { + fail(failMessage); + passed = false; + } + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + cleanup(); + } + }); + } + + private void testAwtControls() throws InterruptedException { + try { + for (Component component : getAWTControls()) { + testComponent(component); + } + if (testEmbeddedFrame && !skipTestingEmbeddedFrame) { + testEmbeddedFrame(); + } + } catch (InvocationTargetException ex) { + ex.printStackTrace(); + fail(ex.getMessage()); + } + } + /** + * Used by standard test machinery. See usage at {@link OverlappingTestBase } + */ + protected static OverlappingTestBase instance; + + protected OverlappingTestBase() { + getVerifyColor(); + } + + /***************************************************** + * Standard Test Machinery Section + * DO NOT modify anything in this section -- it's a + * standard chunk of code which has all of the + * synchronisation necessary for the test harness. + * By keeping it the same in all tests, it is easier + * to read and understand someone else's test, as + * well as insuring that all tests behave correctly + * with the test harness. + * There is a section following this for test- + * classes + ******************************************************/ + private static void init() throws InterruptedException { + //*** Create instructions for the user here *** + //System.setProperty("sun.awt.disableMixing", "true"); + + String[] instructions = { + "This is an AUTOMATIC test, simply wait until it is done.", + "The result (passed or failed) will be shown in the", + "message window below." + }; + Sysout.createDialog(); + Sysout.printInstructions(instructions); + + instance.testAwtControls(); + + if (wasHWClicked) { + fail("HW component received the click."); + passed = false; + } + if (passed) { + pass(); + } + }//End init() + private static boolean theTestPassed = false; + private static boolean testGeneratedInterrupt = false; + private static String failureMessage = ""; + private static Thread mainThread = null; + private static int sleepTime = 300000; + + // Not sure about what happens if multiple of this test are + // instantiated in the same VM. Being static (and using + // static vars), it aint gonna work. Not worrying about + // it for now. + /** + * Starting point for test runs. See usage at {@link OverlappingTestBase } + * @param args regular main args, not used. + * @throws InterruptedException + */ + public static void doMain(String args[]) throws InterruptedException { + mainThread = Thread.currentThread(); + try { + init(); + } catch (TestPassedException e) { + //The test passed, so just return from main and harness will + // interepret this return as a pass + return; + } + //At this point, neither test pass nor test fail has been + // called -- either would have thrown an exception and ended the + // test, so we know we have multiple threads. + + //Test involves other threads, so sleep and wait for them to + // called pass() or fail() + try { + Thread.sleep(sleepTime); + //Timed out, so fail the test + throw new RuntimeException("Timed out after " + sleepTime / 1000 + " seconds"); + } catch (InterruptedException e) { + //The test harness may have interrupted the test. If so, rethrow the exception + // so that the harness gets it and deals with it. + if (!testGeneratedInterrupt) { + throw e; + } + + //reset flag in case hit this code more than once for some reason (just safety) + testGeneratedInterrupt = false; + + if (theTestPassed == false) { + throw new RuntimeException(failureMessage); + } + } + + }//main + + /** + * Test will fail if not passed after this timeout. Default timeout is 300 seconds. + * @param seconds timeout in seconds + */ + public static synchronized void setTimeoutTo(int seconds) { + sleepTime = seconds * 1000; + } + + /** + * Set test as passed. Usually shoudn't be called directly. + */ + public static synchronized void pass() { + Sysout.println("The test passed."); + Sysout.println("The test is over, hit Ctl-C to stop Java VM"); + //first check if this is executing in main thread + if (mainThread == Thread.currentThread()) { + //Still in the main thread, so set the flag just for kicks, + // and throw a test passed exception which will be caught + // and end the test. + theTestPassed = true; + throw new TestPassedException(); + } + theTestPassed = true; + testGeneratedInterrupt = true; + mainThread.interrupt(); + }//pass() + + /** + * Fail test generic message. + */ + public static synchronized void fail() { + //test writer didn't specify why test failed, so give generic + fail("it just plain failed! :-)"); + } + + /** + * Fail test providing specific reason. + * @param whyFailed reason + */ + public static synchronized void fail(String whyFailed) { + Sysout.println("The test failed: " + whyFailed); + Sysout.println("The test is over, hit Ctl-C to stop Java VM"); + //check if this called from main thread + if (mainThread == Thread.currentThread()) { + //If main thread, fail now 'cause not sleeping + throw new RuntimeException(whyFailed); + } + theTestPassed = false; + testGeneratedInterrupt = true; + failureMessage = whyFailed; + mainThread.interrupt(); + }//fail() +}// class LWComboBox +class TestPassedException extends RuntimeException { +} + +//*********** End Standard Test Machinery Section ********** +//************ Begin classes defined for the test **************** +// if want to make listeners, here is the recommended place for them, then instantiate +// them in init() + +/* Example of a class which may be written as part of a test +class NewClass implements anInterface +{ +static int newVar = 0; + +public void eventDispatched(AWTEvent e) +{ +//Counting events to see if we get enough +eventCount++; + +if( eventCount == 20 ) +{ +//got enough events, so pass + +LWComboBox.pass(); +} +else if( tries == 20 ) +{ +//tried too many times without getting enough events so fail + +LWComboBox.fail(); +} + +}// eventDispatched() + +}// NewClass class + + */ +//************** End classes defined for the test ******************* +/**************************************************** +Standard Test Machinery +DO NOT modify anything below -- it's a standard +chunk of code whose purpose is to make user +interaction uniform, and thereby make it simpler +to read and understand someone else's test. + ****************************************************/ +/** +This is part of the standard test machinery. +It creates a dialog (with the instructions), and is the interface +for sending text messages to the user. +To print the instructions, send an array of strings to Sysout.createDialog +WithInstructions method. Put one line of instructions per array entry. +To display a message for the tester to see, simply call Sysout.println +with the string to be displayed. +This mimics System.out.println but works within the test harness as well +as standalone. + */ +class Sysout { + private static TestDialog dialog; + + public static void createDialogWithInstructions(String[] instructions) { + dialog = new TestDialog(new Frame(), "Instructions"); + dialog.printInstructions(instructions); + //dialog.setVisible(true); + println("Any messages for the tester will display here."); + } + + public static void createDialog() { + dialog = new TestDialog(new Frame(), "Instructions"); + String[] defInstr = {"Instructions will appear here. ", ""}; + dialog.printInstructions(defInstr); + //dialog.setVisible(true); + println("Any messages for the tester will display here."); + } + + public static void printInstructions(String[] instructions) { + dialog.printInstructions(instructions); + } + + public static void println(String messageIn) { + dialog.displayMessage(messageIn); + System.out.println(messageIn); + } +}// Sysout class + +/** +This is part of the standard test machinery. It provides a place for the +test instructions to be displayed, and a place for interactive messages +to the user to be displayed. +To have the test instructions displayed, see Sysout. +To have a message to the user be displayed, see Sysout. +Do not call anything in this dialog directly. + */ +class TestDialog extends Dialog { + TextArea instructionsText; + TextArea messageText; + int maxStringLength = 80; + + //DO NOT call this directly, go through Sysout + public TestDialog(Frame frame, String name) { + super(frame, name); + int scrollBoth = TextArea.SCROLLBARS_BOTH; + instructionsText = new TextArea("", 15, maxStringLength, scrollBoth); + add("North", instructionsText); + + messageText = new TextArea("", 5, maxStringLength, scrollBoth); + add("Center", messageText); + + pack(); + + //setVisible(true); + }// TestDialog() + + //DO NOT call this directly, go through Sysout + public void printInstructions(String[] instructions) { + //Clear out any current instructions + instructionsText.setText(""); + + //Go down array of instruction strings + + String printStr, remainingStr; + for (int i = 0; i < instructions.length; i++) { + //chop up each into pieces maxSringLength long + remainingStr = instructions[i]; + while (remainingStr.length() > 0) { + //if longer than max then chop off first max chars to print + if (remainingStr.length() >= maxStringLength) { + //Try to chop on a word boundary + int posOfSpace = remainingStr.lastIndexOf(' ', maxStringLength - 1); + + if (posOfSpace <= 0) { + posOfSpace = maxStringLength - 1; + } + + printStr = remainingStr.substring(0, posOfSpace + 1); + remainingStr = remainingStr.substring(posOfSpace + 1); + } //else just print + else { + printStr = remainingStr; + remainingStr = ""; + } + + instructionsText.append(printStr + "\n"); + + }// while + + }// for + + }//printInstructions() + + //DO NOT call this directly, go through Sysout + public void displayMessage(String messageIn) { + messageText.append(messageIn + "\n"); + System.out.println(messageIn); + } +}// TestDialog class + diff --git a/jdk/test/java/awt/Mixing/AWT_Mixing/SimpleOverlappingTestBase.java b/jdk/test/java/awt/Mixing/AWT_Mixing/SimpleOverlappingTestBase.java new file mode 100644 index 00000000000..4d81127a772 --- /dev/null +++ b/jdk/test/java/awt/Mixing/AWT_Mixing/SimpleOverlappingTestBase.java @@ -0,0 +1,160 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.*; +import java.awt.event.*; +import javax.swing.*; + +/** + * Base class for testing overlapping of Swing and AWT component put into one frame. + * Validates drawing and event delivery at the components intersection. + *

    See base class for usage + * + * @author Sergey Grinev +*/ +public abstract class SimpleOverlappingTestBase extends OverlappingTestBase { + + { + testEmbeddedFrame = true; + } + + /** + * Event delivery validation. If set to true (default) tested lightweight component will be provided + * with mouse listener which should be called in order for test to pass. + */ + protected final boolean useDefaultClickValidation; + + /** + * Constructor which sets {@link SimpleOverlappingTestBase#useDefaultClickValidation } + * @param defaultClickValidation + */ + protected SimpleOverlappingTestBase(boolean defaultClickValidation) { + super(); + this.useDefaultClickValidation = defaultClickValidation; + } + + public SimpleOverlappingTestBase() { + this(true); + } + + //overridables + /** + * Successors override this method providing swing component for testing + * @return swing component to test + */ + protected abstract JComponent getSwingComponent(); + + /** + * For tests debugging. Please, ignore. + */ + protected static final boolean debug = false; + + /** + * Should be set to true if test isn't using {@link SimpleOverlappingTestBase#useDefaultClickValidation } + */ + protected volatile boolean wasLWClicked = false; + + /** + * Current tested lightweight component + * @see SimpleOverlappingTestBase#getSwingComponent() + */ + protected JComponent testedComponent; + + /** + * Setups simple frame with lightweight component returned by {@link SimpleOverlappingTestBase#getSwingComponent() } + * Called by base class. + */ + protected void prepareControls() { + wasLWClicked = false; + + final JFrame f = new JFrame("Mixing : Simple Overlapping test"); + f.setLayout(new SpringLayout()); + f.setSize(200, 200); + + testedComponent = getSwingComponent(); + + if (useDefaultClickValidation) { + testedComponent.addMouseListener(new MouseAdapter() { + + @Override + public void mouseClicked(MouseEvent e) { + wasLWClicked = true; + f.setVisible(false); + } + }); + } + + if (!debug) { + f.add(testedComponent); + } else { + System.err.println("Warning: DEBUG MODE"); + } + + propagateAWTControls(f); + + f.setVisible(true); + } + + /** + * AWT Robot instance. Shouldn't be used in most cases. + */ + protected Robot robot; + + /** + * Run test by {@link OverlappingTestBase#clickAndBlink(java.awt.Robot, java.awt.Point) } validation for current lightweight component. + *

    Called by base class. + * @return true if test passed + */ + protected boolean performTest() { + testedComponent.requestFocus(); + + // run robot + robot = Util.createRobot(); + robot.setAutoDelay(20); + + // get coord + Point lLoc = !debug ? testedComponent.getLocationOnScreen() : new Point(70, 30); + Util.waitForIdle(null); + /* this is a workaround for certain jtreg(?) focus issue: + tests fail starting after failing mixing tests but always pass alone. + */ + JFrame ancestor = (JFrame)(testedComponent.getTopLevelAncestor()); + if( ancestor != null ) { + Point ancestorLoc = ancestor.getLocationOnScreen(); + ancestorLoc.translate(ancestor.getWidth()/2-15, 2); + robot.mouseMove(ancestorLoc.x, ancestorLoc.y); + Util.waitForIdle(robot); + robot.mousePress(InputEvent.BUTTON1_MASK); + robot.delay(50); + robot.mouseRelease(InputEvent.BUTTON1_MASK); + Util.waitForIdle(robot); + } + + clickAndBlink(robot, lLoc); + Util.waitForIdle(null); + + return wasLWClicked; + } + +} + diff --git a/jdk/test/java/awt/Mixing/AWT_Mixing/Util.java b/jdk/test/java/awt/Mixing/AWT_Mixing/Util.java new file mode 100644 index 00000000000..6bebdc881dc --- /dev/null +++ b/jdk/test/java/awt/Mixing/AWT_Mixing/Util.java @@ -0,0 +1,601 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Component; +import java.awt.Frame; +import java.awt.Dialog; +import java.awt.Window; +import java.awt.Button; +import java.awt.Point; +import java.awt.Dimension; +import java.awt.Rectangle; +import java.awt.Robot; +import java.awt.Toolkit; +import java.awt.IllegalComponentStateException; +import java.awt.AWTException; +import java.awt.AWTEvent; + +import java.awt.event.InputEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.awt.event.ActionEvent; +import java.awt.event.FocusEvent; +import java.awt.event.WindowListener; +import java.awt.event.WindowFocusListener; +import java.awt.event.FocusListener; +import java.awt.event.ActionListener; + +import java.awt.peer.FramePeer; + +import java.lang.reflect.Constructor; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + +import java.security.PrivilegedAction; +import java.security.AccessController; + +import java.util.concurrent.atomic.AtomicBoolean; + +/** + *

    This class contains utilities useful for regression testing. + *

    When using jtreg you would include this class into the build + * list via something like: + *

    +     &library ../../../../share/lib/AWT_Mixing/src/regtesthelpers/
    +     &build Util
    +     &run main YourTest
    +   
    + * Note that if you are about to create a test based on + * Applet-template, then put those lines into html-file, not in java-file. + *

    And put an + * import regtesthelpers.Util; + * into the java source of test. +*/ +public final class Util { + private Util() {} // this is a helper class with static methods :) + + /* + * @throws RuntimeException when creation failed + */ + public static Robot createRobot() { + try { + return new Robot(); + } catch (AWTException e) { + throw new RuntimeException("Error: unable to create robot", e); + } + } + + public static Frame createEmbeddedFrame(final Frame embedder) + throws ClassNotFoundException, NoSuchFieldException, IllegalAccessException, NoSuchMethodException, + InstantiationException, InvocationTargetException + { + Toolkit tk = Toolkit.getDefaultToolkit(); + FramePeer frame_peer = (FramePeer) embedder.getPeer(); + System.out.println("frame's peer = " + frame_peer); + if ("sun.awt.windows.WToolkit".equals(tk.getClass().getName())) { + Class comp_peer_class = + Class.forName("sun.awt.windows.WComponentPeer"); + System.out.println("comp peer class = " + comp_peer_class); + Field hwnd_field = comp_peer_class.getDeclaredField("hwnd"); + hwnd_field.setAccessible(true); + System.out.println("hwnd_field =" + hwnd_field); + long hwnd = hwnd_field.getLong(frame_peer); + System.out.println("hwnd = " + hwnd); + + Class clazz = Class.forName("sun.awt.windows.WEmbeddedFrame"); + Constructor constructor = clazz.getConstructor (new Class [] {Long.TYPE}); + return (Frame) constructor.newInstance (new Object[] {hwnd}); + } else if ("sun.awt.X11.XToolkit".equals(tk.getClass().getName())) { + Class x_base_window_class = Class.forName("sun.awt.X11.XBaseWindow"); + System.out.println("x_base_window_class = " + x_base_window_class); + Method get_window = x_base_window_class.getMethod("getWindow", new Class[0]); + System.out.println("get_window = " + get_window); + long window = (Long) get_window.invoke(frame_peer, new Object[0]); + System.out.println("window = " + window); + Class clazz = Class.forName("sun.awt.X11.XEmbeddedFrame"); + Constructor constructor = clazz.getConstructor (new Class [] {Long.TYPE, Boolean.TYPE}); + return (Frame) constructor.newInstance (new Object[] {window, true}); + } + + throw new RuntimeException("Unexpected toolkit - " + tk); + } + + /** + * Makes the window visible and waits until it's shown. + */ + public static void showWindowWait(Window win) { + win.setVisible(true); + waitTillShown(win); + } + + /** + * Moves mouse pointer in the center of given {@code comp} component + * using {@code robot} parameter. + */ + public static void pointOnComp(final Component comp, final Robot robot) { + Rectangle bounds = new Rectangle(comp.getLocationOnScreen(), comp.getSize()); + robot.mouseMove(bounds.x + bounds.width / 2, bounds.y + bounds.height / 2); + } + + /** + * Moves mouse pointer in the center of a given {@code comp} component + * and performs a left mouse button click using the {@code robot} parameter + * with the {@code delay} delay between press and release. + */ + public static void clickOnComp(final Component comp, final Robot robot, int delay) { + pointOnComp(comp, robot); + robot.delay(delay); + robot.mousePress(InputEvent.BUTTON1_MASK); + robot.delay(delay); + robot.mouseRelease(InputEvent.BUTTON1_MASK); + } + + /** + * Moves mouse pointer in the center of a given {@code comp} component + * and performs a left mouse button click using the {@code robot} parameter + * with the default delay between press and release. + */ + public static void clickOnComp(final Component comp, final Robot robot) { + clickOnComp(comp, robot, 50); + } + + /* + * Clicks on a title of Frame/Dialog. + * WARNING: it may fail on some platforms when the window is not wide enough. + */ + public static void clickOnTitle(final Window decoratedWindow, final Robot robot) { + Point p = decoratedWindow.getLocationOnScreen(); + Dimension d = decoratedWindow.getSize(); + + if (decoratedWindow instanceof Frame || decoratedWindow instanceof Dialog) { + robot.mouseMove(p.x + (int)(d.getWidth()/2), p.y + (int)decoratedWindow.getInsets().top/2); + robot.delay(50); + robot.mousePress(InputEvent.BUTTON1_MASK); + robot.delay(50); + robot.mouseRelease(InputEvent.BUTTON1_MASK); + } + } + + public static void waitForIdle(final Robot robot) { + // we do not use robot for now, use SunToolkit.realSync() instead + ((sun.awt.SunToolkit)Toolkit.getDefaultToolkit()).realSync(); + } + + public static Field getField(final Class klass, final String fieldName) { + return AccessController.doPrivileged(new PrivilegedAction() { + public Field run() { + try { + Field field = klass.getDeclaredField(fieldName); + assert (field != null); + field.setAccessible(true); + return field; + } catch (SecurityException se) { + throw new RuntimeException("Error: unexpected exception caught!", se); + } catch (NoSuchFieldException nsfe) { + throw new RuntimeException("Error: unexpected exception caught!", nsfe); + } + } + }); + } + + /* + * Waits for a notification and for a boolean condition to become true. + * The method returns when the above conditions are fullfilled or when the timeout + * occurs. + * + * @param condition the object to be notified and the booelan condition to wait for + * @param timeout the maximum time to wait in milliseconds + * @param catchExceptions if {@code true} the method catches InterruptedException + * @return the final boolean value of the {@code condition} + * @throws InterruptedException if the awaiting proccess has been interrupted + */ + public static boolean waitForConditionEx(final AtomicBoolean condition, long timeout) + throws InterruptedException + { + synchronized (condition) { + long startTime = System.currentTimeMillis(); + while (!condition.get()) { + condition.wait(timeout); + if (System.currentTimeMillis() - startTime >= timeout ) { + break; + } + } + } + return condition.get(); + } + + /* + * The same as {@code waitForConditionEx(AtomicBoolean, long)} except that it + * doesn't throw InterruptedException. + */ + public static boolean waitForCondition(final AtomicBoolean condition, long timeout) { + try { + return waitForConditionEx(condition, timeout); + } catch (InterruptedException e) { + throw new RuntimeException("Error: unexpected exception caught!", e); + } + } + + /* + * The same as {@code waitForConditionEx(AtomicBoolean, long)} but without a timeout. + */ + public static void waitForConditionEx(final AtomicBoolean condition) + throws InterruptedException + { + synchronized (condition) { + while (!condition.get()) { + condition.wait(); + } + } + } + + /* + * The same as {@code waitForConditionEx(AtomicBoolean)} except that it + * doesn't throw InterruptedException. + */ + public static void waitForCondition(final AtomicBoolean condition) { + try { + waitForConditionEx(condition); + } catch (InterruptedException e) { + throw new RuntimeException("Error: unexpected exception caught!", e); + } + } + + public static void waitTillShownEx(final Component comp) throws InterruptedException { + while (true) { + try { + Thread.sleep(100); + comp.getLocationOnScreen(); + break; + } catch (IllegalComponentStateException e) {} + } + } + public static void waitTillShown(final Component comp) { + try { + waitTillShownEx(comp); + } catch (InterruptedException e) { + throw new RuntimeException("Error: unexpected exception caught!", e); + } + } + + /** + * Drags from one point to another with the specified mouse button pressed. + * + * @param robot a robot to use for moving the mouse, etc. + * @param startPoint a start point of the drag + * @param endPoint an end point of the drag + * @param button one of {@code InputEvent.BUTTON1_MASK}, + * {@code InputEvent.BUTTON2_MASK}, {@code InputEvent.BUTTON3_MASK} + * + * @throws IllegalArgumentException if {@code button} is not one of + * {@code InputEvent.BUTTON1_MASK}, {@code InputEvent.BUTTON2_MASK}, + * {@code InputEvent.BUTTON3_MASK} + */ + public static void drag(Robot robot, Point startPoint, Point endPoint, int button) { + if (!(button == InputEvent.BUTTON1_MASK || button == InputEvent.BUTTON2_MASK + || button == InputEvent.BUTTON3_MASK)) + { + throw new IllegalArgumentException("invalid mouse button"); + } + + robot.mouseMove(startPoint.x, startPoint.y); + robot.mousePress(button); + try { + mouseMove(robot, startPoint, endPoint); + } finally { + robot.mouseRelease(button); + } + } + + /** + * Moves the mouse pointer from one point to another. + * Uses Bresenham's algorithm. + * + * @param robot a robot to use for moving the mouse + * @param startPoint a start point of the drag + * @param endPoint an end point of the drag + */ + public static void mouseMove(Robot robot, Point startPoint, Point endPoint) { + int dx = endPoint.x - startPoint.x; + int dy = endPoint.y - startPoint.y; + + int ax = Math.abs(dx) * 2; + int ay = Math.abs(dy) * 2; + + int sx = signWOZero(dx); + int sy = signWOZero(dy); + + int x = startPoint.x; + int y = startPoint.y; + + int d = 0; + + if (ax > ay) { + d = ay - ax/2; + while (true){ + robot.mouseMove(x, y); + robot.delay(50); + + if (x == endPoint.x){ + return; + } + if (d >= 0){ + y = y + sy; + d = d - ax; + } + x = x + sx; + d = d + ay; + } + } else { + d = ax - ay/2; + while (true){ + robot.mouseMove(x, y); + robot.delay(50); + + if (y == endPoint.y){ + return; + } + if (d >= 0){ + x = x + sx; + d = d - ay; + } + y = y + sy; + d = d + ax; + } + } + } + + private static int signWOZero(int i){ + return (i > 0)? 1: -1; + } + + private static int sign(int n) { + return n < 0 ? -1 : n == 0 ? 0 : 1; + } + + /** Returns {@code WindowListener} instance that diposes {@code Window} on + * "window closing" event. + * + * @return the {@code WindowListener} instance that could be set + * on a {@code Window}. After that + * the {@code Window} is disposed when "window closed" + * event is sent to the {@code Window} + */ + public static WindowListener getClosingWindowAdapter() { + return new WindowAdapter () { + public void windowClosing(WindowEvent e) { + e.getWindow().dispose(); + } + }; + } + + /* + * The values directly map to the ones of + * sun.awt.X11.XWM & sun.awt.motif.MToolkit classes. + */ + public final static int + UNDETERMINED_WM = 1, + NO_WM = 2, + OTHER_WM = 3, + OPENLOOK_WM = 4, + MOTIF_WM = 5, + CDE_WM = 6, + ENLIGHTEN_WM = 7, + KDE2_WM = 8, + SAWFISH_WM = 9, + ICE_WM = 10, + METACITY_WM = 11, + COMPIZ_WM = 12, + LG3D_WM = 13; + + /* + * Returns -1 in case of not X Window or any problems. + */ + public static int getWMID() { + Class clazz = null; + try { + if ("sun.awt.X11.XToolkit".equals(Toolkit.getDefaultToolkit().getClass().getName())) { + clazz = Class.forName("sun.awt.X11.XWM"); + } else if ("sun.awt.motif.MToolkit".equals(Toolkit.getDefaultToolkit().getClass().getName())) { + clazz = Class.forName("sun.awt.motif.MToolkit"); + } + } catch (ClassNotFoundException cnfe) { + cnfe.printStackTrace(); + } + if (clazz == null) { + return -1; + } + + try { + final Class _clazz = clazz; + Method m_getWMID = (Method)AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + try { + Method method = _clazz.getDeclaredMethod("getWMID", new Class[] {}); + if (method != null) { + method.setAccessible(true); + } + return method; + } catch (NoSuchMethodException e) { + assert false; + } catch (SecurityException e) { + assert false; + } + return null; + } + }); + return ((Integer)m_getWMID.invoke(null, new Object[] {})).intValue(); + } catch (IllegalAccessException iae) { + iae.printStackTrace(); + } catch (InvocationTargetException ite) { + ite.printStackTrace(); + } + return -1; + } + + + //////////////////////////// + // Some stuff to test focus. + //////////////////////////// + + private static WindowGainedFocusListener wgfListener = new WindowGainedFocusListener(); + private static FocusGainedListener fgListener = new FocusGainedListener(); + private static ActionPerformedListener apListener = new ActionPerformedListener(); + + private abstract static class EventListener { + AtomicBoolean notifier = new AtomicBoolean(false); + Component comp; + boolean printEvent; + + public void listen(Component comp, boolean printEvent) { + this.comp = comp; + this.printEvent = printEvent; + notifier.set(false); + setListener(comp); + } + + public AtomicBoolean getNotifier() { + return notifier; + } + + abstract void setListener(Component comp); + + void printAndNotify(AWTEvent e) { + if (printEvent) { + System.err.println(e); + } + synchronized (notifier) { + notifier.set(true); + notifier.notifyAll(); + } + } + } + + private static class WindowGainedFocusListener extends EventListener implements WindowFocusListener { + + void setListener(Component comp) { + ((Window)comp).addWindowFocusListener(this); + } + + public void windowGainedFocus(WindowEvent e) { + + ((Window)comp).removeWindowFocusListener(this); + printAndNotify(e); + } + + public void windowLostFocus(WindowEvent e) {} + } + + private static class FocusGainedListener extends EventListener implements FocusListener { + + void setListener(Component comp) { + comp.addFocusListener(this); + } + + public void focusGained(FocusEvent e) { + comp.removeFocusListener(this); + printAndNotify(e); + } + + public void focusLost(FocusEvent e) {} + } + + private static class ActionPerformedListener extends EventListener implements ActionListener { + + void setListener(Component comp) { + ((Button)comp).addActionListener(this); + } + + public void actionPerformed(ActionEvent e) { + ((Button)comp).removeActionListener(this); + printAndNotify(e); + } + } + + private static boolean trackEvent(int eventID, Component comp, Runnable action, int time, boolean printEvent) { + EventListener listener = null; + + switch (eventID) { + case WindowEvent.WINDOW_GAINED_FOCUS: + listener = wgfListener; + break; + case FocusEvent.FOCUS_GAINED: + listener = fgListener; + break; + case ActionEvent.ACTION_PERFORMED: + listener = apListener; + break; + } + + listener.listen(comp, printEvent); + action.run(); + return Util.waitForCondition(listener.getNotifier(), time); + } + + /* + * Tracks WINDOW_GAINED_FOCUS event for a window caused by an action. + * @param window the window to track the event for + * @param action the action to perform + * @param time the max time to wait for the event + * @param printEvent should the event received be printed or doesn't + * @return true if the event has been received, otherwise false + */ + public static boolean trackWindowGainedFocus(Window window, Runnable action, int time, boolean printEvent) { + return trackEvent(WindowEvent.WINDOW_GAINED_FOCUS, window, action, time, printEvent); + } + + /* + * Tracks FOCUS_GAINED event for a component caused by an action. + * @see #trackWindowGainedFocus + */ + public static boolean trackFocusGained(Component comp, Runnable action, int time, boolean printEvent) { + return trackEvent(FocusEvent.FOCUS_GAINED, comp, action, time, printEvent); + } + + /* + * Tracks ACTION_PERFORMED event for a button caused by an action. + * @see #trackWindowGainedFocus + */ + public static boolean trackActionPerformed(Button button, Runnable action, int time, boolean printEvent) { + return trackEvent(ActionEvent.ACTION_PERFORMED, button, action, time, printEvent); + } + + /* + * Requests focus on the component provided and waits for the result. + * @return true if the component has been focused, false otherwise. + */ + public static boolean focusComponent(Component comp, int time) { + return focusComponent(comp, time, false); + } + public static boolean focusComponent(final Component comp, int time, boolean printEvent) { + return trackFocusGained(comp, + new Runnable() { + public void run() { + comp.requestFocus(); + } + }, + time, printEvent); + + } +} diff --git a/jdk/test/java/awt/Mixing/AWT_Mixing/ViewportOverlapping.java b/jdk/test/java/awt/Mixing/AWT_Mixing/ViewportOverlapping.java new file mode 100644 index 00000000000..22e1e7730cd --- /dev/null +++ b/jdk/test/java/awt/Mixing/AWT_Mixing/ViewportOverlapping.java @@ -0,0 +1,151 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.GridLayout; +import java.awt.Point; +import java.awt.Robot; +import java.awt.event.InputEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import javax.swing.BorderFactory; +import javax.swing.JButton; +import javax.swing.JComponent; +import javax.swing.JFrame; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.SwingUtilities; + +/** + * AWT/Swing overlapping test for viewport + *

    This test verify if AWT components are drawn correctly being partially shown through viewport + *

    See CR6778882 for details + *

    See base class for test info. + */ +/* +@test +@bug 6778882 +@summary Viewport overlapping test for each AWT component +@author sergey.grinev@oracle.com: area=awt.mixing +@run main ViewportOverlapping + */ +public class ViewportOverlapping extends OverlappingTestBase { + + private volatile int frameClicked; + private Point hLoc; + private Point vLoc; + private Point testLoc; + private Point resizeLoc; + + private JFrame f; + private JPanel p; + private JButton b; + private JScrollPane scrollPane; + + protected void prepareControls() { + p = new JPanel(new GridLayout(0, 1)); + propagateAWTControls(p); + b = new JButton("Space extender"); + p.add(b); + p.setPreferredSize(new Dimension(500, 500)); + scrollPane = new JScrollPane(p); + + f = new JFrame(); + f.addMouseListener(new MouseAdapter() { + + @Override + public void mouseClicked(MouseEvent e) { + frameClicked++; + } + }); + f.getContentPane().add(scrollPane, BorderLayout.CENTER); + ((JComponent) f.getContentPane()).setBorder( + BorderFactory.createEmptyBorder(50, 50, 50, 50)); + f.setSize(400, 400); + f.setLocationRelativeTo(null); + f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + f.setVisible(true); + } + + @Override + protected boolean performTest() { + try { + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + // prepare test data + frameClicked = 0; + + b.requestFocus(); + + scrollPane.getHorizontalScrollBar().setUnitIncrement(40); + scrollPane.getVerticalScrollBar().setUnitIncrement(40); + + hLoc = scrollPane.getHorizontalScrollBar().getLocationOnScreen(); + hLoc.translate(scrollPane.getHorizontalScrollBar().getWidth() - 3, 3); + vLoc = scrollPane.getVerticalScrollBar().getLocationOnScreen(); + vLoc.translate(3, scrollPane.getVerticalScrollBar().getHeight() - 3); + + testLoc = p.getLocationOnScreen(); + testLoc.translate(-3, -3); + + resizeLoc = f.getLocationOnScreen(); + resizeLoc.translate(f.getWidth() - 1, f.getHeight() - 1); + } + }); + } catch (Exception e) { + e.printStackTrace(); + System.exit(1); + } + // run robot + Robot robot = Util.createRobot(); + robot.setAutoDelay(ROBOT_DELAY); + + robot.mouseMove(hLoc.x, hLoc.y); + robot.mousePress(InputEvent.BUTTON1_MASK); + robot.mouseRelease(InputEvent.BUTTON1_MASK); + Util.waitForIdle(robot); + + robot.mouseMove(vLoc.x, vLoc.y); + robot.mousePress(InputEvent.BUTTON1_MASK); + robot.mouseRelease(InputEvent.BUTTON1_MASK); + Util.waitForIdle(robot); + + clickAndBlink(robot, testLoc, false); + robot.mouseMove(resizeLoc.x, resizeLoc.y); + robot.mousePress(InputEvent.BUTTON1_MASK); + robot.mouseMove(resizeLoc.x + 5, resizeLoc.y + 5); + robot.mouseRelease(InputEvent.BUTTON1_MASK); + Util.waitForIdle(robot); + + clickAndBlink(robot, testLoc, false); + return frameClicked == 2; + } + + // this strange plumbing stuff is required due to "Standard Test Machinery" in base class + public static void main(String args[]) throws InterruptedException { + instance = new ViewportOverlapping(); + OverlappingTestBase.doMain(args); + } +} From 536ad9409e3bd922738d629c9608400aec5da041 Mon Sep 17 00:00:00 2001 From: Omair Majid Date: Tue, 29 Apr 2014 15:46:16 -0400 Subject: [PATCH 21/50] 8042159: Allow using a system-installed lcms2 Reviewed-by: andrew, ihse, prr --- jdk/make/lib/Awt2dLibraries.gmk | 29 +++++++++++++++---- .../share/native/sun/java2d/cmm/lcms/LCMS.c | 2 +- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/jdk/make/lib/Awt2dLibraries.gmk b/jdk/make/lib/Awt2dLibraries.gmk index de86e3f86a4..6d1cf628c65 100644 --- a/jdk/make/lib/Awt2dLibraries.gmk +++ b/jdk/make/lib/Awt2dLibraries.gmk @@ -657,17 +657,34 @@ endif ########################################################################################## +LIBLCMS_DIR := $(JDK_TOPDIR)/src/share/native/sun/java2d/cmm/lcms + +ifeq ($(USE_EXTERNAL_LCMS), true) + # If we're using an external library, we'll just need the wrapper part. + # By including it explicitely, all other files will be excluded. + BUILD_LIBLCMS_INCLUDE_FILES := LCMS.c + BUILD_LIBLCMS_HEADERS := +else + BUILD_LIBLCMS_INCLUDE_FILES := + # If we're using the bundled library, we'll need to include it in the + # include path explicitly. Otherwise the system headers will be used. + BUILD_LIBLCMS_HEADERS := -I$(LIBLCMS_DIR) +endif + # TODO: Update awt lib path when awt is converted $(eval $(call SetupNativeCompilation,BUILD_LIBLCMS, \ LIBRARY := lcms, \ OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ - SRC := $(JDK_TOPDIR)/src/share/native/sun/java2d/cmm/lcms, \ + SRC := $(LIBLCMS_DIR), \ + INCLUDE_FILES := $(BUILD_LIBLCMS_INCLUDE_FILES), \ LANG := C, \ OPTIMIZATION := HIGHEST, \ CFLAGS := $(filter-out -xc99=%none, $(CFLAGS_JDKLIB)) \ $(SHARED_LIBRARY_FLAGS) \ -I$(JDK_TOPDIR)/src/share/native/sun/java2d \ - -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug, \ + -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \ + $(BUILD_LIBLCMS_HEADERS) \ + $(LCMS_CFLAGS), \ CFLAGS_solaris := -xc99=no_lib, \ CFLAGS_windows := -DCMS_IS_WINDOWS_, \ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/liblcms/mapfile-vers, \ @@ -675,10 +692,10 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBLCMS, \ $(call SET_SHARED_LIBRARY_ORIGIN), \ LDFLAGS_solaris := /usr/lib$(OPENJDK_TARGET_CPU_ISADIR)/libm.so.2, \ LDFLAGS_windows := $(WIN_AWT_LIB) $(WIN_JAVA_LIB), \ - LDFLAGS_SUFFIX_solaris := -lawt -ljava -ljvm -lc, \ - LDFLAGS_SUFFIX_macosx := $(LIBM) -lawt -ljava -ljvm, \ - LDFLAGS_SUFFIX_linux := -lm -lawt -ljava -ljvm, \ - LDFLAGS_SUFFIX_aix := -lm -lawt -ljava -ljvm,\ + LDFLAGS_SUFFIX_solaris := -lawt -ljava -ljvm -lc $(LCMS_LIBS), \ + LDFLAGS_SUFFIX_macosx := $(LIBM) -lawt -ljava -ljvm $(LCMS_LIBS), \ + LDFLAGS_SUFFIX_linux := -lm -lawt -ljava -ljvm $(LCMS_LIBS), \ + LDFLAGS_SUFFIX_aix := -lm -lawt -ljava -ljvm $(LCMS_LIBS),\ VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ RC_FLAGS := $(RC_FLAGS) \ -D "JDK_FNAME=lcms.dll" \ diff --git a/jdk/src/share/native/sun/java2d/cmm/lcms/LCMS.c b/jdk/src/share/native/sun/java2d/cmm/lcms/LCMS.c index 8e687de0cdf..0939b00a761 100644 --- a/jdk/src/share/native/sun/java2d/cmm/lcms/LCMS.c +++ b/jdk/src/share/native/sun/java2d/cmm/lcms/LCMS.c @@ -30,7 +30,7 @@ #include "jni_util.h" #include "Trace.h" #include "Disposer.h" -#include "lcms2.h" +#include #include "jlong.h" From bb2698cfa6f2bdc92c197f17a7d2f90003db05fa Mon Sep 17 00:00:00 2001 From: Petr Pchelko Date: Wed, 30 Apr 2014 12:41:38 +0400 Subject: [PATCH 22/50] 8042087: [macosx] LWCToolkit.inokeAndWait is calling EventQueue.invokeLater Reviewed-by: anthony, serb --- .../classes/sun/lwawt/macosx/LWCToolkit.java | 69 ++++++++----------- 1 file changed, 29 insertions(+), 40 deletions(-) diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java b/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java index 4a153fc94d4..d0b6882b9a3 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java @@ -611,19 +611,20 @@ public final class LWCToolkit extends LWToolkit { } /** - * Kicks an event over to the appropriate eventqueue and waits for it to + * Kicks an event over to the appropriate event queue and waits for it to * finish To avoid deadlocking, we manually run the NSRunLoop while waiting * Any selector invoked using ThreadUtilities performOnMainThread will be * processed in doAWTRunLoop The InvocationEvent will call * LWCToolkit.stopAWTRunLoop() when finished, which will stop our manual - * runloop Does not dispatch native events while in the loop + * run loop. Does not dispatch native events while in the loop */ public static void invokeAndWait(Runnable runnable, Component component) throws InvocationTargetException { - final long mediator = createAWTRunLoopMediator(); + Objects.requireNonNull(component, "Null component provided to invokeAndWait"); + long mediator = createAWTRunLoopMediator(); InvocationEvent invocationEvent = - new InvocationEvent(component != null ? component : Toolkit.getDefaultToolkit(), + new InvocationEvent(component, runnable, () -> { if (mediator != 0) { @@ -632,49 +633,42 @@ public final class LWCToolkit extends LWToolkit { }, true); - if (component != null) { - AppContext appContext = SunToolkit.targetToAppContext(component); - SunToolkit.postEvent(appContext, invocationEvent); - - // 3746956 - flush events from PostEventQueue to prevent them from getting stuck and causing a deadlock - SunToolkit.flushPendingEvents(appContext); - } else { - // This should be the equivalent to EventQueue.invokeAndWait - ((LWCToolkit)Toolkit.getDefaultToolkit()).getSystemEventQueueForInvokeAndWait().postEvent(invocationEvent); - } - + AppContext appContext = SunToolkit.targetToAppContext(component); + SunToolkit.postEvent(appContext, invocationEvent); + // 3746956 - flush events from PostEventQueue to prevent them from getting stuck and causing a deadlock + SunToolkit.flushPendingEvents(appContext); doAWTRunLoop(mediator, false); - Throwable eventException = invocationEvent.getException(); - if (eventException != null) { - if (eventException instanceof UndeclaredThrowableException) { - eventException = ((UndeclaredThrowableException)eventException).getUndeclaredThrowable(); - } - throw new InvocationTargetException(eventException); - } + checkException(invocationEvent); } public static void invokeLater(Runnable event, Component component) throws InvocationTargetException { - final InvocationEvent invocationEvent = - new InvocationEvent(component != null ? component : Toolkit.getDefaultToolkit(), event); + Objects.requireNonNull(component, "Null component provided to invokeLater"); - if (component != null) { - final AppContext appContext = SunToolkit.targetToAppContext(component); - SunToolkit.postEvent(appContext, invocationEvent); + InvocationEvent invocationEvent = new InvocationEvent(component, event); - // 3746956 - flush events from PostEventQueue to prevent them from getting stuck and causing a deadlock - SunToolkit.flushPendingEvents(appContext); - } else { - // This should be the equivalent to EventQueue.invokeAndWait - ((LWCToolkit)Toolkit.getDefaultToolkit()).getSystemEventQueueForInvokeAndWait().postEvent(invocationEvent); - } + AppContext appContext = SunToolkit.targetToAppContext(component); + SunToolkit.postEvent(SunToolkit.targetToAppContext(component), invocationEvent); + // 3746956 - flush events from PostEventQueue to prevent them from getting stuck and causing a deadlock + SunToolkit.flushPendingEvents(appContext); - final Throwable eventException = invocationEvent.getException(); + checkException(invocationEvent); + } + + /** + * Checks if exception occurred while {@code InvocationEvent} was processed and rethrows it as + * an {@code InvocationTargetException} + * + * @param event the event to check for an exception + * @throws InvocationTargetException if exception occurred when event was processed + */ + private static void checkException(InvocationEvent event) throws InvocationTargetException { + Throwable eventException = event.getException(); if (eventException == null) return; if (eventException instanceof UndeclaredThrowableException) { - throw new InvocationTargetException(((UndeclaredThrowableException)eventException).getUndeclaredThrowable()); + eventException = ((UndeclaredThrowableException)eventException).getUndeclaredThrowable(); } throw new InvocationTargetException(eventException); } @@ -686,11 +680,6 @@ public final class LWCToolkit extends LWToolkit { */ native static void performOnMainThreadAfterDelay(Runnable r, long delay); - // This exists purely to get around permissions issues with getSystemEventQueueImpl - EventQueue getSystemEventQueueForInvokeAndWait() { - return getSystemEventQueueImpl(); - } - // DnD support @Override From b8cc933de8e73c5737be9cbc7d71a3cd386d671f Mon Sep 17 00:00:00 2001 From: Volker Simonis Date: Wed, 30 Apr 2014 11:29:29 +0200 Subject: [PATCH 23/50] 8042090: Fix invalid variable names sun/java2d/loops/ProcessPath.c Reviewed-by: prr --- .../native/sun/java2d/loops/ProcessPath.c | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/jdk/src/share/native/sun/java2d/loops/ProcessPath.c b/jdk/src/share/native/sun/java2d/loops/ProcessPath.c index 52d8dddb3d3..07eb3468926 100644 --- a/jdk/src/share/native/sun/java2d/loops/ProcessPath.c +++ b/jdk/src/share/native/sun/java2d/loops/ProcessPath.c @@ -189,34 +189,34 @@ #define PROCESS_POINT(hnd, fX, fY, checkBounds, pixelInfo) \ do { \ - jint _X = (fX)>> MDP_PREC; \ - jint _Y = (fY)>> MDP_PREC; \ + jint X_ = (fX)>> MDP_PREC; \ + jint Y_ = (fY)>> MDP_PREC; \ if (checkBounds && \ - (hnd->dhnd->yMin > _Y || \ - hnd->dhnd->yMax <= _Y || \ - hnd->dhnd->xMin > _X || \ - hnd->dhnd->xMax <= _X)) break; \ + (hnd->dhnd->yMin > Y_ || \ + hnd->dhnd->yMax <= Y_ || \ + hnd->dhnd->xMin > X_ || \ + hnd->dhnd->xMax <= X_)) break; \ /* \ - * (_X,_Y) should be inside boundaries \ + * (X_,Y_) should be inside boundaries \ * \ - * assert(hnd->dhnd->yMin <= _Y && \ - * hnd->dhnd->yMax > _Y && \ - * hnd->dhnd->xMin <= _X && \ - * hnd->dhnd->xMax > _X); \ + * assert(hnd->dhnd->yMin <= Y_ && \ + * hnd->dhnd->yMax > Y_ && \ + * hnd->dhnd->xMin <= X_ && \ + * hnd->dhnd->xMax > X_); \ * \ */ \ if (pixelInfo[0] == 0) { \ pixelInfo[0] = 1; \ - pixelInfo[1] = _X; \ - pixelInfo[2] = _Y; \ - pixelInfo[3] = _X; \ - pixelInfo[4] = _Y; \ - hnd->dhnd->pDrawPixel(hnd->dhnd, _X, _Y); \ - } else if ((_X != pixelInfo[3] || _Y != pixelInfo[4]) && \ - (_X != pixelInfo[1] || _Y != pixelInfo[2])) { \ - hnd->dhnd->pDrawPixel(hnd->dhnd, _X, _Y); \ - pixelInfo[3] = _X; \ - pixelInfo[4] = _Y; \ + pixelInfo[1] = X_; \ + pixelInfo[2] = Y_; \ + pixelInfo[3] = X_; \ + pixelInfo[4] = Y_; \ + hnd->dhnd->pDrawPixel(hnd->dhnd, X_, Y_); \ + } else if ((X_ != pixelInfo[3] || Y_ != pixelInfo[4]) && \ + (X_ != pixelInfo[1] || Y_ != pixelInfo[2])) { \ + hnd->dhnd->pDrawPixel(hnd->dhnd, X_, Y_); \ + pixelInfo[3] = X_; \ + pixelInfo[4] = Y_; \ } \ } while(0) From e787680bf15e351d63cd8a3453f6e618f4980abf Mon Sep 17 00:00:00 2001 From: Sergey Malenkov Date: Wed, 30 Apr 2014 19:28:05 +0400 Subject: [PATCH 24/50] 8041917: unexcepted behavior of LineBorder while using Boolean variable true Reviewed-by: alexsch, serb --- jdk/src/share/classes/javax/swing/border/LineBorder.java | 4 ++-- jdk/test/javax/swing/border/Test4252164.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/jdk/src/share/classes/javax/swing/border/LineBorder.java b/jdk/src/share/classes/javax/swing/border/LineBorder.java index 1e083c1164f..f29a244d2e8 100644 --- a/jdk/src/share/classes/javax/swing/border/LineBorder.java +++ b/jdk/src/share/classes/javax/swing/border/LineBorder.java @@ -134,8 +134,8 @@ public class LineBorder extends AbstractBorder int offs = this.thickness; int size = offs + offs; if (this.roundedCorners) { - int arc = offs + size; - outer = new RoundRectangle2D.Float(x, y, width, height, arc, arc); + float arc = .2f * offs; + outer = new RoundRectangle2D.Float(x, y, width, height, offs, offs); inner = new RoundRectangle2D.Float(x + offs, y + offs, width - size, height - size, arc, arc); } else { diff --git a/jdk/test/javax/swing/border/Test4252164.java b/jdk/test/javax/swing/border/Test4252164.java index 007e732cf2a..923df715054 100644 --- a/jdk/test/javax/swing/border/Test4252164.java +++ b/jdk/test/javax/swing/border/Test4252164.java @@ -23,7 +23,7 @@ /* * @test - * @bug 4252164 + * @bug 4252164 8041917 * @summary Tests rounded LineBorder for components * @author Sergey Malenkov * @run applet/manual=yesno Test4252164.html From 6289e6c7e82943fdf88071f41422e79b0353416e Mon Sep 17 00:00:00 2001 From: Sergey Bylokhov Date: Mon, 5 May 2014 19:42:11 +0400 Subject: [PATCH 25/50] 8042212: [macosx] Toolkit.getScreenResolution() can return incorrect resolution Reviewed-by: anthony, pchelko --- jdk/src/macosx/native/sun/awt/CGraphicsDevice.m | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/jdk/src/macosx/native/sun/awt/CGraphicsDevice.m b/jdk/src/macosx/native/sun/awt/CGraphicsDevice.m index e20792a231d..a1813b6154d 100644 --- a/jdk/src/macosx/native/sun/awt/CGraphicsDevice.m +++ b/jdk/src/macosx/native/sun/awt/CGraphicsDevice.m @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -156,14 +156,12 @@ JNIEXPORT jdouble JNICALL Java_sun_awt_CGraphicsDevice_nativeGetXResolution (JNIEnv *env, jclass class, jint displayID) { - // TODO: this is the physically correct answer, but we probably want - // to use NSScreen API instead... + // CGDisplayScreenSize can return 0 if displayID is invalid CGSize size = CGDisplayScreenSize(displayID); CGRect rect = CGDisplayBounds(displayID); // 1 inch == 25.4 mm jfloat inches = size.width / 25.4f; - jfloat dpi = rect.size.width / inches; - return dpi; + return inches > 0 ? rect.size.width / inches : 72; } /* @@ -175,14 +173,12 @@ JNIEXPORT jdouble JNICALL Java_sun_awt_CGraphicsDevice_nativeGetYResolution (JNIEnv *env, jclass class, jint displayID) { - // TODO: this is the physically correct answer, but we probably want - // to use NSScreen API instead... + // CGDisplayScreenSize can return 0 if displayID is invalid CGSize size = CGDisplayScreenSize(displayID); CGRect rect = CGDisplayBounds(displayID); // 1 inch == 25.4 mm jfloat inches = size.height / 25.4f; - jfloat dpi = rect.size.height / inches; - return dpi; + return inches > 0 ? rect.size.height / inches : 72; } /* From ac82d17097982c45994c6ac3bf6c631669844bf6 Mon Sep 17 00:00:00 2001 From: Phil Race Date: Mon, 5 May 2014 09:41:41 -0700 Subject: [PATCH 26/50] 8038838: Totally remove all vestiges of com.sun.image.codec.jpeg from JDK 9 Reviewed-by: bae, vadim --- jdk/make/mapfiles/libjpeg/mapfile-vers-closed | 4 ---- 1 file changed, 4 deletions(-) diff --git a/jdk/make/mapfiles/libjpeg/mapfile-vers-closed b/jdk/make/mapfiles/libjpeg/mapfile-vers-closed index 9b3724c4994..6f84d2da352 100644 --- a/jdk/make/mapfiles/libjpeg/mapfile-vers-closed +++ b/jdk/make/mapfiles/libjpeg/mapfile-vers-closed @@ -31,10 +31,6 @@ SUNWprivate_1.1 { Java_sun_awt_image_JPEGImageDecoder_initIDs; Java_sun_awt_image_JPEGImageDecoder_readImage; - Java_sun_awt_image_codec_JPEGImageDecoderImpl_initDecoder; - Java_sun_awt_image_codec_JPEGImageDecoderImpl_readJPEGStream; - Java_sun_awt_image_codec_JPEGImageEncoderImpl_initEncoder; - Java_sun_awt_image_codec_JPEGImageEncoderImpl_writeJPEGStream; Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_initReaderIDs; Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_initJPEGImageReader; From 1a24f81c1bd5da50fe5b96aa7b052da4387664dd Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Mon, 5 May 2014 23:19:00 -0700 Subject: [PATCH 27/50] 8042256: Fix raw and unchecked lint warnings in com.sun.media.sound Reviewed-by: prr --- .../com/sun/media/sound/AbstractLine.java | 2 +- .../sun/media/sound/AbstractMidiDevice.java | 8 ++++--- .../com/sun/media/sound/AbstractMixer.java | 22 ++++++++++--------- .../com/sun/media/sound/AlawCodec.java | 4 ++-- .../sound/AudioSynthesizerPropertyInfo.java | 2 +- .../sun/media/sound/DirectAudioDevice.java | 10 ++++----- .../com/sun/media/sound/EventDispatcher.java | 8 +++---- .../com/sun/media/sound/JDK13Services.java | 6 ++--- .../sun/media/sound/MidiInDeviceProvider.java | 4 ++-- .../media/sound/MidiOutDeviceProvider.java | 4 ++-- .../com/sun/media/sound/MidiUtils.java | 6 ++--- .../com/sun/media/sound/PCMtoPCMCodec.java | 8 +++---- .../com/sun/media/sound/PortMixer.java | 5 +++-- .../sun/media/sound/RealTimeSequencer.java | 22 +++++++++---------- .../com/sun/media/sound/SoftSynthesizer.java | 2 +- .../com/sun/media/sound/UlawCodec.java | 4 ++-- 16 files changed, 61 insertions(+), 56 deletions(-) diff --git a/jdk/src/share/classes/com/sun/media/sound/AbstractLine.java b/jdk/src/share/classes/com/sun/media/sound/AbstractLine.java index e6a7ba2d9cb..1d0393d35eb 100644 --- a/jdk/src/share/classes/com/sun/media/sound/AbstractLine.java +++ b/jdk/src/share/classes/com/sun/media/sound/AbstractLine.java @@ -48,7 +48,7 @@ abstract class AbstractLine implements Line { protected Control[] controls; AbstractMixer mixer; private boolean open = false; - private final Vector listeners = new Vector(); + private final Vector listeners = new Vector<>(); /** * Contains event dispatcher per thread group. diff --git a/jdk/src/share/classes/com/sun/media/sound/AbstractMidiDevice.java b/jdk/src/share/classes/com/sun/media/sound/AbstractMidiDevice.java index 4323970cafa..93c3926aaed 100644 --- a/jdk/src/share/classes/com/sun/media/sound/AbstractMidiDevice.java +++ b/jdk/src/share/classes/com/sun/media/sound/AbstractMidiDevice.java @@ -70,7 +70,7 @@ abstract class AbstractMidiDevice implements MidiDevice, ReferenceCountingDevice /** List of Receivers and Transmitters that opened the device implicitely. */ - private List openKeepingObjects; + private List openKeepingObjects; /** * This is the device handle returned from native code @@ -284,6 +284,7 @@ abstract class AbstractMidiDevice implements MidiDevice, ReferenceCountingDevice } + @SuppressWarnings("unchecked") // Cast of result of clone public final List getReceivers() { List recs; synchronized (traRecLock) { @@ -313,6 +314,7 @@ abstract class AbstractMidiDevice implements MidiDevice, ReferenceCountingDevice } + @SuppressWarnings("unchecked") // Cast of result of clone public final List getTransmitters() { List tras; synchronized (traRecLock) { @@ -372,9 +374,9 @@ abstract class AbstractMidiDevice implements MidiDevice, ReferenceCountingDevice /** Return the list of objects that have opened the device implicitely. */ - private synchronized List getOpenKeepingObjects() { + private synchronized List getOpenKeepingObjects() { if (openKeepingObjects == null) { - openKeepingObjects = new ArrayList(); + openKeepingObjects = new ArrayList<>(); } return openKeepingObjects; } diff --git a/jdk/src/share/classes/com/sun/media/sound/AbstractMixer.java b/jdk/src/share/classes/com/sun/media/sound/AbstractMixer.java index 1055fc6859e..83378615b77 100644 --- a/jdk/src/share/classes/com/sun/media/sound/AbstractMixer.java +++ b/jdk/src/share/classes/com/sun/media/sound/AbstractMixer.java @@ -90,13 +90,13 @@ abstract class AbstractMixer extends AbstractLine implements Mixer { /** * Source lines (ports) currently open */ - private final Vector sourceLines = new Vector(); + private final Vector sourceLines = new Vector<>(); /** * Target lines currently open. */ - private final Vector targetLines = new Vector(); + private final Vector targetLines = new Vector<>(); /** @@ -151,7 +151,7 @@ abstract class AbstractMixer extends AbstractLine implements Mixer { public final Line.Info[] getSourceLineInfo(Line.Info info) { int i; - Vector vec = new Vector(); + Vector vec = new Vector<>(); for (i = 0; i < sourceLineInfo.length; i++) { @@ -162,7 +162,7 @@ abstract class AbstractMixer extends AbstractLine implements Mixer { Line.Info[] returnedArray = new Line.Info[vec.size()]; for (i = 0; i < returnedArray.length; i++) { - returnedArray[i] = (Line.Info)vec.elementAt(i); + returnedArray[i] = vec.elementAt(i); } return returnedArray; @@ -172,7 +172,7 @@ abstract class AbstractMixer extends AbstractLine implements Mixer { public final Line.Info[] getTargetLineInfo(Line.Info info) { int i; - Vector vec = new Vector(); + Vector vec = new Vector<>(); for (i = 0; i < targetLineInfo.length; i++) { @@ -183,7 +183,7 @@ abstract class AbstractMixer extends AbstractLine implements Mixer { Line.Info[] returnedArray = new Line.Info[vec.size()]; for (i = 0; i < returnedArray.length; i++) { - returnedArray[i] = (Line.Info)vec.elementAt(i); + returnedArray[i] = vec.elementAt(i); } return returnedArray; @@ -231,7 +231,7 @@ abstract class AbstractMixer extends AbstractLine implements Mixer { localLines = new Line[sourceLines.size()]; for (int i = 0; i < localLines.length; i++) { - localLines[i] = (Line)sourceLines.elementAt(i); + localLines[i] = sourceLines.elementAt(i); } } @@ -248,7 +248,7 @@ abstract class AbstractMixer extends AbstractLine implements Mixer { localLines = new Line[targetLines.size()]; for (int i = 0; i < localLines.length; i++) { - localLines[i] = (Line)targetLines.elementAt(i); + localLines[i] = targetLines.elementAt(i); } } @@ -453,7 +453,8 @@ abstract class AbstractMixer extends AbstractLine implements Mixer { return; } - Vector localSourceLines = (Vector)sourceLines.clone(); + @SuppressWarnings("unchecked") + Vector localSourceLines = (Vector)sourceLines.clone(); for (int i = 0; i < localSourceLines.size(); i++) { // if any other open line is running, return @@ -468,7 +469,8 @@ abstract class AbstractMixer extends AbstractLine implements Mixer { } } - Vector localTargetLines = (Vector)targetLines.clone(); + @SuppressWarnings("unchecked") + Vector localTargetLines = (Vector)targetLines.clone(); for (int i = 0; i < localTargetLines.size(); i++) { // if any other open line is running, return diff --git a/jdk/src/share/classes/com/sun/media/sound/AlawCodec.java b/jdk/src/share/classes/com/sun/media/sound/AlawCodec.java index 367f318b06a..fbe63f6ff16 100644 --- a/jdk/src/share/classes/com/sun/media/sound/AlawCodec.java +++ b/jdk/src/share/classes/com/sun/media/sound/AlawCodec.java @@ -213,7 +213,7 @@ public final class AlawCodec extends SunCodec { private AudioFormat[] getOutputFormats(AudioFormat inputFormat) { - Vector formats = new Vector(); + Vector formats = new Vector<>(); AudioFormat format; if ( AudioFormat.Encoding.PCM_SIGNED.equals(inputFormat.getEncoding())) { @@ -248,7 +248,7 @@ public final class AlawCodec extends SunCodec { AudioFormat[] formatArray = new AudioFormat[formats.size()]; for (int i = 0; i < formatArray.length; i++) { - formatArray[i] = (AudioFormat)(formats.elementAt(i)); + formatArray[i] = formats.elementAt(i); } return formatArray; } diff --git a/jdk/src/share/classes/com/sun/media/sound/AudioSynthesizerPropertyInfo.java b/jdk/src/share/classes/com/sun/media/sound/AudioSynthesizerPropertyInfo.java index d4305523526..16bfaa20790 100644 --- a/jdk/src/share/classes/com/sun/media/sound/AudioSynthesizerPropertyInfo.java +++ b/jdk/src/share/classes/com/sun/media/sound/AudioSynthesizerPropertyInfo.java @@ -68,7 +68,7 @@ public final class AudioSynthesizerPropertyInfo { * The valueClass field specifies class * used in value field. */ - public Class valueClass = null; + public Class valueClass = null; /** * An array of possible values if the value for the field * AudioSynthesizerPropertyInfo.value may be selected diff --git a/jdk/src/share/classes/com/sun/media/sound/DirectAudioDevice.java b/jdk/src/share/classes/com/sun/media/sound/DirectAudioDevice.java index 7c938bbb1c4..becf4981ba7 100644 --- a/jdk/src/share/classes/com/sun/media/sound/DirectAudioDevice.java +++ b/jdk/src/share/classes/com/sun/media/sound/DirectAudioDevice.java @@ -94,7 +94,7 @@ final class DirectAudioDevice extends AbstractMixer { } private DirectDLI createDataLineInfo(boolean isSource) { - Vector formats = new Vector(); + Vector formats = new Vector<>(); AudioFormat[] hardwareFormatArray = null; AudioFormat[] formatArray = null; @@ -107,7 +107,7 @@ final class DirectAudioDevice extends AbstractMixer { int formatArraySize = size; hardwareFormatArray = new AudioFormat[size]; for (int i = 0; i < size; i++) { - AudioFormat format = (AudioFormat)formats.elementAt(i); + AudioFormat format = formats.elementAt(i); hardwareFormatArray[i] = format; int bits = format.getSampleSizeInBits(); boolean isSigned = format.getEncoding().equals(AudioFormat.Encoding.PCM_SIGNED); @@ -265,7 +265,7 @@ final class DirectAudioDevice extends AbstractMixer { return ((DirectAudioDeviceProvider.DirectAudioDeviceInfo) getMixerInfo()).getMaxSimulLines(); } - private static void addFormat(Vector v, int bits, int frameSizeInBytes, int channels, float sampleRate, + private static void addFormat(Vector v, int bits, int frameSizeInBytes, int channels, float sampleRate, int encoding, boolean signed, boolean bigEndian) { AudioFormat.Encoding enc = null; switch (encoding) { @@ -338,7 +338,7 @@ final class DirectAudioDevice extends AbstractMixer { private static final class DirectDLI extends DataLine.Info { final AudioFormat[] hardwareFormats; - private DirectDLI(Class clazz, AudioFormat[] formatArray, + private DirectDLI(Class clazz, AudioFormat[] formatArray, AudioFormat[] hardwareFormatArray, int minBuffer, int maxBuffer) { super(clazz, formatArray, minBuffer, maxBuffer); @@ -1457,7 +1457,7 @@ final class DirectAudioDevice extends AbstractMixer { } // class DirectBAOS - + @SuppressWarnings("rawtypes") private static native void nGetFormats(int mixerIndex, int deviceID, boolean isSource, Vector formats); diff --git a/jdk/src/share/classes/com/sun/media/sound/EventDispatcher.java b/jdk/src/share/classes/com/sun/media/sound/EventDispatcher.java index 54b948af168..49709891bd0 100644 --- a/jdk/src/share/classes/com/sun/media/sound/EventDispatcher.java +++ b/jdk/src/share/classes/com/sun/media/sound/EventDispatcher.java @@ -57,7 +57,7 @@ final class EventDispatcher implements Runnable { /** * List of events */ - private final ArrayList eventQueue = new ArrayList(); + private final ArrayList eventQueue = new ArrayList<>(); /** @@ -186,7 +186,7 @@ final class EventDispatcher implements Runnable { } if (eventQueue.size() > 0) { // Remove the event from the queue and dispatch it to the listeners. - eventInfo = (EventInfo) eventQueue.remove(0); + eventInfo = eventQueue.remove(0); } } // end of synchronized @@ -230,7 +230,7 @@ final class EventDispatcher implements Runnable { /** * Send audio and MIDI events. */ - void sendAudioEvents(Object event, List listeners) { + void sendAudioEvents(Object event, List listeners) { if ((listeners == null) || (listeners.size() == 0)) { // nothing to do @@ -392,7 +392,7 @@ final class EventDispatcher implements Runnable { * @param event the event to be dispatched * @param listeners listener list; will be copied */ - EventInfo(Object event, List listeners) { + EventInfo(Object event, List listeners) { this.event = event; this.listeners = listeners.toArray(); } diff --git a/jdk/src/share/classes/com/sun/media/sound/JDK13Services.java b/jdk/src/share/classes/com/sun/media/sound/JDK13Services.java index 9f19a8734e3..9c93d06dc23 100644 --- a/jdk/src/share/classes/com/sun/media/sound/JDK13Services.java +++ b/jdk/src/share/classes/com/sun/media/sound/JDK13Services.java @@ -118,7 +118,7 @@ public final class JDK13Services { (the part before the hash sign), if available. If the property is not set or the value has no provider class name part, null is returned. */ - public static synchronized String getDefaultProviderClassName(Class typeClass) { + public static synchronized String getDefaultProviderClassName(Class typeClass) { String value = null; String defaultProviderSpec = getDefaultProvider(typeClass); if (defaultProviderSpec != null) { @@ -144,7 +144,7 @@ public final class JDK13Services { part after the hash sign), if available. If the property is not set or the value has no instance name part, null is returned. */ - public static synchronized String getDefaultInstanceName(Class typeClass) { + public static synchronized String getDefaultInstanceName(Class typeClass) { String value = null; String defaultProviderSpec = getDefaultProvider(typeClass); if (defaultProviderSpec != null) { @@ -165,7 +165,7 @@ public final class JDK13Services { @return The complete value of the property, if available. If the property is not set, null is returned. */ - private static synchronized String getDefaultProvider(Class typeClass) { + private static synchronized String getDefaultProvider(Class typeClass) { if (!SourceDataLine.class.equals(typeClass) && !TargetDataLine.class.equals(typeClass) && !Clip.class.equals(typeClass) diff --git a/jdk/src/share/classes/com/sun/media/sound/MidiInDeviceProvider.java b/jdk/src/share/classes/com/sun/media/sound/MidiInDeviceProvider.java index 1f397724e3f..5044dfeaa17 100644 --- a/jdk/src/share/classes/com/sun/media/sound/MidiInDeviceProvider.java +++ b/jdk/src/share/classes/com/sun/media/sound/MidiInDeviceProvider.java @@ -106,9 +106,9 @@ public final class MidiInDeviceProvider extends AbstractMidiDeviceProvider { * the new instance will not reflect that state... */ static final class MidiInDeviceInfo extends AbstractMidiDeviceProvider.Info { - private final Class providerClass; + private final Class providerClass; - private MidiInDeviceInfo(int index, Class providerClass) { + private MidiInDeviceInfo(int index, Class providerClass) { super(nGetName(index), nGetVendor(index), nGetDescription(index), nGetVersion(index), index); this.providerClass = providerClass; } diff --git a/jdk/src/share/classes/com/sun/media/sound/MidiOutDeviceProvider.java b/jdk/src/share/classes/com/sun/media/sound/MidiOutDeviceProvider.java index 75583ab1e65..eaacf0991be 100644 --- a/jdk/src/share/classes/com/sun/media/sound/MidiOutDeviceProvider.java +++ b/jdk/src/share/classes/com/sun/media/sound/MidiOutDeviceProvider.java @@ -104,9 +104,9 @@ public final class MidiOutDeviceProvider extends AbstractMidiDeviceProvider { * the new instance will not reflect that state... */ static final class MidiOutDeviceInfo extends AbstractMidiDeviceProvider.Info { - private final Class providerClass; + private final Class providerClass; - private MidiOutDeviceInfo(int index, Class providerClass) { + private MidiOutDeviceInfo(int index, Class providerClass) { super(nGetName(index), nGetVendor(index), nGetDescription(index), nGetVersion(index), index); this.providerClass = providerClass; } diff --git a/jdk/src/share/classes/com/sun/media/sound/MidiUtils.java b/jdk/src/share/classes/com/sun/media/sound/MidiUtils.java index a3f62efd29e..eecd33fe0b5 100644 --- a/jdk/src/share/classes/com/sun/media/sound/MidiUtils.java +++ b/jdk/src/share/classes/com/sun/media/sound/MidiUtils.java @@ -295,7 +295,7 @@ public final class MidiUtils { public synchronized void refresh(Sequence seq) { - ArrayList list = new ArrayList(); + ArrayList list = new ArrayList<>(); Track[] tracks = seq.getTracks(); if (tracks.length > 0) { // tempo events only occur in track 0 @@ -313,7 +313,7 @@ public final class MidiUtils { int size = list.size() + 1; firstTempoIsFake = true; if ((size > 1) - && (((MidiEvent) list.get(0)).getTick() == 0)) { + && (list.get(0).getTick() == 0)) { // do not need to add an initial tempo event at the beginning size--; firstTempoIsFake = false; @@ -328,7 +328,7 @@ public final class MidiUtils { e++; } for (int i = 0; i < list.size(); i++, e++) { - MidiEvent evt = (MidiEvent) list.get(i); + MidiEvent evt = list.get(i); ticks[e] = evt.getTick(); tempos[e] = getTempoMPQ(evt.getMessage()); } diff --git a/jdk/src/share/classes/com/sun/media/sound/PCMtoPCMCodec.java b/jdk/src/share/classes/com/sun/media/sound/PCMtoPCMCodec.java index 9a4f1a874b3..dbed920e6fa 100644 --- a/jdk/src/share/classes/com/sun/media/sound/PCMtoPCMCodec.java +++ b/jdk/src/share/classes/com/sun/media/sound/PCMtoPCMCodec.java @@ -91,7 +91,7 @@ public final class PCMtoPCMCodec extends SunCodec { // filter out targetEncoding from the old getOutputFormats( sourceFormat ) method AudioFormat[] formats = getOutputFormats( sourceFormat ); - Vector newFormats = new Vector(); + Vector newFormats = new Vector<>(); for(int i=0; i formats = new Vector<>(); AudioFormat format; int sampleSize = inputFormat.getSampleSizeInBits(); @@ -335,7 +335,7 @@ public final class PCMtoPCMCodec extends SunCodec { for (int i = 0; i < formatArray.length; i++) { - formatArray[i] = (AudioFormat)(formats.elementAt(i)); + formatArray[i] = formats.elementAt(i); } } diff --git a/jdk/src/share/classes/com/sun/media/sound/PortMixer.java b/jdk/src/share/classes/com/sun/media/sound/PortMixer.java index 705648004ff..ee0fbd064ae 100644 --- a/jdk/src/share/classes/com/sun/media/sound/PortMixer.java +++ b/jdk/src/share/classes/com/sun/media/sound/PortMixer.java @@ -253,12 +253,12 @@ final class PortMixer extends AbstractMixer { long newID = ((PortMixer) mixer).getID(); if ((id == 0) || (newID != id) || (controls.length == 0)) { id = newID; - Vector vector = new Vector(); + Vector vector = new Vector<>(); synchronized (vector) { nGetControls(id, portIndex, vector); controls = new Control[vector.size()]; for (int i = 0; i < controls.length; i++) { - controls[i] = (Control) vector.elementAt(i); + controls[i] = vector.elementAt(i); } } } else { @@ -494,6 +494,7 @@ final class PortMixer extends AbstractMixer { private static native String nGetPortName(long id, int portIndex); // fills the vector with the controls for this port + @SuppressWarnings("rawtypes") private static native void nGetControls(long id, int portIndex, Vector vector); // getters/setters for controls diff --git a/jdk/src/share/classes/com/sun/media/sound/RealTimeSequencer.java b/jdk/src/share/classes/com/sun/media/sound/RealTimeSequencer.java index 6ea2ec4b3c6..7252723e776 100644 --- a/jdk/src/share/classes/com/sun/media/sound/RealTimeSequencer.java +++ b/jdk/src/share/classes/com/sun/media/sound/RealTimeSequencer.java @@ -122,7 +122,7 @@ final class RealTimeSequencer extends AbstractMidiDevice /** * List of tracks to which we're recording */ - private final List recordingTracks = new ArrayList(); + private final List recordingTracks = new ArrayList<>(); private long loopStart = 0; @@ -133,13 +133,13 @@ final class RealTimeSequencer extends AbstractMidiDevice /** * Meta event listeners */ - private final ArrayList metaEventListeners = new ArrayList(); + private final ArrayList metaEventListeners = new ArrayList<>(); /** * Control change listeners */ - private final ArrayList controllerEventListeners = new ArrayList(); + private final ArrayList controllerEventListeners = new ArrayList<>(); /** automatic connection support */ @@ -645,7 +645,7 @@ final class RealTimeSequencer extends AbstractMidiDevice boolean flag = false; for(int i=0; i < controllerEventListeners.size(); i++) { - cve = (ControllerListElement) controllerEventListeners.get(i); + cve = controllerEventListeners.get(i); if (cve.listener.equals(listener)) { cve.addControllers(controllers); @@ -669,7 +669,7 @@ final class RealTimeSequencer extends AbstractMidiDevice ControllerListElement cve = null; boolean flag = false; for (int i=0; i < controllerEventListeners.size(); i++) { - cve = (ControllerListElement) controllerEventListeners.get(i); + cve = controllerEventListeners.get(i); if (cve.listener.equals(listener)) { cve.removeControllers(controllers); flag = true; @@ -940,9 +940,9 @@ final class RealTimeSequencer extends AbstractMidiDevice } ShortMessage msg = (ShortMessage) message; int controller = msg.getData1(); - List sendToListeners = new ArrayList(); + List sendToListeners = new ArrayList<>(); for (int i = 0; i < size; i++) { - ControllerListElement cve = (ControllerListElement) controllerEventListeners.get(i); + ControllerListElement cve = controllerEventListeners.get(i); for(int j = 0; j < cve.controllers.length; j++) { if (cve.controllers[j] == controller) { sendToListeners.add(cve.listener); @@ -1213,13 +1213,13 @@ final class RealTimeSequencer extends AbstractMidiDevice this.channel = channel; } - static RecordingTrack get(List recordingTracks, Track track) { + static RecordingTrack get(List recordingTracks, Track track) { synchronized(recordingTracks) { int size = recordingTracks.size(); for (int i = 0; i < size; i++) { - RecordingTrack current = (RecordingTrack)recordingTracks.get(i); + RecordingTrack current = recordingTracks.get(i); if (current.track == track) { return current; } @@ -1228,12 +1228,12 @@ final class RealTimeSequencer extends AbstractMidiDevice return null; } - static Track get(List recordingTracks, int channel) { + static Track get(List recordingTracks, int channel) { synchronized(recordingTracks) { int size = recordingTracks.size(); for (int i = 0; i < size; i++) { - RecordingTrack current = (RecordingTrack)recordingTracks.get(i); + RecordingTrack current = recordingTracks.get(i); if ((current.channel == channel) || (current.channel == -1)) { return current.track; } diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftSynthesizer.java b/jdk/src/share/classes/com/sun/media/sound/SoftSynthesizer.java index 01a64c2dddf..2c6dff99fea 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SoftSynthesizer.java +++ b/jdk/src/share/classes/com/sun/media/sound/SoftSynthesizer.java @@ -949,7 +949,7 @@ public final class SoftSynthesizer implements AudioSynthesizer, Object v = (info == null) ? null : info.get(item2.name); v = (v != null) ? v : storedProperties.getProperty(item2.name); if (v != null) { - Class c = (item2.valueClass); + Class c = (item2.valueClass); if (c.isInstance(v)) item2.value = v; else if (v instanceof String) { diff --git a/jdk/src/share/classes/com/sun/media/sound/UlawCodec.java b/jdk/src/share/classes/com/sun/media/sound/UlawCodec.java index 7dda283a0da..337fe199788 100644 --- a/jdk/src/share/classes/com/sun/media/sound/UlawCodec.java +++ b/jdk/src/share/classes/com/sun/media/sound/UlawCodec.java @@ -198,7 +198,7 @@ public final class UlawCodec extends SunCodec { /* public AudioFormat[] getOutputFormats(AudioFormat inputFormat) { */ private AudioFormat[] getOutputFormats(AudioFormat inputFormat) { - Vector formats = new Vector(); + Vector formats = new Vector<>(); AudioFormat format; if ((inputFormat.getSampleSizeInBits() == 16) @@ -235,7 +235,7 @@ public final class UlawCodec extends SunCodec { AudioFormat[] formatArray = new AudioFormat[formats.size()]; for (int i = 0; i < formatArray.length; i++) { - formatArray[i] = (AudioFormat)(formats.elementAt(i)); + formatArray[i] = formats.elementAt(i); } return formatArray; } From 860e8d8ac711723a2c48893a3719144466532ec9 Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Mon, 5 May 2014 23:38:30 -0700 Subject: [PATCH 28/50] 8039109: Fix unchecked and raw lint warnings in java.awt Reviewed-by: pchelko, forax, flar, prr --- .../share/classes/java/awt/AWTKeyStroke.java | 15 ++++--- .../share/classes/java/awt/CardLayout.java | 1 + jdk/src/share/classes/java/awt/Component.java | 2 +- .../classes/java/awt/GraphicsEnvironment.java | 10 ++--- .../java/awt/KeyboardFocusManager.java | 14 ++++--- .../share/classes/java/awt/SystemTray.java | 6 ++- .../datatransfer/MimeTypeParameterList.java | 4 +- .../java/awt/dnd/DragGestureEvent.java | 3 +- jdk/src/share/classes/java/awt/geom/Area.java | 42 +++++++++---------- .../classes/java/awt/image/BufferedImage.java | 6 +-- .../java/awt/image/CropImageFilter.java | 3 +- .../java/awt/image/FilteredImageSource.java | 14 +++---- .../classes/java/awt/image/ImageFilter.java | 3 +- .../java/awt/image/MemoryImageSource.java | 22 +++++----- .../java/awt/image/ReplicateScaleFilter.java | 3 +- .../awt/image/renderable/ParameterBlock.java | 13 +++--- .../image/renderable/RenderableImageOp.java | 14 +++---- .../renderable/RenderableImageProducer.java | 12 +++--- .../share/classes/java/awt/print/Book.java | 8 ++-- .../classes/java/awt/print/PrinterJob.java | 8 ++-- 20 files changed, 109 insertions(+), 94 deletions(-) diff --git a/jdk/src/share/classes/java/awt/AWTKeyStroke.java b/jdk/src/share/classes/java/awt/AWTKeyStroke.java index c4e07b45530..4be729b8c89 100644 --- a/jdk/src/share/classes/java/awt/AWTKeyStroke.java +++ b/jdk/src/share/classes/java/awt/AWTKeyStroke.java @@ -86,7 +86,8 @@ public class AWTKeyStroke implements Serializable { * Must be called under locked AWTKeyStro */ private static Class getAWTKeyStrokeClass() { - Class clazz = (Class)AppContext.getAppContext().get(AWTKeyStroke.class); + @SuppressWarnings("unchecked") + Class clazz = (Class)AppContext.getAppContext().get(AWTKeyStroke.class); if (clazz == null) { clazz = AWTKeyStroke.class; AppContext.getAppContext().put(AWTKeyStroke.class, AWTKeyStroke.class); @@ -182,6 +183,7 @@ public class AWTKeyStroke implements Serializable { throw new IllegalArgumentException("subclass cannot be null"); } synchronized (AWTKeyStroke.class) { + @SuppressWarnings("unchecked") Class keyStrokeClass = (Class)AppContext.getAppContext().get(AWTKeyStroke.class); if (keyStrokeClass != null && keyStrokeClass.equals(subclass)){ // Already registered @@ -192,7 +194,7 @@ public class AWTKeyStroke implements Serializable { throw new ClassCastException("subclass is not derived from AWTKeyStroke"); } - Constructor ctor = getCtor(subclass); + Constructor ctor = getCtor(subclass); String couldNotInstantiate = "subclass could not be instantiated"; @@ -227,12 +229,12 @@ public class AWTKeyStroke implements Serializable { threat as accessible flag is set only for this Constructor object, not for Class constructor. */ - private static Constructor getCtor(final Class clazz) + private static Constructor getCtor(final Class clazz) { - Constructor ctor = AccessController.doPrivileged(new PrivilegedAction() { - public Constructor run() { + Constructor ctor = AccessController.doPrivileged(new PrivilegedAction>() { + public Constructor run() { try { - Constructor ctor = clazz.getDeclaredConstructor((Class[]) null); + Constructor ctor = clazz.getDeclaredConstructor((Class[]) null); if (ctor != null) { ctor.setAccessible(true); } @@ -249,6 +251,7 @@ public class AWTKeyStroke implements Serializable { private static synchronized AWTKeyStroke getCachedStroke (char keyChar, int keyCode, int modifiers, boolean onKeyRelease) { + @SuppressWarnings("unchecked") Map cache = (Map)AppContext.getAppContext().get(APP_CONTEXT_CACHE_KEY); AWTKeyStroke cacheKey = (AWTKeyStroke)AppContext.getAppContext().get(APP_CONTEXT_KEYSTROKE_KEY); diff --git a/jdk/src/share/classes/java/awt/CardLayout.java b/jdk/src/share/classes/java/awt/CardLayout.java index 3ffb19fbee7..5e813fffbe9 100644 --- a/jdk/src/share/classes/java/awt/CardLayout.java +++ b/jdk/src/share/classes/java/awt/CardLayout.java @@ -560,6 +560,7 @@ public class CardLayout implements LayoutManager2, /** * Reads serializable fields from stream. */ + @SuppressWarnings("unchecked") private void readObject(ObjectInputStream s) throws ClassNotFoundException, IOException { diff --git a/jdk/src/share/classes/java/awt/Component.java b/jdk/src/share/classes/java/awt/Component.java index a7573c09a3c..cd6ae69de1d 100644 --- a/jdk/src/share/classes/java/awt/Component.java +++ b/jdk/src/share/classes/java/awt/Component.java @@ -6184,7 +6184,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Parameter types of coalesceEvents(AWTEvent,AWTEVent). */ - private static final Class[] coalesceEventsParams = { + private static final Class[] coalesceEventsParams = { AWTEvent.class, AWTEvent.class }; diff --git a/jdk/src/share/classes/java/awt/GraphicsEnvironment.java b/jdk/src/share/classes/java/awt/GraphicsEnvironment.java index 66ab39a45b1..e9e9080dba6 100644 --- a/jdk/src/share/classes/java/awt/GraphicsEnvironment.java +++ b/jdk/src/share/classes/java/awt/GraphicsEnvironment.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -95,18 +95,18 @@ public abstract class GraphicsEnvironment { String nm = AccessController.doPrivileged(new GetPropertyAction("java.awt.graphicsenv", null)); try { // long t0 = System.currentTimeMillis(); - Class geCls; + Class geCls; try { // First we try if the bootclassloader finds the requested // class. This way we can avoid to run in a privileged block. - geCls = (Class)Class.forName(nm); + geCls = Class.forName(nm); } catch (ClassNotFoundException ex) { // If the bootclassloader fails, we try again with the // application classloader. ClassLoader cl = ClassLoader.getSystemClassLoader(); - geCls = (Class)Class.forName(nm, true, cl); + geCls = Class.forName(nm, true, cl); } - ge = geCls.newInstance(); + ge = (GraphicsEnvironment)geCls.newInstance(); // long t1 = System.currentTimeMillis(); // System.out.println("GE creation took " + (t1-t0)+ "ms."); if (isHeadless()) { diff --git a/jdk/src/share/classes/java/awt/KeyboardFocusManager.java b/jdk/src/share/classes/java/awt/KeyboardFocusManager.java index b02bb5b0dba..8758a2b50e3 100644 --- a/jdk/src/share/classes/java/awt/KeyboardFocusManager.java +++ b/jdk/src/share/classes/java/awt/KeyboardFocusManager.java @@ -348,6 +348,7 @@ public abstract class KeyboardFocusManager * Component of those Windows that has no such array of its own explicitly * set. */ + @SuppressWarnings({"unchecked", "rawtypes"}) private Set[] defaultFocusTraversalKeys = new Set[4]; /** @@ -422,7 +423,7 @@ public abstract class KeyboardFocusManager targetSet.add(AWTKeyStroke.getAWTKeyStroke(tokens.nextToken())); } return (targetSet.isEmpty()) - ? Collections.EMPTY_SET + ? Collections.emptySet() : Collections.unmodifiableSet(targetSet); } @@ -436,7 +437,7 @@ public abstract class KeyboardFocusManager work_set.add(defaultFocusTraversalKeyStrokes[i][j]); } defaultFocusTraversalKeys[i] = (work_set.isEmpty()) - ? Collections.EMPTY_SET + ? Collections.emptySet() : Collections.unmodifiableSet(work_set); } initPeer(); @@ -1750,11 +1751,12 @@ public abstract class KeyboardFocusManager * @see #addKeyEventDispatcher * @see #removeKeyEventDispatcher */ + @SuppressWarnings("unchecked") // Cast of result of clone protected synchronized java.util.List getKeyEventDispatchers() { return (keyEventDispatchers != null) - ? (java.util.List)keyEventDispatchers.clone() + ? (java.util.List)keyEventDispatchers.clone() : null; } @@ -1841,11 +1843,12 @@ public abstract class KeyboardFocusManager * @see #addKeyEventPostProcessor * @see #removeKeyEventPostProcessor */ + @SuppressWarnings("unchecked") // Cast of result of clone protected java.util.List getKeyEventPostProcessors() { return (keyEventPostProcessors != null) - ? (java.util.List)keyEventPostProcessors.clone() + ? (java.util.List)keyEventPostProcessors.clone() : null; } @@ -1907,8 +1910,7 @@ public abstract class KeyboardFocusManager * javax.swing.JComponent.runInputVerifier() using reflection. */ static synchronized Component getMostRecentFocusOwner(Window window) { - WeakReference weakValue = - (WeakReference)mostRecentFocusOwners.get(window); + WeakReference weakValue = mostRecentFocusOwners.get(window); return weakValue == null ? null : weakValue.get(); } diff --git a/jdk/src/share/classes/java/awt/SystemTray.java b/jdk/src/share/classes/java/awt/SystemTray.java index 7f3a5c31893..e542dfc1712 100644 --- a/jdk/src/share/classes/java/awt/SystemTray.java +++ b/jdk/src/share/classes/java/awt/SystemTray.java @@ -259,7 +259,9 @@ public class SystemTray { Vector icons = null; synchronized (this) { oldArray = systemTray.getTrayIcons(); - icons = (Vector)AppContext.getAppContext().get(TrayIcon.class); + @SuppressWarnings("unchecked") + Vector tmp = (Vector)AppContext.getAppContext().get(TrayIcon.class); + icons = tmp; if (icons == null) { icons = new Vector(3); AppContext.getAppContext().put(TrayIcon.class, icons); @@ -304,6 +306,7 @@ public class SystemTray { TrayIcon[] oldArray = null, newArray = null; synchronized (this) { oldArray = systemTray.getTrayIcons(); + @SuppressWarnings("unchecked") Vector icons = (Vector)AppContext.getAppContext().get(TrayIcon.class); // TrayIcon with no peer is not contained in the array. if (icons == null || !icons.remove(trayIcon)) { @@ -335,6 +338,7 @@ public class SystemTray { * @see TrayIcon */ public TrayIcon[] getTrayIcons() { + @SuppressWarnings("unchecked") Vector icons = (Vector)AppContext.getAppContext().get(TrayIcon.class); if (icons != null) { return icons.toArray(new TrayIcon[icons.size()]); diff --git a/jdk/src/share/classes/java/awt/datatransfer/MimeTypeParameterList.java b/jdk/src/share/classes/java/awt/datatransfer/MimeTypeParameterList.java index f4816b65d87..3a79886c2b4 100644 --- a/jdk/src/share/classes/java/awt/datatransfer/MimeTypeParameterList.java +++ b/jdk/src/share/classes/java/awt/datatransfer/MimeTypeParameterList.java @@ -296,14 +296,14 @@ class MimeTypeParameterList implements Cloneable { /** * @return a clone of this object */ - + @SuppressWarnings("unchecked") // Cast from clone public Object clone() { MimeTypeParameterList newObj = null; try { newObj = (MimeTypeParameterList)super.clone(); } catch (CloneNotSupportedException cannotHappen) { } - newObj.parameters = (Hashtable)parameters.clone(); + newObj.parameters = (Hashtable)parameters.clone(); return newObj; } diff --git a/jdk/src/share/classes/java/awt/dnd/DragGestureEvent.java b/jdk/src/share/classes/java/awt/dnd/DragGestureEvent.java index e8827f44358..3dff336a794 100644 --- a/jdk/src/share/classes/java/awt/dnd/DragGestureEvent.java +++ b/jdk/src/share/classes/java/awt/dnd/DragGestureEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -357,6 +357,7 @@ public class DragGestureEvent extends EventObject { action = newAction; // Pre-1.4 support. 'events' was previously non-transient + @SuppressWarnings("rawtypes") List newEvents; try { newEvents = (List)f.get("events", null); diff --git a/jdk/src/share/classes/java/awt/geom/Area.java b/jdk/src/share/classes/java/awt/geom/Area.java index 507f212b4ea..ae5ab2f683b 100644 --- a/jdk/src/share/classes/java/awt/geom/Area.java +++ b/jdk/src/share/classes/java/awt/geom/Area.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -97,9 +97,9 @@ import sun.awt.geom.AreaOp; * @since 1.2 */ public class Area implements Shape, Cloneable { - private static Vector EmptyCurves = new Vector(); + private static Vector EmptyCurves = new Vector<>(); - private Vector curves; + private Vector curves; /** * Default constructor which creates an empty area. @@ -127,8 +127,8 @@ public class Area implements Shape, Cloneable { } } - private static Vector pathToCurves(PathIterator pi) { - Vector curves = new Vector(); + private static Vector pathToCurves(PathIterator pi) { + Vector curves = new Vector<>(); int windingRule = pi.getWindingRule(); // coords array is big enough for holding: // coordinates returned from currentSegment (6) @@ -334,7 +334,7 @@ public class Area implements Shape, Cloneable { * @since 1.2 */ public void reset() { - curves = new Vector(); + curves = new Vector<>(); invalidateBounds(); } @@ -357,9 +357,9 @@ public class Area implements Shape, Cloneable { * @since 1.2 */ public boolean isPolygonal() { - Enumeration enum_ = curves.elements(); + Enumeration enum_ = curves.elements(); while (enum_.hasMoreElements()) { - if (((Curve) enum_.nextElement()).getOrder() > 1) { + if (enum_.nextElement().getOrder() > 1) { return false; } } @@ -381,8 +381,8 @@ public class Area implements Shape, Cloneable { if (size > 3) { return false; } - Curve c1 = (Curve) curves.get(1); - Curve c2 = (Curve) curves.get(2); + Curve c1 = curves.get(1); + Curve c2 = curves.get(2); if (c1.getOrder() != 1 || c2.getOrder() != 1) { return false; } @@ -411,10 +411,10 @@ public class Area implements Shape, Cloneable { if (curves.size() < 3) { return true; } - Enumeration enum_ = curves.elements(); + Enumeration enum_ = curves.elements(); enum_.nextElement(); // First Order0 "moveto" while (enum_.hasMoreElements()) { - if (((Curve) enum_.nextElement()).getOrder() == 0) { + if (enum_.nextElement().getOrder() == 0) { return false; } } @@ -431,11 +431,11 @@ public class Area implements Shape, Cloneable { } Rectangle2D r = new Rectangle2D.Double(); if (curves.size() > 0) { - Curve c = (Curve) curves.get(0); + Curve c = curves.get(0); // First point is always an order 0 curve (moveto) r.setRect(c.getX0(), c.getY0(), 0, 0); for (int i = 1; i < curves.size(); i++) { - ((Curve) curves.get(i)).enlarge(r); + curves.get(i).enlarge(r); } } return (cachedBounds = r); @@ -507,7 +507,7 @@ public class Area implements Shape, Cloneable { if (other == null) { return false; } - Vector c = new AreaOp.XorOp().calculate(this.curves, other.curves); + Vector c = new AreaOp.XorOp().calculate(this.curves, other.curves); return c.isEmpty(); } @@ -555,10 +555,10 @@ public class Area implements Shape, Cloneable { if (!getCachedBounds().contains(x, y)) { return false; } - Enumeration enum_ = curves.elements(); + Enumeration enum_ = curves.elements(); int crossings = 0; while (enum_.hasMoreElements()) { - Curve c = (Curve) enum_.nextElement(); + Curve c = enum_.nextElement(); crossings += c.crossingsFor(x, y); } return ((crossings & 1) == 1); @@ -658,16 +658,16 @@ public class Area implements Shape, Cloneable { class AreaIterator implements PathIterator { private AffineTransform transform; - private Vector curves; + private Vector curves; private int index; private Curve prevcurve; private Curve thiscurve; - public AreaIterator(Vector curves, AffineTransform at) { + public AreaIterator(Vector curves, AffineTransform at) { this.curves = curves; this.transform = at; if (curves.size() >= 1) { - thiscurve = (Curve) curves.get(0); + thiscurve = curves.get(0); } } @@ -689,7 +689,7 @@ class AreaIterator implements PathIterator { prevcurve = thiscurve; index++; if (index < curves.size()) { - thiscurve = (Curve) curves.get(index); + thiscurve = curves.get(index); if (thiscurve.getOrder() != 0 && prevcurve.getX1() == thiscurve.getX0() && prevcurve.getY1() == thiscurve.getY0()) diff --git a/jdk/src/share/classes/java/awt/image/BufferedImage.java b/jdk/src/share/classes/java/awt/image/BufferedImage.java index bb272aacf69..0c819349135 100644 --- a/jdk/src/share/classes/java/awt/image/BufferedImage.java +++ b/jdk/src/share/classes/java/awt/image/BufferedImage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -76,7 +76,7 @@ public class BufferedImage extends java.awt.Image ColorModel colorModel; WritableRaster raster; OffScreenImageSource osis; - Hashtable properties; + Hashtable properties; boolean isAlphaPremultiplied;// If true, alpha has been premultiplied in // color channels @@ -1106,7 +1106,7 @@ public class BufferedImage extends java.awt.Image public ImageProducer getSource() { if (osis == null) { if (properties == null) { - properties = new Hashtable(); + properties = new Hashtable<>(); } osis = new OffScreenImageSource(this, properties); } diff --git a/jdk/src/share/classes/java/awt/image/CropImageFilter.java b/jdk/src/share/classes/java/awt/image/CropImageFilter.java index 4d75c9e0427..a1d241d33ed 100644 --- a/jdk/src/share/classes/java/awt/image/CropImageFilter.java +++ b/jdk/src/share/classes/java/awt/image/CropImageFilter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -79,6 +79,7 @@ public class CropImageFilter extends ImageFilter { * with the filtering operation. */ public void setProperties(Hashtable props) { + @SuppressWarnings("unchecked") Hashtable p = (Hashtable)props.clone(); p.put("croprect", new Rectangle(cropX, cropY, cropW, cropH)); super.setProperties(p); diff --git a/jdk/src/share/classes/java/awt/image/FilteredImageSource.java b/jdk/src/share/classes/java/awt/image/FilteredImageSource.java index 2f58c096474..a7013159008 100644 --- a/jdk/src/share/classes/java/awt/image/FilteredImageSource.java +++ b/jdk/src/share/classes/java/awt/image/FilteredImageSource.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -68,7 +68,7 @@ public class FilteredImageSource implements ImageProducer { filter = imgf; } - private Hashtable proxies; + private Hashtable proxies; /** * Adds the specified ImageConsumer @@ -94,7 +94,7 @@ public class FilteredImageSource implements ImageProducer { */ public synchronized void addConsumer(ImageConsumer ic) { if (proxies == null) { - proxies = new Hashtable(); + proxies = new Hashtable<>(); } if (!proxies.containsKey(ic)) { ImageFilter imgf = filter.getFilterInstance(ic); @@ -137,7 +137,7 @@ public class FilteredImageSource implements ImageProducer { */ public synchronized void removeConsumer(ImageConsumer ic) { if (proxies != null) { - ImageFilter imgf = (ImageFilter) proxies.get(ic); + ImageFilter imgf = proxies.get(ic); if (imgf != null) { src.removeConsumer(imgf); proxies.remove(ic); @@ -173,9 +173,9 @@ public class FilteredImageSource implements ImageProducer { */ public void startProduction(ImageConsumer ic) { if (proxies == null) { - proxies = new Hashtable(); + proxies = new Hashtable<>(); } - ImageFilter imgf = (ImageFilter) proxies.get(ic); + ImageFilter imgf = proxies.get(ic); if (imgf == null) { imgf = filter.getFilterInstance(ic); proxies.put(ic, imgf); @@ -200,7 +200,7 @@ public class FilteredImageSource implements ImageProducer { */ public void requestTopDownLeftRightResend(ImageConsumer ic) { if (proxies != null) { - ImageFilter imgf = (ImageFilter) proxies.get(ic); + ImageFilter imgf = proxies.get(ic); if (imgf != null) { imgf.resendTopDownLeftRight(src); } diff --git a/jdk/src/share/classes/java/awt/image/ImageFilter.java b/jdk/src/share/classes/java/awt/image/ImageFilter.java index 0b64d726b8e..33198346e03 100644 --- a/jdk/src/share/classes/java/awt/image/ImageFilter.java +++ b/jdk/src/share/classes/java/awt/image/ImageFilter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -104,6 +104,7 @@ public class ImageFilter implements ImageConsumer, Cloneable { * @exception NullPointerException if props is null */ public void setProperties(Hashtable props) { + @SuppressWarnings("unchecked") Hashtable p = (Hashtable)props.clone(); Object o = p.get("filters"); if (o == null) { diff --git a/jdk/src/share/classes/java/awt/image/MemoryImageSource.java b/jdk/src/share/classes/java/awt/image/MemoryImageSource.java index 7046f5e4667..501714fda1f 100644 --- a/jdk/src/share/classes/java/awt/image/MemoryImageSource.java +++ b/jdk/src/share/classes/java/awt/image/MemoryImageSource.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -111,8 +111,8 @@ public class MemoryImageSource implements ImageProducer { Object pixels; int pixeloffset; int pixelscan; - Hashtable properties; - Vector theConsumers = new Vector(); + Hashtable properties; + Vector theConsumers = new Vector<>(); boolean animating; boolean fullbuffers; @@ -197,7 +197,7 @@ public class MemoryImageSource implements ImageProducer { } private void initialize(int w, int h, ColorModel cm, - Object pix, int off, int scan, Hashtable props) { + Object pix, int off, int scan, Hashtable props) { width = w; height = h; model = cm; @@ -205,7 +205,7 @@ public class MemoryImageSource implements ImageProducer { pixeloffset = off; pixelscan = scan; if (props == null) { - props = new Hashtable(); + props = new Hashtable<>(); } properties = props; } @@ -343,9 +343,9 @@ public class MemoryImageSource implements ImageProducer { public synchronized void setAnimated(boolean animated) { this.animating = animated; if (!animating) { - Enumeration enum_ = theConsumers.elements(); + Enumeration enum_ = theConsumers.elements(); while (enum_.hasMoreElements()) { - ImageConsumer ic = (ImageConsumer) enum_.nextElement(); + ImageConsumer ic = enum_.nextElement(); ic.imageComplete(ImageConsumer.STATICIMAGEDONE); if (isConsumer(ic)) { ic.imageComplete(ImageConsumer.IMAGEERROR); @@ -376,9 +376,9 @@ public class MemoryImageSource implements ImageProducer { } this.fullbuffers = fullbuffers; if (animating) { - Enumeration enum_ = theConsumers.elements(); + Enumeration enum_ = theConsumers.elements(); while (enum_.hasMoreElements()) { - ImageConsumer ic = (ImageConsumer) enum_.nextElement(); + ImageConsumer ic = enum_.nextElement(); ic.setHints(fullbuffers ? (ImageConsumer.TOPDOWNLEFTRIGHT | ImageConsumer.COMPLETESCANLINES) @@ -474,9 +474,9 @@ public class MemoryImageSource implements ImageProducer { if ((w <= 0 || h <= 0) && !framenotify) { return; } - Enumeration enum_ = theConsumers.elements(); + Enumeration enum_ = theConsumers.elements(); while (enum_.hasMoreElements()) { - ImageConsumer ic = (ImageConsumer) enum_.nextElement(); + ImageConsumer ic = enum_.nextElement(); if (w > 0 && h > 0) { sendPixels(ic, x, y, w, h); } diff --git a/jdk/src/share/classes/java/awt/image/ReplicateScaleFilter.java b/jdk/src/share/classes/java/awt/image/ReplicateScaleFilter.java index 04a6fdfe52a..7330439f2c5 100644 --- a/jdk/src/share/classes/java/awt/image/ReplicateScaleFilter.java +++ b/jdk/src/share/classes/java/awt/image/ReplicateScaleFilter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -121,6 +121,7 @@ public class ReplicateScaleFilter extends ImageFilter { * with the filtering operation. */ public void setProperties(Hashtable props) { + @SuppressWarnings("unchecked") Hashtable p = (Hashtable)props.clone(); String key = "rescale"; String val = destWidth + "x" + destHeight; diff --git a/jdk/src/share/classes/java/awt/image/renderable/ParameterBlock.java b/jdk/src/share/classes/java/awt/image/renderable/ParameterBlock.java index ca12bfc4c4b..bf14e8ce2d3 100644 --- a/jdk/src/share/classes/java/awt/image/renderable/ParameterBlock.java +++ b/jdk/src/share/classes/java/awt/image/renderable/ParameterBlock.java @@ -153,6 +153,7 @@ public class ParameterBlock implements Cloneable, Serializable { * * @return an Object clone of the ParameterBlock. */ + @SuppressWarnings("unchecked") // casts from clone public Object clone() { ParameterBlock theClone; @@ -164,10 +165,10 @@ public class ParameterBlock implements Cloneable, Serializable { } if (sources != null) { - theClone.setSources((Vector)sources.clone()); + theClone.setSources((Vector)sources.clone()); } if (parameters != null) { - theClone.setParameters((Vector)parameters.clone()); + theClone.setParameters((Vector)parameters.clone()); } return (Object) theClone; } @@ -280,7 +281,7 @@ public class ParameterBlock implements Cloneable, Serializable { /** Clears the list of source images. */ public void removeSources() { - sources = new Vector(); + sources = new Vector<>(); } /** @@ -313,7 +314,7 @@ public class ParameterBlock implements Cloneable, Serializable { /** Clears the list of parameters. */ public void removeParameters() { - parameters = new Vector(); + parameters = new Vector<>(); } /** @@ -696,9 +697,9 @@ public class ParameterBlock implements Cloneable, Serializable { * of the parameters. * @return an array of Class objects. */ - public Class [] getParamClasses() { + public Class[] getParamClasses() { int numParams = getNumParameters(); - Class [] classes = new Class[numParams]; + Class[] classes = new Class[numParams]; int i; for (i = 0; i < numParams; i++) { diff --git a/jdk/src/share/classes/java/awt/image/renderable/RenderableImageOp.java b/jdk/src/share/classes/java/awt/image/renderable/RenderableImageOp.java index 6c51f65a8bf..9d5aaa954a8 100644 --- a/jdk/src/share/classes/java/awt/image/renderable/RenderableImageOp.java +++ b/jdk/src/share/classes/java/awt/image/renderable/RenderableImageOp.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -87,11 +87,11 @@ public class RenderableImageOp implements RenderableImage { return getRenderableSources(); } - private Vector getRenderableSources() { - Vector sources = null; + private Vector getRenderableSources() { + Vector sources = null; if (paramBlock.getNumSources() > 0) { - sources = new Vector(); + sources = new Vector<>(); int i = 0; while (i < paramBlock.getNumSources()) { Object o = paramBlock.getSource(i); @@ -314,19 +314,19 @@ public class RenderableImageOp implements RenderableImage { // contains RenderableImage sources, they will be replaced by // RenderedImages. ParameterBlock renderedParamBlock = (ParameterBlock)paramBlock.clone(); - Vector sources = getRenderableSources(); + Vector sources = getRenderableSources(); try { // This assumes that if there is no renderable source, that there // is a rendered source in paramBlock if (sources != null) { - Vector renderedSources = new Vector(); + Vector renderedSources = new Vector<>(); for (int i = 0; i < sources.size(); i++) { rcOut = myCRIF.mapRenderContext(i, renderContext, paramBlock, this); RenderedImage rdrdImage = - ((RenderableImage)sources.elementAt(i)).createRendering(rcOut); + ((RenderableImage)sources.elementAt(i)).createRendering(rcOut); if (rdrdImage == null) { return null; } diff --git a/jdk/src/share/classes/java/awt/image/renderable/RenderableImageProducer.java b/jdk/src/share/classes/java/awt/image/renderable/RenderableImageProducer.java index c5e357a28c2..206869ae1bf 100644 --- a/jdk/src/share/classes/java/awt/image/renderable/RenderableImageProducer.java +++ b/jdk/src/share/classes/java/awt/image/renderable/RenderableImageProducer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -68,7 +68,7 @@ public class RenderableImageProducer implements ImageProducer, Runnable { RenderContext rc; /** A Vector of image consumers. */ - Vector ics = new Vector(); + Vector ics = new Vector<>(); /** * Constructs a new RenderableImageProducer from a RenderableImage @@ -177,12 +177,12 @@ public class RenderableImageProducer implements ImageProducer, Runnable { int width = raster.getWidth(); int height = raster.getHeight(); - Enumeration icList; + Enumeration icList; ImageConsumer ic; // Set up the ImageConsumers icList = ics.elements(); while (icList.hasMoreElements()) { - ic = (ImageConsumer)icList.nextElement(); + ic = icList.nextElement(); ic.setDimensions(width,height); ic.setHints(ImageConsumer.TOPDOWNLEFTRIGHT | ImageConsumer.COMPLETESCANLINES | @@ -204,7 +204,7 @@ public class RenderableImageProducer implements ImageProducer, Runnable { // Now send the scanline to the Consumers icList = ics.elements(); while (icList.hasMoreElements()) { - ic = (ImageConsumer)icList.nextElement(); + ic = icList.nextElement(); ic.setPixels(0, j, width, 1, colorModel, pix, 0, width); } } @@ -212,7 +212,7 @@ public class RenderableImageProducer implements ImageProducer, Runnable { // Now tell the consumers we're done. icList = ics.elements(); while (icList.hasMoreElements()) { - ic = (ImageConsumer)icList.nextElement(); + ic = icList.nextElement(); ic.imageComplete(ImageConsumer.STATICIMAGEDONE); } } diff --git a/jdk/src/share/classes/java/awt/print/Book.java b/jdk/src/share/classes/java/awt/print/Book.java index 672b842e8e7..eaab083789c 100644 --- a/jdk/src/share/classes/java/awt/print/Book.java +++ b/jdk/src/share/classes/java/awt/print/Book.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -47,7 +47,7 @@ public class Book implements Pageable { /** * The set of pages that make up the Book. */ - private Vector mPages; + private Vector mPages; /* Instance Methods */ @@ -55,7 +55,7 @@ public class Book implements Pageable { * Creates a new, empty Book. */ public Book() { - mPages = new Vector(); + mPages = new Vector<>(); } /** @@ -167,7 +167,7 @@ public class Book implements Pageable { private BookPage getPage(int pageIndex) throws ArrayIndexOutOfBoundsException { - return (BookPage) mPages.elementAt(pageIndex); + return mPages.elementAt(pageIndex); } /** diff --git a/jdk/src/share/classes/java/awt/print/PrinterJob.java b/jdk/src/share/classes/java/awt/print/PrinterJob.java index b9b0d134d64..0c80d1490d4 100644 --- a/jdk/src/share/classes/java/awt/print/PrinterJob.java +++ b/jdk/src/share/classes/java/awt/print/PrinterJob.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -74,9 +74,9 @@ public abstract class PrinterJob { if (security != null) { security.checkPrintJobAccess(); } - return (PrinterJob) java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction() { - public Object run() { + return java.security.AccessController.doPrivileged( + new java.security.PrivilegedAction() { + public PrinterJob run() { String nm = System.getProperty("java.awt.printerjob", null); try { return (PrinterJob)Class.forName(nm).newInstance(); From 0bb0984a41a1c37fc30e14d61b451ae51c6560c2 Mon Sep 17 00:00:00 2001 From: Petr Pchelko Date: Wed, 7 May 2014 19:40:30 +0400 Subject: [PATCH 29/50] 8042585: [macosx] Unused code in LWCToolkit.m Reviewed-by: serb, azvegint --- jdk/src/macosx/native/sun/awt/LWCToolkit.m | 57 +--------------------- 1 file changed, 1 insertion(+), 56 deletions(-) diff --git a/jdk/src/macosx/native/sun/awt/LWCToolkit.m b/jdk/src/macosx/native/sun/awt/LWCToolkit.m index c78834547c3..7347ecdd251 100644 --- a/jdk/src/macosx/native/sun/awt/LWCToolkit.m +++ b/jdk/src/macosx/native/sun/awt/LWCToolkit.m @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -157,61 +157,6 @@ JNF_COCOA_ENTER(env); JNF_COCOA_EXIT(env); } -static JNF_CLASS_CACHE(jc_Component, "java/awt/Component"); -static JNF_MEMBER_CACHE(jf_Component_appContext, jc_Component, "appContext", "Lsun/awt/AppContext;"); -static JNF_CLASS_CACHE(jc_MenuComponent, "java/awt/MenuComponent"); -static JNF_MEMBER_CACHE(jf_MenuComponent_appContext, jc_MenuComponent, "appContext", "Lsun/awt/AppContext;"); - -/* - * Class: sun_awt_SunToolkit - * Method: getAppContext - * Signature: (Ljava/awt/Object;)Lsun/awt/AppContext; - */ -JNIEXPORT jobject JNICALL -Java_sun_awt_SunToolkit_getAppContext -(JNIEnv *env, jclass cls, jobject obj) -{ - jobject appContext = NULL; - -JNF_COCOA_ENTER(env); - - if (JNFIsInstanceOf(env, obj, &jc_Component)) { - appContext = JNFGetObjectField(env, obj, jf_Component_appContext); - } else if (JNFIsInstanceOf(env, obj, &jc_MenuComponent)) { - appContext = JNFGetObjectField(env, obj, jf_MenuComponent_appContext); - } - -JNF_COCOA_EXIT(env); - - return appContext; -} - -/* - * Class: sun_awt_SunToolkit - * Method: setAppContext - * Signature: (Ljava/lang/Object;Lsun/awt/AppContext;)Z - */ -JNIEXPORT jboolean JNICALL -Java_sun_awt_SunToolkit_setAppContext -(JNIEnv *env, jclass cls, jobject obj, jobject appContext) -{ - jboolean isComponent; - -JNF_COCOA_ENTER(env); - - if (JNFIsInstanceOf(env, obj, &jc_Component)) { - JNFSetObjectField(env, obj, jf_Component_appContext, appContext); - isComponent = JNI_TRUE; - } else if (JNFIsInstanceOf(env, obj, &jc_MenuComponent)) { - JNFSetObjectField(env, obj, jf_MenuComponent_appContext, appContext); - isComponent = JNI_FALSE; - } - -JNF_COCOA_EXIT(env); - - return isComponent; -} - /* * Class: sun_lwawt_macosx_LWCToolkit * Method: beep From ceed2af62067267e6607d69707748b87d14058d2 Mon Sep 17 00:00:00 2001 From: Petr Pchelko Date: Wed, 7 May 2014 19:47:26 +0400 Subject: [PATCH 30/50] 8042219: [macosx] LWComponentPeer should not reference classes from sun.lwawt.macosx Reviewed-by: serb, azvegint --- .../classes/sun/lwawt/LWComponentPeer.java | 12 +++-- .../macosx/classes/sun/lwawt/LWToolkit.java | 5 +++ .../classes/sun/lwawt/PlatformDropTarget.java | 34 ++++++++++++++ .../classes/sun/lwawt/macosx/CDropTarget.java | 45 ++++++------------- .../classes/sun/lwawt/macosx/LWCToolkit.java | 9 +++- jdk/src/macosx/native/sun/awt/CDropTarget.h | 2 +- jdk/src/macosx/native/sun/awt/CDropTarget.m | 6 +-- 7 files changed, 70 insertions(+), 43 deletions(-) create mode 100644 jdk/src/macosx/classes/sun/lwawt/PlatformDropTarget.java diff --git a/jdk/src/macosx/classes/sun/lwawt/LWComponentPeer.java b/jdk/src/macosx/classes/sun/lwawt/LWComponentPeer.java index 5880d06be4d..354f2538012 100644 --- a/jdk/src/macosx/classes/sun/lwawt/LWComponentPeer.java +++ b/jdk/src/macosx/classes/sun/lwawt/LWComponentPeer.java @@ -63,8 +63,6 @@ import javax.swing.JComponent; import javax.swing.SwingUtilities; import javax.swing.RepaintManager; -import sun.lwawt.macosx.CDropTarget; - import com.sun.java.swing.SwingUtilities3; public abstract class LWComponentPeer @@ -137,7 +135,7 @@ public abstract class LWComponentPeer private final Object dropTargetLock = new Object(); private int fNumDropTargets = 0; - private CDropTarget fDropTarget = null; + private PlatformDropTarget fDropTarget = null; private final PlatformComponent platformComponent; @@ -1063,11 +1061,11 @@ public abstract class LWComponentPeer // if it's the first (or last) one for the component. Otherwise this call is a no-op. if (++fNumDropTargets == 1) { // Having a non-null drop target would be an error but let's check just in case: - if (fDropTarget != null) - System.err.println("CComponent.addDropTarget(): current drop target is non-null."); - + if (fDropTarget != null) { + throw new IllegalStateException("Current drop target is not null"); + } // Create a new drop target: - fDropTarget = CDropTarget.createDropTarget(dt, target, this); + fDropTarget = LWToolkit.getLWToolkit().createDropTarget(dt, target, this); } } } diff --git a/jdk/src/macosx/classes/sun/lwawt/LWToolkit.java b/jdk/src/macosx/classes/sun/lwawt/LWToolkit.java index b18fdb004f1..315a19a7ff3 100644 --- a/jdk/src/macosx/classes/sun/lwawt/LWToolkit.java +++ b/jdk/src/macosx/classes/sun/lwawt/LWToolkit.java @@ -28,6 +28,7 @@ package sun.lwawt; import java.awt.*; import java.awt.List; import java.awt.datatransfer.*; +import java.awt.dnd.DropTarget; import java.awt.image.*; import java.awt.peer.*; import java.security.*; @@ -440,6 +441,10 @@ public abstract class LWToolkit extends SunToolkit implements Runnable { protected abstract FileDialogPeer createFileDialogPeer(FileDialog target); + protected abstract PlatformDropTarget createDropTarget(DropTarget dropTarget, + Component component, + LWComponentPeer peer); + // ---- UTILITY METHODS ---- // /* diff --git a/jdk/src/macosx/classes/sun/lwawt/PlatformDropTarget.java b/jdk/src/macosx/classes/sun/lwawt/PlatformDropTarget.java new file mode 100644 index 00000000000..e2a9a70e70f --- /dev/null +++ b/jdk/src/macosx/classes/sun/lwawt/PlatformDropTarget.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.lwawt; + +public interface PlatformDropTarget { + + /** + * Release native dragging destination, if any + */ + void dispose(); +} diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CDropTarget.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CDropTarget.java index 910e1407a36..d4f4353d9ec 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CDropTarget.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CDropTarget.java @@ -25,54 +25,37 @@ package sun.lwawt.macosx; -import java.awt.Component; -import java.awt.peer.ComponentPeer; +import sun.lwawt.LWComponentPeer; +import sun.lwawt.PlatformDropTarget; + +import java.awt.*; import java.awt.dnd.DropTarget; -import sun.lwawt.LWComponentPeer; -import sun.lwawt.PlatformWindow; +final class CDropTarget implements PlatformDropTarget { + private long fNativeDropTarget; -public final class CDropTarget { - - Component fComponent; - ComponentPeer fPeer; - DropTarget fDropTarget; - private long fNativeDropTarget; - - public static CDropTarget createDropTarget(DropTarget dropTarget, Component component, ComponentPeer peer) { - return new CDropTarget(dropTarget, component, peer); - } - - private CDropTarget(DropTarget dropTarget, Component component, ComponentPeer peer) { - super(); - - fDropTarget = dropTarget; - fComponent = component; - fPeer = peer; - - long nativePeer = CPlatformWindow.getNativeViewPtr(((LWComponentPeer) peer).getPlatformWindow()); + CDropTarget(DropTarget dropTarget, Component component, LWComponentPeer peer) { + long nativePeer = CPlatformWindow.getNativeViewPtr(peer.getPlatformWindow()); if (nativePeer == 0L) return; // Unsupported for a window without a native view (plugin) // Create native dragging destination: - fNativeDropTarget = this.createNativeDropTarget(dropTarget, component, peer, nativePeer); + fNativeDropTarget = createNativeDropTarget(dropTarget, component, nativePeer); if (fNativeDropTarget == 0) { throw new IllegalStateException("CDropTarget.createNativeDropTarget() failed."); } } - public DropTarget getDropTarget() { - return fDropTarget; - } - + @Override public void dispose() { - // Release native dragging destination, if any: if (fNativeDropTarget != 0) { - this.releaseNativeDropTarget(fNativeDropTarget); + releaseNativeDropTarget(fNativeDropTarget); fNativeDropTarget = 0; } } - protected native long createNativeDropTarget(DropTarget dropTarget, Component component, ComponentPeer peer, long nativePeer); + protected native long createNativeDropTarget(DropTarget dropTarget, + Component component, + long nativePeer); protected native void releaseNativeDropTarget(long nativeDropTarget); } diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java b/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java index d0b6882b9a3..2bb5d4ac508 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java @@ -701,7 +701,14 @@ public final class LWCToolkit extends LWToolkit { return (T)dgr; } -// InputMethodSupport Method + @Override + protected PlatformDropTarget createDropTarget(DropTarget dropTarget, + Component component, + LWComponentPeer peer) { + return new CDropTarget(dropTarget, component, peer); + } + + // InputMethodSupport Method /** * Returns the default keyboard locale of the underlying operating system */ diff --git a/jdk/src/macosx/native/sun/awt/CDropTarget.h b/jdk/src/macosx/native/sun/awt/CDropTarget.h index b6cd156562b..3b87485add7 100644 --- a/jdk/src/macosx/native/sun/awt/CDropTarget.h +++ b/jdk/src/macosx/native/sun/awt/CDropTarget.h @@ -48,7 +48,7 @@ + (CDropTarget *) currentDropTarget; // Common methods: -- (id)init:(jobject)dropTarget component:(jobject)jcomponent peer:(jobject)jpeer control:(id)control; +- (id)init:(jobject)dropTarget component:(jobject)jcomponent control:(id)control; - (void)controlModelControlValid; - (void)removeFromView:(JNIEnv *)env; diff --git a/jdk/src/macosx/native/sun/awt/CDropTarget.m b/jdk/src/macosx/native/sun/awt/CDropTarget.m index 41b0a192c61..7e038ab7715 100644 --- a/jdk/src/macosx/native/sun/awt/CDropTarget.m +++ b/jdk/src/macosx/native/sun/awt/CDropTarget.m @@ -65,7 +65,7 @@ extern JNFClassInfo jc_CDropTargetContextPeer; return sCurrentDropTarget; } -- (id)init:(jobject)jdropTarget component:(jobject)jcomponent peer:(jobject)jpeer control:(id)control +- (id)init:(jobject)jdropTarget component:(jobject)jcomponent control:(id)control { self = [super init]; DLog2(@"[CDropTarget init]: %@\n", self); @@ -714,13 +714,13 @@ extern JNFClassInfo jc_CDropTargetContextPeer; * Signature: (Ljava/awt/dnd/DropTarget;Ljava/awt/Component;Ljava/awt/peer/ComponentPeer;J)J */ JNIEXPORT jlong JNICALL Java_sun_lwawt_macosx_CDropTarget_createNativeDropTarget - (JNIEnv *env, jobject jthis, jobject jdroptarget, jobject jcomponent, jobject jpeer, jlong jnativepeer) + (JNIEnv *env, jobject jthis, jobject jdroptarget, jobject jcomponent, jlong jnativepeer) { CDropTarget* dropTarget = nil; JNF_COCOA_ENTER(env); id controlObj = (id) jlong_to_ptr(jnativepeer); - dropTarget = [[CDropTarget alloc] init:jdroptarget component:jcomponent peer:jpeer control:controlObj]; + dropTarget = [[CDropTarget alloc] init:jdroptarget component:jcomponent control:controlObj]; JNF_COCOA_EXIT(env); return ptr_to_jlong(dropTarget); From b9113e4f414c37306bc07ccbf09abf4801d4c13b Mon Sep 17 00:00:00 2001 From: David DeHaven Date: Mon, 5 May 2014 23:21:27 -0700 Subject: [PATCH 31/50] 8042440: awt_Plugin no longer needed Reviewed-by: serb, pchelko --- jdk/make/lib/Awt2dLibraries.gmk | 1 - jdk/make/mapfiles/libawt/mapfile-mawt-vers | 7 +- jdk/make/mapfiles/libawt/mapfile-vers | 9 +- jdk/make/mapfiles/libawt/mapfile-vers-linux | 14 +- jdk/make/mapfiles/libawt_xawt/mapfile-vers | 8 +- .../solaris/native/sun/awt/awt_LoadLibrary.c | 54 ------- jdk/src/solaris/native/sun/awt/awt_Plugin.c | 149 ------------------ jdk/src/solaris/native/sun/awt/awt_Plugin.h | 54 ------- 8 files changed, 4 insertions(+), 292 deletions(-) delete mode 100644 jdk/src/solaris/native/sun/awt/awt_Plugin.c delete mode 100644 jdk/src/solaris/native/sun/awt/awt_Plugin.h diff --git a/jdk/make/lib/Awt2dLibraries.gmk b/jdk/make/lib/Awt2dLibraries.gmk index 00fa15c59ec..880a52ff096 100644 --- a/jdk/make/lib/Awt2dLibraries.gmk +++ b/jdk/make/lib/Awt2dLibraries.gmk @@ -606,7 +606,6 @@ ifeq ($(findstring $(OPENJDK_TARGET_OS),windows macosx),) debug_mem.c \ debug_trace.c \ debug_util.c \ - awt_Plugin.c \ gnome_interface.c \ gtk2_interface.c \ swing_GTKEngine.c \ diff --git a/jdk/make/mapfiles/libawt/mapfile-mawt-vers b/jdk/make/mapfiles/libawt/mapfile-mawt-vers index a50c13a62e5..b8ea1636c88 100644 --- a/jdk/make/mapfiles/libawt/mapfile-mawt-vers +++ b/jdk/make/mapfiles/libawt/mapfile-mawt-vers @@ -1,5 +1,5 @@ # -# Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -249,11 +249,6 @@ SUNWprivate_1.1 { Java_sun_awt_motif_XsessionWMcommand; Java_sun_awt_motif_XsessionWMcommand_New; - # Java Plugin - getAwtLockFunctions; - getAwtData; - getAwtDisplay; - # libfontmanager entry points AWTIsHeadless; AWTCountFonts; diff --git a/jdk/make/mapfiles/libawt/mapfile-vers b/jdk/make/mapfiles/libawt/mapfile-vers index 05ca7d538dd..b1c6a39ec1e 100644 --- a/jdk/make/mapfiles/libawt/mapfile-vers +++ b/jdk/make/mapfiles/libawt/mapfile-vers @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -173,13 +173,6 @@ SUNWprivate_1.1 { Java_sun_awt_motif_XsessionWMcommand; Java_sun_awt_motif_XsessionWMcommand_New; - # Java Plugin - # This is in awt_LoadLibrary.c and falls through to libmawt. - # Evidently plugin needs this for backward compatability. - getAwtLockFunctions; - getAwtData; - getAwtDisplay; - # libfontmanager entry points AWTIsHeadless; GrPrim_Sg2dGetCompInfo; diff --git a/jdk/make/mapfiles/libawt/mapfile-vers-linux b/jdk/make/mapfiles/libawt/mapfile-vers-linux index f8967e09462..922b015c68c 100644 --- a/jdk/make/mapfiles/libawt/mapfile-vers-linux +++ b/jdk/make/mapfiles/libawt/mapfile-vers-linux @@ -1,5 +1,5 @@ # -# Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -152,13 +152,6 @@ SUNWprivate_1.1 { # Evidently CDE needs this for backward compatability. Java_sun_awt_motif_XsessionWMcommand; - # Java Plugin - # This is in awt_LoadLibrary.c and falls through to libmawt. - # Evidently plugin needs this for backward compatability. - getAwtLockFunctions; - getAwtData; - getAwtDisplay; - # libfontmanager entry points AWTIsHeadless; GrPrim_Sg2dGetCompInfo; @@ -283,11 +276,6 @@ SUNWprivate_1.1 { # CDE private entry point Java_sun_awt_motif_XsessionWMcommand; - # Java Plugin - getAwtLockFunctions; - getAwtData; - getAwtDisplay; - # libfontmanager entry points AWTIsHeadless; AWTCountFonts; diff --git a/jdk/make/mapfiles/libawt_xawt/mapfile-vers b/jdk/make/mapfiles/libawt_xawt/mapfile-vers index 15089a114ca..3ae8af3ddbf 100644 --- a/jdk/make/mapfiles/libawt_xawt/mapfile-vers +++ b/jdk/make/mapfiles/libawt_xawt/mapfile-vers @@ -1,5 +1,5 @@ # -# Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -449,12 +449,6 @@ SUNWprivate_1.1 { awt_Lock; awt_GetComponent; - # Java Plugin - # This is in awt_LoadLibrary.c and falls through to libmawt. - # Evidently plugin needs this for backward compatability. - getAwtLockFunctions; - getAwtData; - getAwtDisplay; #XAWT entry point for CDE Java_sun_awt_motif_XsessionWMcommand; Java_sun_awt_motif_XsessionWMcommand_New; diff --git a/jdk/src/solaris/native/sun/awt/awt_LoadLibrary.c b/jdk/src/solaris/native/sun/awt/awt_LoadLibrary.c index 362d9d70dfb..59483027131 100644 --- a/jdk/src/solaris/native/sun/awt/awt_LoadLibrary.c +++ b/jdk/src/solaris/native/sun/awt/awt_LoadLibrary.c @@ -35,8 +35,6 @@ #include #include -#include "awt_Plugin.h" - #ifdef AIX #include "porting_aix.h" /* For the 'dladdr' function. */ #endif @@ -236,55 +234,3 @@ Java_sun_awt_motif_XsessionWMcommand_New(JNIEnv *env, jobjectArray jargv) (*XsessionWMcommand)(env, jargv); } - - -#define REFLECT_VOID_FUNCTION(name, arglist, paramlist) \ -typedef void name##_type arglist; \ -void name arglist \ -{ \ - static name##_type *name##_ptr = NULL; \ - if (name##_ptr == NULL && awtHandle == NULL) { \ - return; \ - } \ - name##_ptr = (name##_type *) \ - dlsym(awtHandle, #name); \ - if (name##_ptr == NULL) { \ - return; \ - } \ - (*name##_ptr)paramlist; \ -} - -#define REFLECT_FUNCTION(return_type, name, arglist, paramlist) \ -typedef return_type name##_type arglist; \ -return_type name arglist \ -{ \ - static name##_type *name##_ptr = NULL; \ - if (name##_ptr == NULL && awtHandle == NULL) { \ - return NULL; \ - } \ - name##_ptr = (name##_type *) \ - dlsym(awtHandle, #name); \ - if (name##_ptr == NULL) { \ - return NULL; \ - } \ - return (*name##_ptr)paramlist; \ -} - - -/* - * These entry point must remain in libawt.so ***for Java Plugin ONLY*** - * Reflect this call over to the correct libawt_.so. - */ - -REFLECT_VOID_FUNCTION(getAwtLockFunctions, - (void (**AwtLock)(JNIEnv *), void (**AwtUnlock)(JNIEnv *), - void (**AwtNoFlushUnlock)(JNIEnv *), void *reserved), - (AwtLock, AwtUnlock, AwtNoFlushUnlock, reserved)) - -REFLECT_VOID_FUNCTION(getAwtData, - (int32_t *awt_depth, Colormap *awt_cmap, Visual **awt_visual, - int32_t *awt_num_colors, void *pReserved), - (awt_depth, awt_cmap, awt_visual, - awt_num_colors, pReserved)) - -REFLECT_FUNCTION(Display *, getAwtDisplay, (void), ()) diff --git a/jdk/src/solaris/native/sun/awt/awt_Plugin.c b/jdk/src/solaris/native/sun/awt/awt_Plugin.c deleted file mode 100644 index 0b33ac2b23b..00000000000 --- a/jdk/src/solaris/native/sun/awt/awt_Plugin.c +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -#ifdef HEADLESS - #error This file should not be included in headless library -#endif - -#include -#include -#include -#include -#include - -/* - * Fix 4221246: Provide utility function for Netscape to use to - * get AWT display, depth, colormap, and number of colors. - * - */ - -Display *getAwtDisplay(void) -{ - return awt_display; -} - -void getExtAwtData(Display *display, - int32_t screen, - int32_t *awt_depth, - Colormap *awt_cmap, - Visual **awt_visual, - int32_t *awt_num_colors, - void *pReserved) -{ - AwtGraphicsConfigDataPtr defaultConfig = NULL; - -#ifdef DEBUG - if (pReserved != NULL) { - jio_fprintf(stderr, - "getExtAwtData: warning: reserved pointer is not null\n"); - } -#endif - - if (screen >= 0) { - defaultConfig = getDefaultConfig(screen); - } - - if (defaultConfig) { - if (awt_depth != NULL) { - *awt_depth = defaultConfig->awt_depth; - } - - if (awt_cmap != NULL) { - *awt_cmap = defaultConfig->awt_cmap; - } - - if (awt_visual != NULL) { - *awt_visual = defaultConfig->awt_visInfo.visual; - } - - if (awt_num_colors != NULL) { - *awt_num_colors = defaultConfig->awt_num_colors; - } - } -} - -/* - * getAwtData provided for compatibility with Solaris 1.2 Java Plug-in - * - */ -void getAwtData(int32_t *awt_depth, - Colormap *awt_cmap, - Visual **awt_visual, - int32_t *awt_num_colors, - void *pReserved) -{ - Display *display = getAwtDisplay(); - - getExtAwtData(display, - DefaultScreen(display), - awt_depth, - awt_cmap, - awt_visual, - awt_num_colors, - pReserved); -} - -/* - * Fix 4221246: Provide utility funtion for Netscape to get - * function pointers to AWT lock functions. - * - */ - -static void awt_lock_wrapper(JNIEnv *env) { - AWT_LOCK(); -} - -static void awt_unlock_wrapper(JNIEnv *env) { - AWT_UNLOCK(); -} - -static void awt_noflush_unlock_wrapper(JNIEnv *env) { - AWT_NOFLUSH_UNLOCK(); -} - -void getAwtLockFunctions(void (**AwtLock)(JNIEnv *), - void (**AwtUnlock)(JNIEnv *), - void (**AwtNoFlushUnlock)(JNIEnv *), - void *pReserved) -{ -#ifdef DEBUG - if (pReserved != NULL) { - jio_fprintf(stderr, - "getAwtLockFunctions: warning: reserved pointer is not null\n"); - } -#endif - - if (AwtLock != NULL) { - *AwtLock = awt_lock_wrapper; - } - - if (AwtUnlock != NULL) { - *AwtUnlock = awt_unlock_wrapper; - } - - if (AwtNoFlushUnlock != NULL) { - *AwtNoFlushUnlock = awt_noflush_unlock_wrapper; - } -} diff --git a/jdk/src/solaris/native/sun/awt/awt_Plugin.h b/jdk/src/solaris/native/sun/awt/awt_Plugin.h deleted file mode 100644 index 434fabb7216..00000000000 --- a/jdk/src/solaris/native/sun/awt/awt_Plugin.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * Fix 4221246: Export functions for Netscape to use to get AWT info - */ - -#ifndef _AWT_PLUGIN_H_ -#define _AWT_PLUGIN_H_ - -#include -#include -#include - -void getAwtLockFunctions(void (**AwtLock)(JNIEnv *), - void (**AwtUnlock)(JNIEnv *), - void (**AwtNoFlushUnlock)(JNIEnv *), - void *); - -void getExtAwtData(Display *, - int32_t, - int32_t *, /* awt_depth */ - Colormap *, /* awt_cmap */ - Visual **, /* awt_visInfo.visual */ - int32_t *, /* awt_num_colors */ - void *); - -void getAwtData(int32_t *, Colormap *, Visual **, int32_t *, void *); - -Display *getAwtDisplay(void); - -#endif /* _AWT_PLUGIN_H_ */ From 535c74a38e4e5b6f46e0749cc7926c313f713ca0 Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Thu, 8 May 2014 11:46:03 +0200 Subject: [PATCH 32/50] 8042416: X11GraphicsEnvironment.isDisplayLocal() throws NoSuchElementException if DISPLAY host has more IP addresses than a local interface Reviewed-by: anthony, azvegint --- jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java b/jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java index 02f491d6707..cfa6e516dfe 100644 --- a/jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java +++ b/jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java @@ -277,8 +277,9 @@ public class X11GraphicsEnvironment for (; interfaces.hasMoreElements();) { locals = interfaces.nextElement().getInetAddresses(); for (; locals.hasMoreElements();) { + final InetAddress localAddr = locals.nextElement(); for (int i = 0; i < remAddr.length; i++) { - if (locals.nextElement().equals(remAddr[i])) { + if (localAddr.equals(remAddr[i])) { return Boolean.TRUE; } } From 1ec8e7aa8a6ee79c58d5c9fb5e28579cbff2a1cd Mon Sep 17 00:00:00 2001 From: Petr Pchelko Date: Thu, 8 May 2014 16:50:42 +0400 Subject: [PATCH 33/50] 8036917: [macosx] Native memory leaks Reviewed-by: serb, azvegint --- jdk/src/macosx/native/sun/awt/CImage.m | 33 +++++++++++++------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/jdk/src/macosx/native/sun/awt/CImage.m b/jdk/src/macosx/native/sun/awt/CImage.m index b6db3458047..e4ef6306031 100644 --- a/jdk/src/macosx/native/sun/awt/CImage.m +++ b/jdk/src/macosx/native/sun/awt/CImage.m @@ -76,17 +76,17 @@ static void CImage_CopyNSImageIntoArray static NSBitmapImageRep* CImage_CreateImageRep(JNIEnv *env, jintArray buffer, jint width, jint height) { - NSBitmapImageRep* imageRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL - pixelsWide:width - pixelsHigh:height - bitsPerSample:8 - samplesPerPixel:4 - hasAlpha:YES - isPlanar:NO - colorSpaceName:NSDeviceRGBColorSpace - bitmapFormat:NSAlphaFirstBitmapFormat - bytesPerRow:width*4 // TODO: use explicit scanStride - bitsPerPixel:32]; + NSBitmapImageRep* imageRep = [[[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL + pixelsWide:width + pixelsHigh:height + bitsPerSample:8 + samplesPerPixel:4 + hasAlpha:YES + isPlanar:NO + colorSpaceName:NSDeviceRGBColorSpace + bitmapFormat:NSAlphaFirstBitmapFormat + bytesPerRow:width*4 // TODO: use explicit scanStride + bitsPerPixel:32] autorelease]; jint *imgData = (jint *)[imageRep bitmapData]; if (imgData == NULL) return 0L; @@ -115,9 +115,8 @@ JNF_COCOA_ENTER(env); NSBitmapImageRep* imageRep = CImage_CreateImageRep(env, buffer, width, height); if (imageRep) { - NSImage *nsImage = [[[NSImage alloc] initWithSize:NSMakeSize(width, height)] retain]; + NSImage *nsImage = [[NSImage alloc] initWithSize:NSMakeSize(width, height)]; [nsImage addRepresentation:imageRep]; - [imageRep release]; result = ptr_to_jlong(nsImage); } @@ -160,7 +159,7 @@ JNF_COCOA_ENTER(env); (*env)->ReleaseIntArrayElements(env, widths, ws, JNI_ABORT); } if ([reps count]) { - NSImage *nsImage = [[[NSImage alloc] initWithSize:NSMakeSize(0, 0)] retain]; + NSImage *nsImage = [[NSImage alloc] initWithSize:NSMakeSize(0, 0)]; [nsImage addRepresentations: reps]; result = ptr_to_jlong(nsImage); } @@ -184,7 +183,7 @@ JNF_COCOA_ENTER(env); IconRef iconRef; if (noErr == GetIconRef(kOnSystemDisk, kSystemIconsCreator, selector, &iconRef)) { - image = [[[NSImage alloc] initWithIconRef:iconRef] retain]; + image = [[NSImage alloc] initWithIconRef:iconRef]; ReleaseIconRef(iconRef); } @@ -206,7 +205,7 @@ JNIEXPORT jlong JNICALL Java_sun_lwawt_macosx_CImage_nativeCreateNSImageFromFile JNF_COCOA_ENTER(env); NSString *path = JNFNormalizedNSStringForPath(env, file); - image = [[[NSImage alloc] initByReferencingFile:path] retain]; + image = [[NSImage alloc] initByReferencingFile:path]; JNF_COCOA_EXIT(env); @@ -435,7 +434,7 @@ JNIEXPORT jbyteArray JNICALL Java_sun_lwawt_macosx_CImage_nativeGetPlatformImage JNF_COCOA_ENTER(env); - NSBitmapImageRep* imageRep = [CImage_CreateImageRep(env, buffer, width, height) autorelease]; + NSBitmapImageRep* imageRep = CImage_CreateImageRep(env, buffer, width, height); if (imageRep) { NSData *tiffImage = [imageRep TIFFRepresentation]; jsize tiffSize = (jsize)[tiffImage length]; From 358e8a04ee83ac9aec3c9a743e8bf6619df98173 Mon Sep 17 00:00:00 2001 From: Petr Pchelko Date: Thu, 8 May 2014 18:37:34 +0400 Subject: [PATCH 34/50] 8042752: [macosx] NSEvent instances leak throw JNI local references Reviewed-by: serb, azvegint --- jdk/src/macosx/native/sun/awt/AWTView.m | 13 +++++++------ jdk/src/macosx/native/sun/awt/CTrayIcon.m | 7 +++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/jdk/src/macosx/native/sun/awt/AWTView.m b/jdk/src/macosx/native/sun/awt/AWTView.m index bcc832190f4..830fb77e82b 100644 --- a/jdk/src/macosx/native/sun/awt/AWTView.m +++ b/jdk/src/macosx/native/sun/awt/AWTView.m @@ -27,6 +27,7 @@ #import #import +#import "jni_util.h" #import "ThreadUtilities.h" #import "AWTView.h" @@ -391,14 +392,12 @@ AWT_ASSERT_APPKIT_THREAD; (jint)absP.x, (jint)absP.y, [event deltaY], [event deltaX]); - if (jEvent == nil) { - // Unable to create event by some reason. - return; - } + CHECK_NULL(jEvent); static JNF_CLASS_CACHE(jc_PlatformView, "sun/lwawt/macosx/CPlatformView"); static JNF_MEMBER_CACHE(jm_deliverMouseEvent, jc_PlatformView, "deliverMouseEvent", "(Lsun/lwawt/macosx/NSEvent;)V"); JNFCallVoidMethod(env, m_cPlatformView, jm_deliverMouseEvent, jEvent); + (*env)->DeleteLocalRef(env, jEvent); } - (void) resetTrackingArea { @@ -447,20 +446,22 @@ AWT_ASSERT_APPKIT_THREAD; static JNF_CLASS_CACHE(jc_NSEvent, "sun/lwawt/macosx/NSEvent"); static JNF_CTOR_CACHE(jctor_NSEvent, jc_NSEvent, "(IISLjava/lang/String;)V"); - jobject jevent = JNFNewObject(env, jctor_NSEvent, + jobject jEvent = JNFNewObject(env, jctor_NSEvent, [event type], [event modifierFlags], [event keyCode], characters); + CHECK_NULL(jEvent); static JNF_CLASS_CACHE(jc_PlatformView, "sun/lwawt/macosx/CPlatformView"); static JNF_MEMBER_CACHE(jm_deliverKeyEvent, jc_PlatformView, "deliverKeyEvent", "(Lsun/lwawt/macosx/NSEvent;)V"); - JNFCallVoidMethod(env, m_cPlatformView, jm_deliverKeyEvent, jevent); + JNFCallVoidMethod(env, m_cPlatformView, jm_deliverKeyEvent, jEvent); if (characters != NULL) { (*env)->DeleteLocalRef(env, characters); } + (*env)->DeleteLocalRef(env, jEvent); } -(void) deliverResize: (NSRect) rect { diff --git a/jdk/src/macosx/native/sun/awt/CTrayIcon.m b/jdk/src/macosx/native/sun/awt/CTrayIcon.m index 79ae024f76f..35adf3b866d 100644 --- a/jdk/src/macosx/native/sun/awt/CTrayIcon.m +++ b/jdk/src/macosx/native/sun/awt/CTrayIcon.m @@ -25,6 +25,7 @@ #import #import +#import "jni_util.h" #import "CTrayIcon.h" #import "ThreadUtilities.h" @@ -146,14 +147,12 @@ static NSSize ScaledImageSizeForStatusBar(NSSize imageSize) { (jint)absP.x, (jint)absP.y, [event deltaY], [event deltaX]); - if (jEvent == nil) { - // Unable to create event by some reason. - return; - } + CHECK_NULL(jEvent); static JNF_CLASS_CACHE(jc_TrayIcon, "sun/lwawt/macosx/CTrayIcon"); static JNF_MEMBER_CACHE(jm_handleMouseEvent, jc_TrayIcon, "handleMouseEvent", "(Lsun/lwawt/macosx/NSEvent;)V"); JNFCallVoidMethod(env, peer, jm_handleMouseEvent, jEvent); + (*env)->DeleteLocalRef(env, jEvent); } @end //AWTTrayIcon From 4c217914c2965a26f38a85379b007f16061e7aad Mon Sep 17 00:00:00 2001 From: Phil Race Date: Thu, 8 May 2014 15:17:02 -0700 Subject: [PATCH 35/50] 8038875: Remove use of ServiceLoader in finding class implementing sun.java2d.pipe. RenderingEngine Reviewed-by: flar, mchung --- jdk/make/CopyIntoClasses.gmk | 2 - jdk/make/profile-rtjar-includes.txt | 3 +- .../services/sun.java2d.pipe.RenderingEngine | 2 - .../sun/java2d/pipe/RenderingEngine.java | 60 +++++++------------ .../services/sun.java2d.pipe.RenderingEngine | 2 - .../services/sun.java2d.pipe.RenderingEngine | 5 -- 6 files changed, 23 insertions(+), 51 deletions(-) delete mode 100644 jdk/src/share/classes/sun/dc/META-INF/services/sun.java2d.pipe.RenderingEngine delete mode 100644 jdk/src/share/classes/sun/java2d/pisces/META-INF/services/sun.java2d.pipe.RenderingEngine delete mode 100644 jdk/src/solaris/classes/sun/java2d/pisces/META-INF/services/sun.java2d.pipe.RenderingEngine diff --git a/jdk/make/CopyIntoClasses.gmk b/jdk/make/CopyIntoClasses.gmk index 36b0919fa2f..322901603a3 100644 --- a/jdk/make/CopyIntoClasses.gmk +++ b/jdk/make/CopyIntoClasses.gmk @@ -118,10 +118,8 @@ endif SRC_SERVICES_FILES := $(wildcard $(addsuffix /services/*, $(ALL_META-INF_DIRS))) ifdef OPENJDK - SRC_SERVICES_FILES := $(filter-out %sun/dc/META-INF/services/sun.java2d.pipe.RenderingEngine, $(SRC_SERVICES_FILES)) SRC_SERVICES_FILES := $(filter-out %sun/java2d/cmm/kcms/META-INF/services/sun.java2d.cmm.CMMServiceProvider, $(SRC_SERVICES_FILES)) else - SRC_SERVICES_FILES := $(filter-out %sun/java2d/pisces/META-INF/services/sun.java2d.pipe.RenderingEngine, $(SRC_SERVICES_FILES)) SRC_SERVICES_FILES := $(filter-out %sun/java2d/cmm/lcms/META-INF/services/sun.java2d.cmm.CMMServiceProvider, $(SRC_SERVICES_FILES)) endif diff --git a/jdk/make/profile-rtjar-includes.txt b/jdk/make/profile-rtjar-includes.txt index 231b1583ae0..6cce159e400 100644 --- a/jdk/make/profile-rtjar-includes.txt +++ b/jdk/make/profile-rtjar-includes.txt @@ -242,5 +242,4 @@ FULL_JRE_INCLUDE_METAINF_SERVICES := \ META-INF/services/javax.sound.sampled.spi.AudioFileWriter \ META-INF/services/javax.sound.sampled.spi.FormatConversionProvider \ META-INF/services/javax.sound.sampled.spi.MixerProvider \ - META-INF/services/sun.java2d.cmm.PCMM \ - META-INF/services/sun.java2d.pipe.RenderingEngine + META-INF/services/sun.java2d.cmm.PCMM diff --git a/jdk/src/share/classes/sun/dc/META-INF/services/sun.java2d.pipe.RenderingEngine b/jdk/src/share/classes/sun/dc/META-INF/services/sun.java2d.pipe.RenderingEngine deleted file mode 100644 index 45f0ddfa772..00000000000 --- a/jdk/src/share/classes/sun/dc/META-INF/services/sun.java2d.pipe.RenderingEngine +++ /dev/null @@ -1,2 +0,0 @@ -# Ductus Rendering Engine module -sun.dc.DuctusRenderingEngine diff --git a/jdk/src/share/classes/sun/java2d/pipe/RenderingEngine.java b/jdk/src/share/classes/sun/java2d/pipe/RenderingEngine.java index 3c2a77ca73b..034a6e8b218 100644 --- a/jdk/src/share/classes/sun/java2d/pipe/RenderingEngine.java +++ b/jdk/src/share/classes/sun/java2d/pipe/RenderingEngine.java @@ -32,7 +32,6 @@ import java.awt.geom.AffineTransform; import java.security.PrivilegedAction; import java.security.AccessController; -import java.util.ServiceLoader; import sun.security.action.GetPropertyAction; import sun.awt.geom.PathConsumer2D; @@ -97,12 +96,9 @@ public abstract class RenderingEngine { * * * If no specific {@code RenderingEngine} is specified on the command - * or Ductus renderer is specified, it will attempt loading the - * sun.dc.DuctusRenderingEngine class using Class.forName as a fastpath; - * if not found, use the ServiceLoader. - * If no specific {@code RenderingEngine} is specified on the command - * line then the last one returned by enumerating all subclasses of - * {@code RenderingEngine} known to the ServiceLoader is used. + * or Ductus renderer is specified, it will first attempt loading the + * sun.dc.DuctusRenderingEngine class using Class.forName, if that + * is not found, then it will look for Pisces. *

    * Runtime tracing of the actions of the {@code RenderingEngine} * can be enabled by specifying the runtime flag: @@ -117,42 +113,30 @@ public abstract class RenderingEngine { return reImpl; } - reImpl = - AccessController.doPrivileged(new PrivilegedAction() { - public RenderingEngine run() { - final String ductusREClass = "sun.dc.DuctusRenderingEngine"; - String reClass = - System.getProperty("sun.java2d.renderer", ductusREClass); - if (reClass.equals(ductusREClass)) { - try { - Class cls = Class.forName(ductusREClass); - return (RenderingEngine) cls.newInstance(); - } catch (ReflectiveOperationException ignored) { - // not found - } - } - - ServiceLoader reLoader = - ServiceLoader.loadInstalled(RenderingEngine.class); - - RenderingEngine service = null; - - for (RenderingEngine re : reLoader) { - service = re; - if (re.getClass().getName().equals(reClass)) { - break; - } - } - return service; - } - }); + /* Look first for ductus or an app-override renderer, + * if not specified or present, then look for pisces. + */ + final String ductusREClass = "sun.dc.DuctusRenderingEngine"; + final String piscesREClass = "sun.java2d.pisces.PiscesRenderingEngine"; + GetPropertyAction gpa = + new GetPropertyAction("sun.java2d.renderer", ductusREClass); + String reClass = AccessController.doPrivileged(gpa); + try { + Class cls = Class.forName(reClass); + reImpl = (RenderingEngine) cls.newInstance(); + } catch (ReflectiveOperationException ignored0) { + try { + Class cls = Class.forName(piscesREClass); + reImpl = (RenderingEngine) cls.newInstance(); + } catch (ReflectiveOperationException ignored1) { + } + } if (reImpl == null) { throw new InternalError("No RenderingEngine module found"); } - GetPropertyAction gpa = - new GetPropertyAction("sun.java2d.renderer.trace"); + gpa = new GetPropertyAction("sun.java2d.renderer.trace"); String reTrace = AccessController.doPrivileged(gpa); if (reTrace != null) { reImpl = new Tracer(reImpl); diff --git a/jdk/src/share/classes/sun/java2d/pisces/META-INF/services/sun.java2d.pipe.RenderingEngine b/jdk/src/share/classes/sun/java2d/pisces/META-INF/services/sun.java2d.pipe.RenderingEngine deleted file mode 100644 index 607ff59051a..00000000000 --- a/jdk/src/share/classes/sun/java2d/pisces/META-INF/services/sun.java2d.pipe.RenderingEngine +++ /dev/null @@ -1,2 +0,0 @@ -# Pisces Rendering Engine module -sun.java2d.pisces.PiscesRenderingEngine diff --git a/jdk/src/solaris/classes/sun/java2d/pisces/META-INF/services/sun.java2d.pipe.RenderingEngine b/jdk/src/solaris/classes/sun/java2d/pisces/META-INF/services/sun.java2d.pipe.RenderingEngine deleted file mode 100644 index c79fdbde9c8..00000000000 --- a/jdk/src/solaris/classes/sun/java2d/pisces/META-INF/services/sun.java2d.pipe.RenderingEngine +++ /dev/null @@ -1,5 +0,0 @@ -# Jules Rendering Engine module -sun.java2d.jules.JulesRenderingEngine - -# Pisces Rendering Engine module -sun.java2d.pisces.PiscesRenderingEngine From a9f93ddc32c6fc158b449c3bc4b4865a147762fd Mon Sep 17 00:00:00 2001 From: Omair Majid Date: Thu, 8 May 2014 19:27:24 -0400 Subject: [PATCH 36/50] 8042806: Splashscreen uses libjpeg-internal macros Reviewed-by: anthony, prr --- .../share/native/sun/awt/splashscreen/splashscreen_jpeg.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/jdk/src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c b/jdk/src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c index f9cb8995c86..8d41c9207d8 100644 --- a/jdk/src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c +++ b/jdk/src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c @@ -25,7 +25,6 @@ #include "splashscreen_impl.h" -#include "jinclude.h" #include "jpeglib.h" #include "jerror.h" @@ -107,11 +106,11 @@ set_stream_src(j_decompress_ptr cinfo, SplashStream * stream) if (cinfo->src == NULL) { /* first time for this JPEG object? */ cinfo->src = (struct jpeg_source_mgr *) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, - JPOOL_PERMANENT, SIZEOF(stream_source_mgr)); + JPOOL_PERMANENT, sizeof(stream_source_mgr)); src = (stream_src_ptr) cinfo->src; src->buffer = (JOCTET *) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, - JPOOL_PERMANENT, INPUT_BUF_SIZE * SIZEOF(JOCTET)); + JPOOL_PERMANENT, INPUT_BUF_SIZE * sizeof(JOCTET)); } src = (stream_src_ptr) cinfo->src; From 6e71a0cb82a7690c33660d0d2267b60889566c7c Mon Sep 17 00:00:00 2001 From: Anton Nashatyrev Date: Mon, 12 May 2014 18:21:15 +0400 Subject: [PATCH 37/50] 8024932: [TEST_BUG] [macosx] javax/swing/text/StyledEditorKit/8016833/bug8016833.java failed Reviewed-by: serb, alexsch --- .../swing/text/StyledEditorKit/8016833/bug8016833.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/jdk/test/javax/swing/text/StyledEditorKit/8016833/bug8016833.java b/jdk/test/javax/swing/text/StyledEditorKit/8016833/bug8016833.java index 601a31de688..1dec0972346 100644 --- a/jdk/test/javax/swing/text/StyledEditorKit/8016833/bug8016833.java +++ b/jdk/test/javax/swing/text/StyledEditorKit/8016833/bug8016833.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -190,9 +190,9 @@ public class bug8016833 { // not too wide assertTrue(out3.getWidth() * 0.8 < out2.getWidth()); // not too low - assertTrue(out3.getY() - (out1.getY() + out2.getHeight()) < 3); + assertTrue(out3.getY() - (out1.getY() + out2.getHeight() - 1) < 4); // not too high - assertTrue(out3.getY() - (out1.getY() + out2.getHeight()) > 0); + assertTrue(out3.getY() - (out1.getY() + out2.getHeight() - 1) > 0); } void testStrikthrough() { @@ -217,7 +217,7 @@ public class bug8016833 { // not too wide assertTrue(out3.getWidth() * 0.8 < out2.getWidth()); // not too low - assertTrue(out3.getY() - (out1.getY() + out2.getHeight()) < 0); + assertTrue(out3.getY() - (out1.getY() + out2.getHeight() - 1) < 0); // not too high assertTrue(out3.getY() - out1.getY() > 1); } From a80118b3ae552c3306ffbe5399a79e4219bdf3f4 Mon Sep 17 00:00:00 2001 From: Phil Race Date: Mon, 12 May 2014 09:32:23 -0700 Subject: [PATCH 38/50] 8038876: Remove use of ServiceLoader in finding class implementing sun.java2d.cmm.CMMServiceProvider Reviewed-by: bae, mchung --- jdk/make/CopyIntoClasses.gmk | 10 ------ jdk/make/profile-rtjar-includes.txt | 3 +- .../classes/sun/java2d/cmm/CMSManager.java | 36 ++++++++----------- .../sun.java2d.cmm.CMMServiceProvider | 2 -- 4 files changed, 15 insertions(+), 36 deletions(-) delete mode 100644 jdk/src/share/classes/sun/java2d/cmm/lcms/META-INF/services/sun.java2d.cmm.CMMServiceProvider diff --git a/jdk/make/CopyIntoClasses.gmk b/jdk/make/CopyIntoClasses.gmk index 322901603a3..b3a216fb90e 100644 --- a/jdk/make/CopyIntoClasses.gmk +++ b/jdk/make/CopyIntoClasses.gmk @@ -111,18 +111,8 @@ else ALL_META-INF_DIRS := $(ALL_META-INF_DIRS_share) endif -ifndef OPENJDK - ALL_META-INF_DIRS += $(JDK_TOPDIR)/src/closed/share/classes/sun/java2d/cmm/kcms/META-INF -endif - SRC_SERVICES_FILES := $(wildcard $(addsuffix /services/*, $(ALL_META-INF_DIRS))) -ifdef OPENJDK - SRC_SERVICES_FILES := $(filter-out %sun/java2d/cmm/kcms/META-INF/services/sun.java2d.cmm.CMMServiceProvider, $(SRC_SERVICES_FILES)) -else - SRC_SERVICES_FILES := $(filter-out %sun/java2d/cmm/lcms/META-INF/services/sun.java2d.cmm.CMMServiceProvider, $(SRC_SERVICES_FILES)) -endif - # The number of services files are relatively few. If the increase in numbers, then # we have to use ListPathsSafelyNow here. # Change $(JDK_TOPDIR)/src/.../META-INF/services/yyyy into $(JDK_OUTPUTDIR)/classes/META-INF/services/yyyy diff --git a/jdk/make/profile-rtjar-includes.txt b/jdk/make/profile-rtjar-includes.txt index 6cce159e400..061a927e616 100644 --- a/jdk/make/profile-rtjar-includes.txt +++ b/jdk/make/profile-rtjar-includes.txt @@ -241,5 +241,4 @@ FULL_JRE_INCLUDE_METAINF_SERVICES := \ META-INF/services/javax.sound.sampled.spi.AudioFileReader \ META-INF/services/javax.sound.sampled.spi.AudioFileWriter \ META-INF/services/javax.sound.sampled.spi.FormatConversionProvider \ - META-INF/services/javax.sound.sampled.spi.MixerProvider \ - META-INF/services/sun.java2d.cmm.PCMM + META-INF/services/javax.sound.sampled.spi.MixerProvider diff --git a/jdk/src/share/classes/sun/java2d/cmm/CMSManager.java b/jdk/src/share/classes/sun/java2d/cmm/CMSManager.java index 6970c59a19c..6036a3c2636 100644 --- a/jdk/src/share/classes/sun/java2d/cmm/CMSManager.java +++ b/jdk/src/share/classes/sun/java2d/cmm/CMSManager.java @@ -34,7 +34,6 @@ import java.awt.image.WritableRaster; import java.security.AccessController; import java.security.PrivilegedAction; import sun.security.action.GetPropertyAction; -import java.util.ServiceLoader; public class CMSManager { public static ColorSpace GRAYspace; // These two fields allow access @@ -52,35 +51,28 @@ public class CMSManager { return cmmImpl; } - CMMServiceProvider spi = AccessController.doPrivileged( - new PrivilegedAction() { - public CMMServiceProvider run() { - String cmmClass = System.getProperty( - "sun.java2d.cmm", "sun.java2d.cmm.lcms.LcmsServiceProvider"); - - ServiceLoader cmmLoader - = ServiceLoader.loadInstalled(CMMServiceProvider.class); - - CMMServiceProvider spi = null; - - for (CMMServiceProvider cmm : cmmLoader) { - spi = cmm; - if (cmm.getClass().getName().equals(cmmClass)) { - break; - } - } - return spi; + GetPropertyAction gpa = new GetPropertyAction("sun.java2d.cmm"); + String cmmProviderClass = AccessController.doPrivileged(gpa); + CMMServiceProvider provider = null; + if (cmmProviderClass != null) { + try { + Class cls = Class.forName(cmmProviderClass); + provider = (CMMServiceProvider)cls.newInstance(); + } catch (ReflectiveOperationException e) { } - }); + } + if (provider == null) { + provider = new sun.java2d.cmm.lcms.LcmsServiceProvider(); + } - cmmImpl = spi.getColorManagementModule(); + cmmImpl = provider.getColorManagementModule(); if (cmmImpl == null) { throw new CMMException("Cannot initialize Color Management System."+ "No CM module found"); } - GetPropertyAction gpa = new GetPropertyAction("sun.java2d.cmm.trace"); + gpa = new GetPropertyAction("sun.java2d.cmm.trace"); String cmmTrace = AccessController.doPrivileged(gpa); if (cmmTrace != null) { cmmImpl = new CMMTracer(cmmImpl); diff --git a/jdk/src/share/classes/sun/java2d/cmm/lcms/META-INF/services/sun.java2d.cmm.CMMServiceProvider b/jdk/src/share/classes/sun/java2d/cmm/lcms/META-INF/services/sun.java2d.cmm.CMMServiceProvider deleted file mode 100644 index ce7ea564ffb..00000000000 --- a/jdk/src/share/classes/sun/java2d/cmm/lcms/META-INF/services/sun.java2d.cmm.CMMServiceProvider +++ /dev/null @@ -1,2 +0,0 @@ -# Little CMS color management module -sun.java2d.cmm.lcms.LcmsServiceProvider From db84d6b169f3bf12b2d4c51881adfff8953c720a Mon Sep 17 00:00:00 2001 From: Sergey Bylokhov Date: Tue, 13 May 2014 16:06:12 +0400 Subject: [PATCH 39/50] 8042007: Javadoc cleanup of javax.sound.sampled.spi package Reviewed-by: pchelko, bagiras --- .../sound/sampled/spi/AudioFileReader.java | 139 ++++++++------ .../sound/sampled/spi/AudioFileWriter.java | 106 +++++----- .../sampled/spi/FormatConversionProvider.java | 181 +++++++++--------- .../sound/sampled/spi/MixerProvider.java | 53 +++-- 4 files changed, 248 insertions(+), 231 deletions(-) diff --git a/jdk/src/share/classes/javax/sound/sampled/spi/AudioFileReader.java b/jdk/src/share/classes/javax/sound/sampled/spi/AudioFileReader.java index 7829a900bf2..cc476452126 100644 --- a/jdk/src/share/classes/javax/sound/sampled/spi/AudioFileReader.java +++ b/jdk/src/share/classes/javax/sound/sampled/spi/AudioFileReader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,7 +35,7 @@ import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.UnsupportedAudioFileException; /** - * Provider for audio file reading services. Classes providing concrete + * Provider for audio file reading services. Classes providing concrete * implementations can parse the format information from one or more types of * audio file, and can produce audio input streams from files of these types. * @@ -45,93 +45,106 @@ import javax.sound.sampled.UnsupportedAudioFileException; public abstract class AudioFileReader { /** - * Obtains the audio file format of the input stream provided. The stream must - * point to valid audio file data. In general, audio file readers may + * Obtains the audio file format of the input stream provided. The stream + * must point to valid audio file data. In general, audio file readers may * need to read some data from the stream before determining whether they - * support it. These parsers must - * be able to mark the stream, read enough data to determine whether they - * support the stream, and, if not, reset the stream's read pointer to its original - * position. If the input stream does not support this, this method may fail - * with an IOException. - * @param stream the input stream from which file format information should be - * extracted - * @return an AudioFileFormat object describing the audio file format - * @throws UnsupportedAudioFileException if the stream does not point to valid audio - * file data recognized by the system + * support it. These parsers must be able to mark the stream, read enough + * data to determine whether they support the stream, and, if not, reset the + * stream's read pointer to its original position. If the input stream does + * not support this, this method may fail with an {@code IOException}. + * + * @param stream the input stream from which file format information should + * be extracted + * @return an {@code AudioFileFormat} object describing the audio file + * format + * @throws UnsupportedAudioFileException if the stream does not point to + * valid audio file data recognized by the system * @throws IOException if an I/O exception occurs * @see InputStream#markSupported * @see InputStream#mark */ - public abstract AudioFileFormat getAudioFileFormat(InputStream stream) throws UnsupportedAudioFileException, IOException; + public abstract AudioFileFormat getAudioFileFormat(InputStream stream) + throws UnsupportedAudioFileException, IOException; /** - * Obtains the audio file format of the URL provided. The URL must - * point to valid audio file data. - * @param url the URL from which file format information should be - * extracted - * @return an AudioFileFormat object describing the audio file format - * @throws UnsupportedAudioFileException if the URL does not point to valid audio - * file data recognized by the system + * Obtains the audio file format of the URL provided. The URL must point to + * valid audio file data. + * + * @param url the URL from which file format information should be + * extracted + * @return an {@code AudioFileFormat} object describing the audio file + * format + * @throws UnsupportedAudioFileException if the URL does not point to valid + * audio file data recognized by the system * @throws IOException if an I/O exception occurs */ - public abstract AudioFileFormat getAudioFileFormat(URL url) throws UnsupportedAudioFileException, IOException; + public abstract AudioFileFormat getAudioFileFormat(URL url) + throws UnsupportedAudioFileException, IOException; /** - * Obtains the audio file format of the File provided. The File must - * point to valid audio file data. - * @param file the File from which file format information should be - * extracted - * @return an AudioFileFormat object describing the audio file format - * @throws UnsupportedAudioFileException if the File does not point to valid audio - * file data recognized by the system + * Obtains the audio file format of the {@code File} provided. + * The {@code File} must point to valid audio file data. + * + * @param file the {@code File} from which file format information + * should be extracted + * @return an {@code AudioFileFormat} object describing the audio file + * format + * @throws UnsupportedAudioFileException if the {@code File} does not point + * to valid audio file data recognized by the system * @throws IOException if an I/O exception occurs */ - public abstract AudioFileFormat getAudioFileFormat(File file) throws UnsupportedAudioFileException, IOException; + public abstract AudioFileFormat getAudioFileFormat(File file) + throws UnsupportedAudioFileException, IOException; /** - * Obtains an audio input stream from the input stream provided. The stream must - * point to valid audio file data. In general, audio file readers may + * Obtains an audio input stream from the input stream provided. The stream + * must point to valid audio file data. In general, audio file readers may * need to read some data from the stream before determining whether they - * support it. These parsers must - * be able to mark the stream, read enough data to determine whether they - * support the stream, and, if not, reset the stream's read pointer to its original - * position. If the input stream does not support this, this method may fail - * with an IOException. - * @param stream the input stream from which the AudioInputStream should be - * constructed - * @return an AudioInputStream object based on the audio file data contained - * in the input stream. - * @throws UnsupportedAudioFileException if the stream does not point to valid audio - * file data recognized by the system + * support it. These parsers must be able to mark the stream, read enough + * data to determine whether they support the stream, and, if not, reset the + * stream's read pointer to its original position. If the input stream does + * not support this, this method may fail with an {@code IOException}. + * + * @param stream the input stream from which the {@code AudioInputStream} + * should be constructed + * @return an {@code AudioInputStream} object based on the audio file data + * contained in the input stream. + * @throws UnsupportedAudioFileException if the stream does not point to + * valid audio file data recognized by the system * @throws IOException if an I/O exception occurs * @see InputStream#markSupported * @see InputStream#mark */ - public abstract AudioInputStream getAudioInputStream(InputStream stream) throws UnsupportedAudioFileException, IOException; + public abstract AudioInputStream getAudioInputStream(InputStream stream) + throws UnsupportedAudioFileException, IOException; /** - * Obtains an audio input stream from the URL provided. The URL must - * point to valid audio file data. - * @param url the URL for which the AudioInputStream should be - * constructed - * @return an AudioInputStream object based on the audio file data pointed - * to by the URL - * @throws UnsupportedAudioFileException if the URL does not point to valid audio - * file data recognized by the system + * Obtains an audio input stream from the URL provided. The URL must point + * to valid audio file data. + * + * @param url the URL for which the {@code AudioInputStream} should be + * constructed + * @return an {@code AudioInputStream} object based on the audio file data + * pointed to by the URL + * @throws UnsupportedAudioFileException if the URL does not point to valid + * audio file data recognized by the system * @throws IOException if an I/O exception occurs */ - public abstract AudioInputStream getAudioInputStream(URL url) throws UnsupportedAudioFileException, IOException; + public abstract AudioInputStream getAudioInputStream(URL url) + throws UnsupportedAudioFileException, IOException; /** - * Obtains an audio input stream from the File provided. The File must - * point to valid audio file data. - * @param file the File for which the AudioInputStream should be - * constructed - * @return an AudioInputStream object based on the audio file data pointed - * to by the File - * @throws UnsupportedAudioFileException if the File does not point to valid audio - * file data recognized by the system + * Obtains an audio input stream from the {@code File} provided. + * The {@code File} must point to valid audio file data. + * + * @param file the {@code File} for which the {@code AudioInputStream} + * should be constructed + * @return an {@code AudioInputStream} object based on the audio file data + * pointed to by the File + * @throws UnsupportedAudioFileException if the {@code File} does not point + * to valid audio file data recognized by the system * @throws IOException if an I/O exception occurs */ - public abstract AudioInputStream getAudioInputStream(File file) throws UnsupportedAudioFileException, IOException; + public abstract AudioInputStream getAudioInputStream(File file) + throws UnsupportedAudioFileException, IOException; } diff --git a/jdk/src/share/classes/javax/sound/sampled/spi/AudioFileWriter.java b/jdk/src/share/classes/javax/sound/sampled/spi/AudioFileWriter.java index 0207a3b7124..a4cc31bdf18 100644 --- a/jdk/src/share/classes/javax/sound/sampled/spi/AudioFileWriter.java +++ b/jdk/src/share/classes/javax/sound/sampled/spi/AudioFileWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,16 +26,15 @@ package javax.sound.sampled.spi; import java.io.File; -import java.io.InputStream; import java.io.IOException; import java.io.OutputStream; -import javax.sound.sampled.AudioFileFormat; import javax.sound.sampled.AudioInputStream; +import static javax.sound.sampled.AudioFileFormat.Type; /** - * Provider for audio file writing services. Classes providing concrete + * Provider for audio file writing services. Classes providing concrete * implementations can write one or more types of audio file from an audio * stream. * @@ -47,22 +46,23 @@ public abstract class AudioFileWriter { /** * Obtains the file types for which file writing support is provided by this * audio file writer. - * @return array of file types. If no file types are supported, - * an array of length 0 is returned. + * + * @return array of file types. If no file types are supported, an array of + * length 0 is returned. */ - public abstract AudioFileFormat.Type[] getAudioFileTypes(); - + public abstract Type[] getAudioFileTypes(); /** - * Indicates whether file writing support for the specified file type is provided - * by this audio file writer. - * @param fileType the file type for which write capabilities are queried - * @return true if the file type is supported, - * otherwise false + * Indicates whether file writing support for the specified file type is + * provided by this audio file writer. + * + * @param fileType the file type for which write capabilities are queried + * @return {@code true} if the file type is supported, otherwise + * {@code false} */ - public boolean isFileTypeSupported(AudioFileFormat.Type fileType) { + public boolean isFileTypeSupported(Type fileType) { - AudioFileFormat.Type types[] = getAudioFileTypes(); + Type types[] = getAudioFileTypes(); for(int i=0; itrue if the file type is supported for this audio input stream, - * otherwise false + * Indicates whether an audio file of the type specified can be written from + * the audio input stream indicated. + * + * @param fileType file type for which write capabilities are queried + * @param stream for which file writing support is queried + * @return {@code true} if the file type is supported for this audio input + * stream, otherwise {@code false} */ - public boolean isFileTypeSupported(AudioFileFormat.Type fileType, AudioInputStream stream) { + public boolean isFileTypeSupported(Type fileType, AudioInputStream stream) { - AudioFileFormat.Type types[] = getAudioFileTypes( stream ); + Type types[] = getAudioFileTypes( stream ); for(int i=0; i - * The source format represents the format of the incoming - * audio data, which will be converted. + * The source format represents the format of the incoming audio data, which + * will be converted. *

    - * The target format represents the format of the processed, converted - * audio data. This is the format of the data that can be read from - * the stream returned by one of the getAudioInputStream methods. + * The target format represents the format of the processed, converted audio + * data. This is the format of the data that can be read from the stream + * returned by one of the {@code getAudioInputStream} methods. * * @author Kara Kytle * @since 1.3 */ public abstract class FormatConversionProvider { - - // NEW METHODS - /** - * Obtains the set of source format encodings from which format - * conversion services are provided by this provider. + * Obtains the set of source format encodings from which format conversion + * services are provided by this provider. + * * @return array of source format encodings. If for some reason provider - * does not provide any conversion services, an array of length 0 is - * returned. + * does not provide any conversion services, an array of length 0 is + * returned. */ - public abstract AudioFormat.Encoding[] getSourceEncodings(); - + public abstract Encoding[] getSourceEncodings(); /** - * Obtains the set of target format encodings to which format - * conversion services are provided by this provider. + * Obtains the set of target format encodings to which format conversion + * services are provided by this provider. + * * @return array of target format encodings. If for some reason provider - * does not provide any conversion services, an array of length 0 is - * returned. + * does not provide any conversion services, an array of length 0 is + * returned. */ - public abstract AudioFormat.Encoding[] getTargetEncodings(); - + public abstract Encoding[] getTargetEncodings(); /** * Indicates whether the format converter supports conversion from the * specified source format encoding. - * @param sourceEncoding the source format encoding for which support is queried - * @return true if the encoding is supported, otherwise false + * + * @param sourceEncoding the source format encoding for which support is + * queried + * @return {@code true} if the encoding is supported, otherwise + * {@code false} */ - public boolean isSourceEncodingSupported(AudioFormat.Encoding sourceEncoding){ + public boolean isSourceEncodingSupported(Encoding sourceEncoding) { - AudioFormat.Encoding sourceEncodings[] = getSourceEncodings(); + Encoding sourceEncodings[] = getSourceEncodings(); for(int i=0; itrue if the encoding is supported, otherwise false + * + * @param targetEncoding the target format encoding for which support is + * queried + * @return {@code true} if the encoding is supported, otherwise + * {@code false} */ - public boolean isTargetEncodingSupported(AudioFormat.Encoding targetEncoding){ + public boolean isTargetEncodingSupported(Encoding targetEncoding) { - AudioFormat.Encoding targetEncodings[] = getTargetEncodings(); + Encoding targetEncodings[] = getTargetEncodings(); for(int i=0; itrue if the conversion is supported, otherwise false + * Indicates whether the format converter supports conversion to a + * particular encoding from a particular format. + * + * @param targetEncoding desired encoding of the outgoing data + * @param sourceFormat format of the incoming data + * @return {@code true} if the conversion is supported, otherwise + * {@code false} */ - public boolean isConversionSupported(AudioFormat.Encoding targetEncoding, AudioFormat sourceFormat){ + public boolean isConversionSupported(Encoding targetEncoding, + AudioFormat sourceFormat) { - AudioFormat.Encoding targetEncodings[] = getTargetEncodings(sourceFormat); + Encoding targetEncodings[] = getTargetEncodings(sourceFormat); for(int i=0; itrue if the conversion is supported, otherwise false + * + * @param targetFormat desired format of outgoing data + * @param sourceFormat format of the incoming data + * @return {@code true} if the conversion is supported, otherwise + * {@code false} */ - public boolean isConversionSupported(AudioFormat targetFormat, AudioFormat sourceFormat){ + public boolean isConversionSupported(AudioFormat targetFormat, + AudioFormat sourceFormat) { AudioFormat targetFormats[] = getTargetFormats( targetFormat.getEncoding(), sourceFormat ); @@ -173,28 +177,33 @@ public abstract class FormatConversionProvider { return false; } + /** + * Obtains an audio input stream with the specified encoding from the given + * audio input stream. + * + * @param targetEncoding desired encoding of the stream after processing + * @param sourceStream stream from which data to be processed should be + * read + * @return stream from which processed data with the specified target + * encoding may be read + * @throws IllegalArgumentException if the format combination supplied is + * not supported. + */ + public abstract AudioInputStream getAudioInputStream( + Encoding targetEncoding, AudioInputStream sourceStream); /** - * Obtains an audio input stream with the specified encoding from the given audio - * input stream. - * @param targetEncoding desired encoding of the stream after processing - * @param sourceStream stream from which data to be processed should be read - * @return stream from which processed data with the specified target encoding may be read + * Obtains an audio input stream with the specified format from the given + * audio input stream. + * + * @param targetFormat desired data format of the stream after processing + * @param sourceStream stream from which data to be processed should be + * read + * @return stream from which processed data with the specified format may be + * read * @throws IllegalArgumentException if the format combination supplied is - * not supported. + * not supported. */ - public abstract AudioInputStream getAudioInputStream(AudioFormat.Encoding targetEncoding, AudioInputStream sourceStream); - - - /** - * Obtains an audio input stream with the specified format from the given audio - * input stream. - * @param targetFormat desired data format of the stream after processing - * @param sourceStream stream from which data to be processed should be read - * @return stream from which processed data with the specified format may be read - * @throws IllegalArgumentException if the format combination supplied is - * not supported. - */ - public abstract AudioInputStream getAudioInputStream(AudioFormat targetFormat, AudioInputStream sourceStream); - + public abstract AudioInputStream getAudioInputStream( + AudioFormat targetFormat, AudioInputStream sourceStream); } diff --git a/jdk/src/share/classes/javax/sound/sampled/spi/MixerProvider.java b/jdk/src/share/classes/javax/sound/sampled/spi/MixerProvider.java index d1167c0b8a6..638de86b320 100644 --- a/jdk/src/share/classes/javax/sound/sampled/spi/MixerProvider.java +++ b/jdk/src/share/classes/javax/sound/sampled/spi/MixerProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,28 +28,27 @@ package javax.sound.sampled.spi; import javax.sound.sampled.Mixer; /** - * A provider or factory for a particular mixer type. - * This mechanism allows the implementation to determine - * how resources are managed in creation / management of - * a mixer. + * A provider or factory for a particular mixer type. This mechanism allows the + * implementation to determine how resources are managed in creation / + * management of a mixer. * * @author Kara Kytle * @since 1.3 */ public abstract class MixerProvider { - /** * Indicates whether the mixer provider supports the mixer represented by * the specified mixer info object. *

    - * The full set of mixer info objects that represent the mixers supported - * by this {@code MixerProvider} may be obtained - * through the {@code getMixerInfo} method. + * The full set of mixer info objects that represent the mixers supported by + * this {@code MixerProvider} may be obtained through the + * {@code getMixerInfo} method. * - * @param info an info object that describes the mixer for which support is queried - * @return {@code true} if the specified mixer is supported, - * otherwise {@code false} + * @param info an info object that describes the mixer for which support is + * queried + * @return {@code true} if the specified mixer is supported, otherwise + * {@code false} * @see #getMixerInfo() */ public boolean isMixerSupported(Mixer.Info info) { @@ -64,38 +63,34 @@ public abstract class MixerProvider { return false; } - /** - * Obtains the set of info objects representing the mixer - * or mixers provided by this MixerProvider. + * Obtains the set of info objects representing the mixer or mixers provided + * by this MixerProvider. *

    - * The {@code isMixerSupported} method returns {@code true} - * for all the info objects returned by this method. - * The corresponding mixer instances for the info objects - * are returned by the {@code getMixer} method. + * The {@code isMixerSupported} method returns {@code true} for all the info + * objects returned by this method. The corresponding mixer instances for + * the info objects are returned by the {@code getMixer} method. * * @return a set of mixer info objects - * @see #getMixer(javax.sound.sampled.Mixer.Info) getMixer(Mixer.Info) - * @see #isMixerSupported(javax.sound.sampled.Mixer.Info) isMixerSupported(Mixer.Info) + * @see #getMixer(Mixer.Info) + * @see #isMixerSupported(Mixer.Info) */ public abstract Mixer.Info[] getMixerInfo(); - /** * Obtains an instance of the mixer represented by the info object. *

    * The full set of the mixer info objects that represent the mixers - * supported by this {@code MixerProvider} may be obtained - * through the {@code getMixerInfo} method. - * Use the {@code isMixerSupported} method to test whether - * this {@code MixerProvider} supports a particular mixer. + * supported by this {@code MixerProvider} may be obtained through the + * {@code getMixerInfo} method. Use the {@code isMixerSupported} method to + * test whether this {@code MixerProvider} supports a particular mixer. * - * @param info an info object that describes the desired mixer + * @param info an info object that describes the desired mixer * @return mixer instance * @throws IllegalArgumentException if the info object specified does not - * match the info object for a mixer supported by this MixerProvider. + * match the info object for a mixer supported by this MixerProvider * @see #getMixerInfo() - * @see #isMixerSupported(javax.sound.sampled.Mixer.Info) isMixerSupported(Mixer.Info) + * @see #isMixerSupported(Mixer.Info) */ public abstract Mixer getMixer(Mixer.Info info); } From a89eab1dc79148333e7a713f9f4c48b5188591c6 Mon Sep 17 00:00:00 2001 From: Andrew Brygin Date: Wed, 14 May 2014 18:19:14 +0400 Subject: [PATCH 40/50] 6945174: IndexOutOfBoundsException calling ImageIO.read() on malformed PNG Reviewed-by: prr, serb --- .../imageio/plugins/png/PNGImageReader.java | 8 +- .../plugins/png/ReadMalformedPngTest.java | 160 ++++++++++++++++++ 2 files changed, 167 insertions(+), 1 deletion(-) create mode 100644 jdk/test/javax/imageio/plugins/png/ReadMalformedPngTest.java diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java b/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java index 13f2d9349d0..3b2a081d860 100644 --- a/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java +++ b/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java @@ -664,6 +664,12 @@ public class PNGImageReader extends ImageReader { try { while (true) { int chunkLength = stream.readInt(); + + // verify the chunk length first + if (chunkLength < 0 || chunkLength + 4 < 0) { + throw new IIOException("Invalid chunk length " + chunkLength); + } + int chunkType = stream.readInt(); if (chunkType == IDAT_TYPE) { @@ -692,7 +698,7 @@ public class PNGImageReader extends ImageReader { // verify the chunk length if (chunkLength < 0) { - throw new IIOException("Invalid chunk lenght " + chunkLength); + throw new IIOException("Invalid chunk length " + chunkLength); }; try { diff --git a/jdk/test/javax/imageio/plugins/png/ReadMalformedPngTest.java b/jdk/test/javax/imageio/plugins/png/ReadMalformedPngTest.java new file mode 100644 index 00000000000..7aadebc627b --- /dev/null +++ b/jdk/test/javax/imageio/plugins/png/ReadMalformedPngTest.java @@ -0,0 +1,160 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 6945174 + * @summary Test verifies that PNG image readr throw correct exception + * if image contains a chunk with incorrect length. + * @run main ReadMalformedPngTest + */ + +import java.awt.Color; +import java.awt.GradientPaint; +import java.awt.Graphics2D; +import java.awt.image.BufferedImage; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import javax.imageio.IIOException; +import javax.imageio.IIOImage; +import javax.imageio.ImageIO; +import javax.imageio.ImageTypeSpecifier; +import javax.imageio.ImageWriteParam; +import javax.imageio.ImageWriter; +import javax.imageio.metadata.IIOMetadata; +import javax.imageio.metadata.IIOMetadataNode; +import javax.imageio.stream.ImageOutputStream; +import org.w3c.dom.Node; + +public class ReadMalformedPngTest { + + public static void main(String[] args) throws IOException { + ByteArrayInputStream bais = new ByteArrayInputStream(createTestPng()); + + IIOException expected = null; + try { + ImageIO.read(bais); + } catch (IIOException e) { + expected = e; + } catch (Throwable e) { + throw new RuntimeException("Test failed!", e); + } + + if (expected == null) { + throw new RuntimeException("Test failed."); + } + + System.out.println("Test passed."); + } + + private static byte[] createTestPng() throws IOException { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + + BufferedImage img = createTestImage(); + + try { + ImageOutputStream ios = ImageIO.createImageOutputStream(baos); + + ImageWriter w = ImageIO.getImageWritersByFormatName("PNG").next(); + + w.setOutput(ios); + + ImageWriteParam p = w.getDefaultWriteParam(); + + ImageTypeSpecifier t = ImageTypeSpecifier.createFromRenderedImage(img); + + IIOMetadata m = w.getDefaultImageMetadata(t, p); + + String nativeMetadataFormat = m.getNativeMetadataFormatName(); + + Node root = m.getAsTree(nativeMetadataFormat); + + IIOMetadataNode textEntry = new IIOMetadataNode("tEXtEntry"); + textEntry.setAttribute("keyword", "comment"); + textEntry.setAttribute("value", "This is a test image for JDK-6945174"); + + IIOMetadataNode text = new IIOMetadataNode("tEXt"); + text.appendChild(textEntry); + + root.appendChild(text); + + m.mergeTree(nativeMetadataFormat, root); + + IIOImage iio_img = new IIOImage(img, null, m); + + w.write(iio_img); + + w.dispose(); + ios.flush(); + ios.close(); + } catch (IOException e) { + throw new RuntimeException("Test failed.", e); + } + + baos.flush(); + + byte[] data = baos.toByteArray(); + + adjustCommentLength(Integer.MAX_VALUE + 0x1000, data); + + return data; + } + + private static void adjustCommentLength(int v, byte[] data) { + final int pos = getCommentPos(data); + data[pos + 3] = (byte) (v & 0xFF); + v = v >> 8; + data[pos + 2] = (byte) (v & 0xFF); + v = v >> 8; + data[pos + 1] = (byte) (v & 0xFF); + v = v >> 8; + data[pos + 0] = (byte) (v & 0xFF); + } + + private static int getCommentPos(byte[] d) { + int p = 8; + while (p + 8 < d.length) { + if (d[p + 4] == (byte) 0x74 && d[p + 5] == (byte) 0x45 && + d[p + 6] == (byte) 0x58 && d[p + 7] == (byte) 0x74) + { + return p; + } + p++; + } + throw new RuntimeException("Test chunk was not found!"); + } + + private static BufferedImage createTestImage() { + final int w = 128; + final int h = 128; + + BufferedImage img = new BufferedImage(w, h, BufferedImage.TYPE_3BYTE_BGR); + Graphics2D g = img.createGraphics(); + g.setPaint(new GradientPaint(0, 0, Color.blue, + w, h, Color.red)); + g.fillRect(0, 0, w, h); + g.dispose(); + return img; + } +} From 9aa0cef64a155a41e673b1e6ed4c671b5e60eb53 Mon Sep 17 00:00:00 2001 From: Oleg Pekhovskiy Date: Thu, 15 May 2014 20:09:38 +0400 Subject: [PATCH 41/50] 8014755: [TEST_BUG] frames didn't closed after execution some awt/dnd/ tests Reviewed-by: serb, pchelko --- .../DragInterceptorAppletTest.html | 48 ++ .../DragInterceptorAppletTest.java | 154 ++++++ .../DragInterceptorFrame.java | 128 +++++ .../InterprocessMessages.java | 32 ++ .../SourceFrame.java | 68 +++ .../InterJVMGetDropSuccessTest.html | 43 ++ .../InterJVMGetDropSuccessTest.java | 499 ++++++++++++++++++ .../NoFormatsCrashTest.html | 45 ++ .../NoFormatsCrashTest.java | 488 +++++++++++++++++ .../process/ProcessCommunicator.java | 62 ++- 10 files changed, 1545 insertions(+), 22 deletions(-) create mode 100644 jdk/test/java/awt/dnd/DragInterceptorAppletTest/DragInterceptorAppletTest.html create mode 100644 jdk/test/java/awt/dnd/DragInterceptorAppletTest/DragInterceptorAppletTest.java create mode 100644 jdk/test/java/awt/dnd/DragInterceptorAppletTest/DragInterceptorFrame.java create mode 100644 jdk/test/java/awt/dnd/DragInterceptorAppletTest/InterprocessMessages.java create mode 100644 jdk/test/java/awt/dnd/DragInterceptorAppletTest/SourceFrame.java create mode 100644 jdk/test/java/awt/dnd/InterJVMGetDropSuccessTest/InterJVMGetDropSuccessTest.html create mode 100644 jdk/test/java/awt/dnd/InterJVMGetDropSuccessTest/InterJVMGetDropSuccessTest.java create mode 100644 jdk/test/java/awt/dnd/NoFormatsCrashTest/NoFormatsCrashTest.html create mode 100644 jdk/test/java/awt/dnd/NoFormatsCrashTest/NoFormatsCrashTest.java diff --git a/jdk/test/java/awt/dnd/DragInterceptorAppletTest/DragInterceptorAppletTest.html b/jdk/test/java/awt/dnd/DragInterceptorAppletTest/DragInterceptorAppletTest.html new file mode 100644 index 00000000000..7d4a3a5a774 --- /dev/null +++ b/jdk/test/java/awt/dnd/DragInterceptorAppletTest/DragInterceptorAppletTest.html @@ -0,0 +1,48 @@ + + + + + + Unsigned applet can retrieve the dragged information before drop action occurs + + + +

    DragInterceptorAppletTest
    Bug ID: 6887703

    + +

    This is an AUTOMATIC test, simply wait for completion

    + + + + diff --git a/jdk/test/java/awt/dnd/DragInterceptorAppletTest/DragInterceptorAppletTest.java b/jdk/test/java/awt/dnd/DragInterceptorAppletTest/DragInterceptorAppletTest.java new file mode 100644 index 00000000000..5f70e2de35b --- /dev/null +++ b/jdk/test/java/awt/dnd/DragInterceptorAppletTest/DragInterceptorAppletTest.java @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + test + @bug 6887703 + @summary Unsigned applet can retrieve the dragged information before drop action occurs + @author : area=dnd + @run applet DragInterceptorAppletTest.html +*/ + +/** + * DragInterceptorAppletTest.java + * + * summary: Unsigned applet can retrieve the dragged information before drop action occurs + */ + +import static java.lang.Thread.sleep; + +import test.java.awt.regtesthelpers.process.ProcessCommunicator; +import test.java.awt.regtesthelpers.process.ProcessResults; +import test.java.awt.regtesthelpers.Util; +import java.applet.Applet; +import java.awt.*; +import java.awt.event.InputEvent; + +public class DragInterceptorAppletTest extends Applet { + + public void init() { + setLayout(new BorderLayout()); + }//End init() + + public void start() { + + SourceFrame sourceFrame = new SourceFrame(); + + Util.waitForIdle(null); + + String [] args = new String [] { + String.valueOf(sourceFrame.getNextLocationX()), + String.valueOf(sourceFrame.getNextLocationY()), + String.valueOf(sourceFrame.getDragSourcePointX()), + String.valueOf(sourceFrame.getDragSourcePointY()), + }; + String classpath = System.getProperty("java.class.path"); + ProcessResults processResults = + ProcessCommunicator.executeChildProcess(this.getClass(),classpath,args); + + verifyTestResults(processResults); + + }// start() + + private static void verifyTestResults(ProcessResults processResults) { + + switch (processResults.getExitValue()) { + case InterprocessMessages.DATA_WAS_INTERCEPTED_AND_EXCEPTION_HANDLER_WAS_NOT_TRIGGERED: + processResults.printProcessErrorOutput(System.err); + throw new RuntimeException("TEST IS FAILED: Target applet can intercept data " + + "without a clipboard permission and an exception handler was not triggered."); + //Unreachable... + + case InterprocessMessages.DATA_WAS_INTERCEPTED: + processResults.printProcessErrorOutput(System.err); + throw new RuntimeException("TEST IS FAILED: Target applet can intercept data " + + "without a clipboard permission"); + //Unreachable... + + case InterprocessMessages.EXCEPTION_HANDLER_WAS_NOT_TRIGGERED: + processResults.printProcessErrorOutput(System.err); + throw new RuntimeException("TEST IS FAILED: An exception handler was not triggered."); + //Unreachable... + + } + + // The child process throws an exception. do not look at the stderr. + processResults.verifyStdErr(System.err); + processResults.verifyProcessExitValue(System.err); + processResults.printProcessStandartOutput(System.out); + } + + //We cannot make an instance of the applet without the default constructor + public DragInterceptorAppletTest() { + super(); + } + + //We need in this constructor to pass frame position between JVMs + public DragInterceptorAppletTest(Point targetFrameLocation, Point dragSourcePoint) + throws InterruptedException + { + DragInterceptorFrame targetFrame = new DragInterceptorFrame(targetFrameLocation); + + Util.waitForIdle(null); + + final Robot robot = Util.createRobot(); + + robot.mouseMove((int)dragSourcePoint.getX(),(int)dragSourcePoint.getY()); + sleep(100); + robot.mousePress(InputEvent.BUTTON1_MASK); + sleep(100); + robot.mouseRelease(InputEvent.BUTTON1_MASK); + sleep(100); + + Util.drag(robot, dragSourcePoint, targetFrame.getDropTargetPoint(), + InputEvent.BUTTON1_MASK); + + sleep(2000); + ProcessCommunicator.destroyProcess(); + } + + enum InterprocessArguments { + TARGET_FRAME_X_POSITION_ARGUMENT, + TARGET_FRAME_Y_POSITION_ARGUMENT, + DRAG_SOURCE_POINT_X_ARGUMENT, + DRAG_SOURCE_POINT_Y_ARGUMENT; + + int extract (String [] args) { + return Integer.parseInt(args[this.ordinal()]); + } + } + + public static void main (String [] args) { + Point dragSourcePoint = new Point(InterprocessArguments.DRAG_SOURCE_POINT_X_ARGUMENT.extract(args), + InterprocessArguments.DRAG_SOURCE_POINT_Y_ARGUMENT.extract(args)); + Point targetFrameLocation = new Point(InterprocessArguments.TARGET_FRAME_X_POSITION_ARGUMENT.extract(args), + InterprocessArguments.TARGET_FRAME_Y_POSITION_ARGUMENT.extract(args)); + try { + new DragInterceptorAppletTest(targetFrameLocation, dragSourcePoint); + } catch (InterruptedException e) { + e.printStackTrace(); + throw new RuntimeException(e); + } + } + +}// class DragInterceptorAppletTest diff --git a/jdk/test/java/awt/dnd/DragInterceptorAppletTest/DragInterceptorFrame.java b/jdk/test/java/awt/dnd/DragInterceptorAppletTest/DragInterceptorFrame.java new file mode 100644 index 00000000000..69d4a014ba9 --- /dev/null +++ b/jdk/test/java/awt/dnd/DragInterceptorAppletTest/DragInterceptorFrame.java @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.*; +import java.awt.datatransfer.DataFlavor; +import java.awt.datatransfer.UnsupportedFlavorException; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.awt.dnd.*; +import java.io.IOException; +import java.security.Permission; +import java.security.AccessControlException; + +class DragInterceptorFrame extends Frame implements DropTargetListener { + + private static int exitMessage = InterprocessMessages.TEST_PASSED; + private static boolean dataIsAccessible = false; + private static boolean exceptionHasBeenThrown = false; + + DragInterceptorFrame(Point location) { + System.setSecurityManager(new ClipboardDefender()); + initGUI(location); + setDropTarget(new DropTarget(this, DnDConstants.ACTION_COPY, + this)); + } + + private void initGUI(Point location) { + this.setLocation(location); + this.addWindowListener(new WindowAdapter() { + public void windowClosing(WindowEvent e) { + DragInterceptorFrame.this.dispose(); + } + }); + setSize (200, 200); + this.setVisible(true); + } + + public void dragEnter(DropTargetDragEvent dtde) { + // We want to set the exception handler on EDT + Thread.currentThread().setUncaughtExceptionHandler ( + new Thread.UncaughtExceptionHandler() { + public void uncaughtException(Thread t, Throwable e) { + exceptionHasBeenThrown = true; + } + } + ); + examineTransferable(dtde); + } + + public void dragOver(DropTargetDragEvent dtde) { + examineTransferable(dtde); + } + + public void dropActionChanged(DropTargetDragEvent dtde) { + examineTransferable(dtde); + } + + public void dragExit(DropTargetEvent dte) {} + + public void drop(DropTargetDropEvent dtde) { + + if (dataIsAccessible && !exceptionHasBeenThrown) { + exitMessage = InterprocessMessages.DATA_WAS_INTERCEPTED_AND_EXCEPTION_HANDLER_WAS_NOT_TRIGGERED; + } else if (dataIsAccessible) { + exitMessage = InterprocessMessages.DATA_WAS_INTERCEPTED; + } else if (!exceptionHasBeenThrown) { + exitMessage = InterprocessMessages.EXCEPTION_HANDLER_WAS_NOT_TRIGGERED; + } + + // This returns the diagnostic code from the child VM + System.exit(exitMessage); + } + + Point getDropTargetPoint() { + return new Point((int)getLocationOnScreen().getX()+(getWidth()/2), + (int)getLocationOnScreen().getY()+(getHeight()/2)); + } + + private void examineTransferable(DropTargetDragEvent dtde) { + if (dtde.getCurrentDataFlavorsAsList().contains(DataFlavor.stringFlavor)) { + dtde.acceptDrag(DnDConstants.ACTION_COPY); + try{ + if (null != dtde.getTransferable().getTransferData(DataFlavor.stringFlavor)) { + dataIsAccessible = true; + } + } catch (IOException e) { + e.printStackTrace(); + exitMessage = InterprocessMessages.UNEXPECTED_IO_EXCEPTION; + } catch (UnsupportedFlavorException e) { + e.printStackTrace(); + exitMessage = InterprocessMessages.UNEXPECTED_UNSUPPORTED_FLAVOR_EXCEPTION; + } + } + } + + static class ClipboardDefender extends SecurityManager { + public void checkPermission(Permission p) { + if (p instanceof java.awt.AWTPermission && + p.getName().equals("accessClipboard")) { + throw new AccessControlException("access denied "); + } + } + } + + public static void main(String[] args) { + new DragInterceptorFrame(new Point(200,200)); + } +} diff --git a/jdk/test/java/awt/dnd/DragInterceptorAppletTest/InterprocessMessages.java b/jdk/test/java/awt/dnd/DragInterceptorAppletTest/InterprocessMessages.java new file mode 100644 index 00000000000..6506565cd05 --- /dev/null +++ b/jdk/test/java/awt/dnd/DragInterceptorAppletTest/InterprocessMessages.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +public interface InterprocessMessages { + final static int TEST_PASSED = 0; + final static int DATA_WAS_INTERCEPTED = 212; + final static int EXCEPTION_HANDLER_WAS_NOT_TRIGGERED = 213; + final static int DATA_WAS_INTERCEPTED_AND_EXCEPTION_HANDLER_WAS_NOT_TRIGGERED = 214; + + final static int UNEXPECTED_IO_EXCEPTION = 400; + final static int UNEXPECTED_UNSUPPORTED_FLAVOR_EXCEPTION = 401; +} diff --git a/jdk/test/java/awt/dnd/DragInterceptorAppletTest/SourceFrame.java b/jdk/test/java/awt/dnd/DragInterceptorAppletTest/SourceFrame.java new file mode 100644 index 00000000000..7a7c833b91a --- /dev/null +++ b/jdk/test/java/awt/dnd/DragInterceptorAppletTest/SourceFrame.java @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import test.java.awt.regtesthelpers.Util; + +import java.awt.*; +import java.awt.datatransfer.StringSelection; +import java.awt.dnd.DragGestureListener; +import java.awt.dnd.DragSource; +import java.awt.dnd.DnDConstants; +import java.awt.dnd.DragGestureEvent; + +class SourceFrame extends Frame implements DragGestureListener { + + SourceFrame() { + super("Source File List Frame"); + initGUI(); + new DragSource().createDefaultDragGestureRecognizer(this, + DnDConstants.ACTION_COPY,this); + } + + private void initGUI() { + this.addWindowListener(Util.getClosingWindowAdapter()); + this.setLocation(300,250); + this.setSize(200,200); + this.setVisible(true); + } + + int getNextLocationX() { + return getX()+getWidth(); + } + + int getNextLocationY() { + return getY(); + } + + int getDragSourcePointX() { + return (int)getLocationOnScreen().getX()+(getWidth()/2); + } + + int getDragSourcePointY() { + return (int)getLocationOnScreen().getY()+ (getHeight()/2); + } + + public void dragGestureRecognized(DragGestureEvent dge) { + dge.startDrag(null, new StringSelection("A TEXT")); + } +} diff --git a/jdk/test/java/awt/dnd/InterJVMGetDropSuccessTest/InterJVMGetDropSuccessTest.html b/jdk/test/java/awt/dnd/InterJVMGetDropSuccessTest/InterJVMGetDropSuccessTest.html new file mode 100644 index 00000000000..2b3aa7aa60c --- /dev/null +++ b/jdk/test/java/awt/dnd/InterJVMGetDropSuccessTest/InterJVMGetDropSuccessTest.html @@ -0,0 +1,43 @@ + + + + + + + + + +

    InterJVMGetDropSuccessTest
    Bug ID: 4658741

    + +

    This is an AUTOMATIC test, simply wait for completion

    + + + + diff --git a/jdk/test/java/awt/dnd/InterJVMGetDropSuccessTest/InterJVMGetDropSuccessTest.java b/jdk/test/java/awt/dnd/InterJVMGetDropSuccessTest/InterJVMGetDropSuccessTest.java new file mode 100644 index 00000000000..9307fa26df5 --- /dev/null +++ b/jdk/test/java/awt/dnd/InterJVMGetDropSuccessTest/InterJVMGetDropSuccessTest.java @@ -0,0 +1,499 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + test + @bug 4658741 + @summary verifies that getDropSuccess() returns correct value for inter-JVM DnD + @author das@sparc.spb.su area=dnd + @run applet InterJVMGetDropSuccessTest.html +*/ + +// Note there is no @ in front of test above. This is so that the +// harness will not mistake this file as a test file. It should +// only see the html file as a test file. (the harness runs all +// valid test files, so it would run this test twice if this file +// were valid as well as the html file.) +// Also, note the area= after Your Name in the author tag. Here, you +// should put which functional area the test falls in. See the +// AWT-core home page -> test areas and/or -> AWT team for a list of +// areas. +// Note also the 'InterJVMGetDropSuccessTest.html' in the run tag. This should +// be changed to the name of the test. + + +/** + * InterJVMGetDropSuccessTest.java + * + * summary: verifies that getDropSuccess() returns correct value for inter-JVM DnD + */ + +import java.applet.Applet; +import java.awt.*; +import java.awt.datatransfer.*; +import java.awt.dnd.*; +import java.awt.event.*; +import java.io.*; +import javax.swing.*; + + +//Automated tests should run as applet tests if possible because they +// get their environments cleaned up, including AWT threads, any +// test created threads, and any system resources used by the test +// such as file descriptors. (This is normally not a problem as +// main tests usually run in a separate VM, however on some platforms +// such as the Mac, separate VMs are not possible and non-applet +// tests will cause problems). Also, you don't have to worry about +// synchronisation stuff in Applet tests they way you do in main +// tests... + + +public class InterJVMGetDropSuccessTest extends Applet { + + private int returnCode = Util.CODE_NOT_RETURNED; + private boolean successCodes[] = { true, false }; + private int dropCount = 0; + + final Frame frame = new Frame("Target Frame"); + + final DropTargetListener dropTargetListener = new DropTargetAdapter() { + public void drop(DropTargetDropEvent dtde) { + dtde.acceptDrop(DnDConstants.ACTION_COPY); + dtde.dropComplete(successCodes[dropCount]); + dropCount++; + } + }; + final DropTarget dropTarget = new DropTarget(frame, dropTargetListener); + + public void init() { + //Create instructions for the user here, as well as set up + // the environment -- set the layout manager, add buttons, + // etc. + + String[] instructions = + { + "This is an AUTOMATIC test", + "simply wait until it is done" + }; + Sysout.createDialog( ); + Sysout.printInstructions( instructions ); + + frame.setTitle("Test frame"); + frame.setBounds(100, 100, 150, 150); + } // init() + + public void start() { + + frame.setVisible(true); + + try { + Thread.sleep(Util.FRAME_ACTIVATION_TIMEOUT); + + Point p = frame.getLocationOnScreen(); + Dimension d = frame.getSize(); + + String javaPath = System.getProperty("java.home", ""); + String command = javaPath + File.separator + "bin" + + File.separator + "java -cp " + System.getProperty("test.classes", ".") + + " Child " + + p.x + " " + p.y + " " + d.width + " " + d.height; + + Process process = Runtime.getRuntime().exec(command); + returnCode = process.waitFor(); + + InputStream errorStream = process.getErrorStream(); + int count = errorStream.available(); + if (count > 0) { + byte[] b = new byte[count]; + errorStream.read(b); + System.err.println("========= Child VM System.err ========"); + System.err.print(new String(b)); + System.err.println("======================================"); + } + + InputStream outputStream = process.getInputStream(); + count = outputStream.available(); + if (count > 0) { + byte[] b = new byte[count]; + outputStream.read(b); + System.err.println("========= Child VM System.out ========"); + System.err.print(new String(b)); + System.err.println("======================================"); + } + } catch (Throwable e) { + e.printStackTrace(); + throw new RuntimeException(e); + } + switch (returnCode) { + case Util.CODE_NOT_RETURNED: + throw new RuntimeException("Child VM: failed to start"); + case Util.CODE_FAILURE: + throw new RuntimeException("Child VM: abnormal termination"); + default: + if (dropCount == 2) { + int expectedRetCode = 0; + if (successCodes[0]) { + expectedRetCode |= Util.CODE_FIRST_SUCCESS; + } + if (successCodes[1]) { + expectedRetCode |= Util.CODE_SECOND_SUCCESS; + } + if (expectedRetCode != returnCode) { + throw new RuntimeException("The test failed. Expected:" + + expectedRetCode + ". Returned:" + + returnCode); + } + } + break; + } + } // start() +} // class InterJVMGetDropSuccessTest + +final class Util implements AWTEventListener { + public static final int CODE_NOT_RETURNED = -1; + public static final int CODE_FIRST_SUCCESS = 0x2; + public static final int CODE_SECOND_SUCCESS = 0x2; + public static final int CODE_FAILURE = 0x1; + + public static final int FRAME_ACTIVATION_TIMEOUT = 3000; + + static final Object SYNC_LOCK = new Object(); + static final int MOUSE_RELEASE_TIMEOUT = 1000; + + static final Util theInstance = new Util(); + + static { + Toolkit.getDefaultToolkit().addAWTEventListener(theInstance, AWTEvent.MOUSE_EVENT_MASK); + } + + public static Point getCenterLocationOnScreen(Component c) { + Point p = c.getLocationOnScreen(); + Dimension d = c.getSize(); + p.translate(d.width / 2, d.height / 2); + return p; + } + + public static int sign(int n) { + return n < 0 ? -1 : n == 0 ? 0 : 1; + } + + private Component clickedComponent = null; + + private void reset() { + clickedComponent = null; + } + + public void eventDispatched(AWTEvent e) { + if (e.getID() == MouseEvent.MOUSE_RELEASED) { + clickedComponent = (Component)e.getSource(); + synchronized (SYNC_LOCK) { + SYNC_LOCK.notifyAll(); + } + } + } + + public static boolean pointInComponent(Robot robot, Point p, Component comp) + throws InterruptedException { + return theInstance.pointInComponentImpl(robot, p, comp); + } + + private boolean pointInComponentImpl(Robot robot, Point p, Component comp) + throws InterruptedException { + robot.waitForIdle(); + reset(); + robot.mouseMove(p.x, p.y); + robot.mousePress(InputEvent.BUTTON1_MASK); + synchronized (SYNC_LOCK) { + robot.mouseRelease(InputEvent.BUTTON1_MASK); + SYNC_LOCK.wait(MOUSE_RELEASE_TIMEOUT); + } + + Component c = clickedComponent; + + while (c != null && c != comp) { + c = c.getParent(); + } + + return c == comp; + } +} + +class Child { + static class DragSourceDropListener extends DragSourceAdapter { + private boolean finished = false; + private boolean dropSuccess = false; + + public void reset() { + finished = false; + dropSuccess = false; + } + + public boolean isDropFinished() { + return finished; + } + + public boolean getDropSuccess() { + return dropSuccess; + } + + public void dragDropEnd(DragSourceDropEvent dsde) { + finished = true; + dropSuccess = dsde.getDropSuccess(); + synchronized (Util.SYNC_LOCK) { + Util.SYNC_LOCK.notifyAll(); + } + } + } + + final Frame frame = new Frame("Source Frame"); + final DragSource dragSource = DragSource.getDefaultDragSource(); + final DragSourceDropListener dragSourceListener = new DragSourceDropListener(); + final Transferable transferable = new StringSelection("TEXT"); + final DragGestureListener dragGestureListener = new DragGestureListener() { + public void dragGestureRecognized(DragGestureEvent dge) { + dge.startDrag(null, transferable, dragSourceListener); + } + }; + final DragGestureRecognizer dragGestureRecognizer = + dragSource.createDefaultDragGestureRecognizer(frame, DnDConstants.ACTION_COPY, + dragGestureListener); + + public static void main(String[] args) { + Child child = new Child(); + child.run(args); + } + + public void run(String[] args) { + try { + if (args.length != 4) { + throw new RuntimeException("Incorrect command line arguments."); + } + + int x = Integer.parseInt(args[0]); + int y = Integer.parseInt(args[1]); + int w = Integer.parseInt(args[2]); + int h = Integer.parseInt(args[3]); + + frame.setBounds(300, 200, 150, 150); + frame.setVisible(true); + + Thread.sleep(Util.FRAME_ACTIVATION_TIMEOUT); + + Point sourcePoint = Util.getCenterLocationOnScreen(frame); + + Point targetPoint = new Point(x + w / 2, y + h / 2); + + Robot robot = new Robot(); + robot.mouseMove(sourcePoint.x, sourcePoint.y); + robot.mousePress(InputEvent.BUTTON1_MASK); + for (Point p = new Point(sourcePoint); !p.equals(targetPoint); + p.translate(Util.sign(targetPoint.x - p.x), + Util.sign(targetPoint.y - p.y))) { + robot.mouseMove(p.x, p.y); + Thread.sleep(50); + } + + synchronized (Util.SYNC_LOCK) { + robot.mouseRelease(InputEvent.BUTTON1_MASK); + Util.SYNC_LOCK.wait(Util.FRAME_ACTIVATION_TIMEOUT); + } + + if (!dragSourceListener.isDropFinished()) { + throw new RuntimeException("Drop not finished"); + } + + boolean success1 = dragSourceListener.getDropSuccess(); + + dragSourceListener.reset(); + robot.mouseMove(sourcePoint.x, sourcePoint.y); + robot.mousePress(InputEvent.BUTTON1_MASK); + for (Point p = new Point(sourcePoint); !p.equals(targetPoint); + p.translate(Util.sign(targetPoint.x - p.x), + Util.sign(targetPoint.y - p.y))) { + robot.mouseMove(p.x, p.y); + Thread.sleep(50); + } + + synchronized (Util.SYNC_LOCK) { + robot.mouseRelease(InputEvent.BUTTON1_MASK); + Util.SYNC_LOCK.wait(Util.FRAME_ACTIVATION_TIMEOUT); + } + + if (!dragSourceListener.isDropFinished()) { + throw new RuntimeException("Drop not finished"); + } + + boolean success2 = dragSourceListener.getDropSuccess(); + int retCode = 0; + + if (success1) { + retCode |= Util.CODE_FIRST_SUCCESS; + } + if (success2) { + retCode |= Util.CODE_SECOND_SUCCESS; + } + // This returns the diagnostic code from the child VM + System.exit(retCode); + } catch (Throwable e) { + e.printStackTrace(); + // This returns the diagnostic code from the child VM + System.exit(Util.CODE_FAILURE); + } + } // run() +} // class child + +/**************************************************** + Standard Test Machinery + DO NOT modify anything below -- it's a standard + chunk of code whose purpose is to make user + interaction uniform, and thereby make it simpler + to read and understand someone else's test. + ****************************************************/ + +/** + This is part of the standard test machinery. + It creates a dialog (with the instructions), and is the interface + for sending text messages to the user. + To print the instructions, send an array of strings to Sysout.createDialog + WithInstructions method. Put one line of instructions per array entry. + To display a message for the tester to see, simply call Sysout.println + with the string to be displayed. + This mimics System.out.println but works within the test harness as well + as standalone. + */ + +class Sysout + { + private static TestDialog dialog; + + public static void createDialogWithInstructions( String[] instructions ) + { + dialog = new TestDialog( new Frame(), "Instructions" ); + dialog.printInstructions( instructions ); + dialog.show(); + println( "Any messages for the tester will display here." ); + } + + public static void createDialog( ) + { + dialog = new TestDialog( new Frame(), "Instructions" ); + String[] defInstr = { "Instructions will appear here. ", "" } ; + dialog.printInstructions( defInstr ); + dialog.show(); + println( "Any messages for the tester will display here." ); + } + + + public static void printInstructions( String[] instructions ) + { + dialog.printInstructions( instructions ); + } + + + public static void println( String messageIn ) + { + dialog.displayMessage( messageIn ); + } + + }// Sysout class + +/** + This is part of the standard test machinery. It provides a place for the + test instructions to be displayed, and a place for interactive messages + to the user to be displayed. + To have the test instructions displayed, see Sysout. + To have a message to the user be displayed, see Sysout. + Do not call anything in this dialog directly. + */ +class TestDialog extends Dialog + { + + TextArea instructionsText; + TextArea messageText; + int maxStringLength = 80; + + //DO NOT call this directly, go through Sysout + public TestDialog( Frame frame, String name ) + { + super( frame, name ); + int scrollBoth = TextArea.SCROLLBARS_BOTH; + instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); + add( "North", instructionsText ); + + messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); + add("South", messageText); + + pack(); + + show(); + }// TestDialog() + + //DO NOT call this directly, go through Sysout + public void printInstructions( String[] instructions ) + { + //Clear out any current instructions + instructionsText.setText( "" ); + + //Go down array of instruction strings + + String printStr, remainingStr; + for( int i=0; i < instructions.length; i++ ) + { + //chop up each into pieces maxSringLength long + remainingStr = instructions[ i ]; + while( remainingStr.length() > 0 ) + { + //if longer than max then chop off first max chars to print + if( remainingStr.length() >= maxStringLength ) + { + //Try to chop on a word boundary + int posOfSpace = remainingStr. + lastIndexOf( ' ', maxStringLength - 1 ); + + if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; + + printStr = remainingStr.substring( 0, posOfSpace + 1 ); + remainingStr = remainingStr.substring( posOfSpace + 1 ); + } + //else just print + else + { + printStr = remainingStr; + remainingStr = ""; + } + + instructionsText.append( printStr + "\n" ); + + }// while + + }// for + + }//printInstructions() + + //DO NOT call this directly, go through Sysout + public void displayMessage( String messageIn ) + { + messageText.append( messageIn + "\n" ); + } + + }// TestDialog class diff --git a/jdk/test/java/awt/dnd/NoFormatsCrashTest/NoFormatsCrashTest.html b/jdk/test/java/awt/dnd/NoFormatsCrashTest/NoFormatsCrashTest.html new file mode 100644 index 00000000000..c19a0a02354 --- /dev/null +++ b/jdk/test/java/awt/dnd/NoFormatsCrashTest/NoFormatsCrashTest.html @@ -0,0 +1,45 @@ + + + + + + + + + +

    NoFormatsCrashTest
    Bug ID: 4870762

    + +

    This is an AUTOMATIC test, simply wait for completion

    + + + + + diff --git a/jdk/test/java/awt/dnd/NoFormatsCrashTest/NoFormatsCrashTest.java b/jdk/test/java/awt/dnd/NoFormatsCrashTest/NoFormatsCrashTest.java new file mode 100644 index 00000000000..3be0adc666e --- /dev/null +++ b/jdk/test/java/awt/dnd/NoFormatsCrashTest/NoFormatsCrashTest.java @@ -0,0 +1,488 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + test + @bug 4870762 + @summary tests that a drop target JVM doesn't crash if the source doesn't export + data in native formats. + @author das@sparc.spb.su area=dnd + @compile NoFormatsCrashTest.java + @run applet NoFormatsCrashTest.html +*/ + +// Note there is no @ in front of test above. This is so that the +// harness will not mistake this file as a test file. It should +// only see the html file as a test file. (the harness runs all +// valid test files, so it would run this test twice if this file +// were valid as well as the html file.) +// Also, note the area= after Your Name in the author tag. Here, you +// should put which functional area the test falls in. See the +// AWT-core home page -> test areas and/or -> AWT team for a list of +// areas. +// Note also the 'NoFormatsCrashTest.html' in the run tag. This should +// be changed to the name of the test. + + +/** + * NoFormatsCrashTest.java + * + * summary: tests that a drop target JVM doesn't crash if the source doesn't export + * data in native formats. + */ + +import java.applet.Applet; +import java.awt.*; +import java.awt.datatransfer.*; +import java.awt.dnd.*; +import java.awt.event.*; +import java.io.*; + + +//Automated tests should run as applet tests if possible because they +// get their environments cleaned up, including AWT threads, any +// test created threads, and any system resources used by the test +// such as file descriptors. (This is normally not a problem as +// main tests usually run in a separate VM, however on some platforms +// such as the Mac, separate VMs are not possible and non-applet +// tests will cause problems). Also, you don't have to worry about +// synchronisation stuff in Applet tests they way you do in main +// tests... + + +public class NoFormatsCrashTest extends Applet { + + final Frame frame = new Frame(); + private volatile Process process; + + static final int FRAME_ACTIVATION_TIMEOUT = 2000; + + public static void main(String[] args) { + NoFormatsCrashTest test = new NoFormatsCrashTest(); + test.run(args); + } + + public void run(String[] args) { + try { + if (args.length != 4) { + throw new RuntimeException("Incorrect command line arguments."); + } + + int x = Integer.parseInt(args[0]); + int y = Integer.parseInt(args[1]); + int w = Integer.parseInt(args[2]); + int h = Integer.parseInt(args[3]); + + Panel panel = new DragSourcePanel(); + + frame.setTitle("Drag source frame"); + frame.setLocation(500, 200); + frame.add(panel); + frame.pack(); + frame.setVisible(true); + + Thread.sleep(FRAME_ACTIVATION_TIMEOUT); + + Point sourcePoint = panel.getLocationOnScreen(); + Dimension d = panel.getSize(); + sourcePoint.translate(d.width / 2, d.height / 2); + + Point targetPoint = new Point(x + w / 2, y + h / 2); + + Robot robot = new Robot(); + robot.mouseMove(sourcePoint.x, sourcePoint.y); + robot.keyPress(KeyEvent.VK_CONTROL); + robot.mousePress(InputEvent.BUTTON1_MASK); + for (; !sourcePoint.equals(targetPoint); + sourcePoint.translate(sign(targetPoint.x - sourcePoint.x), + sign(targetPoint.y - sourcePoint.y))) { + robot.mouseMove(sourcePoint.x, sourcePoint.y); + Thread.sleep(50); + } + robot.mouseRelease(InputEvent.BUTTON1_MASK); + robot.keyRelease(KeyEvent.VK_CONTROL); + + Thread.sleep(FRAME_ACTIVATION_TIMEOUT); + + if (process.isAlive()) { + process.destroy(); + } + } catch (Throwable e) { + e.printStackTrace(); + throw new RuntimeException(e); + } + } // run() + + public void init() { + //Create instructions for the user here, as well as set up + // the environment -- set the layout manager, add buttons, + // etc. + + String[] instructions = + { + "This is an AUTOMATIC test", + "simply wait until it is done" + }; + Sysout.createDialog( ); + Sysout.printInstructions( instructions ); + + frame.setTitle("Drop target frame"); + frame.setLocation(200, 200); + + } // init() + + public void start() { + DropTargetPanel panel = new DropTargetPanel(); + frame.add(panel); + frame.pack(); + frame.setVisible(true); + + try { + Thread.sleep(FRAME_ACTIVATION_TIMEOUT); + + Point p = frame.getLocationOnScreen(); + Dimension d = frame.getSize(); + + String javaPath = System.getProperty("java.home", ""); + String command = javaPath + File.separator + "bin" + + File.separator + "java -cp " + System.getProperty("test.classes", ".") + + " NoFormatsCrashTest " + + p.x + " " + p.y + " " + d.width + " " + d.height; + + process = Runtime.getRuntime().exec(command); + ProcessResults pres = ProcessResults.doWaitFor(process); + System.err.println("Child VM return code: " + pres.exitValue); + + if (pres.stderr != null && pres.stderr.length() > 0) { + System.err.println("========= Child VM System.err ========"); + System.err.print(pres.stderr); + System.err.println("======================================"); + } + + if (pres.stdout != null && pres.stdout.length() > 0) { + System.err.println("========= Child VM System.out ========"); + System.err.print(pres.stdout); + System.err.println("======================================"); + } + + } catch (Throwable e) { + e.printStackTrace(); + throw new RuntimeException(e); + } + + if (panel.isTestFailed()) { + throw new RuntimeException(); + } + } // start() + + public static int sign(int n) { + return n < 0 ? -1 : n > 0 ? 1 : 0; + } +} // class NoFormatsCrashTest + +class TestTransferable implements Transferable { + + public static DataFlavor dataFlavor = null; + static final Object data = new Object(); + + static { + DataFlavor df = null; + try { + df = new DataFlavor(DataFlavor.javaJVMLocalObjectMimeType + + "; class=java.lang.Object"); + } catch (ClassNotFoundException e) { + throw new ExceptionInInitializerError(e); + } + dataFlavor = df; + } + + public DataFlavor[] getTransferDataFlavors() { + return new DataFlavor[] { dataFlavor }; + } + + public boolean isDataFlavorSupported(DataFlavor df) { + return dataFlavor.equals(df); + } + + public Object getTransferData(DataFlavor df) + throws UnsupportedFlavorException, IOException { + if (!isDataFlavorSupported(df)) { + throw new UnsupportedFlavorException(df); + } + return data; + } +} + +class DragSourcePanel extends Panel { + public DragSourcePanel() { + final Transferable t = new TestTransferable(); + final DragSourceListener dsl = new DragSourceAdapter() { + public void dragDropEnd(DragSourceDropEvent dtde) { + try { + Thread.sleep(100); + } catch (InterruptedException e) { + e.printStackTrace(); + } + // This finishes child VM + System.exit(0); + } + }; + final DragGestureListener dgl = new DragGestureListener() { + public void dragGestureRecognized(DragGestureEvent dge) { + dge.startDrag(null, t, dsl); + } + }; + final DragSource ds = DragSource.getDefaultDragSource(); + final DragGestureRecognizer dgr = + ds.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY, + dgl); + } + + public Dimension getPreferredSize() { + return new Dimension(100, 100); + } +} + +class DropTargetPanel extends Panel { + private boolean testFailed = false; + public DropTargetPanel() { + final DropTargetListener dtl = new DropTargetAdapter() { + public void dragOver(DropTargetDragEvent dtde) { + try { + dtde.getCurrentDataFlavorsAsList(); + } catch (Exception e) { + testFailed = true; + e.printStackTrace(); + } + } + public void drop(DropTargetDropEvent dtde) { + dtde.rejectDrop(); + } + }; + final DropTarget dt = new DropTarget(this, dtl); + } + + public boolean isTestFailed() { + return testFailed; + } + + public Dimension getPreferredSize() { + return new Dimension(100, 100); + } +} + +class ProcessResults { + public int exitValue; + public String stdout; + public String stderr; + + public ProcessResults() { + exitValue = -1; + stdout = ""; + stderr = ""; + } + + /** + * Method to perform a "wait" for a process and return its exit value. + * This is a workaround for Process.waitFor() never returning. + */ + public static ProcessResults doWaitFor(Process p) { + ProcessResults pres = new ProcessResults(); + + InputStream in = null; + InputStream err = null; + + try { + in = p.getInputStream(); + err = p.getErrorStream(); + + boolean finished = false; + + while (!finished) { + try { + while (in.available() > 0) { + pres.stdout += (char)in.read(); + } + while (err.available() > 0) { + pres.stderr += (char)err.read(); + } + // Ask the process for its exitValue. If the process + // is not finished, an IllegalThreadStateException + // is thrown. If it is finished, we fall through and + // the variable finished is set to true. + pres.exitValue = p.exitValue(); + finished = true; + } + catch (IllegalThreadStateException e) { + // Process is not finished yet; + // Sleep a little to save on CPU cycles + Thread.currentThread().sleep(500); + } + } + if (in != null) in.close(); + if (err != null) err.close(); + } + catch (Throwable e) { + System.err.println("doWaitFor(): unexpected exception"); + e.printStackTrace(); + throw new RuntimeException(e); + } + return pres; + } +} + +/**************************************************** + Standard Test Machinery + DO NOT modify anything below -- it's a standard + chunk of code whose purpose is to make user + interaction uniform, and thereby make it simpler + to read and understand someone else's test. + ****************************************************/ + +/** + This is part of the standard test machinery. + It creates a dialog (with the instructions), and is the interface + for sending text messages to the user. + To print the instructions, send an array of strings to Sysout.createDialog + WithInstructions method. Put one line of instructions per array entry. + To display a message for the tester to see, simply call Sysout.println + with the string to be displayed. + This mimics System.out.println but works within the test harness as well + as standalone. + */ + +class Sysout + { + private static TestDialog dialog; + + public static void createDialogWithInstructions( String[] instructions ) + { + dialog = new TestDialog( new Frame(), "Instructions" ); + dialog.printInstructions( instructions ); + dialog.show(); + println( "Any messages for the tester will display here." ); + } + + public static void createDialog( ) + { + dialog = new TestDialog( new Frame(), "Instructions" ); + String[] defInstr = { "Instructions will appear here. ", "" } ; + dialog.printInstructions( defInstr ); + dialog.show(); + println( "Any messages for the tester will display here." ); + } + + + public static void printInstructions( String[] instructions ) + { + dialog.printInstructions( instructions ); + } + + + public static void println( String messageIn ) + { + dialog.displayMessage( messageIn ); + } + + }// Sysout class + +/** + This is part of the standard test machinery. It provides a place for the + test instructions to be displayed, and a place for interactive messages + to the user to be displayed. + To have the test instructions displayed, see Sysout. + To have a message to the user be displayed, see Sysout. + Do not call anything in this dialog directly. + */ +class TestDialog extends Dialog + { + + TextArea instructionsText; + TextArea messageText; + int maxStringLength = 80; + + //DO NOT call this directly, go through Sysout + public TestDialog( Frame frame, String name ) + { + super( frame, name ); + int scrollBoth = TextArea.SCROLLBARS_BOTH; + instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); + add( "North", instructionsText ); + + messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); + add("South", messageText); + + pack(); + + show(); + }// TestDialog() + + //DO NOT call this directly, go through Sysout + public void printInstructions( String[] instructions ) + { + //Clear out any current instructions + instructionsText.setText( "" ); + + //Go down array of instruction strings + + String printStr, remainingStr; + for( int i=0; i < instructions.length; i++ ) + { + //chop up each into pieces maxSringLength long + remainingStr = instructions[ i ]; + while( remainingStr.length() > 0 ) + { + //if longer than max then chop off first max chars to print + if( remainingStr.length() >= maxStringLength ) + { + //Try to chop on a word boundary + int posOfSpace = remainingStr. + lastIndexOf( ' ', maxStringLength - 1 ); + + if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; + + printStr = remainingStr.substring( 0, posOfSpace + 1 ); + remainingStr = remainingStr.substring( posOfSpace + 1 ); + } + //else just print + else + { + printStr = remainingStr; + remainingStr = ""; + } + + instructionsText.append( printStr + "\n" ); + + }// while + + }// for + + }//printInstructions() + + //DO NOT call this directly, go through Sysout + public void displayMessage( String messageIn ) + { + messageText.append( messageIn + "\n" ); + } + + }// TestDialog class diff --git a/jdk/test/java/awt/regtesthelpers/process/ProcessCommunicator.java b/jdk/test/java/awt/regtesthelpers/process/ProcessCommunicator.java index 8c0e6db916a..8177a2d2ab3 100644 --- a/jdk/test/java/awt/regtesthelpers/process/ProcessCommunicator.java +++ b/jdk/test/java/awt/regtesthelpers/process/ProcessCommunicator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,21 +25,22 @@ package test.java.awt.regtesthelpers.process; import java.io.*; -/** This class is created to solve interprocess communication problems. +/** + * This class is created to solve interprocess communication problems. * When you need to write a regression test which should verify inter jvm * behavior such as DnD data transfer, Clipboard data transfer, focus * transfer etc., you could use the next scenario: * * 1. Write an implementation for the parent JVM, using applet test. - * 2. Write an implimentation for the child JVM or native application, using + * 2. Write an implementation for the child JVM or native application, using * main() function. * 3. Execute child process using ProcessCommunicator.executeChildProcess() * method. - * 4. You can decide whetherthe test is passed on the basis of + * 4. You can decide whether the test is passed on the basis of * ProcessResults class data. * - * Note: The class is not thread safe. You should access its methods only from the same - * thread. + * Note: The class is not thread safe. You should access its methods only from + * the same thread. */ public class ProcessCommunicator { @@ -48,31 +49,34 @@ public class ProcessCommunicator { private static final String javaPath = javaHome + File.separator + "bin" + File.separator + "java "; private static String command = ""; + private static volatile Process process; private ProcessCommunicator() {} - /** The same as {#link #executeChildProcess(Class,String)} except - * the {@code classPathArgument} parameter. The class path - * parameter is for the debug purposes + /** + * The same as {#link #executeChildProcess(Class,String)} except + * the {@code classPathArgument} parameter. The class path + * parameter is for the debug purposes * - * @param classToExecute is passed to the child JVM - * @param classPathArguments class path for the child JVM - * @param args arguments that will be passed to the executed class - * @return results of the executed {@code Process} + * @param classToExecute is passed to the child JVM + * @param classPathArguments class path for the child JVM + * @param args arguments that will be passed to the executed class + * @return results of the executed {@code Process} */ public static ProcessResults executeChildProcess(final Class classToExecute, final String classPathArguments, final String [] args) { try { String command = buildCommand(classToExecute, classPathArguments, args); - Process process = Runtime.getRuntime().exec(command); + process = Runtime.getRuntime().exec(command); return doWaitFor(process); } catch (IOException e) { throw new RuntimeException(e); } } - /** Executes child {code Process} + /** + * Executes child {code Process} * * @param classToExecute class to be executed as a child java process * @param args args to be passed in to the child process @@ -86,11 +90,11 @@ public class ProcessCommunicator { /** * Waits for a process and return its results. - * This is a workaround for Process.waitFor() never returning. + * This is a workaround for {@code Process.waitFor()} never returning. * * @return results of the executed {@code Process} */ - private static ProcessResults doWaitFor(final Process p) { + public static ProcessResults doWaitFor(final Process p) { ProcessResults pres = new ProcessResults(); final InputStream in; @@ -133,13 +137,14 @@ public class ProcessCommunicator { return pres; } - /** Builds command on the basis of the passed class name, - * class path and arguments. + /** + * Builds command on the basis of the passed class name, + * class path and arguments. * * @param classToExecute with class will be executed in the new JVM * @param classPathArguments java class path (only for test purposes) * @param args arguments for the new application. This could be used - * to pass some information from the parnent to child JVM. + * to pass some information from the parent to child JVM. * @return command to execute the {@code Process} */ private static String buildCommand(final Class classToExecute, @@ -162,11 +167,24 @@ public class ProcessCommunicator { return command; } - /** Could be used for the debug purposes. + /** + * Could be used for the debug purposes. * - * @return command that was build to execute the child process + * @return command that was build to execute the child process */ public static String getExecutionCommand () { return command; } + + /** + * Terminates the process created by {@code executeChildProcess} methods. + */ + public static void destroyProcess() { + if (process != null) { + if (process.isAlive()) { + process.destroy(); + } + process = null; + } + } } From 5b7ccb7c0a20d9154ae64164f09e600deac0cad3 Mon Sep 17 00:00:00 2001 From: Anton Litvinov Date: Thu, 15 May 2014 20:21:17 +0400 Subject: [PATCH 42/50] 8041725: Nimbus JList selection colors persist across L&F changes Reviewed-by: alexsch, alexp --- .../classes/javax/swing/plaf/nimbus/skin.laf | 12 +-- .../swing/plaf/nimbus/8041725/bug8041725.java | 82 +++++++++++++++++++ 2 files changed, 88 insertions(+), 6 deletions(-) create mode 100644 jdk/test/javax/swing/plaf/nimbus/8041725/bug8041725.java diff --git a/jdk/src/share/classes/javax/swing/plaf/nimbus/skin.laf b/jdk/src/share/classes/javax/swing/plaf/nimbus/skin.laf index 39010042190..394721e1c41 100644 --- a/jdk/src/share/classes/javax/swing/plaf/nimbus/skin.laf +++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/skin.laf @@ -1,7 +1,7 @@ |lTwn3P@#>fl8+RJJ_E zv*+FdjUH33e3Rcy?s3-bp8EpZdzt+P1~zuu;w|_j5DK-3KJxIAcs}{mU8&E|eTImYwsixw0Qb8LWc_@wvMbR0mqwwPbX)kOkQE1R>RCA*C^j(g zIf9f)vPE!P&^Bi&R{p}CJ7K|X)rTE=W<|Sfb6~FhwIKEVhmNx`cYf1Dno>FDwhZo) zj5M14e?LN|4}1!sxL~`n*Du&O^UT2X=~f^=OC?vKF&5ga6T~%pMK{wl2_AjOpX6O2 zwBSN8d*l&gNRr$jSp-3um>pY(#RQU8N<*2Bez#Q11Ysw*@Sa)#s6Pvc4GHfI3>mFT z=3&bQ71(1)^&Zm0oa^(l_J*&Bnbbn3+mQ&_qhv-@?7DD6TowKV=0d|606!Tpbq0|Q zSgw>mb_GpXU_$4ry%HB?NuYzs_VIESIQ)Tq-!pKqe2l{IFYiUFZX%Q3xGQO-$n3lH=L;{i! zjLwqd<>?LmJzilPd`oX$DHC%%sNIS(4rrtzSbqQ7TYrC{tw|ASi(E=3arZa|G53}; zS`$%BR_cr_Ox)`{gSR{&$DOS7s)-(2(ud5AQ@oE+i#{DB!VR@FqsEjCWbLNI%_c)u zV`MCb4p-2`2pmP!RL96(T1hlpv&4TWTL`OpBbk}YSbtzIwhbJzp(CJPha@sVZp_ve zePPH2l*v>|loe%l%+QA8u^{S3q26~rYDrsyZwK;nD=|7$p~tQxO{kR-$0ags_$=n| ztQr;#o$fAv412I_4{O-;hJim4<1&a2^gK{1g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Hf zJ$QDMcPo^RYg*vTyZwEj9Iv;d0Entj`=wZ40o5YOa&OkH36Ypv16nH*=SoL@^_*RH0+Whhb;UQ+G+*UqnL zuKVjDL9)Mgw8^e$yF{}0Y`MOe5JgV5PixK7r+y=3K>K@<>s}b={2FCkJRtky39f&P zQg!)zl9fqyGbV|#%neBjs_pMhwnN2lPPPkZF`s*OsO>$ Date: Fri, 23 May 2014 16:24:43 +0100 Subject: [PATCH 49/50] 8042857: 14 stuck threads waiting for notification on LDAPRequest Reviewed-by: vinnie --- .../classes/com/sun/jndi/ldap/Connection.java | 4 +- .../com/sun/jndi/ldap/LdapTimeoutTest.java | 45 +++++++++++++++---- 2 files changed, 38 insertions(+), 11 deletions(-) diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/Connection.java b/jdk/src/share/classes/com/sun/jndi/ldap/Connection.java index 65a675ffdf5..a0643a6ad29 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/Connection.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/Connection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -459,10 +459,10 @@ public final class Connection implements Runnable { // will be woken up before readTimeout only if reply is // available ldr.wait(readTimeout); - waited = true; } else { ldr.wait(15 * 1000); // 15 second timeout } + waited = true; } else { break; } diff --git a/jdk/test/com/sun/jndi/ldap/LdapTimeoutTest.java b/jdk/test/com/sun/jndi/ldap/LdapTimeoutTest.java index 0db3ab9239c..39270374488 100644 --- a/jdk/test/com/sun/jndi/ldap/LdapTimeoutTest.java +++ b/jdk/test/com/sun/jndi/ldap/LdapTimeoutTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -64,11 +64,12 @@ public class LdapTimeoutTest { env.put(Context.SECURITY_PRINCIPAL, "user"); env.put(Context.SECURITY_CREDENTIALS, "password"); - env.put("com.sun.jndi.ldap.connect.timeout", "10"); - env.put("com.sun.jndi.ldap.read.timeout", "3000"); - InitialContext ctx = null; try { + new LdapTimeoutTest().deadServerNoTimeout(env); + + env.put("com.sun.jndi.ldap.connect.timeout", "10"); + env.put("com.sun.jndi.ldap.read.timeout", "3000"); new LdapTimeoutTest().ldapReadTimeoutTest(env, false); new LdapTimeoutTest().ldapReadTimeoutTest(env, true); new LdapTimeoutTest().simpleAuthConnectTest(env); @@ -84,7 +85,7 @@ public class LdapTimeoutTest { void ldapReadTimeoutTest(Hashtable env, boolean ssl) { InitialContext ctx = null; if (ssl) env.put(Context.SECURITY_PROTOCOL, "ssl"); - ScheduledFuture killer = killSwitch(); + ScheduledFuture killer = killSwitch(5000); long start = System.nanoTime(); try { ctx = new InitialDirContext(env); @@ -112,7 +113,7 @@ public class LdapTimeoutTest { void simpleAuthConnectTest(Hashtable env) { InitialContext ctx = null; - ScheduledFuture killer = killSwitch(); + ScheduledFuture killer = killSwitch(5000); long start = System.nanoTime(); try { ctx = new InitialDirContext(env); @@ -139,6 +140,32 @@ public class LdapTimeoutTest { } } + void deadServerNoTimeout(Hashtable env) { + InitialContext ctx = null; + ScheduledFuture killer = killSwitch(30000); + long start = System.nanoTime(); + try { + ctx = new InitialDirContext(env); + SearchControls scl = new SearchControls(); + scl.setSearchScope(SearchControls.SUBTREE_SCOPE); + NamingEnumeration answer = ((InitialDirContext)ctx) + .search("ou=People,o=JNDITutorial", "(objectClass=*)", scl); + // shouldn't reach here + fail(); + } catch (NamingException e) { + long end = System.nanoTime(); + if (TimeUnit.NANOSECONDS.toMillis(end - start) < 14000) { + System.err.println("fail: timeout should be at least 15 seconds, actual time: " + + TimeUnit.NANOSECONDS.toMillis(end - start)); + fail(); + } else { + pass(); + } + } finally { + if (!shutItDown(killer, ctx)) fail(); + } + } + boolean shutItDown(ScheduledFuture killer, InitialContext ctx) { killer.cancel(true); try { @@ -149,15 +176,15 @@ public class LdapTimeoutTest { } } - ScheduledFuture killSwitch() { + ScheduledFuture killSwitch(int ms) { final Thread current = Thread.currentThread(); return LdapTimeoutTest.pool.schedule(new Callable() { public Void call() throws Exception { System.err.println("Fail: killSwitch()"); - current.interrupt(); + System.exit(0); return null; } - }, 5000, TimeUnit.MILLISECONDS); + }, ms, TimeUnit.MILLISECONDS); } static class Server extends Thread { From 7f334fe1a10fdc7b5a830f5740602ff3e63bfeca Mon Sep 17 00:00:00 2001 From: Rob McKenna Date: Fri, 23 May 2014 19:42:16 +0100 Subject: [PATCH 50/50] 8041451: com.sun.jndi.ldap.Connection:ReadTimeout should abandon ldap request Reviewed-by: vinnie --- jdk/src/share/classes/com/sun/jndi/ldap/Connection.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/Connection.java b/jdk/src/share/classes/com/sun/jndi/ldap/Connection.java index a0643a6ad29..d41c94480e9 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/Connection.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/Connection.java @@ -474,7 +474,7 @@ public final class Connection implements Runnable { } if ((rber == null) && waited) { - removeRequest(ldr); + abandonRequest(ldr, null); throw new NamingException("LDAP response read timed out, timeout used:" + readTimeout + "ms." );