--- old/src/java.desktop/share/classes/java/awt/Taskbar.java 2016-08-31 01:40:01.000000000 +0300 +++ new/src/java.desktop/share/classes/java/awt/Taskbar.java 2016-08-31 01:40:01.000000000 +0300 @@ -179,17 +179,20 @@ /** * Calls to the security manager's {@code checkPermission} method with - * an {@code AWTPermission("showWindowWithoutWarningBanner")} - * permission. + * an {@code AWTPermission("showWindowWithoutWarningBanner")} and an + * {@code AWTPermission("canProcessApplicationEvents")} + * permissions. */ - private void checkAWTPermission(){ + private void checkPermissions(){ SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(new AWTPermission( + "canProcessApplicationEvents")); + sm.checkPermission(new AWTPermission( "showWindowWithoutWarningBanner")); } } - + private Taskbar() { Toolkit defaultToolkit = Toolkit.getDefaultToolkit(); if (defaultToolkit instanceof SunToolkit) { @@ -262,12 +265,13 @@ * @param enabled disables this request if false * @param critical if this is an important request * @throws SecurityException if a security manager exists and it denies the - * {@code AWTPermission("showWindowWithoutWarningBanner")} permission. + * {@code AWTPermission("showWindowWithoutWarningBanner")} or the + * {@code RuntimePermission("canProcessApplicationEvents")} permission. * @throws UnsupportedOperationException if the current platform * does not support the {@link Taskbar.Feature#USER_ATTENTION} feature */ public void requestUserAttention(final boolean enabled, final boolean critical) { - checkAWTPermission(); + checkPermissions(); checkFeatureSupport(Feature.USER_ATTENTION); peer.requestUserAttention(enabled, critical); } @@ -279,12 +283,13 @@ * * @param w window * @throws SecurityException if a security manager exists and it denies the - * {@code AWTPermission("showWindowWithoutWarningBanner")} permission. + * {@code AWTPermission("showWindowWithoutWarningBanner")} or the + * {@code RuntimePermission("canProcessApplicationEvents")} permission. * @throws UnsupportedOperationException if the current platform * does not support the {@link Taskbar.Feature#USER_ATTENTION_WINDOW} feature */ public void requestWindowUserAttention(Window w) { - checkAWTPermission(); + checkPermissions(); checkFeatureSupport(Feature.USER_ATTENTION_WINDOW); peer.requestWindowUserAttention(w); } @@ -295,12 +300,13 @@ * * @param menu the PopupMenu to attach to this application * @throws SecurityException if a security manager exists and it denies the - * {@code AWTPermission("showWindowWithoutWarningBanner")} permission. + * {@code AWTPermission("showWindowWithoutWarningBanner")} or the + * {@code RuntimePermission("canProcessApplicationEvents")} permission. * @throws UnsupportedOperationException if the current platform * does not support the {@link Taskbar.Feature#MENU} feature */ public void setMenu(final PopupMenu menu) { - checkAWTPermission(); + checkPermissions(); checkFeatureSupport(Feature.MENU); peer.setMenu(menu); } @@ -310,12 +316,13 @@ * * @return the PopupMenu * @throws SecurityException if a security manager exists and it denies the - * {@code AWTPermission("showWindowWithoutWarningBanner")} permission. + * {@code AWTPermission("showWindowWithoutWarningBanner")} or the + * {@code RuntimePermission("canProcessApplicationEvents")} permission. * @throws UnsupportedOperationException if the current platform * does not support the {@link Taskbar.Feature#MENU} feature */ public PopupMenu getMenu() { - checkAWTPermission(); + checkPermissions(); checkFeatureSupport(Feature.MENU); return peer.getMenu(); } @@ -325,12 +332,13 @@ * * @param image to change * @throws SecurityException if a security manager exists and it denies the - * {@code AWTPermission("showWindowWithoutWarningBanner")} permission. + * {@code AWTPermission("showWindowWithoutWarningBanner")} or the + * {@code RuntimePermission("canProcessApplicationEvents")} permission. * @throws UnsupportedOperationException if the current platform * does not support the {@link Taskbar.Feature#ICON_IMAGE} feature */ public void setIconImage(final Image image) { - checkAWTPermission(); + checkPermissions(); checkFeatureSupport(Feature.ICON_IMAGE); peer.setIconImage(image); } @@ -340,12 +348,13 @@ * * @return an image of this application's icon * @throws SecurityException if a security manager exists and it denies the - * {@code AWTPermission("showWindowWithoutWarningBanner")} permission. + * {@code AWTPermission("showWindowWithoutWarningBanner")} or the + * {@code RuntimePermission("canProcessApplicationEvents")} permission. * @throws UnsupportedOperationException if the current platform * does not support the {@link Taskbar.Feature#ICON_IMAGE} feature */ public Image getIconImage() { - checkAWTPermission(); + checkPermissions(); checkFeatureSupport(Feature.ICON_IMAGE); return peer.getIconImage(); } @@ -362,13 +371,14 @@ * Passing {@code null} as parameter hides the badge. * @param badge label to affix to the icon * @throws SecurityException if a security manager exists and it denies the - * {@code AWTPermission("showWindowWithoutWarningBanner")} permission. + * {@code AWTPermission("showWindowWithoutWarningBanner")} or the + * {@code RuntimePermission("canProcessApplicationEvents")} permission. * @throws UnsupportedOperationException if the current platform * 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(); + checkPermissions(); checkFeatureSupport(Feature.ICON_BADGE_NUMBER); peer.setIconBadge(badge); } @@ -381,12 +391,13 @@ * @param w window to update * @param badge image to affix to the icon * @throws SecurityException if a security manager exists and it denies the - * {@code AWTPermission("showWindowWithoutWarningBanner")} permission. + * {@code AWTPermission("showWindowWithoutWarningBanner")} or the + * {@code RuntimePermission("canProcessApplicationEvents")} permission. * @throws UnsupportedOperationException if the current platform * does not support the {@link Taskbar.Feature#ICON_BADGE_IMAGE_WINDOW} feature */ public void setWindowIconBadge(Window w, final Image badge) { - checkAWTPermission(); + checkPermissions(); checkFeatureSupport(Feature.ICON_BADGE_IMAGE_WINDOW); if (w != null) { peer.setWindowIconBadge(w, badge); @@ -398,11 +409,14 @@ * Affixes a small system-provided progress bar to this application's icon. * * @param value from 0 to 100, other to disable progress indication + * @throws SecurityException if a security manager exists and it denies the + * {@code AWTPermission("showWindowWithoutWarningBanner")} or the + * {@code RuntimePermission("canProcessApplicationEvents")} permission. * @throws UnsupportedOperationException if the current platform * does not support the {@link Taskbar.Feature#PROGRESS_VALUE} feature */ public void setProgressValue(int value) { - checkAWTPermission(); + checkPermissions(); checkFeatureSupport(Feature.PROGRESS_VALUE); peer.setProgressValue(value); } @@ -413,12 +427,13 @@ * @param w window to update * @param value from 0 to 100, other to disable progress indication * @throws SecurityException if a security manager exists and it denies the - * {@code AWTPermission("showWindowWithoutWarningBanner")} permission. + * {@code AWTPermission("showWindowWithoutWarningBanner")} or the + * {@code RuntimePermission("canProcessApplicationEvents")} permission. * @throws UnsupportedOperationException if the current platform * does not support the {@link Taskbar.Feature#PROGRESS_VALUE_WINDOW} feature */ public void setWindowProgressValue(Window w, int value) { - checkAWTPermission(); + checkPermissions(); checkFeatureSupport(Feature.PROGRESS_VALUE_WINDOW); if (w != null) { peer.setWindowProgressValue(w, value); @@ -436,12 +451,13 @@ * @see State#INDETERMINATE * @see State#ERROR * @throws SecurityException if a security manager exists and it denies the - * {@code AWTPermission("showWindowWithoutWarningBanner")} permission. + * {@code AWTPermission("showWindowWithoutWarningBanner")} or the + * {@code RuntimePermission("canProcessApplicationEvents")} permission. * @throws UnsupportedOperationException if the current platform * does not support the {@link Taskbar.Feature#PROGRESS_STATE_WINDOW} feature */ public void setWindowProgressState(Window w, State state) { - checkAWTPermission(); + checkPermissions(); checkFeatureSupport(Feature.PROGRESS_STATE_WINDOW); if (w != null) { peer.setWindowProgressState(w, state);