equal
deleted
inserted
replaced
1121 * |
1121 * |
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 = AccessController |
1126 String hostsFileName = |
1127 .doPrivileged(new GetPropertyAction("jdk.net.hosts.file")); |
1127 GetPropertyAction.getProperty("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 = AccessController.doPrivileged( |
1646 String prefix = GetPropertyAction.getProperty("impl.prefix", ""); |
1647 new GetPropertyAction("impl.prefix", "")); |
|
1648 try { |
1647 try { |
1649 impl = Class.forName("java.net." + prefix + implName).newInstance(); |
1648 impl = Class.forName("java.net." + prefix + implName).newInstance(); |
1650 } catch (ClassNotFoundException e) { |
1649 } catch (ClassNotFoundException e) { |
1651 System.err.println("Class not found: java.net." + prefix + |
1650 System.err.println("Class not found: java.net." + prefix + |
1652 implName + ":\ncheck impl.prefix property " + |
1651 implName + ":\ncheck impl.prefix property " + |