jdk/src/java.base/share/classes/java/net/InetAddress.java
changeset 37781 71ed5645f17c
parent 37593 824750ada3d6
child 37782 ad8fe7507ecc
equal deleted inserted replaced
37780:06f3783b338f 37781:71ed5645f17c
  1122      * @return a NameService
  1122      * @return a NameService
  1123      */
  1123      */
  1124     private static NameService createNameService() {
  1124     private static NameService createNameService() {
  1125 
  1125 
  1126         String hostsFileName =
  1126         String hostsFileName =
  1127                 GetPropertyAction.getProperty("jdk.net.hosts.file");
  1127                 GetPropertyAction.privilegedGetProperty("jdk.net.hosts.file");
  1128         NameService theNameService;
  1128         NameService theNameService;
  1129         if (hostsFileName != null) {
  1129         if (hostsFileName != null) {
  1130             theNameService = new HostsFileNameService(hostsFileName);
  1130             theNameService = new HostsFileNameService(hostsFileName);
  1131         } else {
  1131         } else {
  1132             theNameService = new PlatformNameService();
  1132             theNameService = new PlatformNameService();
  1641          * of the implementation object we instantiate, to which we
  1641          * of the implementation object we instantiate, to which we
  1642          * delegate the real work (like native methods).  This
  1642          * delegate the real work (like native methods).  This
  1643          * property can vary across implementations of the java.
  1643          * property can vary across implementations of the java.
  1644          * classes.  The default is an empty String "".
  1644          * classes.  The default is an empty String "".
  1645          */
  1645          */
  1646         String prefix = GetPropertyAction.getProperty("impl.prefix", "");
  1646         String prefix = GetPropertyAction.privilegedGetProperty("impl.prefix", "");
  1647         try {
  1647         try {
  1648             impl = Class.forName("java.net." + prefix + implName).newInstance();
  1648             impl = Class.forName("java.net." + prefix + implName).newInstance();
  1649         } catch (ClassNotFoundException e) {
  1649         } catch (ClassNotFoundException e) {
  1650             System.err.println("Class not found: java.net." + prefix +
  1650             System.err.println("Class not found: java.net." + prefix +
  1651                                implName + ":\ncheck impl.prefix property " +
  1651                                implName + ":\ncheck impl.prefix property " +