JDK-4752810 : REGRESSION: Regtest-test bug .../DelayedClassLoadingTest.sh fails on JDK1.4.2-b0
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.4.2
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_98,windows_2000,windows_xp
  • CPU: x86
  • Submitted: 2002-09-25
  • Updated: 2002-11-01
  • Resolved: 2002-10-18
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.4.2 mantisFixed
Related Reports
Relates :  
Description

Name: asR10013			Date: 09/24/2002


Filed By       : J2SE-SQA [###@###.###
JDK            : JDK1.4.2-b02
Testbase       : RegTest-test
Platform[s]    : Windows
Falling test[s]: 
        java/awt/dnd/DelayedClassLoadingTest/DelayedClassLoadingTest.sh

Regtest-test test java/awt/dnd/DelayedClassLoadingTest/DelayedClassLoadingTest.sh 
fails with JDK1.4.2-b02. The test used to pass with JDK1.4.1.

It worth to note that the test was written in response to bugid 4429868 which
asked not to load drag&drop classes just for the sake of optimization and for 
other platforms (Solaris/Linux).

jtr file location:
==================
/net/jtgb4u4c.eng/export/sail15/results/mantis/b02/regtest/win32/winXP_HE__linux-21/workDir/test/java/awt/dnd/DelayedClassLoadingTest/DelayedClassLoadingTest.jtr

How to reproduce:
=================
Run the following script (you may need to change its variables)
 
--- script start ---

#!/bin/bash

PS=';'
JAVA_BASE=h:/java

export TESTJAVA=$JAVA_BASE/jdk1.4.2/win32
TEST_BASE=$JAVA_BASE/regtest
JT=$JAVA_BASE/jct/lib/javatest.jar
JTREG=$JAVA_BASE/jct/lib/jtreg.jar

TEST_BASE_ROOT=$TEST_BASE/test
TEST_PACKAGE=java/awt/dnd/DelayedClassLoadingTest

TEST_SHORT_NAME=DelayedClassLoadingTest

TEST_NAME=$TEST_PACKAGE/$TEST_SHORT_NAME

export TESTSRC=$TEST_BASE_ROOT/$TEST_PACKAGE

export CLASSPATH=".${PS}${JDK}${PS}${JDK}/lib/tools.jar${PS}${TEST_BASE}${PS}${TESTSRC}${PS}${JT}${PS}${JTREG}"

$TESTJAVA/bin/javac -g -classpath "$CLASSPATH" -d . $TEST_BASE_ROOT/${TEST_NAME}.java

$TEST_BASE_ROOT/${TEST_NAME}.sh

--- script end ---

Test output:
============

JDK under test is: h:/java/jdk1.4.2/win32
cp: /*.class: The system cannot find the file specified.
cp: "h:/java/regtest/test/java/awt/dnd/DelayedClassLoadingTest/SCCS" is a directory (not copied)
[Loaded java.awt.dnd.peer.DragSourceContextPeer from H:\JAVA\JDK1.4.2\WIN32\JRE\lib\rt.jar]
[Loaded sun.awt.dnd.SunDragSourceContextPeer from H:\JAVA\JDK1.4.2\WIN32\JRE\lib\rt.jar]
The test failed :-(
Some datatransfer classes were loaded on startup
exit status was 1

======================================================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: mantis FIXED IN: mantis INTEGRATED IN: mantis mantis-b04 VERIFIED IN: mantis
24-08-2004

SUGGESTED FIX Name: agR10216 Date: 09/30/2002 First of all, remove '\r' characters from the file with DnD classes ('dnd.classes') to allow test failure detection. In order to fix 4613903 we must filter out all mouse events that are on the java event queue when drag is started. So we must trigger filtering of mouse events in an entry point of DnD operation. Any such entry point is a method of some DnD class, and the most approapriate DnD entry point is SunDragSourceContextPeer.startDrag(). Therefore we can not avoid loading of a DnD class or a new class that serves for wrapping and keeping the DnD class from being loaded. Let SunDragSourceContextPeer and DragSourceContextPeer are loaded. The fix is to remove these classes from the file 'dnd.classes', so they will not be checked for loading. ###@###.### 2002-09-27 ======================================================================
27-09-2002

EVALUATION Name: agR10216 Date: 09/25/2002 This is a regression introduced by the fix 4613903. The method SunDragSourceContextPeer.checkEvent() was added and it is called from the class EventDispatchThread. Since EventDispatchThread is loaded and resolved, SunDragSourceContextPeer and its superclass DragSourceContextPeer are loaded too. Actually this bug reproduces not only on Windows platforms. Those dnd classes are loaded on any platform. But the file with DnD classes (to check that they are not loaded) contains '\r' characters, and it prevents to detect test failure on Unix. ###@###.### 2002-09-25 ======================================================================
25-09-2002