-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
1.4.0
-
sparc
-
solaris_2.6
Name: ssR10000 Date: 03/21/2001
The method SwingUtilities.calculateInnerArea(JComponent c, Rectangle r) throws NullPointerException when first arg is null.
But javadoc says:
Parameters:
c - the JComponent in question; if null, this method returns null
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
r - the Rectangle instance to be modified; may be null
Example:
-------------- Example ----
import javax.swing.*;
import java.awt.*;
public class Test {
public static void main(String argv[]) {
try {
Rectangle res = SwingUtilities.calculateInnerArea(null, null);
} catch (NullPointerException npe) {
npe.printStackTrace();
}
System.exit(0);
}
}
-------------- Output -----
<ssw@archer(pts/9).263> java -fullversion
java full version "1.4.0-beta-b55"
<ssw@archer(pts/9).264> java Test
java.lang.NullPointerException
at javax.swing.SwingUtilities.calculateInnerArea(SwingUtilities.java:1724)
at Test.main(Test.java:9)
-------------------
======================================================================
- duplicates
-
JDK-4422178 SwingUtilities.calculateInnerArea() throws NPE
-
- Resolved
-