-
Bug
-
Resolution: Cannot Reproduce
-
P4
-
None
-
1.3.0
-
x86
-
linux
Name: skR10017 Date: 06/29/2000
The following test shows that classic VM for Linux throws unexpected
NullPointerException.
This bug affects
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0beta-b09)
Classic VM (build 1.3.0beta-b09, green threads, nojit)
--------------------------test.java-----------------
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class test extends Thread {
static JFrame testerframe =null;
public static void main(String argv[]) {
testerframe = new JFrame();
testerframe.setLocation(100,0);
testerframe.setSize(new Dimension(100, 200));
testerframe.addComponentListener(new ComponentListener()
{
public void componentResized(ComponentEvent e)
{}
public void componentHidden(ComponentEvent e)
{}
public void componentMoved(ComponentEvent e)
{}
public void componentShown(ComponentEvent e)
{
String strInstr = "Test drag and drop(dnd) of text in ";
JTextArea jta = new JTextArea(strInstr);
JScrollPane scrollpane = new JScrollPane(jta);
scrollpane.setPreferredSize(new Dimension(100, 100));
scrollpane.setMinimumSize(new Dimension(100, 100));
testerframe.getContentPane().add(scrollpane);
test t = new test();
t.start();
}
} );
testerframe.show();
}
public void run() {
SwingUtilities.updateComponentTreeUI(testerframe);
}
}
-----------------------output------------------------------
[kotl@linux-4 new]$ java -classic test
Exception occurred during event dispatching:
java.lang.NullPointerException:
at javax.swing.plaf.metal.MetalScrollBarUI.paintThumb(MetalScrollBarUI.java:273)
at javax.swing.plaf.basic.BasicScrollBarUI.paint(BasicScrollBarUI.java:278)
at javax.swing.plaf.ComponentUI.update(ComponentUI.java:39)
at javax.swing.JComponent.paintComponent(JComponent.java:398)
at javax.swing.JComponent.paint(JComponent.java:739)
at javax.swing.JComponent.paintChildren(JComponent.java:523)
at javax.swing.JComponent.paint(JComponent.java:748)
at javax.swing.JComponent.paintWithBuffer(JComponent.java:4393)
at javax.swing.JComponent._paintImmediately(JComponent.java:4336)
at javax.swing.JComponent.paintImmediately(JComponent.java:4187)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:370)
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:205)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:154)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:317)
at java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:103)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:84)
[kotl@linux-4 new]$ java -hotspot test
[kotl@linux-4 new]$
--------------------------------------------------------------
I've found that this bug is reproducible only if
DISPLAY variable is set to the name of machine
where the test is executed:
---------------- output ------------------
[kotl@linux-14 dnd]$ export DISPLAY=linux-14:0
[kotl@linux-14 dnd]$ java -classic test
Exception occurred during event dispatching:
java.lang.NullPointerException:
at
javax.swing.plaf.metal.MetalScrollBarUI.paintThumb(MetalScrollBarUI.java:273)
at
javax.swing.plaf.basic.BasicScrollBarUI.paint(BasicScrollBarUI.java:278)
at javax.swing.plaf.ComponentUI.update(ComponentUI.java:39)
at javax.swing.JComponent.paintComponent(JComponent.java:398)
at javax.swing.JComponent.paint(JComponent.java:739)
at javax.swing.JComponent.paintChildren(JComponent.java:523)
at javax.swing.JComponent.paint(JComponent.java:748)
at javax.swing.JComponent.paintWithBuffer(JComponent.java:4393)
at
javax.swing.JComponent._paintImmediately(JComponent.java:4336)
at javax.swing.JComponent.paintImmediately(JComponent.java:4187)
at
javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:370)
at
javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:205)
at
java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:154)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:317)
at
java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:103)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:84)
[kotl@linux-14 dnd]$ export DISPLAY=linux-7:0
[kotl@linux-14 dnd]$ java -classic test
[kotl@linux-14 dnd]$
------------------------------------------------------
Sergei M. Kotlyachkov
###@###.### 2000-07-13