8159374: Taskbar.setIconBadge() spec omits mention of exception for ICON_BADGE_TEXT feature
authorazvegint
Tue, 12 Jul 2016 14:13:48 +0300
changeset 39854 28eb438b1368
parent 39853 a317160ac73b
child 39855 f8c20b96a710
8159374: Taskbar.setIconBadge() spec omits mention of exception for ICON_BADGE_TEXT feature Reviewed-by: alexsch, ssadetsky
jdk/src/java.desktop/share/classes/java/awt/Taskbar.java
jdk/src/java.desktop/unix/classes/sun/awt/X11/XTaskbarPeer.java
--- 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);