harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r814478 [1/3] - in /harmony/enhanced/classlib/branches/java6: ./ depends/build/ make/ modules/beans/make/ modules/beans/src/main/java/java/beans/ modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/ modules/beans/src/test/...
Date Mon, 14 Sep 2009 05:45:04 GMT
Author: hindessm
Date: Mon Sep 14 05:45:00 2009
New Revision: 814478

URL: http://svn.apache.org/viewvc?rev=814478&view=rev
Log:
Merge updates from classlib trunk@814402 since r808406.

Added:
    harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/a2e/
      - copied from r814402, harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/a2e/
    harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/a2e/unix/
      - copied from r814402, harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/a2e/unix/
    harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/a2e/unix/atoe.c
      - copied unchanged from r814402, harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/a2e/unix/atoe.c
    harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/a2e/unix/atoe_utils.c
      - copied unchanged from r814402, harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/a2e/unix/atoe_utils.c
    harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/a2e/unix/exports.txt
      - copied unchanged from r814402, harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/a2e/unix/exports.txt
    harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/a2e/unix/headers/
      - copied from r814402, harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/a2e/unix/headers/
    harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/a2e/unix/headers/arpa/
      - copied from r814402, harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/a2e/unix/headers/arpa/
    harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/a2e/unix/headers/arpa/inet.h
      - copied unchanged from r814402, harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/a2e/unix/headers/arpa/inet.h
    harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/a2e/unix/headers/atoe.h
      - copied unchanged from r814402, harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/a2e/unix/headers/atoe.h
    harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/a2e/unix/headers/ctype.h
      - copied unchanged from r814402, harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/a2e/unix/headers/ctype.h
    harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/a2e/unix/headers/dirent.h
      - copied unchanged from r814402, harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/a2e/unix/headers/dirent.h
    harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/a2e/unix/headers/dlfcn.h
      - copied unchanged from r814402, harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/a2e/unix/headers/dlfcn.h
    harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/a2e/unix/headers/dll.h
      - copied unchanged from r814402, harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/a2e/unix/headers/dll.h
    harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/a2e/unix/headers/fcntl.h
      - copied unchanged from r814402, harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/a2e/unix/headers/fcntl.h
    harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/a2e/unix/headers/grp.h
      - copied unchanged from r814402, harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/a2e/unix/headers/grp.h
    harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/a2e/unix/headers/langinfo.h
      - copied unchanged from r814402, harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/a2e/unix/headers/langinfo.h
    harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/a2e/unix/headers/locale.h
      - copied unchanged from r814402, harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/a2e/unix/headers/locale.h
    harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/a2e/unix/headers/netdb.h
      - copied unchanged from r814402, harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/a2e/unix/headers/netdb.h
    harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/a2e/unix/headers/pwd.h
      - copied unchanged from r814402, harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/a2e/unix/headers/pwd.h
    harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/a2e/unix/headers/stdio.h
      - copied unchanged from r814402, harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/a2e/unix/headers/stdio.h
    harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/a2e/unix/headers/stdlib.h
      - copied unchanged from r814402, harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/a2e/unix/headers/stdlib.h
    harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/a2e/unix/headers/string.h
      - copied unchanged from r814402, harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/a2e/unix/headers/string.h
    harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/a2e/unix/headers/sys/
      - copied from r814402, harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/a2e/unix/headers/sys/
    harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/a2e/unix/headers/sys/ipc.h
      - copied unchanged from r814402, harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/a2e/unix/headers/sys/ipc.h
    harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/a2e/unix/headers/sys/stat.h
      - copied unchanged from r814402, harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/a2e/unix/headers/sys/stat.h
    harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/a2e/unix/headers/sys/time.h
      - copied unchanged from r814402, harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/a2e/unix/headers/sys/time.h
    harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/a2e/unix/headers/sys/utsname.h
      - copied unchanged from r814402, harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/a2e/unix/headers/sys/utsname.h
    harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/a2e/unix/headers/time.h
      - copied unchanged from r814402, harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/a2e/unix/headers/time.h
    harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/a2e/unix/headers/unistd.h
      - copied unchanged from r814402, harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/a2e/unix/headers/unistd.h
    harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/a2e/unix/headers/utime.h
      - copied unchanged from r814402, harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/a2e/unix/headers/utime.h
    harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/a2e/unix/makefile
      - copied unchanged from r814402, harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/a2e/unix/makefile
    harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/a2e/unix/sysTranslate.c
      - copied unchanged from r814402, harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/a2e/unix/sysTranslate.c
    harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/zos/
      - copied from r814402, harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/zos/
    harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/zos/hymmap.c
      - copied unchanged from r814402, harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/zos/hymmap.c
    harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/zos/hysl.c
      - copied unchanged from r814402, harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/zos/hysl.c
Modified:
    harmony/enhanced/classlib/branches/java6/   (props changed)
    harmony/enhanced/classlib/branches/java6/depends/build/defines.mk
    harmony/enhanced/classlib/branches/java6/make/depends-common.xml   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/beans/make/exclude.common
    harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/Statement.java
    harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/XMLDecoder.java
    harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/XMLDecoderTest.java
    harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/MockBean4CodecPrimitives.java
    harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/atomic/   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/locks/   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/jmx/META-INF/   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/lang-management/src/test/api/java/org/apache/harmony/lang/management/tests/java/util/logging/   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/BufferedOutputStream.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/CharArrayReader.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/DataOutputStream.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/FilterOutputStream.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/InputStream.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/LineNumberInputStream.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/ObjectInputStream.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/ObjectOutputStream.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/PrintStream.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/PushbackInputStream.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/PushbackReader.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/StringBufferInputStream.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/StringReader.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/lang/AbstractStringBuilder.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/lang/ArrayIndexOutOfBoundsException.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/DatagramSocketImpl.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/Arrays.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/Collections.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpURLConnection.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/internal/process/ProcessInputStream.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/net/PlainDatagramSocketImpl.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/net/SocketInputStream.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSMemory.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/platform/PlatformAddress.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/util/ExternalMessages.properties
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/fdlibm.h   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/gp.h   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/hymagic.h   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/hysocket.h   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/hyvmls.h   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/jni.h   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/jni_types.h   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/jvmpi.h   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/jvmri.h   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/jvmti.h   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/jvmti_types.h   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/vmi.h   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/vmizip.h   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/launcher/shared/cmain.c
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/launcher/unix/makefile
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/bigint.c
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/cbigint.c
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/fltconst.h
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/OSFileSystemLinux32.c
    harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/FileTest.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/DatagramSocketImplTest.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/util/CollectionsTest.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/test/resources/net.resources/   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/nio/src/main/java/common/java/nio/DirectByteBuffer.java
    harmony/enhanced/classlib/branches/java6/modules/nio/src/main/java/common/java/nio/ReadOnlyDirectByteBuffer.java
    harmony/enhanced/classlib/branches/java6/modules/nio/src/main/java/common/java/nio/ReadWriteDirectByteBuffer.java
    harmony/enhanced/classlib/branches/java6/modules/nio/src/main/java/common/java/nio/channels/Channels.java
    harmony/enhanced/classlib/branches/java6/modules/nio/src/main/java/common/org/apache/harmony/nio/internal/nls/messages.properties
    harmony/enhanced/classlib/branches/java6/modules/nio/src/main/java/unix/org/apache/harmony/nio/internal/EpollSelectorImpl.java
    harmony/enhanced/classlib/branches/java6/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/SocketChannelTest.java
    harmony/enhanced/classlib/branches/java6/modules/nio_char/src/main/native/niochar/unix/makefile
    harmony/enhanced/classlib/branches/java6/modules/pack200/depends/manifests/asm-3.1/   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java5/org/apache/harmony/pack200/Pack200Adapter.java   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java5/org/apache/harmony/pack200/Pack200PackerAdapter.java   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/portlib/build.xml
    harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/common/shared/strhelp.c
    harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/include/shared/hyport.h
    harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/shared/hynls.c
    harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/shared/hyport.c
    harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/hysysinfo.c
    harmony/enhanced/classlib/branches/java6/modules/prefs/build.xml
    harmony/enhanced/classlib/branches/java6/modules/print/build.xml
    harmony/enhanced/classlib/branches/java6/modules/rmi/META-INF/MANIFEST.MF
    harmony/enhanced/classlib/branches/java6/modules/swing/src/test/api/java.injected/javax/swing/BasicSwingTestCase.java   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/swing/src/test/api/java.injected/javax/swing/SwingTestCase.java   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/swing/src/test/api/java.injected/javax/swing/text/parser/   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/text/META-INF/MANIFEST.MF
    harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/BreakIterator.java
    harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/Collator.java
    harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/DateFormat.java
    harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/Format.java
    harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/MessageFormat.java
    harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/NumberFormat.java
    harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/org/apache/harmony/text/internal/nls/messages.properties
    harmony/enhanced/classlib/branches/java6/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/MessageFormatTest.java
    harmony/enhanced/classlib/branches/java6/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/ParseExceptionTest.java
    harmony/enhanced/classlib/branches/java6/support/src/test/java/tests/resources/Created_by_1_4.jar

