src/share/classes/java/net/SocketPermission.java

Print this page

        

@@ -136,11 +136,11 @@
  *
  * @serial exclude
  */
 
 public final class SocketPermission extends Permission
-implements java.io.Serializable
+    implements java.io.Serializable
 {
     private static final long serialVersionUID = -7204263841984476862L;
 
     /**
      * Connect to host:port

@@ -230,12 +230,11 @@
         Boolean tmp = java.security.AccessController.doPrivileged(
                 new sun.security.action.GetBooleanAction("sun.net.trustNameService"));
         trustNameService = tmp.booleanValue();
     }
 
-    private static synchronized Debug getDebug()
-    {
+    private static synchronized Debug getDebug() {
         if (!debugInit) {
             debug = Debug.getInstance("access");
             debugInit = true;
         }
         return debug;

@@ -286,12 +285,11 @@
 
     private void setDeny() {
         defaultDeny = true;
     }
 
-    private static String getHost(String host)
-    {
+    private static String getHost(String host) {
         if (host.equals("")) {
             return "localhost";
         } else {
             /* IPv6 literal address used in this context should follow
              * the format specified in RFC 2732;

@@ -808,11 +806,10 @@
      * @param p the permission to check against.
      *
      * @return true if the specified permission is implied by this object,
      * false if not.
      */
-
     public boolean implies(Permission p) {
         int i,j;
 
         if (!(p instanceof SocketPermission))
             return false;

@@ -842,16 +839,15 @@
      *      attempt to match based on the wildcard.
      * <li> If this object was not initialized with an IP address, attempt
      *      to find a match based on the IP addresses in both objects.
      * <li> Attempt to match on the canonical hostnames of both objects.
      * </ul>
-     * @param p the incoming permission request
+     * @param that the incoming permission request
      *
      * @return true if "permission" is a proper subset of the current object,
      * false if not.
      */
-
     boolean impliesIgnoreMask(SocketPermission that) {
         int i,j;
 
         if ((that.mask & RESOLVE) != that.mask) {
             // check port range

@@ -1227,11 +1223,11 @@
  *
  * @serial include
  */
 
 final class SocketPermissionCollection extends PermissionCollection
-implements Serializable
+    implements Serializable
 {
     // Not serialized; see serialization section at end of class
     private transient List<SocketPermission> perms;
 
     /**

@@ -1253,13 +1249,11 @@
      *                                       SocketPermission
      *
      * @exception SecurityException - if this SocketPermissionCollection object
      *                                has been marked readonly
      */
-
-    public void add(Permission permission)
-    {
+    public void add(Permission permission) {
         if (! (permission instanceof SocketPermission))
             throw new IllegalArgumentException("invalid permission: "+
                                                permission);
         if (isReadOnly())
             throw new SecurityException(

@@ -1274,11 +1268,11 @@
 
     /**
      * Check and see if this collection of permissions implies the permissions
      * expressed in "permission".
      *
-     * @param p the Permission object to compare
+     * @param permission the Permission object to compare
      *
      * @return true if "permission" is a proper subset of a permission in
      * the collection, false if not.
      */
 

@@ -1367,12 +1361,13 @@
     }
 
     /*
      * Reads in a Vector of SocketPermissions and saves them in the perms field.
      */
-    private void readObject(ObjectInputStream in) throws IOException,
-    ClassNotFoundException {
+    private void readObject(ObjectInputStream in)
+        throws IOException, ClassNotFoundException
+    {
         // Don't call in.defaultReadObject()
 
         // Read in serialized fields
         ObjectInputStream.GetField gfields = in.readFields();