JDK-4461210 : Robot.delay() causes null pointer exception when XTEST extensions are not avail.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.3.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_7
  • CPU: sparc
  • Submitted: 2001-05-21
  • Updated: 2020-02-15
  • Resolved: 2020-02-15
Related Reports
Duplicate :  
Description

Name: yyT116575			Date: 05/21/2001


$ ./java -version
java version "1.3.0_02"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0_02)
Java HotSpot(TM) Client VM (build 1.3.0_02, mixed mode)
$ 


This may be a new bug ... or a duplicate of 4251318 ... it probably is a
duplicate if Robot.delay(int) spawns a child process.

The following program gets a null pointer exception when ran on a Solaris
machine via an X-Term on a PC:

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class Foo {
   
  private class Bar extends Thread {
    public void run() {
      Robot r = null;
      try {
        r = new Robot();
      } catch(Exception e) {
        System.out.println("ERROR!!!");
      }

      for (int i=0; i<10; i++) {
        System.out.println("Bar ["+i+"]");
        System.out.flush();
        r.delay(500);
      }
      System.exit(0);
    }
  }
   
  public void runFoo() {
    new Bar().start();
  }
   
  public static void main(String[] args) {
    Foo f = new Foo();
    f.runFoo();
  }
}


The output is:

Bar [0]
java.lang.NullPointerException
        at Foo$Bar.run(Foo.java:13)
(Review ID: 124648) 
======================================================================

Comments
Fixed as part of JDK-6287244
15-02-2020

EVALUATION Commit to fix in merlin (NPE) eric.hawkes@eng 2001-05-22 Can the submitter please include the output from 'xdpyinfo' command executed on the xterm used for this bug. I want to check if XTEST is listed. richard.ray@eng 2001-05-23 On Solaris find... /usr/openwin/bin/xdpyinfo I will need the output for this on the Solaris machine that is failing. I suspect that XTEST is not supported with X-Term being used on the PC. Robot requires that the XTEST extensions be installed. Please have the submitter insure that XTEST extensions are included with the XTerm emulator used on the PC. richard.ray@eng 2001-05-29 XTEST is not listed in the submitters output from 'xdpyinfo'. XTEST is required for Robot to work on Solaris/XTERM. Lowering the priority of the bug. richard.ray@eng 2001-05-30
29-05-2001