Propchange: harmony/enhanced/classlib/branches/java6/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Sep 14 05:45:00 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk:713674-735919,765923-808406
+/harmony/enhanced/classlib/trunk:713674-735919,765923-814402

Modified: harmony/enhanced/classlib/branches/java6/depends/build/defines.mk
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/depends/build/defines.mk?rev=814478&r1=814477&r2=814478&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/depends/build/defines.mk (original)
+++ harmony/enhanced/classlib/branches/java6/depends/build/defines.mk Mon Sep 14 05:45:00 2009
@@ -62,6 +62,10 @@
 endif
 
 MDLLIBFILES = $(LIBPATH)libhycommon.a
+ifeq ($(HY_OS),zos)
+# On z/OS we need to link every module against the ascii2ebcdic library
+MDLLIBFILES += $(LIBPATH)libhya2e.x
+endif
 
 ifeq ($(HY_NO_THR),false)
 ifeq ($(HY_THR_NO_DEPLOY), true)

Propchange: harmony/enhanced/classlib/branches/java6/make/depends-common.xml
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Sep 14 05:45:00 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/make/depends-common.xml:768152-808406
+/harmony/enhanced/classlib/trunk/make/depends-common.xml:768152-814402

Modified: harmony/enhanced/classlib/branches/java6/modules/beans/make/exclude.common
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/make/exclude.common?rev=814478&r1=814477&r2=814478&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/make/exclude.common (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/make/exclude.common Mon Sep 14 05:45:00 2009
@@ -1,4 +1,3 @@
 org/apache/harmony/beans/tests/java/beans/VetoableChangeSupportTest.java
-org/apache/harmony/beans/tests/java/beans/XMLDecoderTest.java
 org/apache/harmony/beans/tests/java/beans/XMLEncoderTest.java
 

Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/Statement.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/Statement.java?rev=814478&r1=814477&r2=814478&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/Statement.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/Statement.java Mon Sep 14 05:45:00 2009
@@ -566,9 +566,6 @@
             }
             for (int i = 0; i < referenceMethodArgumentTypes.length; i++) {
                 if (referenceMethodArgumentTypes[i] == null) {
-                    if (argumentTypes[i].isPrimitive()) {
-                        return INFINITY;
-                    }
                     // doesn't affect the norm calculation if null
                     continue;
                 }

Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/XMLDecoder.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/XMLDecoder.java?rev=814478&r1=814477&r2=814478&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/XMLDecoder.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/XMLDecoder.java Mon Sep 14 05:45:00 2009
@@ -48,7 +48,7 @@
     private static class DefaultExceptionListener implements ExceptionListener {
 
         public void exceptionThrown(Exception e) {
-            e.printStackTrace();
+            System.err.println(e.getMessage());
             System.err.println("Continue..."); //$NON-NLS-1$
         }
     }
@@ -266,8 +266,9 @@
             while (readObjs.pop() != toClose) {
                 //
             }
-            // push back expression
+
             if (toClose.isExpression) {
+                // push back expression
                 readObjs.push(toClose);
             }
         }
@@ -413,16 +414,21 @@
                     clazzes);
             Method chosenOne = matchMethods.get(0);
             matchMethods.remove(0);
+            int methodCounter = 1;
             for (Method method : matchMethods) {
                 int difference = comparator.compare(chosenOne, method);
                 if (difference > 0) {
                     chosenOne = method;
+                    methodCounter = 1;
                 } else if (difference == 0) {
-                    // if 2 methods have same relevance, throw exception
-                    throw new NoSuchMethodException(Messages.getString(
-                            "beans.62", methodName)); //$NON-NLS-1$
+                    methodCounter++;
                 }
             }
+            if (methodCounter > 1) {
+                // if 2 methods have same relevance, throw exception
+                throw new NoSuchMethodException(Messages.getString(
+                                                                   "beans.62", methodName)); //$NON-NLS-1$
+            }
             return chosenOne;
         }
 
@@ -517,6 +523,7 @@
         boolean fromOwner;
 
         Object result;
+
     }
 
     private InputStream inputStream;
@@ -630,7 +637,7 @@
                 this.listener.exceptionThrown(e);
             }
         }
-        
+
         if (readObjIndex >= readObjs.size()) {
             throw new ArrayIndexOutOfBoundsException("no more objects to read");
         }

Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/XMLDecoderTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/XMLDecoderTest.java?rev=814478&r1=814477&r2=814478&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/XMLDecoderTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/XMLDecoderTest.java Mon Sep 14 05:45:00 2009
@@ -22,11 +22,14 @@
 import java.beans.XMLDecoder;
 import java.beans.XMLEncoder;
 import java.io.BufferedInputStream;
+import java.io.BufferedReader;
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.lang.reflect.Array;
 import java.util.HashMap;
 import java.util.Vector;
-import java.lang.reflect.Array;
 
 import junit.framework.Test;
 import junit.framework.TestCase;
@@ -50,6 +53,33 @@
         junit.textui.TestRunner.run(XMLDecoderTest.class);
     }
 
+    private InputStream getCodedXML(Class clazz, String xmlFile)
+            throws Exception {
+        InputStream refIn;
+
+        String version = System.getProperty("java.version");
+
+        refIn = XMLEncoderTest.class.getResourceAsStream(xmlFile);
+        if (refIn == null) {
+            throw new Error("resource " + xmlFile + " not exist in "
+                    + XMLEncoderTest.class.getPackage());
+        }
+        BufferedReader br = new BufferedReader(new InputStreamReader(refIn,
+                "UTF-8"));
+        StringBuilder sb = new StringBuilder();
+        String line = null;
+        while ((line = br.readLine()) != null) {
+            sb.append(line + "\n");
+        }
+        refIn.close();
+        String refString = sb.toString();
+        refString = refString.replace("${version}", version);
+        if (clazz != null) {
+            refString = refString.replace("${classname}", clazz.getName());
+        }
+        return new ByteArrayInputStream(refString.getBytes("UTF-8"));
+    }
+
     static byte xml123bytes[] = null;
 
     static {
@@ -74,7 +104,7 @@
         }
 
     }
-    
+
     /*
      * test XMLDecoder constructor with null inputStream argument
      */
@@ -118,7 +148,7 @@
         assertNotNull(xmlDecoder.getExceptionListener());
         xmlDecoder.close();
     }
-    
+
     /*
      * test XMLDecoder constructor
      */
@@ -126,19 +156,22 @@
         XMLDecoder xmlDecoder;
         xmlDecoder = new XMLDecoder(new ByteArrayInputStream(xml123bytes));
         assertEquals(null, xmlDecoder.getOwner());
-        
+
         final Vector<Exception> exceptions = new Vector<Exception>();
         ExceptionListener el = new ExceptionListener() {
             public void exceptionThrown(Exception e) {
                 exceptions.addElement(e);
             }
         };
-        
-        xmlDecoder = new XMLDecoder(new ByteArrayInputStream(xml123bytes), this, el);
+
+        xmlDecoder = new XMLDecoder(new ByteArrayInputStream(xml123bytes),
+                this, el);
         assertEquals(el, xmlDecoder.getExceptionListener());
         assertEquals(this, xmlDecoder.getOwner());
     }
 
+    /* RI fails on this testcase */
+    /*
     public void testConstructor_ClassLoader() {
         XMLDecoder dec;
         final Vector<Exception> exceptions = new Vector<Exception>();
@@ -163,8 +196,10 @@
         } catch (ArrayIndexOutOfBoundsException e) {
             // also valid
         }
+
         dec.close();
     }
+    */
 
     public void testClose() {
         XMLDecoder dec = new XMLDecoder(new ByteArrayInputStream(xml123bytes));
@@ -230,7 +265,7 @@
         assertEquals(2, ints[1]);
         assertEquals(3, ints[2]);
     }
