jdk/src/share/classes/java/net/InetAddress.java
changeset 5180 8161f879d704
parent 2 90ce3da70b43
child 5506 202f599c92aa
--- a/jdk/src/share/classes/java/net/InetAddress.java	Tue Dec 01 08:55:15 2009 -0800
+++ b/jdk/src/share/classes/java/net/InetAddress.java	Wed Dec 02 12:17:42 2009 +0000
@@ -35,6 +35,7 @@
 import java.security.AccessController;
 import java.io.ObjectStreamException;
 import java.io.IOException;
+import java.io.ObjectInputStream;
 import sun.security.action.*;
 import sun.net.InetAddressCachePolicy;
 import sun.net.util.IPAddressUtil;
@@ -1472,6 +1473,23 @@
 
         return impl;
     }
+
+    private void readObjectNoData (ObjectInputStream s) throws
+                         IOException, ClassNotFoundException {
+        if (getClass().getClassLoader() != null) {
+            throw new SecurityException ("invalid address type");
+        }
+    }
+
+    private void readObject (ObjectInputStream s) throws
+                         IOException, ClassNotFoundException {
+        s.defaultReadObject ();
+        if (getClass().getClassLoader() != null) {
+            hostName = null;
+            address = 0;
+            throw new SecurityException ("invalid address type");
+        }
+    }
 }
 
 /*