< prev index next >

src/java.base/share/classes/java/net/InetAddress.java

Print this page




1692                                "in your properties file.");
1693         } catch (IllegalAccessException e) {
1694             System.err.println("Cannot access class: java.net." + prefix +
1695                                implName + ":\ncheck impl.prefix property " +
1696                                "in your properties file.");
1697         }
1698 
1699         if (impl == null) {
1700             try {
1701                 @SuppressWarnings("deprecation")
1702                 Object tmp = Class.forName(implName).newInstance();
1703                 impl = tmp;
1704             } catch (Exception e) {
1705                 throw new Error("System property impl.prefix incorrect");
1706             }
1707         }
1708 
1709         return (InetAddressImpl) impl;
1710     }
1711 
1712     private void readObjectNoData () throws
1713                          IOException, ClassNotFoundException {
1714         if (getClass().getClassLoader() != null) {
1715             throw new SecurityException ("invalid address type");
1716         }
1717     }
1718 
1719     private static final jdk.internal.misc.Unsafe UNSAFE
1720             = jdk.internal.misc.Unsafe.getUnsafe();
1721     private static final long FIELDS_OFFSET
1722             = UNSAFE.objectFieldOffset(InetAddress.class, "holder");
1723 
1724     private void readObject (ObjectInputStream s) throws
1725                          IOException, ClassNotFoundException {
1726         if (getClass().getClassLoader() != null) {
1727             throw new SecurityException ("invalid address type");
1728         }
1729         GetField gf = s.readFields();
1730         String host = (String)gf.get("hostName", null);
1731         int address= gf.get("address", 0);
1732         int family= gf.get("family", 0);
1733         InetAddressHolder h = new InetAddressHolder(host, address, family);




1692                                "in your properties file.");
1693         } catch (IllegalAccessException e) {
1694             System.err.println("Cannot access class: java.net." + prefix +
1695                                implName + ":\ncheck impl.prefix property " +
1696                                "in your properties file.");
1697         }
1698 
1699         if (impl == null) {
1700             try {
1701                 @SuppressWarnings("deprecation")
1702                 Object tmp = Class.forName(implName).newInstance();
1703                 impl = tmp;
1704             } catch (Exception e) {
1705                 throw new Error("System property impl.prefix incorrect");
1706             }
1707         }
1708 
1709         return (InetAddressImpl) impl;
1710     }
1711 
1712     private void readObjectNoData () {

1713         if (getClass().getClassLoader() != null) {
1714             throw new SecurityException ("invalid address type");
1715         }
1716     }
1717 
1718     private static final jdk.internal.misc.Unsafe UNSAFE
1719             = jdk.internal.misc.Unsafe.getUnsafe();
1720     private static final long FIELDS_OFFSET
1721             = UNSAFE.objectFieldOffset(InetAddress.class, "holder");
1722 
1723     private void readObject (ObjectInputStream s) throws
1724                          IOException, ClassNotFoundException {
1725         if (getClass().getClassLoader() != null) {
1726             throw new SecurityException ("invalid address type");
1727         }
1728         GetField gf = s.readFields();
1729         String host = (String)gf.get("hostName", null);
1730         int address= gf.get("address", 0);
1731         int family= gf.get("family", 0);
1732         InetAddressHolder h = new InetAddressHolder(host, address, family);


< prev index next >