@@ -1668,51 +1668,6 @@ static InetAddress anyLocalAddress() {
16681668 return impl .anyLocalAddress ();
16691669 }
16701670
1671- /*
1672- * Load and instantiate an underlying impl class
1673- */
1674- static InetAddressImpl loadImpl (String implName ) {
1675- Object impl = null ;
1676-
1677- /*
1678- * Property "impl.prefix" will be prepended to the classname
1679- * of the implementation object we instantiate, to which we
1680- * delegate the real work (like native methods). This
1681- * property can vary across implementations of the java.
1682- * classes. The default is an empty String "".
1683- */
1684- String prefix = GetPropertyAction .privilegedGetProperty ("impl.prefix" , "" );
1685- try {
1686- @ SuppressWarnings ("deprecation" )
1687- Object tmp = Class .forName ("java.net." + prefix + implName ).newInstance ();
1688- impl = tmp ;
1689- } catch (ClassNotFoundException e ) {
1690- System .err .println ("Class not found: java.net." + prefix +
1691- implName + ":\n check impl.prefix property " +
1692- "in your properties file." );
1693- } catch (InstantiationException e ) {
1694- System .err .println ("Could not instantiate: java.net." + prefix +
1695- implName + ":\n check impl.prefix property " +
1696- "in your properties file." );
1697- } catch (IllegalAccessException e ) {
1698- System .err .println ("Cannot access class: java.net." + prefix +
1699- implName + ":\n check impl.prefix property " +
1700- "in your properties file." );
1701- }
1702-
1703- if (impl == null ) {
1704- try {
1705- @ SuppressWarnings ("deprecation" )
1706- Object tmp = Class .forName (implName ).newInstance ();
1707- impl = tmp ;
1708- } catch (Exception e ) {
1709- throw new Error ("System property impl.prefix incorrect" );
1710- }
1711- }
1712-
1713- return (InetAddressImpl ) impl ;
1714- }
1715-
17161671 /**
17171672 * Initializes an empty InetAddress.
17181673 */
@@ -1793,8 +1748,8 @@ private void writeObject (ObjectOutputStream s) throws
17931748class InetAddressImplFactory {
17941749
17951750 static InetAddressImpl create () {
1796- return InetAddress . loadImpl ( isIPv6Supported () ?
1797- " Inet6AddressImpl" : " Inet4AddressImpl" );
1751+ return isIPv6Supported () ?
1752+ new Inet6AddressImpl () : new Inet4AddressImpl ( );
17981753 }
17991754
18001755 static native boolean isIPv6Supported ();
0 commit comments