-    
+
     public void testReadObject_Array_WithoutLength() {
         // Read array of primitive types without length attribute
         XMLDecoder dec = new XMLDecoder(this.getClass().getResourceAsStream(
@@ -322,22 +357,22 @@
         assertSame(b.getInts(), b.getRef());
     }
 
-    public void testReadObject_NoChange() {
-        XMLDecoder dec = new XMLDecoder(this.getClass().getResourceAsStream(
+    public void testReadObject_NoChange() throws Exception {
+        XMLDecoder dec = new XMLDecoder(getCodedXML(MockBean4Codec.class,
                 "/xml/MockBean4Codec_NoChange.xml"));
         dec.readObject();
     }
 
-    public void testReadObject_BornFriendChange() {
-        XMLDecoder dec = new XMLDecoder(this.getClass().getResourceAsStream(
+    public void testReadObject_BornFriendChange() throws Exception {
+        XMLDecoder dec = new XMLDecoder(getCodedXML(MockBean4Codec.class,
                 "/xml/MockBean4Codec_BornFriendChange.xml"));
         MockBean4Codec b = (MockBean4Codec) dec.readObject();
         assertEquals(888, b.getBornFriend().getZarr()[0]);
         assertEquals(b.getBornFriend(), b.getNill());
     }
 
-    public void testReadObject_ManyChanges() {
-        XMLDecoder dec = new XMLDecoder(this.getClass().getResourceAsStream(
+    public void testReadObject_ManyChanges() throws Exception {
+        XMLDecoder dec = new XMLDecoder(getCodedXML(MockBean4Codec.class,
                 "/xml/MockBean4Codec_ManyChanges.xml"));
         MockBean4Codec b = (MockBean4Codec) dec.readObject();
         assertEquals(127, b.getB());
@@ -374,67 +409,62 @@
         assertEquals("6", b.getZarrarr()[0][2]);
     }
 
-    public void testReadObject_StaticField() {
-        XMLDecoder dec1 = new XMLDecoder(this.getClass().getResourceAsStream(
+    public void testReadObject_StaticField() throws Exception {
+        XMLDecoder dec1 = new XMLDecoder(getCodedXML(
+                MockBean4StaticField.class,
                 "/xml/MockBean4StaticField_Original.xml"));
         MockBean4StaticField o1 = (MockBean4StaticField) dec1.readObject();
+        assertNull(o1);
 
-        XMLDecoder dec2 = new XMLDecoder(this.getClass().getResourceAsStream(
-                "/xml/MockBean4StaticField.xml"));
+        XMLDecoder dec2 = new XMLDecoder(getCodedXML(
+                MockBean4StaticField.class, "/xml/MockBean4StaticField.xml"));
         MockBean4StaticField o2 = (MockBean4StaticField) dec2.readObject();
-
-        if (!o1.equals(o2)) {
-            System.out
-                    .println("Loading object with static field, original xml: "
-                            + o1.getV());
-            System.out.println("Loading object with static field, field xml: "
-                    + o2.getV());
-        }
-
-        assertEquals(o1, o2);
+        assertNotNull(o2);
     }
 
-    public void testReadObject_Owner() {
+    public void testReadObject_Owner() throws Exception {
         MockBean4Owner_Owner o1 = new MockBean4Owner_Owner();
-        XMLDecoder dec1 = new XMLDecoder(this.getClass().getResourceAsStream(
-                "/xml/MockBean4Owner_SetOwner.xml"), o1);
+        XMLDecoder dec1 = new XMLDecoder(
+                getCodedXML(MockBean4Owner_Target.class,
+                        "/xml/MockBean4Owner_SetOwner.xml"), o1);
         MockBean4Owner_Target t1 = (MockBean4Owner_Target) dec1.readObject();
 
         assertEquals(1, o1.getV());
         assertEquals(o1, t1.getV());
     }
-    
-    public void testReadObject_Owner_Specific(){
+
+    public void testReadObject_Owner_Specific() {
         String expectedValue = "expected value";
         HashMap map = new HashMap();
         map.put("key", expectedValue);
-        
-        XMLDecoder decoder = new XMLDecoder(this.getClass().getResourceAsStream(
-                "/xml/MockOwner.xml"), map);
+
+        XMLDecoder decoder = new XMLDecoder(this.getClass()
+                .getResourceAsStream("/xml/MockOwner.xml"), map);
         String actualValue = (String) decoder.readObject();
-        assertEquals(expectedValue,actualValue);
-        
+        assertEquals(expectedValue, actualValue);
+
         MockOwnerClass mock = new MockOwnerClass();
         expectedValue = "I_Ljava.lang.String";
         decoder = new XMLDecoder(this.getClass().getResourceAsStream(
-        "/xml/MockOwner_Specific.xml"), mock);
+                "/xml/MockOwner_Specific.xml"), mock);
         actualValue = (String) decoder.readObject();
-        assertEquals(expectedValue,actualValue);
-        
+        assertEquals(expectedValue, actualValue);
+
         decoder = new XMLDecoder(this.getClass().getResourceAsStream(
-        "/xml/MockOwner_Ambiguous.xml"), mock);
+                "/xml/MockOwner_Ambiguous.xml"), mock);
         actualValue = (String) decoder.readObject();
         assertNull(actualValue);
-        
+
         decoder = new XMLDecoder(this.getClass().getResourceAsStream(
-        "/xml/MockOwner_Null.xml"), mock);
+                "/xml/MockOwner_Null.xml"), mock);
         actualValue = (String) decoder.readObject();
         assertNull(actualValue);
     }
 
-    public void testReadObject_Owner_WithWriteStatement() {
+    public void testReadObject_Owner_WithWriteStatement() throws Exception {
         MockBean4Owner_Owner o2 = new MockBean4Owner_Owner();
-        XMLDecoder dec2 = new XMLDecoder(this.getClass().getResourceAsStream(
+        XMLDecoder dec2 = new XMLDecoder(getCodedXML(
+                MockBean4Owner_Target.class,
                 "/xml/MockBean4Owner_SetOwnerWithWriteStatement.xml"), o2);
         MockBean4Owner_Target t2 = (MockBean4Owner_Target) dec2.readObject();
 
@@ -474,13 +504,13 @@
                 return isCalled;
             }
         }
-        
+
         XMLDecoder xmlDecoder = new XMLDecoder(new ByteArrayInputStream(
                 "<java><string/>".getBytes("UTF-8")));
         MockExceptionListener mockListener = new MockExceptionListener();
         xmlDecoder.setExceptionListener(mockListener);
-        
-        assertFalse(mockListener.isCalled());        
+
+        assertFalse(mockListener.isCalled());
         // Real Parsing should occur in method of ReadObject rather constructor.
         assertNotNull(xmlDecoder.readObject());
         assertTrue(mockListener.isCalled());
@@ -498,12 +528,14 @@
         assertSame(newL, dec.getExceptionListener());
     }
 
-    public void testSetExceptionListener_CatchException() {
+    /* RI also failed on the test case */
+    /*
+    public void testSetExceptionListener_CatchException() throws Exception {
         MockExceptionListener l = new MockExceptionListener();
-        new XMLDecoder(XMLDecoderTest.class
-                .getResourceAsStream("/xml/bad_int.xml"), null, l);
+        new XMLDecoder(getCodedXML(null, "/xml/bad_int.xml"), null, l);
         assertTrue(l.size() > 0);
     }
+    */
 
     public void testSetOwner() {
         XMLDecoder dec = new XMLDecoder(new ByteArrayInputStream(xml123bytes));
@@ -590,7 +622,22 @@
      * The test checks the code generation for XML from Test6.xml
      */
     public void testDecodeReference() throws Exception {
-        decode("xml/Test6.xml");
+        XMLDecoder d = null;
+        try {
+            Introspector.setBeanInfoSearchPath(new String[] {});
+            d = new XMLDecoder(getCodedXML(
+                    org.apache.harmony.beans.tests.support.SampleBean.class,
+                    "/xml/Test6.xml"));
+            while (true) {
+                d.readObject();
+            }
+        } catch (ArrayIndexOutOfBoundsException aibe) {
+            assertTrue(true);
+        } finally {
+            if (d != null) {
+                d.close();
+            }
+        }
     }
 
     /**
@@ -600,7 +647,6 @@
         decode("xml/Test7.xml");
     }
 
-
     /**
      * Regression test for HARMONY-1890
      */
@@ -616,29 +662,16 @@
         decoder = new XMLDecoder(new ByteArrayInputStream(out.toByteArray()));
         obj = decoder.readObject();
         decoder.close();
-        
         assertTrue("Returned object is not array", obj.getClass().isArray());
-        assertSame("String type expected", String.class,
-                obj.getClass().getComponentType());
+        assertSame("String type expected", String.class, obj.getClass()
+                .getComponentType());
         assertEquals("Size mismatch", 10, Array.getLength(obj));
     }
-    
-    /*
-     * The test checks the code generation for XML from MainTest.xml
-     * 
-     * public void testMain() { decode("xml/MainTest.xml"); }
-     */
 
-    /**
-     * 
-     */
     public static Test suite() {
         return new TestSuite(XMLDecoderTest.class);
     }
 
-    /**
-     * 
-     */
     private void decode(String resourceName) throws Exception {
         XMLDecoder d = null;
         try {

Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/MockBean4CodecPrimitives.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/MockBean4CodecPrimitives.java?rev=814478&r1=814477&r2=814478&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/MockBean4CodecPrimitives.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/MockBean4CodecPrimitives.java Mon Sep 14 05:45:00 2009
@@ -93,6 +93,9 @@
             Field fields[] = getClass().getDeclaredFields();
             for (Field element : fields) {
                 Object mine = element.get(this);
+                if (mine instanceof MockBean4CodecPrimitives) {
+                    continue;
+                }
                 if (mine != null) {
                     code += mine.hashCode();
                 }

Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/atomic/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Sep 14 05:45:00 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/atomic:765923-808406
+/harmony/enhanced/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/atomic:765923-814402

Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/locks/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Sep 14 05:45:00 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/locks:765923-808406
+/harmony/enhanced/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/locks:765923-814402

Propchange: harmony/enhanced/classlib/branches/java6/modules/jmx/META-INF/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Sep 14 05:45:00 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/modules/jmx/META-INF:768152-808406
+/harmony/enhanced/classlib/trunk/modules/jmx/META-INF:768152-814402

Propchange: harmony/enhanced/classlib/branches/java6/modules/lang-management/src/test/api/java/org/apache/harmony/lang/management/tests/java/util/logging/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Sep 14 05:45:00 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/modules/lang-management/src/test/api/java/org/apache/harmony/lang/management/tests/java/util/logging:768152-808406
+/harmony/enhanced/classlib/trunk/modules/lang-management/src/test/api/java/org/apache/harmony/lang/management/tests/java/util/logging:768152-814402

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/BufferedOutputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/BufferedOutputStream.java?rev=814478&r1=814477&r2=814478&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/BufferedOutputStream.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/BufferedOutputStream.java Mon Sep 14 05:45:00 2009
@@ -131,9 +131,14 @@
             return;
         }
         
-        if (offset < 0 || offset > buffer.length - length || length < 0) {
-            // K002f=Arguments out of bounds
-            throw new ArrayIndexOutOfBoundsException(Msg.getString("K002f")); //$NON-NLS-1$
+        if (offset < 0 || offset > buffer.length - length) {
+            // K002e=Offset out of bounds \: {0}
+            throw new ArrayIndexOutOfBoundsException(Msg.getString("K002e", offset)); //$NON-NLS-1$
+        
+        }
+        if (length < 0) {
+            // K0031=Length out of bounds \: {0}
+            throw new ArrayIndexOutOfBoundsException(Msg.getString("K0031", length)); //$NON-NLS-1$
         }
 
         // flush the internal buffer first if we have not enough space left

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/CharArrayReader.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/CharArrayReader.java?rev=814478&r1=814477&r2=814478&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/CharArrayReader.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/CharArrayReader.java Mon Sep 14 05:45:00 2009
@@ -200,10 +200,15 @@
      */
     @Override
     public int read(char buffer[], int offset, int len) throws IOException {
-        // avoid int overflow
-        if (offset < 0 || offset > buffer.length || len < 0
-                || len > buffer.length - offset) {
-            throw new ArrayIndexOutOfBoundsException();
+        if (offset < 0 || offset > buffer.length) {
+            // K002e=Offset out of bounds \: {0}
+            throw new ArrayIndexOutOfBoundsException(
+                    Msg.getString("K002e", offset)); //$NON-NLS-1$
+        }
+        if (len < 0 || len > buffer.length - offset) {
+            // K0031=Length out of bounds \: {0}
+            throw new ArrayIndexOutOfBoundsException(
+                    Msg.getString("K0031", len)); //$NON-NLS-1$
         }
         synchronized (lock) {
             if (isClosed()) {

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/DataOutputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/DataOutputStream.java?rev=814478&r1=814477&r2=814478&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/DataOutputStream.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/DataOutputStream.java Mon Sep 14 05:45:00 2009
@@ -277,6 +277,19 @@
         written += 8;
     }
 
+    int writeLongToBuffer(long val,
+                          byte[] buffer, int offset) throws IOException {
+        buffer[offset++] = (byte) (val >> 56);
+        buffer[offset++] = (byte) (val >> 48);
+        buffer[offset++] = (byte) (val >> 40);
+        buffer[offset++] = (byte) (val >> 32);
+        buffer[offset++] = (byte) (val >> 24);
+        buffer[offset++] = (byte) (val >> 16);
+        buffer[offset++] = (byte) (val >> 8);
+        buffer[offset++] = (byte) val;
+        return offset;
+    }
+
     /**
      * Writes the specified 16-bit short to the target stream. Only the lower
      * two bytes of the integer {@code val} are written, with the higher one
@@ -296,6 +309,13 @@
         written += 2;
     }
 
+    int writeShortToBuffer(int val,
+                           byte[] buffer, int offset) throws IOException {
+        buffer[offset++] = (byte) (val >> 8);
+        buffer[offset++] = (byte) val;
+        return offset;
+    }
+
     /**
      * Writes the specified encoded in {@link DataInput modified UTF-8} to this
      * stream.
@@ -314,8 +334,11 @@
         if (utfCount > 65535) {
             throw new UTFDataFormatException(Msg.getString("K0068")); //$NON-NLS-1$
         }
-        writeShort((int) utfCount);
-        writeUTFBytes(str, utfCount);
+        byte[] buffer = new byte[(int)utfCount + 2];
+        int offset = 0;
+        offset = writeShortToBuffer((int) utfCount, buffer, offset);
+        offset = writeUTFBytesToBuffer(str, (int) utfCount, buffer, offset);
+        write(buffer, 0, offset);
     }
 
     long countUTFBytes(String str) {
@@ -333,24 +356,22 @@
         return utfCount;
     }
 
-    void writeUTFBytes(String str, long count) throws IOException {
-        int size = (int) count;
+    int writeUTFBytesToBuffer(String str, long count,
+                              byte[] buffer, int offset) throws IOException {
         int length = str.length();
-        byte[] utfBytes = new byte[size];
-        int utfIndex = 0;
         for (int i = 0; i < length; i++) {
             int charValue = str.charAt(i);
             if (charValue > 0 && charValue <= 127) {
-                utfBytes[utfIndex++] = (byte) charValue;
+                buffer[offset++] = (byte) charValue;
             } else if (charValue <= 2047) {
-                utfBytes[utfIndex++] = (byte) (0xc0 | (0x1f & (charValue >> 6)));
-                utfBytes[utfIndex++] = (byte) (0x80 | (0x3f & charValue));
+                buffer[offset++] = (byte) (0xc0 | (0x1f & (charValue >> 6)));
+                buffer[offset++] = (byte) (0x80 | (0x3f & charValue));
             } else {
-                utfBytes[utfIndex++] = (byte) (0xe0 | (0x0f & (charValue >> 12)));
-                utfBytes[utfIndex++] = (byte) (0x80 | (0x3f & (charValue >> 6)));
-                utfBytes[utfIndex++] = (byte) (0x80 | (0x3f & charValue));
+                buffer[offset++] = (byte) (0xe0 | (0x0f & (charValue >> 12)));
+                buffer[offset++] = (byte) (0x80 | (0x3f & (charValue >> 6)));
+                buffer[offset++] = (byte) (0x80 | (0x3f & charValue));
              }
         }
-        write(utfBytes, 0, utfIndex);
+        return offset;
     }
 }

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/FilterOutputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/FilterOutputStream.java?rev=814478&r1=814477&r2=814478&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/FilterOutputStream.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/FilterOutputStream.java Mon Sep 14 05:45:00 2009
@@ -99,7 +99,7 @@
      *            the buffer to write.
      * @param offset
      *            the index of the first byte in {@code buffer} to write.
-     * @param count
+     * @param length
      *            the number of bytes in {@code buffer} to write.
      * @throws IndexOutOfBoundsException
      *             if {@code offset < 0} or {@code count < 0}, or if
@@ -109,13 +109,17 @@
      *             if an I/O error occurs while writing to this stream.
      */
     @Override
-    public void write(byte buffer[], int offset, int count) throws IOException {
-        // avoid int overflow, force null buffer check first
-        if (offset > buffer.length || offset < 0 || count < 0
-                || count > buffer.length - offset) {
-            throw new ArrayIndexOutOfBoundsException(Msg.getString("K002f")); //$NON-NLS-1$
+    public void write(byte buffer[], int offset, int length) throws IOException {
+        // Force null buffer check first!
+        if (offset > buffer.length || offset < 0) {
+            // K002e=Offset out of bounds \: {0}
+            throw new ArrayIndexOutOfBoundsException(Msg.getString("K002e", offset)); //$NON-NLS-1$
         }
-        for (int i = 0; i < count; i++) {
+        if (length < 0 || length > buffer.length - offset) {
+            // K0031=Length out of bounds \: {0}
+            throw new ArrayIndexOutOfBoundsException(Msg.getString("K0031", length)); //$NON-NLS-1$
+        }
+        for (int i = 0; i < length; i++) {
             // Call write() instead of out.write() since subclasses could
             // override the write() method.
             write(buffer[offset + i]);

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/InputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/InputStream.java?rev=814478&r1=814477&r2=814478&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/InputStream.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/InputStream.java Mon Sep 14 05:45:00 2009
@@ -17,6 +17,8 @@
 
 package java.io;
 
+import org.apache.harmony.luni.util.Msg;
+
 /**
  * The base class for all input streams. An input stream is a means of reading
  * data from a source in a byte-wise manner.
@@ -147,10 +149,14 @@
      *             if the stream is closed or another IOException occurs.
      */
     public int read(byte b[], int offset, int length) throws IOException {
-        // avoid int overflow, check null b
-        if (offset > b.length || offset < 0 || length < 0
-                || length > b.length - offset) {
-            throw new ArrayIndexOutOfBoundsException();
+        // Force null check for b first!
+        if (offset > b.length || offset < 0) {
+            // K002e=Offset out of bounds \: {0}
+            throw new ArrayIndexOutOfBoundsException(Msg.getString("K002e", offset)); //$NON-NLS-1$
+        } 
+        if (length < 0 || length > b.length - offset) {
+            // K0031=Length out of bounds \: {0}
+            throw new ArrayIndexOutOfBoundsException(Msg.getString("K0031", length)); //$NON-NLS-1$
         }
         for (int i = 0; i < length; i++) {
             int c;

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/LineNumberInputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/LineNumberInputStream.java?rev=814478&r1=814477&r2=814478&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/LineNumberInputStream.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/LineNumberInputStream.java Mon Sep 14 05:45:00 2009
@@ -17,6 +17,8 @@
 
 package java.io;
 
+import org.apache.harmony.luni.util.Msg;
+
 /**
  * Wraps an existing {@link InputStream} and counts the line terminators
  * encountered while reading the data. Line numbering starts at 0. Recognized
@@ -167,13 +169,14 @@
      */
     @Override
     public int read(byte[] buffer, int offset, int length) throws IOException {
-        if (buffer == null) {
-            throw new NullPointerException();
-        }
-        // avoid int overflow
-        if (offset < 0 || offset > buffer.length || length < 0
-                || length > buffer.length - offset) {
-            throw new ArrayIndexOutOfBoundsException();
+        // Force buffer null check first!
+        if (offset > buffer.length || offset < 0) {
+            // K002e=Offset out of bounds \: {0}
+            throw new ArrayIndexOutOfBoundsException(Msg.getString("K002e", offset)); //$NON-NLS-1$
+        } 
+        if (length < 0 || length > buffer.length - offset) {
+            // K0031=Length out of bounds \: {0}
+            throw new ArrayIndexOutOfBoundsException(Msg.getString("K0031", length)); //$NON-NLS-1$
         }
 
         for (int i = 0; i < length; i++) {

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/ObjectInputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/ObjectInputStream.java?rev=814478&r1=814477&r2=814478&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/ObjectInputStream.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/ObjectInputStream.java Mon Sep 14 05:45:00 2009
@@ -664,13 +664,14 @@
      */
     @Override
     public int read(byte[] buffer, int offset, int length) throws IOException {
-        if (buffer == null) {
-            throw new NullPointerException();
-        }
-        // avoid int overflow
-        if (offset < 0 || offset > buffer.length || length < 0
-                || length > buffer.length - offset) {
-            throw new ArrayIndexOutOfBoundsException();
+        // Force buffer null check first!
+        if (offset > buffer.length || offset < 0) {
+            // K002e=Offset out of bounds \: {0}
+            throw new ArrayIndexOutOfBoundsException(Msg.getString("K002e", offset)); //$NON-NLS-1$
+        }
+        if (length < 0 || length > buffer.length - offset) {
+            // K0031=Length out of bounds \: {0}
+            throw new ArrayIndexOutOfBoundsException(Msg.getString("K0031", length)); //$NON-NLS-1$
         }
         if (length == 0) {
             return 0;

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/ObjectOutputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/ObjectOutputStream.java?rev=814478&r1=814477&r2=814478&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/ObjectOutputStream.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/ObjectOutputStream.java Mon Sep 14 05:45:00 2009
@@ -1555,15 +1555,20 @@
     private Integer writeNewString(String object, boolean unshared)
             throws IOException {
         long count = output.countUTFBytes(object);
+        byte[] buffer;
+        int offset = 0;
         if (count <= 0xffff) {
-            output.writeByte(TC_STRING);
-            output.writeShort((short) count);
+            buffer = new byte[(int)count+3];
+            buffer[offset++] = TC_STRING;
+            offset = output.writeShortToBuffer((short) count, buffer, offset);
         } else {
-            output.writeByte(TC_LONGSTRING);
-            output.writeLong(count);
+            buffer = new byte[(int)count+9];
+            buffer[offset++] = TC_LONGSTRING;
+            offset = output.writeLongToBuffer(count, buffer, offset);
         }
-        output.writeUTFBytes(object, count);
-     
+        offset = output.writeUTFBytesToBuffer(object, count, buffer, offset);
+        output.write(buffer, 0, offset);
+
         Integer handle = nextHandle();
 
         if (!unshared) {

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/PrintStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/PrintStream.java?rev=814478&r1=814477&r2=814478&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/PrintStream.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/PrintStream.java Mon Sep 14 05:45:00 2009
@@ -662,7 +662,7 @@
      *            the buffer to be written.
      * @param offset
      *            the index of the first byte in {@code buffer} to write.
-     * @param count
+     * @param length
      *            the number of bytes in {@code buffer} to write.
      * @throws IndexOutOfBoundsException
      *             if {@code offset < 0} or {@code count < 0}, or if {@code
@@ -670,14 +670,15 @@
      * @see #flush()
      */
     @Override
-    public void write(byte[] buffer, int offset, int count) {
-        if (buffer == null) {
-            throw new NullPointerException();
-        }
-        // avoid int overflow
-        if (offset < 0 || offset > buffer.length || count < 0
-                || count > buffer.length - offset) {
-            throw new ArrayIndexOutOfBoundsException(Msg.getString("K002f")); //$NON-NLS-1$
+    public void write(byte[] buffer, int offset, int length) {
+        // Force buffer null check first!
+        if (offset > buffer.length || offset < 0) {
+            // K002e=Offset out of bounds \: {0}
+            throw new ArrayIndexOutOfBoundsException(Msg.getString("K002e", offset)); //$NON-NLS-1$
+        }
+        if (length < 0 || length > buffer.length - offset) {
+            // K0031=Length out of bounds \: {0}
+            throw new ArrayIndexOutOfBoundsException(Msg.getString("K0031", length)); //$NON-NLS-1$
         }
         synchronized (this) {
             if (out == null) {
@@ -685,7 +686,7 @@
                 return;
             }
             try {
-                out.write(buffer, offset, count);
+                out.write(buffer, offset, length);
                 if (autoflush) {
                     flush();
                 }

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/PushbackInputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/PushbackInputStream.java?rev=814478&r1=814477&r2=814478&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/PushbackInputStream.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/PushbackInputStream.java Mon Sep 14 05:45:00 2009
@@ -177,15 +177,17 @@
     @Override
     public int read(byte[] buffer, int offset, int length) throws IOException {
         if (buf == null) {
-            throw new IOException();
-        }
-        if (buffer == null) {
-            throw new NullPointerException();
+            // K0059=Stream is closed
+            throw new IOException(Msg.getString("K0059")); //$NON-NLS-1$
         }
-        // avoid int overflow
-        if (offset < 0 || offset > buffer.length || length < 0
-                || length > buffer.length - offset) {
-            throw new ArrayIndexOutOfBoundsException();
+        // Force buffer null check first!
+        if (offset > buffer.length || offset < 0) {
+            // K002e=Offset out of bounds \: {0}
+            throw new ArrayIndexOutOfBoundsException(Msg.getString("K002e", offset)); //$NON-NLS-1$
+        }
+        if (length < 0 || length > buffer.length - offset) {
+            // K0031=Length out of bounds \: {0}
+            throw new ArrayIndexOutOfBoundsException(Msg.getString("K0031", length)); //$NON-NLS-1$
         }
 
         int copiedBytes = 0, copyLength = 0, newOffset = offset;
@@ -291,18 +293,22 @@
     public void unread(byte[] buffer, int offset, int length)
             throws IOException {
         if (length > pos) {
-            // Pushback buffer full
+            // K007e=Pushback buffer full
             throw new IOException(Msg.getString("K007e")); //$NON-NLS-1$
         }
-        // avoid int overflow
-        if (offset < 0 || offset > buffer.length || length < 0
-                || length > buffer.length - offset) {
-            throw new ArrayIndexOutOfBoundsException();
+        if (offset > buffer.length || offset < 0) {
+            // K002e=Offset out of bounds \: {0}
+            throw new ArrayIndexOutOfBoundsException(Msg.getString("K002e", offset)); //$NON-NLS-1$
+        }
+        if (length < 0 || length > buffer.length - offset) {
+            // K0031=Length out of bounds \: {0}
+            throw new ArrayIndexOutOfBoundsException(Msg.getString("K0031", length)); //$NON-NLS-1$
         }
-
         if (buf == null) {
-            throw new IOException();
+            // K0059=Stream is closed
+            throw new IOException(Msg.getString("K0059")); //$NON-NLS-1$
         }
+
         System.arraycopy(buffer, offset, buf, pos - length, length);
         pos = pos - length;
     }

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/PushbackReader.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/PushbackReader.java?rev=814478&r1=814477&r2=814478&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/PushbackReader.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/PushbackReader.java Mon Sep 14 05:45:00 2009
@@ -289,7 +289,7 @@
      *            reader.
      * @param offset
      *            the index of the first byte in {@code buffer} to push back.
-     * @param count
+     * @param length
      *            the number of bytes to push back.
      * @throws IndexOutOfBoundsException
      *             if {@code offset < 0} or {@code count < 0}, or if
@@ -302,23 +302,27 @@
      * @throws NullPointerException
      *             if {@code buffer} is {@code null}.
      */
-    public void unread(char[] buffer, int offset, int count) throws IOException {
+    public void unread(char[] buffer, int offset, int length) throws IOException {
         synchronized (lock) {
             if (buf == null) {
+                // K0059=Stream is closed
                 throw new IOException(Msg.getString("K0059")); //$NON-NLS-1$
             }
-            if (count > pos) {
-                // Pushback buffer full
+            if (length > pos) {
+                // K007e=Pushback buffer full
                 throw new IOException(Msg.getString("K007e")); //$NON-NLS-1$
             }
-            if (buffer == null) {
-                throw new NullPointerException();
-            }
-            // avoid int overflow
-            if (offset < 0 || count < 0 || offset > buffer.length - count) {
-                throw new ArrayIndexOutOfBoundsException();
+            // Force buffer null check first!
+            if (offset > buffer.length - length || offset < 0) {
+                // K002e=Offset out of bounds \: {0}
+                throw new ArrayIndexOutOfBoundsException(Msg.getString("K002e", offset)); //$NON-NLS-1$
+            }
+            if (length < 0) {
+                // K0031=Length out of bounds \: {0}
+                throw new ArrayIndexOutOfBoundsException(Msg.getString("K0031", length)); //$NON-NLS-1$
             }
-            for (int i = offset + count - 1; i >= offset; i--) {
+
+            for (int i = offset + length - 1; i >= offset; i--) {
                 unread(buffer[i]);
             }
         }

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/StringBufferInputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/StringBufferInputStream.java?rev=814478&r1=814477&r2=814478&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/StringBufferInputStream.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/StringBufferInputStream.java Mon Sep 14 05:45:00 2009
@@ -112,13 +112,19 @@
             return -1;
         }
         if (b == null) {
+            // K0047=buffer is null
             throw new NullPointerException(Msg.getString("K0047")); //$NON-NLS-1$
         }
         // avoid int overflow
-        if (offset < 0 || offset > b.length || length < 0
-                || length > b.length - offset) {
-            throw new ArrayIndexOutOfBoundsException();
+        if (offset < 0 || offset > b.length) {
+            // K002e=Offset out of bounds \: {0}
+            throw new ArrayIndexOutOfBoundsException(Msg.getString("K002e", offset)); //$NON-NLS-1$
+        }
+        if (length < 0 || length > b.length - offset) {
+            // K0031=Length out of bounds \: {0}
+            throw new ArrayIndexOutOfBoundsException(Msg.getString("K0031", length)); //$NON-NLS-1$
         }
+
         if (length == 0) {
             return 0;
         }

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/StringReader.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/StringReader.java?rev=814478&r1=814477&r2=814478&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/StringReader.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/StringReader.java Mon Sep 14 05:45:00 2009
@@ -154,12 +154,16 @@
     public int read(char buf[], int offset, int len) throws IOException {
         synchronized (lock) {
             if (isClosed()) {
+                // K0083=StringReader is closed.
                 throw new IOException(Msg.getString("K0083")); //$NON-NLS-1$
             }
-            // avoid int overflow
-            if (offset < 0 || offset > buf.length || len < 0
-                    || len > buf.length - offset) {
-                throw new ArrayIndexOutOfBoundsException();
+            if (offset < 0 || offset > buf.length) {
+                // K002e=Offset out of bounds \: {0}
+                throw new ArrayIndexOutOfBoundsException(Msg.getString("K002e", offset)); //$NON-NLS-1$
+            }
+            if (len < 0 || len > buf.length - offset) {
+                // K0031=Length out of bounds \: {0}
+                throw new ArrayIndexOutOfBoundsException(Msg.getString("K0031", len)); //$NON-NLS-1$
             }
             if (len == 0) {
                 return 0;

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/lang/AbstractStringBuilder.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/lang/AbstractStringBuilder.java?rev=814478&r1=814477&r2=814478&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/lang/AbstractStringBuilder.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/lang/AbstractStringBuilder.java Mon Sep 14 05:45:00 2009
@@ -118,21 +118,23 @@
         count = newSize;
     }
 
-    final void append0(char chars[], int start, int length) {
-        if (chars == null) {
-            throw new NullPointerException();
-        }
-        // start + length could overflow, start/length maybe MaxInt
-        if (start >= 0 && 0 <= length && length <= chars.length - start) {
-            int newSize = count + length;
-            if (newSize > value.length) {
-                enlargeBuffer(newSize);
-            }
-            System.arraycopy(chars, start, value, count, length);
-            count = newSize;
-        } else {
-            throw new ArrayIndexOutOfBoundsException();
+    final void append0(char[] chars, int offset, int length) {
+        // Force null check of chars first!
+        if (offset > chars.length || offset < 0) {
+            // K002e=Offset out of bounds \: {0}
+            throw new ArrayIndexOutOfBoundsException(Msg.getString("K002e", offset)); //$NON-NLS-1$
+        }
+        if (length < 0 || chars.length - offset < length) {
+            // K0031=Length out of bounds \: {0}
+            throw new ArrayIndexOutOfBoundsException(Msg.getString("K0031", length)); //$NON-NLS-1$
         }
+
+        int newSize = count + length;
+        if (newSize > value.length) {
+            enlargeBuffer(newSize);
+        }
+        System.arraycopy(chars, offset, value, count, length);
+        count = newSize;
     }
 
     final void append0(char ch) {

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/lang/ArrayIndexOutOfBoundsException.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/lang/ArrayIndexOutOfBoundsException.java?rev=814478&r1=814477&r2=814478&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/lang/ArrayIndexOutOfBoundsException.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/lang/ArrayIndexOutOfBoundsException.java Mon Sep 14 05:45:00 2009
@@ -44,6 +44,7 @@
      *            the invalid index.
      */
     public ArrayIndexOutOfBoundsException(int index) {
+        // K0052=Array index out of range\: {0}
         super(Msg.getString("K0052", index)); //$NON-NLS-1$
     }
 

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/DatagramSocketImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/DatagramSocketImpl.java?rev=814478&r1=814477&r2=814478&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/DatagramSocketImpl.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/DatagramSocketImpl.java Mon Sep 14 05:45:00 2009
@@ -104,17 +104,6 @@
     }
 
     /**
-     * Gets the value for the specified socket option.
-     * 
-     * @param optID
-     *            the ID of the socket option to be retrieved.
-     * @return the requested option value.
-     * @throws SocketException
-     *                if an error occurs while accessing the option.
-     */
-    public abstract Object getOption(int optID) throws SocketException;
-
-    /**
      * Gets the time-to-live (TTL) for multicast packets sent on this socket.
      * 
      * @return the time-to-live option as a byte value.
@@ -232,19 +221,6 @@
     protected abstract void send(DatagramPacket pack) throws IOException;
 
     /**
-     * Sets the value for the specified socket option.
-     * 
-     * @param optID
-     *            the ID of the socket option to be set.
-     * @param val
-     *            the value of the option.
-     * @throws SocketException
-     *                if an error occurs while setting the option.
-     */
-    public abstract void setOption(int optID, Object val)
-            throws SocketException;
-
-    /**
      * Sets the time-to-live (TTL) option for multicast packets sent on this
      * socket.
      * 

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/Arrays.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/Arrays.java?rev=814478&r1=814477&r2=814478&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/Arrays.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/Arrays.java Mon Sep 14 05:45:00 2009
@@ -20,6 +20,8 @@
 import java.io.Serializable;
 import java.lang.reflect.Array;
 
+import org.apache.harmony.luni.util.Msg;
+
 /**
  * {@code Arrays} contains static methods which operate on arrays.
  * 
@@ -750,14 +752,7 @@
      *                if {@code start < 0} or {@code end > array.length}.
      */
     public static void fill(byte[] array, int start, int end, byte value) {
-        // Check for null first
-        int length = array.length;
-        if (start > end) {
-            throw new IllegalArgumentException();
-        }
-        if (start < 0 || end > length) {
-            throw new ArrayIndexOutOfBoundsException();
-        }
+        checkBounds(array.length, start, end);
         for (int i = start; i < end; i++) {
             array[i] = value;
         }
@@ -794,14 +789,7 @@
      *                if {@code start < 0} or {@code end > array.length}.
      */
     public static void fill(short[] array, int start, int end, short value) {
-        // Check for null first
-        int length = array.length;
-        if (start > end) {
-            throw new IllegalArgumentException();
-        }
-        if (start < 0 || end > length) {
-            throw new ArrayIndexOutOfBoundsException();
-        }
+        checkBounds(array.length, start, end);
         for (int i = start; i < end; i++) {
             array[i] = value;
         }
@@ -838,14 +826,7 @@
      *                if {@code start < 0} or {@code end > array.length}.
      */
     public static void fill(char[] array, int start, int end, char value) {
-        // Check for null first
-        int length = array.length;
-        if (start > end) {
-            throw new IllegalArgumentException();
-        }
-        if (start < 0 || end > length) {
-            throw new ArrayIndexOutOfBoundsException();
-        }
+        checkBounds(array.length, start, end);
         for (int i = start; i < end; i++) {
             array[i] = value;
         }
@@ -882,14 +863,7 @@
      *                if {@code start < 0} or {@code end > array.length}.
      */
     public static void fill(int[] array, int start, int end, int value) {
-        // Check for null first
-        int length = array.length;
-        if (start > end) {
-            throw new IllegalArgumentException();
-        }
-        if (start < 0 || end > length) {
-            throw new ArrayIndexOutOfBoundsException();
-        }
+        checkBounds(array.length, start, end);
         for (int i = start; i < end; i++) {
             array[i] = value;
         }
@@ -926,14 +900,7 @@
      *                if {@code start < 0} or {@code end > array.length}.
      */
     public static void fill(long[] array, int start, int end, long value) {
-        // Check for null first
-        int length = array.length;
-        if (start > end) {
-            throw new IllegalArgumentException();
-        }
-        if (start < 0 || end > length) {
-            throw new ArrayIndexOutOfBoundsException();
-        }
+        checkBounds(array.length, start, end);
         for (int i = start; i < end; i++) {
             array[i] = value;
         }
@@ -970,14 +937,7 @@
      *                if {@code start < 0} or {@code end > array.length}.
      */
     public static void fill(float[] array, int start, int end, float value) {
-        // Check for null first
-        int length = array.length;
-        if (start > end) {
-            throw new IllegalArgumentException();
-        }
-        if (start < 0 || end > length) {
-            throw new ArrayIndexOutOfBoundsException();
-        }
+        checkBounds(array.length, start, end);
         for (int i = start; i < end; i++) {
             array[i] = value;
         }
@@ -1014,14 +974,7 @@
      *                if {@code start < 0} or {@code end > array.length}.
      */
     public static void fill(double[] array, int start, int end, double value) {
-        // Check for null first
-        int length = array.length;
-        if (start > end) {
-            throw new IllegalArgumentException();
-        }
-        if (start < 0 || end > length) {
-            throw new ArrayIndexOutOfBoundsException();
-        }
+        checkBounds(array.length, start, end);
         for (int i = start; i < end; i++) {
             array[i] = value;
         }
@@ -1058,14 +1011,7 @@
      *                if {@code start < 0} or {@code end > array.length}.
      */
     public static void fill(boolean[] array, int start, int end, boolean value) {
-        // Check for null first
-        int length = array.length;
-        if (start > end) {
-            throw new IllegalArgumentException();
-        }
-        if (start < 0 || end > length) {
-            throw new ArrayIndexOutOfBoundsException();
-        }
+        checkBounds(array.length, start, end);
         for (int i = start; i < end; i++) {
             array[i] = value;
         }
@@ -1102,14 +1048,7 @@
      *                if {@code start < 0} or {@code end > array.length}.
      */
     public static void fill(Object[] array, int start, int end, Object value) {
-        // Check for null first
-        int length = array.length;
-        if (start > end) {
-            throw new IllegalArgumentException();
-        }
-        if (start < 0 || end > length) {
-            throw new ArrayIndexOutOfBoundsException();
-        }
+        checkBounds(array.length, start, end);
         for (int i = start; i < end; i++) {
             array[i] = value;
         }
@@ -1948,11 +1887,17 @@
 
     private static void checkBounds(int arrLength, int start, int end) {
         if (start > end) {
-            throw new IllegalArgumentException("start(" + start //$NON-NLS-1$
-                    + ") > end(" + end + ")"); //$NON-NLS-1$ //$NON-NLS-2$
-        }
-        if (start < 0 || end > arrLength) {
-            throw new ArrayIndexOutOfBoundsException();
+            // K0033=Start index ({0}) is greater than end index ({1})
+            throw new IllegalArgumentException(Msg.getString("K0033", //$NON-NLS-1$
+                    Integer.valueOf(start), Integer.valueOf(end)));
+        }
+        if (start < 0) {
+            // K0052=Array index out of range\: {0}
+            throw new ArrayIndexOutOfBoundsException(Msg.getString("K0052", start)); //$NON-NLS-1$
+        }
+        if (end > arrLength) {
+            // K0052=Array index out of range\: {0}
+            throw new ArrayIndexOutOfBoundsException(Msg.getString("K0052", end)); //$NON-NLS-1$
         }
     }
 

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/Collections.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/Collections.java?rev=814478&r1=814477&r2=814478&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/Collections.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/Collections.java Mon Sep 14 05:45:00 2009
@@ -24,6 +24,7 @@
 import java.lang.reflect.Array;
 
 import org.apache.harmony.luni.internal.nls.Messages;
+import org.apache.harmony.luni.util.Msg;
 
 /**
  * {@code Collections} contains static methods which operate on
@@ -1589,7 +1590,8 @@
     public static <T> void copy(List<? super T> destination,
             List<? extends T> source) {
         if (destination.size() < source.size()) {
-            throw new ArrayIndexOutOfBoundsException();
+            // K0032=Source size {0} does not fit into destination
+            throw new ArrayIndexOutOfBoundsException(Msg.getString("K0032", source.size())); //$NON-NLS-1$
         }
         Iterator<? extends T> srcIt = source.iterator();
         ListIterator<? super T> destIt = destination.listIterator();
@@ -1597,7 +1599,8 @@
             try {
                 destIt.next();
             } catch (NoSuchElementException e) {
-                throw new ArrayIndexOutOfBoundsException();
+                // K0032=Source size {0} does not fit into destination
+                throw new ArrayIndexOutOfBoundsException(Msg.getString("K0032", source.size())); //$NON-NLS-1$
             }
             destIt.set(srcIt.next());
         }
@@ -1840,36 +1843,30 @@
      * @throws UnsupportedOperationException
      *             when replacing an element in the list is not supported.
      */
-    @SuppressWarnings("unchecked")
     public static void shuffle(List<?> list, Random random) {
-        if (!(list instanceof RandomAccess)) {
-            Object[] array = list.toArray();
+        @SuppressWarnings("unchecked") // we won't put foreign objects in
+        final List<Object> objectList = (List<Object>) list;
+
+        if (list instanceof RandomAccess) {
+            for (int i = objectList.size() - 1; i > 0; i--) {
+                int index = random.nextInt(i + 1);
+                objectList.set(index, objectList.set(i, objectList.get(index)));
+            }
+        } else {
+            Object[] array = objectList.toArray();
             for (int i = array.length - 1; i > 0; i--) {
                 int index = random.nextInt(i + 1);
-                if (index < 0) {
-                    index = -index;
-                }
                 Object temp = array[i];
                 array[i] = array[index];
                 array[index] = temp;
             }
 
             int i = 0;
-            ListIterator<Object> it = (ListIterator<Object>) list
-                    .listIterator();
+            ListIterator<Object> it = objectList.listIterator();
             while (it.hasNext()) {
                 it.next();
                 it.set(array[i++]);
             }
-        } else {
-            List<Object> rawList = (List<Object>) list;
-            for (int i = rawList.size() - 1; i > 0; i--) {
-                int index = random.nextInt(i + 1);
-                if (index < 0) {
-                    index = -index;
-                }
-                rawList.set(index, rawList.set(i, rawList.get(index)));
-            }
         }
     }
 

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpURLConnection.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpURLConnection.java?rev=814478&r1=814477&r2=814478&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpURLConnection.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpURLConnection.java Mon Sep 14 05:45:00 2009
@@ -172,13 +172,14 @@
 
         @Override
         public int read(byte[] buf, int offset, int length) throws IOException {
-            if (buf == null) {
-                throw new NullPointerException();
-            }
-            // avoid int overflow
-            if (offset < 0 || length < 0 || offset > buf.length
-                    || buf.length - offset < length) {
-                throw new ArrayIndexOutOfBoundsException();
+            // Force buf null check first, and avoid int overflow
+            if (offset < 0 || offset > buf.length) {
+                // K002e=Offset out of bounds \: {0}
+                throw new ArrayIndexOutOfBoundsException(Msg.getString("K002e", offset)); //$NON-NLS-1$
+            }
+            if (length < 0 || buf.length - offset < length) {
+                // K0031=Length out of bounds \: {0}
+                throw new ArrayIndexOutOfBoundsException(Msg.getString("K0031", length)); //$NON-NLS-1$
             }
             if (bytesRemaining <= 0) {
                 disconnect(false);
@@ -292,13 +293,14 @@
 
         @Override
         public int read(byte[] buf, int offset, int length) throws IOException {
-            if (buf == null) {
-                throw new NullPointerException();
-            }
-            // avoid int overflow
-            if (offset < 0 || length < 0 || offset > buf.length
-                    || buf.length - offset < length) {
-                throw new ArrayIndexOutOfBoundsException();
+            // Force buf null check first, and avoid int overflow
+            if (offset > buf.length || offset < 0) {
+                // K002e=Offset out of bounds \: {0}
+                throw new ArrayIndexOutOfBoundsException(Msg.getString("K002e", offset)); //$NON-NLS-1$
+            }
+            if (length < 0 || buf.length - offset < length) {
+                // K0031=Length out of bounds \: {0}
+                throw new ArrayIndexOutOfBoundsException(Msg.getString("K0031", length)); //$NON-NLS-1$
             }
             if (bytesRemaining <= 0) {
                 readChunkSize();

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/internal/process/ProcessInputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/internal/process/ProcessInputStream.java?rev=814478&r1=814477&r2=814478&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/internal/process/ProcessInputStream.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/internal/process/ProcessInputStream.java Mon Sep 14 05:45:00 2009
@@ -20,6 +20,8 @@
 import java.io.FileDescriptor;
 import java.io.IOException;
 
+import org.apache.harmony.luni.util.Msg;
+
 class ProcessInputStream extends java.io.InputStream {
 
     private long handle;
@@ -120,10 +122,13 @@
             if (handle == -1) {
                 return -1;
             }
-            if ((nbytes < 0 || nbytes > buffer.length)
-                    || (offset < 0 || offset > buffer.length)
-                    || ((nbytes + offset) > buffer.length)) {
-                throw new ArrayIndexOutOfBoundsException();
+            if (nbytes > buffer.length  || nbytes < 0) {
+                // K0031=Length out of bounds \: {0}
+                throw new ArrayIndexOutOfBoundsException(Msg.getString("K0031", nbytes)); //$NON-NLS-1$
+            }
+            if (offset < 0 || offset > buffer.length - nbytes) {
+                // K002e=Offset out of bounds \: {0}
+                throw new ArrayIndexOutOfBoundsException(Msg.getString("K002e", offset)); //$NON-NLS-1$
             }
             return readImpl(buffer, offset, nbytes, handle);
         }

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/net/PlainDatagramSocketImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/net/PlainDatagramSocketImpl.java?rev=814478&r1=814477&r2=814478&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/net/PlainDatagramSocketImpl.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/net/PlainDatagramSocketImpl.java Mon Sep 14 05:45:00 2009
@@ -154,7 +154,6 @@
         close();
     }
 
-    @Override
     public Object getOption(int optID) throws SocketException {
         if (optID == SocketOptions.SO_TIMEOUT) {
             return Integer.valueOf(receiveTimeout);
@@ -285,7 +284,6 @@
      * @throws SocketException thrown if the option value is unsupported or
      *         invalid
      */
-    @Override
     public void setOption(int optID, Object val) throws SocketException {
         /*
          * for datagram sockets on some platforms we have to set both the

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/net/SocketInputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/net/SocketInputStream.java?rev=814478&r1=814477&r2=814478&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/net/SocketInputStream.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/net/SocketInputStream.java Mon Sep 14 05:45:00 2009
@@ -78,7 +78,8 @@
         }
 
         if (0 > offset || offset >= buffer.length) {
-            throw new ArrayIndexOutOfBoundsException(Msg.getString("K002e"));//$NON-NLS-1$
+            // K002e=Offset out of bounds \: {0}
+            throw new ArrayIndexOutOfBoundsException(Msg.getString("K002e", offset));//$NON-NLS-1$
         }
         if (0 > count || offset + count > buffer.length) {
             throw new ArrayIndexOutOfBoundsException(Msg.getString("K002f"));//$NON-NLS-1$



Mime
View raw message