--- a/jdk/src/share/classes/java/awt/SecondaryLoop.java Fri Dec 10 16:14:04 2010 -0800
+++ b/jdk/src/share/classes/java/awt/SecondaryLoop.java Mon Dec 13 16:21:36 2010 -0800
@@ -30,15 +30,15 @@
* <p>
* Objects that implement this interface are created with the
* {@link EventQueue#createSecondaryLoop} method. The interface
- * provides two methods, {@link enter} and {@link exit},
+ * provides two methods, {@link #enter} and {@link #exit},
* which can be used to start and stop the event loop.
* <p>
- * When the {@link enter} method is called, the current
+ * When the {@link #enter} method is called, the current
* thread is blocked until the loop is terminated by the
- * {@link exit} method. Also, a new event loop is started
+ * {@link #exit} method. Also, a new event loop is started
* on the event dispatch thread, which may or may not be
* the current thread. The loop can be terminated on any
- * thread by calling its {@link exit} method. After the
+ * thread by calling its {@link #exit} method. After the
* loop is terminated, the {@code SecondaryLoop} object can
* be reused to run a new nested event loop.
* <p>
@@ -102,7 +102,7 @@
* <p>
* This method can be called by any thread including the event
* dispatch thread. This thread will be blocked until the {@link
- * exit} method is called or the loop is terminated. A new
+ * #exit} method is called or the loop is terminated. A new
* secondary loop will be created on the event dispatch thread
* for dispatching events in either case.
* <p>
@@ -123,23 +123,23 @@
/**
* Unblocks the execution of the thread blocked by the {@link
- * enter} method and exits the secondary loop.
+ * #enter} method and exits the secondary loop.
* <p>
- * This method resumes the thread that called the {@link enter}
+ * This method resumes the thread that called the {@link #enter}
* method and exits the secondary loop that was created when
- * the {@link enter} method was invoked.
+ * the {@link #enter} method was invoked.
* <p>
* Note that if any other secondary loop is started while this
* loop is running, the blocked thread will not resume execution
* until the nested loop is terminated.
* <p>
* If this secondary loop has not been started with the {@link
- * enter} method, or this secondary loop has already finished
- * with the {@link exit} method, this method returns {@code
+ * #enter} method, or this secondary loop has already finished
+ * with the {@link #exit} method, this method returns {@code
* false}, otherwise {@code true} is returned.
*
* @return {@code true} if this loop was previously started and
- * has not yet been finished with the {@link exit} method,
+ * has not yet been finished with the {@link #exit} method,
* {@code false} otherwise
*/
public boolean exit();
--- a/jdk/src/share/classes/sun/applet/Main.java Fri Dec 10 16:14:04 2010 -0800
+++ b/jdk/src/share/classes/sun/applet/Main.java Mon Dec 13 16:21:36 2010 -0800
@@ -339,7 +339,7 @@
// Standard browser properties
avProps.put("browser", "sun.applet.AppletViewer");
avProps.put("browser.version", "1.06");
- avProps.put("browser.vendor", "Sun Microsystems Inc.");
+ avProps.put("browser.vendor", "Oracle Corporation");
avProps.put("http.agent", "Java(tm) 2 SDK, Standard Edition v" + theVersion);
// Define which packages can be extended by applets
--- a/jdk/src/share/classes/sun/awt/dnd/SunDropTargetContextPeer.java Fri Dec 10 16:14:04 2010 -0800
+++ b/jdk/src/share/classes/sun/awt/dnd/SunDropTargetContextPeer.java Mon Dec 13 16:21:36 2010 -0800
@@ -94,6 +94,11 @@
protected int dropStatus = STATUS_NONE;
protected boolean dropComplete = false;
+ // The flag is used to monitor whether the drop action is
+ // handled by a user. That allows to distinct during
+ // which operation getTransferData() method is invoked.
+ boolean dropInProcess = false;
+
/*
* global lock
*/
@@ -220,7 +225,7 @@
SecurityManager sm = System.getSecurityManager();
try {
- if (!dropComplete && sm != null) {
+ if (!dropInProcess && sm != null) {
sm.checkSystemClipboardAccess();
}
} catch (Exception e) {
@@ -526,6 +531,8 @@
setCurrentJVMLocalSourceTransferable(null);
}
+ dropInProcess = true;
+
try {
((DropTargetListener)dt).drop(new DropTargetDropEvent(dtc,
hots,
@@ -538,6 +545,7 @@
} else if (dropComplete == false) {
dropComplete(false);
}
+ dropInProcess = false;
}
} else {
rejectDrop();
--- a/jdk/src/solaris/classes/sun/awt/X11/MotifDnDDragSourceProtocol.java Fri Dec 10 16:14:04 2010 -0800
+++ b/jdk/src/solaris/classes/sun/awt/X11/MotifDnDDragSourceProtocol.java Mon Dec 13 16:21:36 2010 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -134,7 +134,8 @@
if (swapNeeded) {
t = MotifDnDConstants.Swapper.swap(t);
}
- long time = t;
+ long time = t & 0xffffffffL;
+ // with correction of (32-bit unsigned to 64-bit signed) implicit conversion.
/* Discard events from the previous receiver. */
if (targetEnterServerTime == XConstants.CurrentTime ||
--- a/jdk/src/solaris/classes/sun/awt/X11/MotifDnDDropTargetProtocol.java Fri Dec 10 16:14:04 2010 -0800
+++ b/jdk/src/solaris/classes/sun/awt/X11/MotifDnDDropTargetProtocol.java Mon Dec 13 16:21:36 2010 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -928,7 +928,9 @@
throw new IOException("Cannot get data: drag source property atom unavailable");
}
- long time_stamp = MotifDnDConstants.Swapper.getInt(data + 4, eventByteOrder);
+ long time_stamp = MotifDnDConstants.Swapper.getInt(data + 4, eventByteOrder) & 0xffffffffL;
+ // with correction of (32-bit unsigned to 64-bit signed) implicit conversion.
+
XAtom selectionAtom = XAtom.get(selatom);
XSelection selection = XSelection.getSelection(selectionAtom);
@@ -962,7 +964,9 @@
return false;
}
- long time_stamp = MotifDnDConstants.Swapper.getInt(data + 4, eventByteOrder);
+ long time_stamp = MotifDnDConstants.Swapper.getInt(data + 4, eventByteOrder) & 0xffffffffL;
+ // with correction of (32-bit unsigned to 64-bit signed) implicit conversion.
+
long sel_atom = MotifDnDConstants.Swapper.getInt(data + 12, eventByteOrder);
long status_atom = 0;
--- a/jdk/src/windows/classes/sun/awt/Win32GraphicsDevice.java Fri Dec 10 16:14:04 2010 -0800
+++ b/jdk/src/windows/classes/sun/awt/Win32GraphicsDevice.java Mon Dec 13 16:21:36 2010 -0800
@@ -30,6 +30,7 @@
import java.awt.GraphicsConfiguration;
import java.awt.GraphicsEnvironment;
import java.awt.DisplayMode;
+import java.awt.EventQueue;
import java.awt.Frame;
import java.awt.Rectangle;
import java.awt.Window;
@@ -610,11 +611,18 @@
*
* @param w full-screen window
*/
- protected void addFSWindowListener(Window w) {
+ protected void addFSWindowListener(final Window w) {
// Note: even though we create a listener for Window instances of
// fs windows they will not receive window events.
fsWindowListener = new Win32FSWindowAdapter(this);
- w.addWindowListener(fsWindowListener);
+
+ // Fix for 6709453. Using invokeLater to avoid listening
+ // for the events already posted to the queue.
+ EventQueue.invokeLater(new Runnable() {
+ public void run() {
+ w.addWindowListener(fsWindowListener);
+ }
+ });
}
/**