jdk/src/share/classes/java/net/SocketPermission.java
changeset 22341 4689530d03b9
parent 22339 e91bfaf4360d
child 22633 303b60d0f31a
equal deleted inserted replaced
22340:79163d48aeda 22341:4689530d03b9
    42 import java.io.ObjectOutputStream;
    42 import java.io.ObjectOutputStream;
    43 import java.io.ObjectInputStream;
    43 import java.io.ObjectInputStream;
    44 import java.io.IOException;
    44 import java.io.IOException;
    45 import sun.net.util.IPAddressUtil;
    45 import sun.net.util.IPAddressUtil;
    46 import sun.net.RegisteredDomain;
    46 import sun.net.RegisteredDomain;
       
    47 import sun.net.PortConfig;
    47 import sun.security.util.SecurityConstants;
    48 import sun.security.util.SecurityConstants;
    48 import sun.security.util.Debug;
    49 import sun.security.util.Debug;
    49 
    50 
    50 
    51 
    51 /**
    52 /**
  1215                             "jdk.net.ephemeralPortRange."+suffix, -1
  1216                             "jdk.net.ephemeralPortRange."+suffix, -1
  1216                     );
  1217                     );
  1217                     if (val != -1) {
  1218                     if (val != -1) {
  1218                         return val;
  1219                         return val;
  1219                     } else {
  1220                     } else {
  1220                         String prop = Security.getProperty(
  1221                         return suffix.equals("low") ?
  1221                             "network.ephemeralPortRange."+suffix
  1222                             PortConfig.getLower() : PortConfig.getUpper();
  1222                         );
       
  1223                         try {
       
  1224                                 val = Integer.parseInt(prop);
       
  1225                         } catch (NumberFormatException e) {
       
  1226                             // shouldn't happen
       
  1227                             return defval;
       
  1228                         }
       
  1229                     }
  1223                     }
  1230                     return val;
       
  1231                 }
  1224                 }
  1232             }
  1225             }
  1233         );
  1226         );
  1234     }
  1227     }
  1235 
  1228