8159374: Taskbar.setIconBadge() spec omits mention of exception for ICON_BADGE_TEXT feature
Reviewed-by: alexsch, ssadetsky
--- a/jdk/src/java.desktop/share/classes/java/awt/Taskbar.java Mon Jul 11 12:07:59 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/java/awt/Taskbar.java Tue Jul 12 14:13:48 2016 +0300
@@ -364,7 +364,8 @@
* @throws SecurityException if a security manager exists and it denies the
* {@code AWTPermission("showWindowWithoutWarningBanner")} permission.
* @throws UnsupportedOperationException if the current platform
- * does not support the {@link Taskbar.Feature#ICON_BADGE_NUMBER} feature
+ * does not support the {@link Taskbar.Feature#ICON_BADGE_NUMBER}
+ * or {@link Taskbar.Feature#ICON_BADGE_TEXT} feature
*/
public void setIconBadge(final String badge) {
checkAWTPermission();
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XTaskbarPeer.java Mon Jul 11 12:07:59 2016 -0700
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XTaskbarPeer.java Tue Jul 12 14:13:48 2016 +0300
@@ -107,6 +107,8 @@
val = Long.parseLong(badge);
visible = true;
} catch (NumberFormatException e) {
+ throw new UnsupportedOperationException("The " + Feature.ICON_BADGE_TEXT
+ + " feature is not supported on the current platform!");
}
}
setBadge(val, visible);