Locale.java (Locale): Don't explicitly check for null.
authorTom Tromey <tromey@cygnus.com>
Thu, 4 May 2000 15:50:34 +0000 (15:50 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Thu, 4 May 2000 15:50:34 +0000 (15:50 +0000)
* java/util/Locale.java (Locale): Don't explicitly check for
null.
* java/util/Hashtable.java (containsKey): Don't explicitly check
for null.
(get): Likewise.
* java/util/BitSet.java (and, or, xor): Don't explicitly check for
null.
* java/util/zip/ZipEntry.java (ZipEntry): Don't explicitly check
for null.
* java/text/StringCharacterIterator.java
(StringCharacterIterator): Don't check for null.
* java/text/ChoiceFormat.java (setChoices): Don't explicitly check
for null pointer.
* java/net/MulticastSocket.java (joinGroup): Don't explicitly
check for null pointer.
(leaveGroup): Likewise.
* java/net/DatagramPacket.java (DatagramPacket): Removed erroneous
comment.
(setData): Likewise.
* java/lang/ThreadGroup.java (ThreadGroup): Don't explicitly check
for `p==null'.

From-SVN: r33671

libjava/ChangeLog
libjava/java/lang/ThreadGroup.java
libjava/java/net/DatagramPacket.java
libjava/java/net/MulticastSocket.java
libjava/java/text/ChoiceFormat.java
libjava/java/text/StringCharacterIterator.java
libjava/java/util/BitSet.java
libjava/java/util/Hashtable.java
libjava/java/util/Locale.java
libjava/java/util/zip/ZipEntry.java

index 3035ddabb8d5268dbfba517c5a59fec49bd30c5f..f2f293b1dc03b95d32f3f074ded88a28c4388974 100644 (file)
@@ -1,3 +1,38 @@
+2000-05-04  Tom Tromey  <tromey@cygnus.com>
+
+       * java/util/Locale.java (Locale): Don't explicitly check for
+       null.
+       * java/util/Hashtable.java (containsKey): Don't explicitly check
+       for null.
+       (get): Likewise.
+       * java/util/BitSet.java (and, or, xor): Don't explicitly check for
+       null.
+       * java/util/zip/ZipEntry.java (ZipEntry): Don't explicitly check
+       for null.
+       * java/text/StringCharacterIterator.java
+       (StringCharacterIterator): Don't check for null.
+       * java/text/ChoiceFormat.java (setChoices): Don't explicitly check
+       for null pointer.
+       * java/net/MulticastSocket.java (joinGroup): Don't explicitly
+       check for null pointer.
+       (leaveGroup): Likewise.
+       * java/net/DatagramPacket.java (DatagramPacket): Removed erroneous
+       comment.
+       (setData): Likewise.
+       * java/lang/ThreadGroup.java (ThreadGroup): Don't explicitly check
+       for `p==null'.
+
+2000-04-23  Tom Tromey  <tromey@cygnus.com>
+
+       * prims.cc (DECLARE_PRIM_TYPE): Define a vtable as well.
+       (_Jv_PrimClass): Set `methods' by calling _Jv_FindArrayClass.
+       * include/jvm.h (struct _Jv_ArrayVTable): Declare.
+       (NUM_OBJECT_METHODS): New define.
+       * java/lang/natClassLoader.cc (_Jv_FindArrayClass): Added
+       `array_vtable' parameter.  Added assertion.
+       * java/lang/Class.h (_Jv_FindArrayClass): Added `array_vtable'
+       parameter.
+
 2000-04-28  Jakub Jelinek  <jakub@redhat.com>
 
        * Makefile.am (GCJCOMPILE, JCFLAGS, JF1CLAGS, jv_convert_LINK,
index 73aa0449690853393c41f5ffbcfae5ff00c5eccc..f74c1943ecb1d14b5b34f50e886d953b33685a29 100644 (file)
@@ -1,6 +1,6 @@
 // ThreadGroup.java - ThreadGroup class.
 
-/* Copyright (C) 1998, 1999  Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000  Free Software Foundation
 
    This file is part of libgcj.
 
@@ -344,8 +344,6 @@ public class ThreadGroup
   public ThreadGroup (ThreadGroup p, String n)
   {
     checkAccess ();
-    if (p == null)
-      throw new NullPointerException ();
     if (p.destroyed_flag)
       throw new IllegalArgumentException ();
 
index d2abb7fa9a26619fffb3d5b2b6617b1ba21a8d6b..b08f6736e4f03f8f8f592c752e5b8d2e5958bb48 100644 (file)
@@ -1,6 +1,6 @@
 // DatagramPacket.java - Represents packets in a connectionless protocol.
 
-/* Copyright (C) 1999  Free Software Foundation
+/* Copyright (C) 1999, 2000  Free Software Foundation
 
    This file is part of libgcj.
 
@@ -32,8 +32,6 @@ public final class DatagramPacket
   // JDK1.2
   public DatagramPacket(byte[] buf, int offset, int length)
   {
-    // FIXME: We can't currently rely on NullPointerException being
-    // thrown when we invoke a method on a null object.
     if (buf == null)
       throw new NullPointerException("Null buffer");
     if (offset < 0)
@@ -60,8 +58,6 @@ public final class DatagramPacket
   public DatagramPacket(byte[] buf, int offset, int length,
        InetAddress address, int port)
   {
-    // FIXME: We can't currently rely on NullPointerException being
-    // thrown when we invoke a method on a null object.
     if (buf == null)
       throw new NullPointerException("Null buffer");
     if (offset < 0)
@@ -145,8 +141,6 @@ public final class DatagramPacket
   {
     // This form of setData must be used if offset is to be changed.
 
-    // FIXME: We can't currently rely on NullPointerException being
-    // thrown when we invoke a method on a null object.
     if (buf == null)
       throw new NullPointerException("Null buffer");
     if (offset < 0)
index 9da0aac1719ff5d1c27b211aafca4262fa1f3e16..c5bee02b33297b7015a96bf71bcb99358949cb6b 100644 (file)
@@ -1,6 +1,6 @@
 // MulticastSocket.java
 
-/* Copyright (C) 1999  Free Software Foundation
+/* Copyright (C) 1999, 2000  Free Software Foundation
 
    This file is part of libgcj.
 
@@ -84,10 +84,6 @@ public class MulticastSocket extends DatagramSocket
 
   public void joinGroup(InetAddress mcastaddr) throws IOException
   {
-    // FIXME: We can't currently rely on NullPointerException being
-    // thrown when we invoke a method on a null object.
-    if (mcastaddr == null)
-      throw new NullPointerException("Null address");
     if (! mcastaddr.isMulticastAddress())
       throw new IOException("Not a Multicast address");
 
@@ -100,10 +96,6 @@ public class MulticastSocket extends DatagramSocket
 
   public void leaveGroup(InetAddress mcastaddr) throws IOException
   {
-    // FIXME: We can't currently rely on NullPointerException being
-    // thrown when we invoke a method on a null object.
-    if (mcastaddr == null)
-      throw new NullPointerException("Null address");
     if (! mcastaddr.isMulticastAddress())
       throw new IOException("Not a Multicast address");
 
index 92b697c273f0d5049ba55753993ba32254bcfb47..b3bb8341deb63c61a6c33228a3fdd704fd45816f 100644 (file)
@@ -1,6 +1,6 @@
 // ChoiceFormat.java - Formatter for `switch'-like string substitution.
 
-/* Copyright (C) 1999  Free Software Foundation
+/* Copyright (C) 1999, 2000  Free Software Foundation
 
    This file is part of libgcj.
 
@@ -257,8 +257,6 @@ public class ChoiceFormat extends NumberFormat
 
   public void setChoices (double[] limits, String[] strings)
     {
-      if (limits == null || strings == null)
-       throw new NullPointerException ();
       if (limits.length != strings.length)
        throw new IllegalArgumentException ();
       this.strings = (String[]) strings.clone();
index c41ce4100fddf4895e5e6a7b4ea02a2ab876b700..dc02ce8628282c219a322ca8506132d2b3d6996f 100644 (file)
@@ -1,6 +1,6 @@
 // StringCharacterIterator.java - Iterate over string of Unicode characters.
 
-/* Copyright (C) 1999  Free Software Foundation
+/* Copyright (C) 1999, 2000  Free Software Foundation
 
    This file is part of libgcj.
 
@@ -106,20 +106,14 @@ public final class StringCharacterIterator implements CharacterIterator
 
   public StringCharacterIterator (String text)
     {
-      // FIXME: remove check for null once we have compiler/runtime
-      // support for NullPointerException.
-      this (text, 0, text == null ? 0 : text.length(), 0);
+      this (text, 0, text.length(), 0);
     }
   public StringCharacterIterator (String text, int pos)
     {
-      // FIXME: remove check for null once we have compiler/runtime
-      // support for NullPointerException.
-      this (text, 0, text == null ? 0 : text.length(), pos);
+      this (text, 0, text.length(), pos);
     }
   public StringCharacterIterator (String text, int begin, int end, int pos)
     {
-      if (text == null)
-       throw new NullPointerException ();
       if (begin < 0 || begin > end || end > text.length()
          // In 1.1 we would also throw if `pos == end'.
          || pos < begin || pos > end)
index 1a9e51b028574b3bf91fe80502824774f61cc7ea..56d89b116b60ca156274e2cbe8d6bae1370ad8f8 100644 (file)
@@ -1,6 +1,6 @@
 // BitSet - A vector of bits.
 
-/* Copyright (C) 1998, 1999  Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000  Free Software Foundation
 
    This file is part of libgcj.
 
@@ -24,8 +24,6 @@ public final class BitSet implements Cloneable, Serializable
 {
   public void and (BitSet bs)
     {
-      if (bs == null)
-       throw new NullPointerException ();
       int max = Math.min(bits.length, bs.bits.length);
       int i;
       for (i = 0; i < max; ++i)
@@ -110,8 +108,6 @@ public final class BitSet implements Cloneable, Serializable
 
   public void or (BitSet bs)
     {
-      if (bs == null)
-       throw new NullPointerException ();
       ensure (bs.bits.length - 1);
       int i;
       for (i = 0; i < bs.bits.length; ++i)
@@ -159,8 +155,6 @@ public final class BitSet implements Cloneable, Serializable
 
   public void xor (BitSet bs)
     {
-      if (bs == null)
-       throw new NullPointerException ();
       ensure (bs.bits.length - 1);
       int i;
       for (i = 0; i < bs.bits.length; ++i)
index 62866b082650a401e02c7ab1500f86094774e2c4..5b5361152f4cd27bc52c05619cfbf18bbf3a7325 100644 (file)
@@ -164,7 +164,8 @@ public class Hashtable extends Dictionary implements Cloneable, Serializable
     return newTable;
   }
 
-  public synchronized boolean contains(Object value) throws NullPointerException
+  public synchronized boolean contains(Object value)
+    throws NullPointerException
   {
     // An exception is thrown here according to the JDK 1.2 doc.
     if (value == null)
@@ -180,10 +181,6 @@ public class Hashtable extends Dictionary implements Cloneable, Serializable
 
   public synchronized boolean containsKey(Object key)
   {
-    // The Map interface mandates that we throw this.
-    if (key == null)
-      throw new NullPointerException ();
-
     for (HashtableEntry elem = bucket[Math.abs(key.hashCode()
                                               % bucket.length)];
         elem != null; elem = elem.nextEntry)
@@ -200,11 +197,6 @@ public class Hashtable extends Dictionary implements Cloneable, Serializable
 
   public synchronized Object get(Object key)
   {
-    // The Dictionary interface mandates that get() throw a
-    // NullPointerException if key is null.
-    if (key == null)
-      throw new NullPointerException ();
-
     for (HashtableEntry elem = bucket[Math.abs (key.hashCode()
                                                % bucket.length)];
         elem != null; elem = elem.nextEntry)
@@ -225,8 +217,10 @@ public class Hashtable extends Dictionary implements Cloneable, Serializable
   }
 
   public synchronized Object put(Object key, Object value)
-                               throws NullPointerException
+    throws NullPointerException
   {
+    // We could really just check `value == null', but checking both
+    // is a bit clearer.
     if (key == null || value == null)
       throw new NullPointerException();
 
index e427e2ed43a4ef7931a6c0b0a396d10b91055abf..d2dc2f759172ea4c3ab4a97faf1a6ab3c9d0ed1d 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 1999  Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000  Free Software Foundation
 
    This file is part of libgcj.
 
@@ -65,10 +65,6 @@ public final class Locale implements java.io.Serializable, Cloneable
   public Locale (String languageCode, String countryCode,
                 String variantCode)
   {
-    // We must explicitly check the arguments.
-    if (languageCode == null || countryCode == null
-       || variantCode == null)
-      throw new NullPointerException ();
     language = languageCode.toLowerCase();
     country = countryCode.toUpperCase();
     variant = variantCode.toUpperCase();
index 39df164e2b32115c701c0b86194b3185a72226de..9ff7f4d7c664193ba35486d3be67776c702fa21b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999  Free Software Foundation
+/* Copyright (C) 1999, 2000  Free Software Foundation
 
    This file is part of libgcj.
 
@@ -39,8 +39,6 @@ public class ZipEntry implements ZipConstants
 
   public ZipEntry (String name)
   {
-    if (name == null)
-      throw new NullPointerException ();
     if (name.length() > 65535)
       throw new IllegalArgumentException ();
     this.name = name;