jdk/src/share/classes/java/security/Permission.java
changeset 2172 2e7377d894db
parent 2 90ce3da70b43
child 5506 202f599c92aa
--- a/jdk/src/share/classes/java/security/Permission.java	Fri Feb 27 16:34:19 2009 -0800
+++ b/jdk/src/share/classes/java/security/Permission.java	Mon Mar 02 23:17:53 2009 +0800
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2003 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2009 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -214,18 +214,18 @@
     /**
      * Returns a string describing this Permission.  The convention is to
      * specify the class name, the permission name, and the actions in
-     * the following format: '("ClassName" "name" "actions")'.
+     * the following format: '("ClassName" "name" "actions")', or
+     * '("ClassName" "name")' if actions list is null or empty.
      *
      * @return information about this Permission.
      */
-
     public String toString() {
         String actions = getActions();
         if ((actions == null) || (actions.length() == 0)) { // OPTIONAL
-            return "(" + getClass().getName() + " " + name + ")";
+            return "(\"" + getClass().getName() + "\" \"" + name + "\")";
         } else {
-            return "(" + getClass().getName() + " " + name + " " +
-                actions + ")";
+            return "(\"" + getClass().getName() + "\" \"" + name +
+                 "\" \"" + actions + "\")";
         }
     }
 }