5015261: NPE may be thrown if JDesktopIcon is set to null on a JInternalFrame
Reviewed-by: serb, prr, aivanov
This commit is contained in:
parent
9bc023220f
commit
22ef4f0653
@ -188,6 +188,8 @@ public class JInternalFrame extends JComponent implements
|
||||
protected String title;
|
||||
/**
|
||||
* The icon that is displayed when this internal frame is iconified.
|
||||
* Subclassers must ensure this is set to a non-null value
|
||||
* during construction and not subsequently set this to null.
|
||||
* @see #iconable
|
||||
*/
|
||||
protected JDesktopIcon desktopIcon;
|
||||
@ -1307,11 +1309,15 @@ public class JInternalFrame extends JComponent implements
|
||||
* <code>JInternalFrame</code>.
|
||||
*
|
||||
* @param d the <code>JDesktopIcon</code> to display on the desktop
|
||||
* @throws NullPointerException if the {@code d} is {@code null}
|
||||
* @see #getDesktopIcon
|
||||
*/
|
||||
@BeanProperty(description
|
||||
= "The icon shown when this internal frame is minimized.")
|
||||
public void setDesktopIcon(JDesktopIcon d) {
|
||||
if (d == null) {
|
||||
throw new NullPointerException("JDesktopIcon is null");
|
||||
}
|
||||
JDesktopIcon oldValue = getDesktopIcon();
|
||||
desktopIcon = d;
|
||||
firePropertyChange("desktopIcon", oldValue, d);
|
||||
|
Loading…
x
Reference in New Issue
Block a user