8147400: Deprecate policytool

Reviewed-by: xuelei, mullan
This commit is contained in:
Weijun Wang 2016-01-27 21:59:00 +08:00
parent e9df200123
commit c1d20c94d3

View File

@ -65,8 +65,11 @@ import javax.swing.border.EmptyBorder;
* *
* @see java.security.Policy * @see java.security.Policy
* @since 1.2 * @since 1.2
* @deprecated The policytool tool has been deprecated and
* is planned to be removed in a future release.
*/ */
@Deprecated
public class PolicyTool { public class PolicyTool {
// for i18n // for i18n
@ -738,6 +741,8 @@ public class PolicyTool {
* run the PolicyTool * run the PolicyTool
*/ */
public static void main(String args[]) { 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); parseArgs(args);
SwingUtilities.invokeLater(new Runnable() { SwingUtilities.invokeLater(new Runnable() {
public void run() { public void run() {
@ -873,6 +878,7 @@ public class PolicyTool {
* The Permission contains the (Type, Name, Action) triplet. * The Permission contains the (Type, Name, Action) triplet.
* *
*/ */
@SuppressWarnings("deprecation")
class PolicyEntry { class PolicyEntry {
private CodeSource codesource; private CodeSource codesource;
@ -1012,6 +1018,7 @@ class PolicyEntry {
/** /**
* The main window for the PolicyTool * The main window for the PolicyTool
*/ */
@SuppressWarnings("deprecation")
class ToolWindow extends JFrame { class ToolWindow extends JFrame {
// use serialVersionUID from JDK 1.2.2 for interoperability // use serialVersionUID from JDK 1.2.2 for interoperability
private static final long serialVersionUID = 5682568601210376777L; private static final long serialVersionUID = 5682568601210376777L;
@ -1549,6 +1556,7 @@ class ToolWindow extends JFrame {
/** /**
* General dialog window * General dialog window
*/ */
@SuppressWarnings("deprecation")
class ToolDialog extends JDialog { class ToolDialog extends JDialog {
// use serialVersionUID from JDK 1.2.2 for interoperability // use serialVersionUID from JDK 1.2.2 for interoperability
private static final long serialVersionUID = -372244357011301190L; private static final long serialVersionUID = -372244357011301190L;
@ -2912,6 +2920,7 @@ class ToolDialog extends JDialog {
/** /**
* Event handler for the PolicyTool window * Event handler for the PolicyTool window
*/ */
@SuppressWarnings("deprecation")
class ToolWindowListener implements WindowListener { class ToolWindowListener implements WindowListener {
private PolicyTool tool; private PolicyTool tool;
@ -2956,6 +2965,7 @@ class ToolWindowListener implements WindowListener {
/** /**
* Event handler for the Policy List * Event handler for the Policy List
*/ */
@SuppressWarnings("deprecation")
class PolicyListListener extends MouseAdapter implements ActionListener { class PolicyListListener extends MouseAdapter implements ActionListener {
private PolicyTool tool; private PolicyTool tool;
@ -2985,6 +2995,7 @@ class PolicyListListener extends MouseAdapter implements ActionListener {
/** /**
* Event handler for the File Menu * Event handler for the File Menu
*/ */
@SuppressWarnings("deprecation")
class FileMenuListener implements ActionListener { class FileMenuListener implements ActionListener {
private PolicyTool tool; private PolicyTool tool;
@ -3083,6 +3094,7 @@ class FileMenuListener implements ActionListener {
/** /**
* Event handler for the main window buttons and Edit Menu * Event handler for the main window buttons and Edit Menu
*/ */
@SuppressWarnings("deprecation")
class MainWindowListener implements ActionListener { class MainWindowListener implements ActionListener {
private PolicyTool tool; private PolicyTool tool;
@ -3158,6 +3170,7 @@ class MainWindowListener implements ActionListener {
* if edit is FALSE, then we are ADDing a new PolicyEntry, * if edit is FALSE, then we are ADDing a new PolicyEntry,
* so we only need to update the GUI listing. * so we only need to update the GUI listing.
*/ */
@SuppressWarnings("deprecation")
class AddEntryDoneButtonListener implements ActionListener { class AddEntryDoneButtonListener implements ActionListener {
private PolicyTool tool; private PolicyTool tool;
@ -3224,6 +3237,7 @@ class AddEntryDoneButtonListener implements ActionListener {
/** /**
* Event handler for ChangeKeyStoreOKButton button * Event handler for ChangeKeyStoreOKButton button
*/ */
@SuppressWarnings("deprecation")
class ChangeKeyStoreOKButtonListener implements ActionListener { class ChangeKeyStoreOKButtonListener implements ActionListener {
private PolicyTool tool; private PolicyTool tool;
@ -3270,6 +3284,7 @@ class ChangeKeyStoreOKButtonListener implements ActionListener {
/** /**
* Event handler for AddPrinButton button * Event handler for AddPrinButton button
*/ */
@SuppressWarnings("deprecation")
class AddPrinButtonListener implements ActionListener { class AddPrinButtonListener implements ActionListener {
private PolicyTool tool; private PolicyTool tool;
@ -3295,6 +3310,7 @@ class AddPrinButtonListener implements ActionListener {
/** /**
* Event handler for AddPermButton button * Event handler for AddPermButton button
*/ */
@SuppressWarnings("deprecation")
class AddPermButtonListener implements ActionListener { class AddPermButtonListener implements ActionListener {
private PolicyTool tool; private PolicyTool tool;
@ -3320,6 +3336,7 @@ class AddPermButtonListener implements ActionListener {
/** /**
* Event handler for AddPrinOKButton button * Event handler for AddPrinOKButton button
*/ */
@SuppressWarnings("deprecation")
class NewPolicyPrinOKButtonListener implements ActionListener { class NewPolicyPrinOKButtonListener implements ActionListener {
private PolicyTool tool; private PolicyTool tool;
@ -3383,6 +3400,7 @@ class NewPolicyPrinOKButtonListener implements ActionListener {
/** /**
* Event handler for AddPermOKButton button * Event handler for AddPermOKButton button
*/ */
@SuppressWarnings("deprecation")
class NewPolicyPermOKButtonListener implements ActionListener { class NewPolicyPermOKButtonListener implements ActionListener {
private PolicyTool tool; private PolicyTool tool;
@ -3446,6 +3464,7 @@ class NewPolicyPermOKButtonListener implements ActionListener {
/** /**
* Event handler for RemovePrinButton button * Event handler for RemovePrinButton button
*/ */
@SuppressWarnings("deprecation")
class RemovePrinButtonListener implements ActionListener { class RemovePrinButtonListener implements ActionListener {
private PolicyTool tool; private PolicyTool tool;
@ -3481,6 +3500,7 @@ class RemovePrinButtonListener implements ActionListener {
/** /**
* Event handler for RemovePermButton button * Event handler for RemovePermButton button
*/ */
@SuppressWarnings("deprecation")
class RemovePermButtonListener implements ActionListener { class RemovePermButtonListener implements ActionListener {
private PolicyTool tool; private PolicyTool tool;
@ -3523,6 +3543,7 @@ class RemovePermButtonListener implements ActionListener {
* GUI listing. If the user is editing an existing PolicyEntry, we * GUI listing. If the user is editing an existing PolicyEntry, we
* update both the GUI listing and the actual PolicyEntry. * update both the GUI listing and the actual PolicyEntry.
*/ */
@SuppressWarnings("deprecation")
class EditPrinButtonListener extends MouseAdapter implements ActionListener { class EditPrinButtonListener extends MouseAdapter implements ActionListener {
private PolicyTool tool; private PolicyTool tool;
@ -3569,6 +3590,7 @@ class EditPrinButtonListener extends MouseAdapter implements ActionListener {
* GUI listing. If the user is editing an existing PolicyEntry, we * GUI listing. If the user is editing an existing PolicyEntry, we
* update both the GUI listing and the actual PolicyEntry. * update both the GUI listing and the actual PolicyEntry.
*/ */
@SuppressWarnings("deprecation")
class EditPermButtonListener extends MouseAdapter implements ActionListener { class EditPermButtonListener extends MouseAdapter implements ActionListener {
private PolicyTool tool; private PolicyTool tool;
@ -3609,6 +3631,7 @@ class EditPermButtonListener extends MouseAdapter implements ActionListener {
/** /**
* Event handler for Principal Popup Menu * Event handler for Principal Popup Menu
*/ */
@SuppressWarnings("deprecation")
class PrincipalTypeMenuListener implements ItemListener { class PrincipalTypeMenuListener implements ItemListener {
private ToolDialog td; private ToolDialog td;
@ -3660,6 +3683,7 @@ class PrincipalTypeMenuListener implements ItemListener {
/** /**
* Event handler for Permission Popup Menu * Event handler for Permission Popup Menu
*/ */
@SuppressWarnings("deprecation")
class PermissionMenuListener implements ItemListener { class PermissionMenuListener implements ItemListener {
private ToolDialog td; private ToolDialog td;
@ -3734,6 +3758,7 @@ class PermissionMenuListener implements ItemListener {
/** /**
* Event handler for Permission Name Popup Menu * Event handler for Permission Name Popup Menu
*/ */
@SuppressWarnings("deprecation")
class PermissionNameMenuListener implements ItemListener { class PermissionNameMenuListener implements ItemListener {
private ToolDialog td; private ToolDialog td;
@ -3887,6 +3912,7 @@ class StatusOKButtonListener implements ActionListener {
/** /**
* Event handler for UserSaveYes button * Event handler for UserSaveYes button
*/ */
@SuppressWarnings("deprecation")
class UserSaveYesButtonListener implements ActionListener { class UserSaveYesButtonListener implements ActionListener {
private ToolDialog us; private ToolDialog us;
@ -3941,6 +3967,7 @@ class UserSaveYesButtonListener implements ActionListener {
/** /**
* Event handler for UserSaveNoButton * Event handler for UserSaveNoButton
*/ */
@SuppressWarnings("deprecation")
class UserSaveNoButtonListener implements ActionListener { class UserSaveNoButtonListener implements ActionListener {
private PolicyTool tool; private PolicyTool tool;
@ -3989,6 +4016,7 @@ class UserSaveCancelButtonListener implements ActionListener {
/** /**
* Event handler for ConfirmRemovePolicyEntryOKButtonListener * Event handler for ConfirmRemovePolicyEntryOKButtonListener
*/ */
@SuppressWarnings("deprecation")
class ConfirmRemovePolicyEntryOKButtonListener implements ActionListener { class ConfirmRemovePolicyEntryOKButtonListener implements ActionListener {
private PolicyTool tool; private PolicyTool tool;
@ -4144,6 +4172,7 @@ class AudioPerm extends Perm {
} }
} }
@SuppressWarnings("deprecation")
class AuthPerm extends Perm { class AuthPerm extends Perm {
AuthPerm() { AuthPerm() {
super(javax.security.auth.AuthPermission.class, super(javax.security.auth.AuthPermission.class,
@ -4216,6 +4245,7 @@ class FilePerm extends Perm {
} }
} }
@SuppressWarnings("deprecation")
class URLPerm extends Perm { class URLPerm extends Perm {
URLPerm() { URLPerm() {
super(java.net.URLPermission.class, super(java.net.URLPermission.class,
@ -4380,6 +4410,7 @@ class ReflectPerm extends Perm {
} }
} }
@SuppressWarnings("deprecation")
class RuntimePerm extends Perm { class RuntimePerm extends Perm {
RuntimePerm() { RuntimePerm() {
super(java.lang.RuntimePermission.class, super(java.lang.RuntimePermission.class,
@ -4420,6 +4451,7 @@ class RuntimePerm extends Perm {
} }
} }
@SuppressWarnings("deprecation")
class SecurityPerm extends Perm { class SecurityPerm extends Perm {
SecurityPerm() { SecurityPerm() {
super(java.security.SecurityPermission.class, super(java.security.SecurityPermission.class,