JDK-4031168 : java.awt.Toolkit.getDefaultToolkit prevents main from exiting
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.1
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_2.5
  • CPU: sparc
  • Submitted: 1997-02-10
  • Updated: 1997-02-11
  • Resolved: 1997-02-11
Related Reports
Duplicate :  
Description

Name: saC57035			Date: 02/10/97


This bug was found by St.Petersburg Java SQE team (by Dmitry A. Silaev).

If method java.awt.Toolkit.getDefaultToolkit is called inside of 'main' body,
finishing 'main' does not return to system prompt. 
System.exit, however, works fine in this case.

Here is the example demonstrating the bug:
______________________ Test.java _________________________________
import java.awt.*;
    
class Test {

public static void main(String[] args){
    System.out.println(Toolkit.getDefaultToolkit());
    System.out.println("OK");
}

}    
______________________ Output ________________________________________
% java Test
sun.awt.motif.MToolkit@ee3009b0
OK
^C%
______________________________________________________________________

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