harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apetre...@apache.org
Subject svn commit: r521196 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ByteArrayOutputStream.java
Date Thu, 22 Mar 2007 10:39:48 GMT
Author: apetrenko
Date: Thu Mar 22 03:39:34 2007
New Revision: 521196

URL: http://svn.apache.org/viewvc?view=rev&rev=521196
Log:
Patch for HARMONY-3373 "[classlib][luni]java.io.ByteArrayOutputStream: avoid to use exception
mechanism as logic in write(int)"

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ByteArrayOutputStream.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ByteArrayOutputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ByteArrayOutputStream.java?view=diff&rev=521196&r1=521195&r2=521196
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ByteArrayOutputStream.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ByteArrayOutputStream.java
Thu Mar 22 03:39:34 2007
@@ -223,15 +223,10 @@
      */
     @Override
     public synchronized void write(int oneByte) {
-        try {
-            buf[count] = (byte) oneByte;
-            count++;
-        } catch (IndexOutOfBoundsException e) {
-            // Expand when necessary
+        if (count == buf.length) {
             expand(1);
-            buf[count++] = (byte) oneByte;
-        } catch (NullPointerException e) {
         }
+        buf[count++] = (byte) oneByte;
     }
 
     /**



Mime
View raw message