JDK-4178887 : win32: Need AWTEvent.copyPrivateDataInto()
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.2.0
  • Priority: P1
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_nt
  • CPU: sparc
  • Submitted: 1998-10-05
  • Updated: 1999-01-15
  • Resolved: 1999-01-15
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.2.0 1.2fcsFixed
Related Reports
Relates :  
Description
-----------------------------------------------------------------------
jethro 5Oct98

We are not properly cloning native data when AWTEvents are cloned.
Cloning is used extensively with lightweight components, and not
cloning the private data is causing drag and drop to fail on
Motif (see bug 4177037). To make this work everywhere, we need
a native copyDataFieldInto() method on all platforms, including
win32.

The java method signature looks like this:

    private native void copyDataFieldInto(AWTEvent that);


The native method looks something like this:

/*
 * Class:     java_awt_AWTEvent
 * Method:    copyDataFieldInto
 * Signature: ()V
 *
 * Allocates a copy of the data instance variable and copies it
 * from thisEvent into thatEvent. If data is null, thatEvent's
 * data field is also set to NULL.
 */
JNIEXPORT void JNICALL
Java_java_awt_AWTEvent_copyDataFieldInto
  (JNIEnv *env, jobject thisEvent, jobject thatEvent) {

    /* on win32, AWTEvent.data is of type (MSG*) */
    MSG *pThisData = NULL;
    MSG *pThatData = NULL;
    AWT_LOCK();
    pThisData = (void *)(*env)->GetLongField(env, thisEvent, awtEventIDs.data);
    if (pThisData != NULL) {
	/***** 
         ***** ALLOCATE/CLONE pThisData to pThatData 
         *****/
    }
    (*env)->SetLongField(env, thatEvent, awtEventIDs.data, (jlong)pThatData);
    AWT_UNLOCK();
} /* AWTEvent_copyDataFieldInto() */

-----------------------------------------------------------------------

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: 1.2fcs FIXED IN: 1.2fcs INTEGRATED IN: 1.2fcs
14-06-2004

EVALUATION ------------------------------------------------------------------------ jethro 5Oct98 We should definitely do this. ------------------------------------------------------------------------ Okay, okay! Geez! :-) fred.ecks@Eng 1998-10-07
07-10-1998