7185678: java/awt/Menu/NullMenuLabelTest/NullMenuLabelTest.java failed with NPE
Reviewed-by: art, ahgross
--- a/jdk/src/solaris/classes/sun/awt/X11/XMenuItemPeer.java Mon Jul 23 15:51:46 2012 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XMenuItemPeer.java Wed Jul 25 19:46:00 2012 +0400
@@ -202,7 +202,8 @@
if (target == null) {
return "";
}
- return AWTAccessor.getMenuItemAccessor().getLabel(target);
+ String label = AWTAccessor.getMenuItemAccessor().getLabel(target);
+ return (label == null) ? "" : label;
}
boolean isTargetEnabled() {