Hi all,

This commit makes InetAddress throw InternalErrors instead of
RuntimeExceptions when stuff that shouldn't happen happens.
There's also a little javadoc fix in there.

Cheers,
Gary
Index: ChangeLog
===================================================================
RCS file: /cvsroot/classpath/classpath/ChangeLog,v
retrieving revision 1.8642
diff -u -r1.8642 ChangeLog
--- ChangeLog   3 Oct 2006 19:47:58 -0000       1.8642
+++ ChangeLog   4 Oct 2006 10:20:40 -0000
@@ -1,3 +1,8 @@
+2006-10-04  Gary Benson  <[EMAIL PROTECTED]>
+
+       * java/net/InetAddress.java: Updated javadoc.
+       (<clinit>, getByLiteral): Throw InternalError on failures.
+
 2006-10-03  Francis Kung  <[EMAIL PROTECTED]>
 
        * gnu/java/awt/peer/gtk/CairoGraphics2D.java
Index: java/net/InetAddress.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/net/InetAddress.java,v
retrieving revision 1.52
diff -u -r1.52 InetAddress.java
--- java/net/InetAddress.java   19 Sep 2006 08:55:29 -0000      1.52
+++ java/net/InetAddress.java   4 Oct 2006 10:20:40 -0000
@@ -59,7 +59,7 @@
  * @author Per Bothner
  * @author Gary Benson ([EMAIL PROTECTED])
  *
- * @specnote This class is not final since JK 1.4
+ * @specnote This class is not final since JDK 1.4
  */
 public class InetAddress implements Serializable
 {
@@ -87,7 +87,7 @@
       }
     catch (UnknownHostException e)
       {
-       throw new RuntimeException("should never happen", e);
+       throw (InternalError) new InternalError().initCause(e);
       }
     ANY_IF.hostName = ANY_IF.getHostName();
   }
@@ -104,7 +104,7 @@
       }
     catch (UnknownHostException e)
       {
-       throw new RuntimeException("should never happen", e);
+       throw (InternalError) new InternalError().initCause(e);
       }
   }    
 
@@ -522,7 +522,7 @@
       }
     catch (UnknownHostException e)
       {
-       throw new RuntimeException("should never happen", e);
+       throw (InternalError) new InternalError().initCause(e);
       }
   }
 

Reply via email to