-
Bug
-
Resolution: Fixed
-
P3
-
1.2.0
-
swing0.7
-
sparc
-
solaris_2.5
-
Verified
Name: asC58863 Date: 12/24/97
java.awt.swing.ViewportLayout.preferredLayoutSize(parent) throws
undocumented NullPointerException in case parent.getView() returns null.
Here is the test demonstrating the bug:
-----------------Test.java------------------------
import java.awt.swing.*;
class Test {
public static void main(String[] argv) {
ViewportLayout layout = new ViewportLayout();
JViewport parent = new JViewport();
parent.setView( null);
try {
layout.preferredLayoutSize(parent);
System.out.println(" OKAY ");
} catch(NullPointerException e) {
System.out.println(" FAILED : "+e+" has been thrown");
}
System.exit(0);
}
}
---------Output from the test---------------------
FAILED : java.lang.NullPointerException has been thrown
--------------------------------------------------
======================================================================