RFR 8147400: Deprecate policytool

Sean Mullan sean.mullan at oracle.com
Wed Jan 27 13:30:39 UTC 2016


Looks good to me.

--Sean

On 01/26/2016 04:56 AM, Wang Weijun wrote:
> Hi All
>
> Please review the patch below. Every change after line 873 is adding "@SuppressWarnings("deprecation")" to a top-level class that references the PolicyTool class. I wish they were static inner classes.
>
> We also planned to add "Note: The policytool tool has been deprecated since JDK 9 and is planned to be removed in the next major JDK release" to its man page inside Oracle JDK, but it's probably not good to mention JDK 9 and 10 inside openjdk source codes.
>
> Thanks
> Max
>
> diff --git a/src/jdk.policytool/share/classes/sun/security/tools/policytool/PolicyTool.java b/src/jdk.policytool/share/classes/sun/security/tools/policytool/PolicyTool.java
> --- a/src/jdk.policytool/share/classes/sun/security/tools/policytool/PolicyTool.java
> +++ b/src/jdk.policytool/share/classes/sun/security/tools/policytool/PolicyTool.java
> @@ -65,8 +65,11 @@
>    *
>    * @see java.security.Policy
>    * @since   1.2
> + * @deprecated The policytool tool has been deprecated and
> + * is planned to be removed in a future release.
>    */
>
> + at Deprecated
>   public class PolicyTool {
>
>       // for i18n
> @@ -738,6 +741,8 @@
>        * run the PolicyTool
>        */
>       public static void main(String args[]) {
> +        System.out.println("Note: The policytool tool has been deprecated and" +
> +                " is planned to be removed in a future release.\n");
>           parseArgs(args);
>           SwingUtilities.invokeLater(new Runnable() {
>               public void run() {
> @@ -873,6 +878,7 @@
>    * The Permission contains the (Type, Name, Action) triplet.
>    *
>    */
> + at SuppressWarnings("deprecation")
>   class PolicyEntry {
>
>       private CodeSource codesource;
> @@ -1012,6 +1018,7 @@
>   /**
>    * The main window for the PolicyTool
>    */
> + at SuppressWarnings("deprecation")
>   class ToolWindow extends JFrame {
>       // use serialVersionUID from JDK 1.2.2 for interoperability
>       private static final long serialVersionUID = 5682568601210376777L;
> @@ -1549,6 +1556,7 @@
>   /**
>    * General dialog window
>    */
> + at SuppressWarnings("deprecation")
>   class ToolDialog extends JDialog {
>       // use serialVersionUID from JDK 1.2.2 for interoperability
>       private static final long serialVersionUID = -372244357011301190L;
> @@ -2912,6 +2920,7 @@
>   /**
>    * Event handler for the PolicyTool window
>    */
> + at SuppressWarnings("deprecation")
>   class ToolWindowListener implements WindowListener {
>
>       private PolicyTool tool;
> @@ -2956,6 +2965,7 @@
>   /**
>    * Event handler for the Policy List
>    */
> + at SuppressWarnings("deprecation")
>   class PolicyListListener extends MouseAdapter implements ActionListener {
>
>       private PolicyTool tool;
> @@ -2985,6 +2995,7 @@
>   /**
>    * Event handler for the File Menu
>    */
> + at SuppressWarnings("deprecation")
>   class FileMenuListener implements ActionListener {
>
>       private PolicyTool tool;
> @@ -3083,6 +3094,7 @@
>   /**
>    * Event handler for the main window buttons and Edit Menu
>    */
> + at SuppressWarnings("deprecation")
>   class MainWindowListener implements ActionListener {
>
>       private PolicyTool tool;
> @@ -3158,6 +3170,7 @@
>    *    if edit is FALSE, then we are ADDing a new PolicyEntry,
>    *    so we only need to update the GUI listing.
>    */
> + at SuppressWarnings("deprecation")
>   class AddEntryDoneButtonListener implements ActionListener {
>
>       private PolicyTool tool;
> @@ -3224,6 +3237,7 @@
>   /**
>    * Event handler for ChangeKeyStoreOKButton button
>    */
> + at SuppressWarnings("deprecation")
>   class ChangeKeyStoreOKButtonListener implements ActionListener {
>
>       private PolicyTool tool;
> @@ -3270,6 +3284,7 @@
>   /**
>    * Event handler for AddPrinButton button
>    */
> + at SuppressWarnings("deprecation")
>   class AddPrinButtonListener implements ActionListener {
>
>       private PolicyTool tool;
> @@ -3295,6 +3310,7 @@
>   /**
>    * Event handler for AddPermButton button
>    */
> + at SuppressWarnings("deprecation")
>   class AddPermButtonListener implements ActionListener {
>
>       private PolicyTool tool;
> @@ -3320,6 +3336,7 @@
>   /**
>    * Event handler for AddPrinOKButton button
>    */
> + at SuppressWarnings("deprecation")
>   class NewPolicyPrinOKButtonListener implements ActionListener {
>
>       private PolicyTool tool;
> @@ -3383,6 +3400,7 @@
>   /**
>    * Event handler for AddPermOKButton button
>    */
> + at SuppressWarnings("deprecation")
>   class NewPolicyPermOKButtonListener implements ActionListener {
>
>       private PolicyTool tool;
> @@ -3446,6 +3464,7 @@
>   /**
>    * Event handler for RemovePrinButton button
>    */
> + at SuppressWarnings("deprecation")
>   class RemovePrinButtonListener implements ActionListener {
>
>       private PolicyTool tool;
> @@ -3481,6 +3500,7 @@
>   /**
>    * Event handler for RemovePermButton button
>    */
> + at SuppressWarnings("deprecation")
>   class RemovePermButtonListener implements ActionListener {
>
>       private PolicyTool tool;
> @@ -3523,6 +3543,7 @@
>    * GUI listing.  If the user is editing an existing PolicyEntry, we
>    * update both the GUI listing and the actual PolicyEntry.
>    */
> + at SuppressWarnings("deprecation")
>   class EditPrinButtonListener extends MouseAdapter implements ActionListener {
>
>       private PolicyTool tool;
> @@ -3569,6 +3590,7 @@
>    * GUI listing.  If the user is editing an existing PolicyEntry, we
>    * update both the GUI listing and the actual PolicyEntry.
>    */
> + at SuppressWarnings("deprecation")
>   class EditPermButtonListener extends MouseAdapter implements ActionListener {
>
>       private PolicyTool tool;
> @@ -3609,6 +3631,7 @@
>   /**
>    * Event handler for Principal Popup Menu
>    */
> + at SuppressWarnings("deprecation")
>   class PrincipalTypeMenuListener implements ItemListener {
>
>       private ToolDialog td;
> @@ -3660,6 +3683,7 @@
>   /**
>    * Event handler for Permission Popup Menu
>    */
> + at SuppressWarnings("deprecation")
>   class PermissionMenuListener implements ItemListener {
>
>       private ToolDialog td;
> @@ -3734,6 +3758,7 @@
>   /**
>    * Event handler for Permission Name Popup Menu
>    */
> + at SuppressWarnings("deprecation")
>   class PermissionNameMenuListener implements ItemListener {
>
>       private ToolDialog td;
> @@ -3887,6 +3912,7 @@
>   /**
>    * Event handler for UserSaveYes button
>    */
> + at SuppressWarnings("deprecation")
>   class UserSaveYesButtonListener implements ActionListener {
>
>       private ToolDialog us;
> @@ -3941,6 +3967,7 @@
>   /**
>    * Event handler for UserSaveNoButton
>    */
> + at SuppressWarnings("deprecation")
>   class UserSaveNoButtonListener implements ActionListener {
>
>       private PolicyTool tool;
> @@ -3989,6 +4016,7 @@
>   /**
>    * Event handler for ConfirmRemovePolicyEntryOKButtonListener
>    */
> + at SuppressWarnings("deprecation")
>   class ConfirmRemovePolicyEntryOKButtonListener implements ActionListener {
>
>       private PolicyTool tool;
> @@ -4144,6 +4172,7 @@
>       }
>   }
>
> + at SuppressWarnings("deprecation")
>   class AuthPerm extends Perm {
>       AuthPerm() {
>           super(javax.security.auth.AuthPermission.class,
> @@ -4216,6 +4245,7 @@
>       }
>   }
>
> + at SuppressWarnings("deprecation")
>   class URLPerm extends Perm {
>       URLPerm() {
>           super(java.net.URLPermission.class,
> @@ -4380,6 +4410,7 @@
>       }
>   }
>
> + at SuppressWarnings("deprecation")
>   class RuntimePerm extends Perm {
>       RuntimePerm() {
>           super(java.lang.RuntimePermission.class,
> @@ -4420,6 +4451,7 @@
>       }
>   }
>
> + at SuppressWarnings("deprecation")
>   class SecurityPerm extends Perm {
>       SecurityPerm() {
>           super(java.security.SecurityPermission.class,
>



More information about the security-dev mailing list