JDK-6990278 : Text selection in java.awt.TextField leads to AWT Assertion Failure at least in JDK7b88 +
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 7,8,9
  • Priority: P4
  • Status: Closed
  • Resolution: Cannot Reproduce
  • OS: windows
  • CPU: generic
  • Submitted: 2010-10-07
  • Updated: 2015-08-31
  • Resolved: 2015-08-31
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.
JDK 9
9 b79Resolved
Related Reports
Relates :  
Description
OS: Windows
PASSES: JDK6, JDK7b40
FAILS: at least JDK7b88+

TO REPRODUCE MANUALLY:
The following code sample shows an AWT text field. 
One of the possible ways to reproduce the failure is to select all the text in it with mouse by dragging mouse from the right to the left side of the text field. For fastdebug version of JDK a dialog will be shown offering debugging session.

--------------------------------------------------------------
import javax.swing.*;
import java.awt.*;
import java.lang.reflect.*;

public class TextFieldTest {
    public static void main(String[] args) throws Exception {
        SwingUtilities.invokeAndWait(new Runnable() {
            public void run() {
                Frame frame = new Frame();
                frame.add(new TextField("some text"));
                frame.pack();
                frame.setVisible(true);
            }
        });
    }
}
--------------------------------------------------------------

When the failure occures dialog will appear containing text:

*********************
AWT Assertion Failure
*********************
::GetScrollInfo(GetHWnd(), 0, &si)
File '../../../src/windows/native/sun/windows/awt_TextField.cpp', at line 255
GetLastError() is 5a7 : The window does not have scroll bars.

Do you want to break into the debugger?
*********************

Comments
This issue is not reproducible. Tested with below Windows-64 builds, 1. java version "1.9.0-ea-fastdebug" Java(TM) SE Runtime Environment (build 1.9.0-ea-fastdebug-b79) [Screenshot: Tested_With_jdk-9-ea-bin-b79-windows-x64-debug-26_aug_2015.png] 2. java version "1.8.0_66-fastdebug" Java(TM) SE Runtime Environment (build 1.8.0_66-fastdebug-b11) [Screenshot: Tested_With_jdk-8u66-windows-x64-debug.png]
31-08-2015

This issue is not reproducible. Please check the previous comment & attachments for reference.
31-08-2015

not a regression for 8 and 9
12-12-2014

- this is an issue reported against 7(7u), - there are now affected version 9 filed for this issue - 7u issues are transferred to Sustaining Nevertheless if someone have a report against 9 - please reopen and add affectedVersion 9 or 7u specific escalations might be reopen to Sustaining
10-08-2014

- this is an issue reported against 7(7u), - there are now affected version 9 filed for this issue - 7u issues are transferred to Sustaining Nevertheless if someone have a report against 9 - please reopen and add affectedVersion 9 or 7u specific escalations might be reopen to Sustaining
10-08-2014

EVALUATION The causing changeset is: changeset: 903:4dc625187820 date: Tue Mar 10 18:33:29 2009 +0300 summary: 6806217: implement synthetic focus model for MS Windows Before that change we've been checking for: if (!IsFocusable()) { <skip> VERIFY(::GetScrollInfo(GetHWnd(), SB_HORZ, &si)); After that change we started to check for: if (IsFocusingMouseMessage(msg)) { <skip> VERIFY(::GetScrollInfo(GetHWnd(), SB_HORZ, &si)); So far on receiving the mouse click (whatever) event we call the ::GetScrollInfo(args). If I changed the test for this CR in the way of making the TextField unfocusable I'd reproduce the defect with earlier than JDK7b55. So just make it: Frame frame = new Frame(); TextField tf = new TextField("some text"); tf.setFocusable(false); frame.add(tf); frame.pack(); frame.setVisible(true); For now I don't see reason to keep that call in.
09-11-2010

EVALUATION Got it. I've seen a CR related to that (affecting the scroll bar for the text widget) some time ago but can't find its #.
08-10-2010