harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r986497 [3/4] - in /harmony/enhanced/java/branches/mrh: ./ classlib/ classlib/depends/build/platform/ classlib/depends/manifests/xalan-j_2.7.0/ classlib/depends/manifests/xerces_2.10.0/ classlib/make/ classlib/modules/archive/src/main/nativ...
Date Tue, 17 Aug 2010 21:36:14 GMT
Modified: harmony/enhanced/java/branches/mrh/classlib/modules/nio/src/main/java/common/org/apache/harmony/nio/internal/FileChannelImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/nio/src/main/java/common/org/apache/harmony/nio/internal/FileChannelImpl.java?rev=986497&r1=986496&r2=986497&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/nio/src/main/java/common/org/apache/harmony/nio/internal/FileChannelImpl.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/nio/src/main/java/common/org/apache/harmony/nio/internal/FileChannelImpl.java Tue Aug 17 21:36:10 2010
@@ -603,8 +603,8 @@ public abstract class FileChannelImpl ex
         for (int i = offset; i < length + offset; i++) {
             if (bytesRemaining > sources[i].remaining()) {
                 int pos = sources[i].limit();
-                sources[i].position(pos);
                 bytesRemaining -= sources[i].remaining();
+                sources[i].position(pos);
             } else {
                 int pos = sources[i].position() + (int) bytesRemaining;
                 sources[i].position(pos);

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/nio/src/main/java/common/org/apache/harmony/nio/internal/PipeImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/nio/src/main/java/common/org/apache/harmony/nio/internal/PipeImpl.java?rev=986497&r1=986496&r2=986497&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/nio/src/main/java/common/org/apache/harmony/nio/internal/PipeImpl.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/nio/src/main/java/common/org/apache/harmony/nio/internal/PipeImpl.java Tue Aug 17 21:36:10 2010
@@ -24,6 +24,10 @@ import java.nio.ByteBuffer;
 import java.nio.channels.Pipe;
 import java.nio.channels.ServerSocketChannel;
 import java.nio.channels.spi.SelectorProvider;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
 
 import org.apache.harmony.luni.platform.FileDescriptorHandler;
 
@@ -42,21 +46,30 @@ final class PipeImpl extends Pipe {
 
     public PipeImpl() throws IOException {
         super();
+        sink = new SinkChannelImpl(SelectorProvider.provider());
+        source = new SourceChannelImpl(SelectorProvider.provider());
         try {
-            sink = new SinkChannelImpl(SelectorProvider.provider());
-            source = new SourceChannelImpl(SelectorProvider.provider());
-            sink.finishConnect();
-            source.accept();
-            source.closeServer();
-        } catch(IOException ioe){
+            AccessController.doPrivileged(new PrivilegedExceptionAction<Void>() {
+                public Void run() throws Exception {
+                    sink.finishConnect();
+                    source.accept();
+                    source.closeServer();
+                    return null;
+                }
+            });
+        } catch (PrivilegedActionException e) {
             reset();
-            throw ioe;
-        } catch(RuntimeException e){
-            reset();
-            throw e;
+            Exception ex = e.getException();
+            if (ex instanceof IOException) {
+                throw (IOException) ex;
+            }
+            if (ex instanceof RuntimeException) {
+                throw (RuntimeException) ex;
+            }
+            throw new RuntimeException(ex);
         }
     }
-    
+
     private void reset(){
         if(sink != null){
             try {

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/nio/src/main/java/common/org/apache/harmony/nio/internal/SocketChannelImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/nio/src/main/java/common/org/apache/harmony/nio/internal/SocketChannelImpl.java?rev=986497&r1=986496&r2=986497&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/nio/src/main/java/common/org/apache/harmony/nio/internal/SocketChannelImpl.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/nio/src/main/java/common/org/apache/harmony/nio/internal/SocketChannelImpl.java Tue Aug 17 21:36:10 2010
@@ -43,6 +43,7 @@ import java.nio.channels.UnsupportedAddr
 import java.nio.channels.spi.SelectorProvider;
 
 import org.apache.harmony.luni.net.PlainSocketImpl;
+import org.apache.harmony.luni.net.NetUtil;
 import org.apache.harmony.luni.platform.FileDescriptorHandler;
 import org.apache.harmony.luni.platform.INetworkSystem;
 import org.apache.harmony.luni.platform.Platform;
@@ -147,7 +148,7 @@ class SocketChannelImpl extends SocketCh
         fd = new FileDescriptor();
         status = SOCKET_STATUS_UNCONNECTED;
         if (connect) {
-            networkSystem.createStreamSocket(fd, true);
+            networkSystem.createStreamSocket(fd, NetUtil.preferIPv4Stack());
         }
     }
 
@@ -745,7 +746,7 @@ class SocketChannelImpl extends SocketCh
          */
         @Override
         public boolean isConnected() {
-            return channel.isConnected();
+            return super.isConnected() || channel.isConnected();
         }
 
         /**

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/DatagramChannelTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/DatagramChannelTest.java?rev=986497&r1=986496&r2=986497&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/DatagramChannelTest.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/DatagramChannelTest.java Tue Aug 17 21:36:10 2010
@@ -2576,6 +2576,23 @@ public class DatagramChannelTest extends
         }
     }
     
+    public void test_bounded_harmony6493() throws IOException {
+        DatagramChannel server = DatagramChannel.open();
+        InetSocketAddress addr = new InetSocketAddress("localhost", 0);
+        server.socket().bind(addr);
+        SocketAddress boundedAddress = server.socket().getLocalSocketAddress();
+
+        DatagramChannel client = DatagramChannel.open();
+        ByteBuffer sent = ByteBuffer.allocate(1024);
+        sent.put("test".getBytes());
+        sent.flip();
+        client.send(sent, boundedAddress);
+        assertTrue(client.socket().isBound());
+        
+        server.close();
+        client.close();
+    }
+    
     // -------------------------------------------------------------------
     // Mock class for security test.
     // -------------------------------------------------------------------

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/PipeTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/PipeTest.java?rev=986497&r1=986496&r2=986497&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/PipeTest.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/PipeTest.java Tue Aug 17 21:36:10 2010
@@ -17,9 +17,11 @@
 package org.apache.harmony.nio.tests.java.nio.channels;
 
 import java.io.IOException;
+import java.net.NetPermission;
 import java.nio.channels.Pipe;
 import java.nio.channels.Pipe.SinkChannel;
 import java.nio.channels.Pipe.SourceChannel;
+import java.security.Permission;
 
 import junit.framework.TestCase;
 
@@ -36,6 +38,22 @@ public class PipeTest extends TestCase {
 		assertNotNull(pipe);
 	}
 	
+    /**
+     * @tests java.nio.channels.Pipe#open()
+     */
+    public void test_open_securityManager() throws IOException {
+        SecurityManager old = System.getSecurityManager();
+        SecurityManager sm = new MockSM();
+
+        try {
+            System.setSecurityManager(sm);
+            Pipe pipe = Pipe.open();
+            assertNotNull(pipe);
+        } finally {
+            System.setSecurityManager(old);
+        }
+    }
+
 	/**
 	 * @tests java.nio.channels.Pipe#sink()
 	 */
@@ -55,3 +73,17 @@ public class PipeTest extends TestCase {
 	}
 
 }
+
+class MockSM extends SecurityManager {
+    public void checkPermission(Permission permission) {
+        if (permission instanceof NetPermission) {
+            throw new SecurityException();
+        }
+
+        if (permission instanceof RuntimePermission) {
+            if ("setSecurityManager".equals(permission.getName())) {
+                return;
+            }
+        }
+    }
+}

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/ServerSocketChannelTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/ServerSocketChannelTest.java?rev=986497&r1=986496&r2=986497&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/ServerSocketChannelTest.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/ServerSocketChannelTest.java Tue Aug 17 21:36:10 2010
@@ -369,10 +369,11 @@ public class ServerSocketChannelTest ext
     }
     
     /**
+     * @throws InterruptedException 
      * @tests ServerSocketChannel#accept().socket()
      */
     public void test_read_LByteBuffer_Blocking_ReadWriteRealLargeData()
-            throws IOException {
+            throws IOException, InterruptedException {
         serverChannel.socket().bind(localAddr1);
         ByteBuffer buf = ByteBuffer.allocate(CAPACITY_64KB);
         for (int i = 0; i < CAPACITY_64KB; i++) {
@@ -380,13 +381,38 @@ public class ServerSocketChannelTest ext
         }
         buf.flip();
         clientChannel.connect(localAddr1);
-        clientChannel.write(buf);
-        clientChannel.close();
+        WriteChannelThread writeThread = new WriteChannelThread(clientChannel, buf);
+        writeThread.start();
         Socket socket = serverChannel.accept().socket();
         InputStream in = socket.getInputStream();
         assertReadResult(in,CAPACITY_64KB);
+        writeThread.join();
+        // check if the thread threw any exceptions
+        if (writeThread.exception != null) {
+            throw writeThread.exception;
+        }
     }
 
+    class WriteChannelThread extends Thread {
+        SocketChannel channel;
+        ByteBuffer buffer;
+        IOException exception;
+        
+        public WriteChannelThread(SocketChannel channel, ByteBuffer buffer) {
+            this.channel = channel;
+            this.buffer = buffer;
+        }
+        
+        public void run() {
+            try {
+                channel.write(buffer);
+                channel.close();
+            } catch (IOException e) {
+                exception = e;
+            }
+        }
+    }
+    
     /**
      * @tests ServerSocketChannel#accept().socket()
      */
@@ -400,11 +426,16 @@ public class ServerSocketChannelTest ext
         }
         buf.flip();
         clientChannel.connect(localAddr1);
-        clientChannel.write(buf);
-        clientChannel.close();
+        WriteChannelThread writeThread = new WriteChannelThread(clientChannel, buf);
+        writeThread.start();
         Socket socket = serverChannel.accept().socket();
         InputStream in = socket.getInputStream();
         assertReadResult(in,CAPACITY_64KB);
+        writeThread.join();
+        // check if the thread threw any exceptions
+        if (writeThread.exception != null) {
+            throw writeThread.exception;
+        }
     }
     
     /**
@@ -420,10 +451,35 @@ public class ServerSocketChannelTest ext
         }
         clientChannel.connect(localAddr1); 
         Socket socket = serverChannel.accept().socket();
-        OutputStream out = socket.getOutputStream();
-        out.write(writeContent);
-        socket.close();
+        WriteSocketThread writeThread = new WriteSocketThread(socket, writeContent);
+        writeThread.start();
         assertWriteResult(CAPACITY_64KB);
+        writeThread.join();
+        // check if the thread threw any exceptions
+        if (writeThread.exception != null) {
+            throw writeThread.exception;
+        }
+    }
+    
+    class WriteSocketThread extends Thread {
+        Socket socket;
+        byte[] buffer;
+        IOException exception;
+        
+        public WriteSocketThread(Socket socket, byte[] buffer) {
+            this.socket = socket;
+            this.buffer = buffer;
+        }
+        
+        public void run() {
+            try {
+                OutputStream out = socket.getOutputStream();
+                out.write(buffer);
+                socket.close();
+            } catch (IOException e) {
+                exception = e;
+            }
+        }
     }
     
     /**
@@ -438,10 +494,14 @@ public class ServerSocketChannelTest ext
         }
         clientChannel.connect(localAddr1); 
         Socket socket = serverChannel.accept().socket();
-        OutputStream out = socket.getOutputStream();
-        out.write(writeContent);
-        socket.close();
+        WriteSocketThread writeThread = new WriteSocketThread(socket, writeContent);
+        writeThread.start();
         assertWriteResult(CAPACITY_64KB);
+        writeThread.join();
+        // check if the thread threw any exceptions
+        if (writeThread.exception != null) {
+            throw writeThread.exception;
+        }
     }
     
     /**

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/SocketChannelTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/SocketChannelTest.java?rev=986497&r1=986496&r2=986497&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/SocketChannelTest.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/SocketChannelTest.java Tue Aug 17 21:36:10 2010
@@ -2805,6 +2805,46 @@ public class SocketChannelTest extends T
 
     /**
      * @tests java.nio.channels.SocketChannel#write(ByteBuffer[])
+     * 
+     * In non-blocking mode, the native system call will return EAGAIN/EWOULDBLOCK error
+     * code on Linux/Unix and return WSATRY_AGAIN/WSAEWOULDBLOCK error code on Windows.
+     * These error code means try again but not fatal error, so we should not throw exception.
+     */
+    public void test_write$NonBlockingException() throws Exception {
+        ServerSocketChannel ssc = ServerSocketChannel.open();
+        ssc.configureBlocking(false);
+        ssc.socket().bind(null);
+        SocketChannel sc = SocketChannel.open();
+        sc.configureBlocking(false);
+        boolean connected = sc.connect(ssc.socket().getLocalSocketAddress());
+        SocketChannel sock = ssc.accept();
+        if (!connected) {
+            sc.finishConnect();
+        }
+
+        try {
+            for (int i = 0; i < 100; i++) {
+                ByteBuffer buf1 = ByteBuffer.allocate(10);
+                sc.socket().setSendBufferSize(512);
+                int bufSize = sc.socket().getSendBufferSize();
+                ByteBuffer buf2 = ByteBuffer.allocate(bufSize * 10);
+
+                ByteBuffer[] sent = new ByteBuffer[2];
+                sent[0] = buf1;
+                sent[1] = buf2;
+
+                sc.write(sent);
+            }
+        } finally {
+            ssc.close();
+            sc.close();
+            sock.close();
+        }
+
+    }
+
+    /**
+     * @tests java.nio.channels.SocketChannel#write(ByteBuffer[])
      */
     public void test_write$LByteBuffer2() throws IOException {
         // Set-up

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/nio_char/src/main/java/java/nio/charset/CharsetEncoder.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/nio_char/src/main/java/java/nio/charset/CharsetEncoder.java?rev=986497&r1=986496&r2=986497&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/nio_char/src/main/java/java/nio/charset/CharsetEncoder.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/nio_char/src/main/java/java/nio/charset/CharsetEncoder.java Tue Aug 17 21:36:10 2010
@@ -88,7 +88,7 @@ public abstract class CharsetEncoder {
     /*
      * internal status consts
      */
-    private static final int INIT = 0;
+    private static final int READY = 0;
 
     private static final int ONGOING = 1;
 
@@ -96,6 +96,8 @@ public abstract class CharsetEncoder {
 
     private static final int FLUSH = 3;
 
+    private static final int INIT = 4;
+
     // the Charset which creates this encoder
     private Charset cs;
 
@@ -111,6 +113,9 @@ public abstract class CharsetEncoder {
     // internal status
     private int status;
 
+    // internal status indicates encode(CharBuffer) operation is finished
+    private boolean finished;
+
     // action for malformed input
     private CodingErrorAction malformAction;
 
@@ -217,10 +222,10 @@ public abstract class CharsetEncoder {
 
     // implementation of canEncode
     private boolean implCanEncode(CharBuffer cb) {
-        if (status == FLUSH) {
-            status = INIT;
+        if (status == FLUSH || status == INIT) {
+            status = READY;
         }
-        if (status != INIT) {
+        if (status != READY) {
             // niochar.0B=Another encoding process is ongoing\!
             throw new IllegalStateException(Messages.getString("niochar.0B")); //$NON-NLS-1$
         }
@@ -347,7 +352,8 @@ public abstract class CharsetEncoder {
             }
             break;
         }
-        status = FLUSH;
+        status = READY;
+        finished = true;
         return output;
     }
 
@@ -438,6 +444,12 @@ public abstract class CharsetEncoder {
      */
     public final CoderResult encode(CharBuffer in, ByteBuffer out,
             boolean endOfInput) {
+        //If the previous step is encode(CharBuffer), then no more input is needed
+        // thus endOfInput should not be false
+        if (status == READY && finished && !endOfInput) {
+            throw new IllegalStateException();
+        }
+
         if ((status == FLUSH) || (!endOfInput && status == END)) {
             throw new IllegalStateException();
         }
@@ -553,7 +565,7 @@ public abstract class CharsetEncoder {
      *             for the last boolean parameter.
      */
     public final CoderResult flush(ByteBuffer out) {
-        if (status != END && status != INIT) {
+        if (status != END && status != READY) {
             throw new IllegalStateException();
         }
         CoderResult result = implFlush(out);

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/nio_char/src/test/java/org/apache/harmony/nio_char/tests/java/nio/charset/ASCIICharsetEncoderTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/nio_char/src/test/java/org/apache/harmony/nio_char/tests/java/nio/charset/ASCIICharsetEncoderTest.java?rev=986497&r1=986496&r2=986497&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/nio_char/src/test/java/org/apache/harmony/nio_char/tests/java/nio/charset/ASCIICharsetEncoderTest.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/nio_char/src/test/java/org/apache/harmony/nio_char/tests/java/nio/charset/ASCIICharsetEncoderTest.java Tue Aug 17 21:36:10 2010
@@ -290,20 +290,31 @@ public class ASCIICharsetEncoderTest ext
     public void testInternalState_Flushed() {
         CharsetEncoder newEncoder = cs.newEncoder();
         
-        //init -> flushed
-        {
-            ByteBuffer out = ByteBuffer.allocate(0x10);
-            newEncoder.flush(out);
-        }
-        
-        //reset - > flushed
+        // init -> flushed
+		{
+			ByteBuffer out = ByteBuffer.allocate(0x10);
+			try {
+				newEncoder.flush(out);
+				fail("Should throw IllegalStateException");
+			} catch (IllegalStateException e) {
+				//expected
+			}
+
+		}
+
+        // reset - > flushed
         {
             newEncoder.reset();
             CharBuffer in = CharBuffer.wrap("A");
             ByteBuffer out = ByteBuffer.allocate(0x10);
             newEncoder.encode(in, out, true);
             newEncoder.reset();
-            newEncoder.flush(out);
+            try {
+                newEncoder.flush(out);
+				fail("Should throw IllegalStateException");
+            } catch (IllegalStateException e) {
+                //expected
+            }
         }
         
         //encoding - > flushed
@@ -421,23 +432,14 @@ public class ASCIICharsetEncoderTest ext
             CharBuffer in = CharBuffer.wrap("A");
             newEncoder.encode(in);
             ByteBuffer out = ByteBuffer.allocate(0x10);
-            try {
-                newEncoder.encode(in, out, true);
-                fail("Should throw IllegalStateException");
-            } catch (IllegalStateException e) {
-                // expected
-            }
+            newEncoder.encode(in, out, true);
         }
+
         //Encode -> Flushed
         {
             CharBuffer in = CharBuffer.wrap("A");
             ByteBuffer out = newEncoder.encode(in);
-            try {
-                newEncoder.flush(out);
-                fail("Should throw IllegalStateException");
-            } catch (IllegalStateException e) {
-                // expected
-            }
+            newEncoder.flush(out);
         }
         
         //Encode - > encode

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/nio_char/src/test/java/tests/api/java/nio/charset/CharsetEncoderTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/nio_char/src/test/java/tests/api/java/nio/charset/CharsetEncoderTest.java?rev=986497&r1=986496&r2=986497&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/nio_char/src/test/java/tests/api/java/nio/charset/CharsetEncoderTest.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/nio_char/src/test/java/tests/api/java/nio/charset/CharsetEncoderTest.java Tue Aug 17 21:36:10 2010
@@ -296,6 +296,7 @@ public class CharsetEncoderTest extends 
 			encoder.flush(out);
 			fail("should throw IllegalStateException");
 		} catch (IllegalStateException e) {
+		    // Expected
 		}
 
 		// Illegal state: flush after encode with endOfInput is false
@@ -305,8 +306,22 @@ public class CharsetEncoderTest extends 
 			encoder.flush(out);
 			fail("should throw IllegalStateException");
 		} catch (IllegalStateException e) {
+		    // Expected
 		}
 	}
+	
+	public void testFlushAfterConstructing() {
+		ByteBuffer out = ByteBuffer.allocate(5);
+		
+		//Illegal state: flush after instance created
+		try {
+			encoder.flush(out);			
+			fail("should throw IllegalStateException");
+		} catch (IllegalStateException e) {
+			// Expected
+		}
+
+	}
 
 	// test illegal states for encode facade
 	public void testEncodeFacadeIllegalState() throws CharacterCodingException {

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/portlib/src/main/native/a2e/unix/atoe.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/portlib/src/main/native/a2e/unix/atoe.c?rev=986497&r1=986496&r2=986497&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/portlib/src/main/native/a2e/unix/atoe.c (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/portlib/src/main/native/a2e/unix/atoe.c Tue Aug 17 21:36:10 2010
@@ -2092,7 +2092,7 @@ atoe_execvp (const char *file, char *con
         free(ebcdicArgv[i]);
     }
     free(ebcdicArgv);
-    free(ebcdicPath);
+    free(ebcdicFile);
 
     return rc;
 }

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/portlib/src/main/native/include/shared/hycomp.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/portlib/src/main/native/include/shared/hycomp.h?rev=986497&r1=986496&r2=986497&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/portlib/src/main/native/include/shared/hycomp.h (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/portlib/src/main/native/include/shared/hycomp.h Tue Aug 17 21:36:10 2010
@@ -115,7 +115,7 @@ typedef unsigned long long U_64;
 #define HY_LITTLE_ENDIAN
 #endif
 
-#if defined(HYPPC32)
+#if defined(HYPPC32) && defined(LINUX)
 #define VA_PTR(valist) (&valist[0])
 #endif
 

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/portlib/src/main/native/include/unix/hysock.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/portlib/src/main/native/include/unix/hysock.h?rev=986497&r1=986496&r2=986497&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/portlib/src/main/native/include/unix/hysock.h (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/portlib/src/main/native/include/unix/hysock.h Tue Aug 17 21:36:10 2010
@@ -127,7 +127,7 @@ typedef struct ip_mreq OSIPMREQ;
 #define OS_MCAST_LOOP IP_MULTICAST_LOOP
 #if defined(IPv6_FUNCTION_SUPPORT)
 #define OS_MCAST_INTERFACE_2 IPV6_MULTICAST_IF
-#if defined(FREEBSD) || defined(MACOSX)
+#if defined(FREEBSD) || defined(MACOSX) || defined(ZOS)
 #define OS_IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP
 #define OS_IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP
 #else

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/portlib/src/main/native/thread/shared/hythread.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/portlib/src/main/native/thread/shared/hythread.c?rev=986497&r1=986496&r2=986497&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/portlib/src/main/native/thread/shared/hythread.c (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/portlib/src/main/native/thread/shared/hythread.c Tue Aug 17 21:36:10 2010
@@ -830,7 +830,7 @@ hythread_tls_set (hythread_t thread, hyt
  *				HYTHREAD_PRIORITY_USER_MIN<br>
  *				HYTHREAD_PRIORITY_MIN<br>
  * 
- * @returns 0 on success or negative value on failure (priority wasn't changed)
+ * @return 0 on success or negative value on failure (priority wasn't changed)
  * 
  * 
  */

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/print/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/print/META-INF/MANIFEST.MF?rev=986497&r1=986496&r2=986497&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/print/META-INF/MANIFEST.MF (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/print/META-INF/MANIFEST.MF Tue Aug 17 21:36:10 2010
@@ -35,7 +35,8 @@ Import-Package: java.awt,
  javax.swing.event,
  javax.swing.text,
  org.apache.harmony.awt.gl,
- org.apache.harmony.awt.gl.windows
+ org.apache.harmony.awt.gl.windows,
+ org.apache.harmony.kernel.vm
 Export-Package: javax.print,
  javax.print.attribute,
  javax.print.attribute.standard,

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/ServiceUI.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/ServiceUI.java?rev=986497&r1=986496&r2=986497&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/ServiceUI.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/ServiceUI.java Tue Aug 17 21:36:10 2010
@@ -25,6 +25,8 @@ import java.awt.HeadlessException;
 import java.awt.KeyboardFocusManager;
 import java.awt.Window;
 import javax.print.attribute.PrintRequestAttributeSet;
+
+import org.apache.harmony.print.internal.nls.Messages;
 import org.apache.harmony.x.print.ServiceUIDialog;
 
 public class ServiceUI {
@@ -65,12 +67,18 @@ public class ServiceUI {
      */
     static int checkServices(PrintService[] services, PrintService defaultService,
             PrintRequestAttributeSet attributes) {
-        if (services == null) {
-            throw new IllegalArgumentException("Services list is null!");
-        } else if (services.length == 0) {
-            throw new IllegalArgumentException("Services list is empty!");
-        } else if (attributes == null) {
-            throw new IllegalArgumentException("Attribute set is null!");
+       
+    if (services == null) {                 
+            //print.02= Services list is null
+            throw new IllegalArgumentException(Messages.getString("print.02")); //$NON-NLS-1$                   
+        }    
+    else if (services.length == 0) {                  
+            //print.03= Services list is empty
+            throw new IllegalArgumentException(Messages.getString("print.03")); //$NON-NLS-1$
+          }   
+    else if (attributes == null) {        
+            //print.04= Attribute set is null
+            throw new IllegalArgumentException(Messages.getString("print.04")); //$NON-NLS-1$            
         }
         int serviceIndex = 0;
         boolean defaultServiceFound = (defaultService == null);
@@ -81,9 +89,9 @@ public class ServiceUI {
                 break;
             }
         }
-        if (!defaultServiceFound) {
-            throw new IllegalArgumentException(
-                    "Default service is absent in the services list!");
+        if (!defaultServiceFound) {                    
+            //print.05= Default service is absent in the services list
+            throw new IllegalArgumentException(Messages.getString("print.05")); //$NON-NLS-1$
         }
         return serviceIndex;
     }

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/SimpleDoc.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/SimpleDoc.java?rev=986497&r1=986496&r2=986497&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/SimpleDoc.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/SimpleDoc.java Tue Aug 17 21:36:10 2010
@@ -25,6 +25,8 @@ import java.io.Reader;
 import java.io.StringReader;
 import javax.print.attribute.DocAttributeSet;
 
+import org.apache.harmony.print.internal.nls.Messages;
+
 public final class SimpleDoc implements Doc {
     private Object printdata;
 
@@ -44,16 +46,19 @@ public final class SimpleDoc implements 
          * in the DocFlavor.
          */
         if (docflavor == null || printData == null) {
-            throw new IllegalArgumentException("Argument is null");
+            
+            //print.00= Argument is null
+            throw new IllegalArgumentException(Messages.getString("print.00")); //$NON-NLS-1$
         }
         try {
             Class<?> clazz = Class.forName(docflavor.getRepresentationClassName());
             if (!clazz.isInstance(printData)) {
                 throw new IllegalArgumentException("");
             }
-        } catch (Exception e) {
-            throw new IllegalArgumentException("Wrong type of print data");
-        }
+        } catch (Exception e) {          
+            //print.01= Wrong type of print data
+            throw new IllegalArgumentException(Messages.getString("print.01")); //$NON-NLS-1$
+            }
         this.printdata = printData;
         this.flavor = docflavor;
         this.attributes = docattributes;

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/AttributeSetUtilities.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/AttributeSetUtilities.java?rev=986497&r1=986496&r2=986497&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/AttributeSetUtilities.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/AttributeSetUtilities.java Tue Aug 17 21:36:10 2010
@@ -18,6 +18,8 @@ package javax.print.attribute;
 
 import java.io.Serializable;
 
+import org.apache.harmony.print.internal.nls.Messages;
+
 public final class AttributeSetUtilities {
 
 
@@ -147,16 +149,19 @@ public final class AttributeSetUtilities
         }
 
 
-        public boolean add(Attribute attribute) {
-            throw new UnmodifiableSetException("Unmodifiable attribute set");
-        }
+        public boolean add(Attribute attribute) {                     
+            //print.06= Unmodifiable attribute set
+            throw new UnmodifiableSetException(Messages.getString("print.06")); //$NON-NLS-1$
+            }
 
-        public boolean addAll(AttributeSet attributeSet) {
-            throw new UnmodifiableSetException("Unmodifiable attribute set");
-        }
+        public boolean addAll(AttributeSet attributeSet) {             
+            //print.06= Unmodifiable attribute set
+            throw new UnmodifiableSetException(Messages.getString("print.06")); //$NON-NLS-1$        
+            }
 
-        public void clear() {
-            throw new UnmodifiableSetException("Unmodifiable attribute set");
+        public void clear() {            
+            //print.06= Unmodifiable attribute set
+            throw new UnmodifiableSetException(Messages.getString("print.06")); //$NON-NLS-1$
         }
 
         public boolean containsKey(Class attributeCategory) {
@@ -178,17 +183,19 @@ public final class AttributeSetUtilities
         public int hashCode() {
             return aset.hashCode();
         }
-
+        
         public boolean isEmpty() {
             return aset.isEmpty();
         }
-
-        public boolean remove(Attribute attribute) {
-            throw new UnmodifiableSetException("Unmodifiable attribute set");
+        
+        public boolean remove(Attribute attribute) {             
+            //print.06= Unmodifiable attribute set
+            throw new UnmodifiableSetException(Messages.getString("print.06")); //$NON-NLS-1$
         }
-
-        public synchronized boolean remove (Class attributeCategory) {
-            throw new UnmodifiableSetException("Unmodifiable attribute set");
+        
+        public synchronized boolean remove (Class attributeCategory) {             
+            //print.06= Unmodifiable attribute set
+            throw new UnmodifiableSetException(Messages.getString("print.06")); //$NON-NLS-1$
         }
 
         public int size() {
@@ -257,113 +264,124 @@ public final class AttributeSetUtilities
 
     public static AttributeSet 
         synchronizedView (AttributeSet attributeSet) {
-            if (attributeSet == null) {
-                throw new NullPointerException("Null attribute set");
+            if (attributeSet == null) {                           
+                //print.07= Null attribute set
+                throw new NullPointerException(Messages.getString("print.07")); //$NON-NLS-1$            
             }
             return new SynchronizedAttributeSet(attributeSet);
     }
   
     public static DocAttributeSet 
         synchronizedView (DocAttributeSet attributeSet) {
-            if (attributeSet == null) {
-                throw new NullPointerException("Null attribute set");
+            if (attributeSet == null) {                
+                //print.07= Null attribute set
+                throw new NullPointerException(Messages.getString("print.07")); //$NON-NLS-1$           
             }
             return new SynchronizedDocAttributeSet(attributeSet);
     }
     
     public static PrintRequestAttributeSet 
         synchronizedView(PrintRequestAttributeSet attributeSet) {
-            if (attributeSet == null) {
-                throw new NullPointerException("Null attribute set");
+        if (attributeSet == null) {                
+                //print.07= Null attribute set
+                throw new NullPointerException(Messages.getString("print.07")); //$NON-NLS-1$           
             }
             return new SynchronizedPrintRequestAttributeSet(attributeSet);
     }
 
     public static PrintJobAttributeSet
         synchronizedView(PrintJobAttributeSet attributeSet) {
-            if (attributeSet == null) {
-                throw new NullPointerException("Null attribute set");
+            if (attributeSet == null) {                
+                //print.07= Null attribute set
+                throw new NullPointerException(Messages.getString("print.07")); //$NON-NLS-1$           
             }
             return new SynchronizedPrintJobAttributeSet(attributeSet);
     }
 
     public static PrintServiceAttributeSet
         synchronizedView(PrintServiceAttributeSet attributeSet) {
-            if (attributeSet == null) {
-                throw new NullPointerException("Null attribute set");
+            if (attributeSet == null) {                
+                //print.07= Null attribute set
+                throw new NullPointerException(Messages.getString("print.07")); //$NON-NLS-1$           
             }
             return new SynchronizedPrintServiceAttributeSet(attributeSet);
     }
 
     
     public static AttributeSet unmodifiableView (AttributeSet attributeSet) {
-        if (attributeSet == null) {
-            throw new NullPointerException("Null attribute set");
+        if (attributeSet == null) {            
+            //print.07= Null attribute set
+            throw new NullPointerException(Messages.getString("print.07")); //$NON-NLS-1$       
         }
         return new UnmodifiableAttributeSet(attributeSet);
     }
     
     public static DocAttributeSet 
                     unmodifiableView (DocAttributeSet attributeSet) {
-        if (attributeSet == null) {
-            throw new NullPointerException("Null attribute set");
+        if (attributeSet == null) {            
+            //print.07= Null attribute set
+            throw new NullPointerException(Messages.getString("print.07")); //$NON-NLS-1$        
         }
         return new UnmodifiableDocAttributeSet(attributeSet);
     }
     
     public static PrintJobAttributeSet
                     unmodifiableView(PrintJobAttributeSet attributeSet) {
-        if (attributeSet == null) {
-            throw new NullPointerException("Null attribute set");
+        if (attributeSet == null) {            
+            //print.07= Null attribute set
+            throw new NullPointerException(Messages.getString("print.07")); //$NON-NLS-1$        
         }
         return new UnmodifiablePrintJobAttributeSet(attributeSet);
     }
     
     public static PrintRequestAttributeSet 
                     unmodifiableView(PrintRequestAttributeSet attributeSet) {
-        if (attributeSet == null) {
-            throw new NullPointerException("Null attribute set");
+        if (attributeSet == null) {            
+            //print.07= Null attribute set
+            throw new NullPointerException(Messages.getString("print.07")); //$NON-NLS-1$       
         }
         return new UnmodifiablePrintRequestAttributeSet(attributeSet);
     }
       
     public static PrintServiceAttributeSet
                         unmodifiableView(PrintServiceAttributeSet attributeSet) {
-        if (attributeSet == null) {
-            throw new NullPointerException("Null attribute set");
+        if (attributeSet == null) {            
+            //print.07= Null attribute set
+            throw new NullPointerException(Messages.getString("print.07")); //$NON-NLS-1$       
         }
         return new UnmodifiablePrintServiceAttributeSet (attributeSet);
     }
 
     
     public static Class<?> verifyAttributeCategory(Object object, Class<?> interfaceName) {
-        if (!(Attribute.class).isAssignableFrom(interfaceName)) {
-            throw new ClassCastException(interfaceName.getName() + " is not "
-                    + "interface Attribute or it's subinterface");
+        if (!(Attribute.class).isAssignableFrom(interfaceName)) {          
+            //print.08={0} is not interface Attribute or it's subinterface
+            throw new ClassCastException(Messages.getString("print.08",
+                                                            interfaceName.getName())); //$NON-NLs-1$            
         } else if (interfaceName.isAssignableFrom((Class<?>) object)) {
             return (Class<?>) object;
-        } else {
-            throw new ClassCastException(object.getClass().getName() + "doesn't implement"
-                    + interfaceName.getName());
+        } else {                   
+            //print.09={0} doesn't implement {1}
+            throw new ClassCastException(Messages.getString("print.09", object.getClass().getName(), interfaceName.getName())); //$NON-NLS-1$        
         }
     }
 
     public static Attribute verifyAttributeValue(Object attribute, Class<?> interfaceName) {
-        if (attribute == null) {
-            throw new NullPointerException("Null attribute");
+        if (attribute == null) {                      
+          //print.0A= Null attribute 
+            throw new NullPointerException(Messages.getString("print.0A")); //$NON-NLS-1$            
         } else if (interfaceName.isInstance(attribute)) {
             return (Attribute) attribute;
-        } else {
-            throw new ClassCastException("Object is not an instance of "
-                    + interfaceName.getName());
+        } else {                  
+            //print.0B= Object is not an instance of {0}
+            throw new ClassCastException(Messages.getString("print.0B", interfaceName.getName())); //$NON-NLS-1$        
         }
     }
 
     public static void verifyCategoryForValue(Class<?> attributeCategory, Attribute attribute) {
-        if (!attributeCategory.equals(attribute.getCategory())) {
-            throw new IllegalArgumentException(attributeCategory.getName()
-                    + "is not equal to the category of the attribute"
-                    + attribute.getCategory().getName());
+        if (!attributeCategory.equals(attribute.getCategory())) {                        
+            //print.0C= {0} is not equal to the category of the attribute {1}
+            throw new IllegalArgumentException(Messages.getString("print.0C", attributeCategory.getName(), attribute.getCategory().getName())); //$NON-NLs-1$        
         }
     }
 

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/HashAttributeSet.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/HashAttributeSet.java?rev=986497&r1=986496&r2=986497&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/HashAttributeSet.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/HashAttributeSet.java Tue Aug 17 21:36:10 2010
@@ -23,6 +23,8 @@ import java.io.ObjectOutputStream;
 import java.io.IOException;
 import java.util.HashMap;
 
+import org.apache.harmony.print.internal.nls.Messages;
+
 public class HashAttributeSet implements Serializable, AttributeSet {
     private static final long serialVersionUID = 5311560590283707917L;
 
@@ -47,23 +49,26 @@ public class HashAttributeSet implements
     }
 
     protected HashAttributeSet(Class<?> interfaceName) {
-        if (interfaceName == null) {
-            throw new NullPointerException("Null attribute interface");
+        if (interfaceName == null) {             
+            //print.0D= Null attribute interface
+            throw new NullPointerException(Messages.getString("print.0D")); //$NON-NLS-1$        
         }
         attributeInterfaceName = interfaceName;
     }
 
     protected HashAttributeSet(Attribute attribute, Class<?> interfaceName) {
-        if (interfaceName == null) {
-            throw new NullPointerException("Null attribute interface");
+        if (interfaceName == null) {            
+            //print.0D= Null attribute interface
+            throw new NullPointerException(Messages.getString("print.0D")); //$NON-NLS-1$            
         }
         attributeInterfaceName = interfaceName;
         add(attribute);
     }
 
     protected HashAttributeSet(Attribute[] attributes, Class<?> interfaceName) {
-        if (interfaceName == null) {
-            throw new NullPointerException("Null attribute interface");
+        if (interfaceName == null) {            
+             //print.0D= Null attribute interface
+            throw new NullPointerException(Messages.getString("print.0D")); //$NON-NLS-1$        
         }
         attributeInterfaceName = interfaceName;
         if (attributes != null) {

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/IntegerSyntax.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/IntegerSyntax.java?rev=986497&r1=986496&r2=986497&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/IntegerSyntax.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/IntegerSyntax.java Tue Aug 17 21:36:10 2010
@@ -19,6 +19,8 @@ package javax.print.attribute;
 
 import java.io.Serializable;
 
+import org.apache.harmony.print.internal.nls.Messages;
+
 public abstract class IntegerSyntax implements Cloneable, Serializable {
     private static final long serialVersionUID = 3644574816328081943L;
     
@@ -31,9 +33,9 @@ public abstract class IntegerSyntax impl
 
     protected IntegerSyntax(int intValue, int lowerBound, int upperBound) {
         super();
-        if ((intValue < lowerBound) || (intValue > upperBound)) {
-            throw new IllegalArgumentException("Value " + intValue + " not in valid range ("
-                    + lowerBound + "," + upperBound + ")");
+        if ((intValue < lowerBound) || (intValue > upperBound)) {             
+            //print.0E= Value {0} not in valid range ({1})
+            throw new IllegalArgumentException(Messages.getString("print.0E", intValue, lowerBound+","+upperBound)); //$NON-NLS-1$        
         }
         value = intValue;
     }

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/ResolutionSyntax.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/ResolutionSyntax.java?rev=986497&r1=986496&r2=986497&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/ResolutionSyntax.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/ResolutionSyntax.java Tue Aug 17 21:36:10 2010
@@ -19,6 +19,8 @@ package javax.print.attribute;
 
 import java.io.Serializable;
 
+import org.apache.harmony.print.internal.nls.Messages;
+
 public abstract class ResolutionSyntax implements Cloneable, Serializable {
     private static final long serialVersionUID = 2706743076526672017L;
 
@@ -31,14 +33,17 @@ public abstract class ResolutionSyntax i
     private final int feedRes;
 
     public ResolutionSyntax(int crossFeedResolution, int feedResolution, int units) {
-        if (crossFeedResolution < 1) {
-            throw new IllegalArgumentException("CrossFeedResolution " + "is less than 1");
-        }
-        if (feedResolution < 1) {
-            throw new IllegalArgumentException("FeedResolution is less than 1");
-        }
-        if (units < 1) {
-            throw new IllegalArgumentException("Units is less than 1");
+        if (crossFeedResolution < 1) {           
+            //print.0F= CrossFeedResolution is less than 1
+            throw new IllegalArgumentException(Messages.getString("print.0F")); //$NON-NLS-1$            
+        }
+        if (feedResolution < 1) {            
+            //print.10= Feed resolution is less than 1
+            throw new IllegalArgumentException(Messages.getString("print.10")); //$NON-NLS-1$        
+        }
+        if (units < 1) {            
+            //print.11= Units is less than 1
+            throw new IllegalArgumentException(Messages.getString("print.11")); // $NON-NLS-1$        
         }
         crossFeedRes = crossFeedResolution * units;
         feedRes = feedResolution * units;
@@ -56,7 +61,8 @@ public abstract class ResolutionSyntax i
 
     public int getCrossFeedResolution(int units) {
         if (units < 1) {
-            throw new IllegalArgumentException("units is less than 1");
+            //print.11= Units is less than 1
+            throw new IllegalArgumentException(Messages.getString("print.11")); // $NON-NLS-1$
         }
         return Math.round(((float) crossFeedRes) / units);
     }
@@ -67,7 +73,8 @@ public abstract class ResolutionSyntax i
 
     public int getFeedResolution(int units) {
         if (units < 1) {
-            throw new IllegalArgumentException("units is less than 1");
+            //print.11= Units is less than 1
+            throw new IllegalArgumentException(Messages.getString("print.11")); // $NON-NLS-1$
         }
         return Math.round(((float) feedRes) / units);
     }

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/SetOfIntegerSyntax.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/SetOfIntegerSyntax.java?rev=986497&r1=986496&r2=986497&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/SetOfIntegerSyntax.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/SetOfIntegerSyntax.java Tue Aug 17 21:36:10 2010
@@ -20,22 +20,26 @@ package javax.print.attribute;
 import java.io.Serializable;
 import java.util.Vector;
 
+import org.apache.harmony.print.internal.nls.Messages;
+
 public abstract class SetOfIntegerSyntax implements Cloneable, Serializable {
     private static final long serialVersionUID = 3666874174847632203L;
 
     private int[][] canonicalArray;
 
     protected SetOfIntegerSyntax(int value) {
-        if (value < 0) {
-            throw new IllegalArgumentException("Value " + value + " is less than 0");
+        if (value < 0) {                       
+            //print.12= Value {0} is less than 0
+            throw new IllegalArgumentException(Messages.getString("print.12", value)); //NON-NLS-1$            
         }
         canonicalArray = new int[][] { { value, value } };
     }
 
     protected SetOfIntegerSyntax(int lowerBound, int upperBound) {
         if (lowerBound <= upperBound) {
-            if (lowerBound < 0) {
-                throw new IllegalArgumentException("Lower bound is less than 0");
+            if (lowerBound < 0) {              
+            //print.13= Lower bound is less than 0
+            throw new IllegalArgumentException(Messages.getString("print.13")); //NON-NLS-1$              
             }
             canonicalArray = new int[][] { { lowerBound, upperBound } };
         } else {
@@ -103,9 +107,9 @@ public abstract class SetOfIntegerSyntax
                             continue;
                         } else if (Character.isDigit(symbol)) {
                             num1long = num1long * 10 + Character.digit(symbol, 10);
-                            if (num1long > Integer.MAX_VALUE) {
-                                throw new IllegalArgumentException(num1long
-                                        + " is out of int range");
+                            if (num1long > Integer.MAX_VALUE) {                                                            
+                                //print.14= {0} is out of int range
+                                throw new IllegalArgumentException(Messages.getString("print.24", num1long)); //$NON-NLs-1$
                             }
                             num2long = num1long;
                         } else if ((symbol == ':') || (symbol == '-')) {
@@ -131,9 +135,9 @@ public abstract class SetOfIntegerSyntax
                             continue;
                         } else if (Character.isDigit(symbol)) {
                             num2long = num2long * 10 + Character.digit(symbol, 10);
-                            if (num2long > Integer.MAX_VALUE) {
-                                throw new IllegalArgumentException(num2long
-                                        + " is out of int range");
+                            if (num2long > Integer.MAX_VALUE) {                             
+                                //print.14= {0} is out of int range
+                                throw new IllegalArgumentException(Messages.getString("print.14", num2long)); //$NON-NLs-1$                                
                             }
                         } else {
                             throw new IllegalArgumentException();
@@ -159,7 +163,8 @@ public abstract class SetOfIntegerSyntax
         int num2;
         for (int[] element : values) {
             if (element == null) {
-                throw new NullPointerException("int[][] array has null element");
+                //print.15= int[][] array has null element
+                throw new NullPointerException(Messages.getString("print.15")); //$NON-NLS-1$
             }
             if (element.length == 1) {
                 num1 = element[0];
@@ -168,11 +173,12 @@ public abstract class SetOfIntegerSyntax
                 num1 = element[0];
                 num2 = element[1];
             } else {
-                throw new IllegalArgumentException("Only array of length-1 "
-                        + "or length-2 arrays of ints are valid");
+            	//print.16= Only array of length-1 or length-2 arrays of ints are valid
+                throw new IllegalArgumentException(Messages.getString("print.16")); //$NON-NLS-1$                
             }
             if (num1 < 0) {
-                throw new IllegalArgumentException("Valid values are " + "not less than 0");
+                //print.17= Valid values are not less than 0
+                throw new IllegalArgumentException(Messages.getString("print.17")); //$NON-NLS-1$            
             } else if (num1 <= num2) {
                 addRange(vector, num1, num2);
             }

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/Size2DSyntax.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/Size2DSyntax.java?rev=986497&r1=986496&r2=986497&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/Size2DSyntax.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/Size2DSyntax.java Tue Aug 17 21:36:10 2010
@@ -19,6 +19,8 @@ package javax.print.attribute;
 
 import java.io.Serializable;
 
+import org.apache.harmony.print.internal.nls.Messages;
+
 public abstract class Size2DSyntax implements Cloneable, Serializable {
     private static final long serialVersionUID = 5584439964938660530L;
     
@@ -32,7 +34,8 @@ public abstract class Size2DSyntax imple
 
     protected Size2DSyntax(int x, int y, int units) {
         if ((x < 0) || (y < 0) || (units < 1)) {
-            throw new IllegalArgumentException("Valid values are:" + "x>=0, y>=0, units>=1");
+            //print.18= Valid values are x>=0, y>=0, units>=1
+            throw new IllegalArgumentException(Messages.getString("print.18")); //$NON-NLs-1$            
         }
         this.x = x * units;
         this.y = y * units;
@@ -40,7 +43,8 @@ public abstract class Size2DSyntax imple
 
     protected Size2DSyntax(float x, float y, int units) {
         if ((x < 0.0f) || (y < 0.0f) || (units < 1)) {
-            throw new IllegalArgumentException("Valid values are:" + "x>=0.0, y>=0.0, units>=1");
+            //print.19= VAlid values are x>=0.0, y>=0.0, units>=1
+            throw new IllegalArgumentException(Messages.getString("print.19")); //$NON-NLs-1$            
         }
         this.x = Math.round(x * units);
         this.y = Math.round(y * units);
@@ -61,14 +65,16 @@ public abstract class Size2DSyntax imple
 
     public float getX(int units) {
         if (units < 1) {
-            throw new IllegalArgumentException("units is less than 1");
+            //print.11= Units is less than 1
+            throw new IllegalArgumentException(Messages.getString("print.11")); // $NON-NLS-1$
         }
         return ((float) x) / units;
     }
 
     public float getY(int units) {
         if (units < 1) {
-            throw new IllegalArgumentException("units is less than 1");
+            //print.11= Units is less than 1
+            throw new IllegalArgumentException(Messages.getString("print.11")); // $NON-NLS-1$        
         }
         return ((float) y) / units;
     }

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/standard/CopiesSupported.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/standard/CopiesSupported.java?rev=986497&r1=986496&r2=986497&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/standard/CopiesSupported.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/standard/CopiesSupported.java Tue Aug 17 21:36:10 2010
@@ -21,6 +21,8 @@ import javax.print.attribute.Attribute;
 import javax.print.attribute.SetOfIntegerSyntax;
 import javax.print.attribute.SupportedValuesAttribute;
 
+import org.apache.harmony.print.internal.nls.Messages;
+
 public final class CopiesSupported extends SetOfIntegerSyntax implements
         SupportedValuesAttribute {
     private static final long serialVersionUID = 6927711687034846001L;
@@ -28,16 +30,19 @@ public final class CopiesSupported exten
     public CopiesSupported(int value) {
         super(value);
         if (value < 1) {
-            throw new IllegalArgumentException("Value" + value + "is less than 1");
+            //print.1A= Value {0} is less than 1
+            throw new IllegalArgumentException(Messages.getString("print.1A", value)); //NON-NLS-1$        
         }
     }
 
     public CopiesSupported(int lowerBound, int upperBound) {
         super(lowerBound, upperBound);
         if (lowerBound > upperBound) {
-            throw new IllegalArgumentException("Null range");
-        } else if (lowerBound < 1) {
-            throw new IllegalArgumentException("Lower bound" + lowerBound + "is less than 1");
+            //print.1B= Null range
+            throw new IllegalArgumentException(Messages.getString("print.1B")); //$NON-NLS-1$            
+        } else if (lowerBound < 1) {                     
+            //print.1C= Lower bound {0} is less than 1
+            throw new IllegalArgumentException(Messages.getString("print.1C", lowerBound)); //$NON-NLS-1$            
         }
     }
 

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/standard/JobImpressionsSupported.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/standard/JobImpressionsSupported.java?rev=986497&r1=986496&r2=986497&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/standard/JobImpressionsSupported.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/standard/JobImpressionsSupported.java Tue Aug 17 21:36:10 2010
@@ -21,6 +21,8 @@ import javax.print.attribute.Attribute;
 import javax.print.attribute.SetOfIntegerSyntax;
 import javax.print.attribute.SupportedValuesAttribute;
 
+import org.apache.harmony.print.internal.nls.Messages;
+
 public final class JobImpressionsSupported extends SetOfIntegerSyntax implements
         SupportedValuesAttribute {
     private static final long serialVersionUID = -4887354803843173692L;
@@ -28,9 +30,11 @@ public final class JobImpressionsSupport
     public JobImpressionsSupported(int lowerBound, int upperBound) {
         super(lowerBound, upperBound);
         if (lowerBound > upperBound) {
-            throw new IllegalArgumentException("Null range: lowerBound " + "> upperBound");
-        } else if (lowerBound < 0) {
-            throw new IllegalArgumentException("Lower bound " + lowerBound + " is less than 0");
+            //print.1D= Null range: lowerBound > upperBound
+            throw new IllegalArgumentException(Messages.getString("print.1D")); //$NON-NLS-1$
+       	} else if (lowerBound < 0) {
+            //print.1E=Lower bound {0} is less than 0
+            throw new IllegalArgumentException(Messages.getString("print.1E", lowerBound)); //$NON-NLs-1$            
         }
     }
 

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/standard/JobKOctetsSupported.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/standard/JobKOctetsSupported.java?rev=986497&r1=986496&r2=986497&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/standard/JobKOctetsSupported.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/standard/JobKOctetsSupported.java Tue Aug 17 21:36:10 2010
@@ -21,6 +21,8 @@ import javax.print.attribute.Attribute;
 import javax.print.attribute.SetOfIntegerSyntax;
 import javax.print.attribute.SupportedValuesAttribute;
 
+import org.apache.harmony.print.internal.nls.Messages;
+
 public final class JobKOctetsSupported extends SetOfIntegerSyntax implements
         SupportedValuesAttribute {
     private static final long serialVersionUID = -2867871140549897443L;
@@ -28,9 +30,11 @@ public final class JobKOctetsSupported e
     public JobKOctetsSupported(int lowerBound, int upperBound) {
         super(lowerBound, upperBound);
         if (lowerBound > upperBound) {
-            throw new IllegalArgumentException("Null range: lowerBound " + "> upperBound");
+		    //print.1D= Null range: lowerBound > upperBound
+            throw new IllegalArgumentException(Messages.getString("print.1D")); //$NON-NLS-1$        
         } else if (lowerBound < 0) {
-            throw new IllegalArgumentException("Lower bound " + lowerBound + " is less than 0");
+            //print.1E=Lower bound {0} is less than 0
+            throw new IllegalArgumentException(Messages.getString("print.1E", lowerBound)); //$NON-NLs-1$        
         }
     }
 

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/standard/JobMediaSheetsSupported.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/standard/JobMediaSheetsSupported.java?rev=986497&r1=986496&r2=986497&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/standard/JobMediaSheetsSupported.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/standard/JobMediaSheetsSupported.java Tue Aug 17 21:36:10 2010
@@ -21,6 +21,8 @@ import javax.print.attribute.Attribute;
 import javax.print.attribute.SetOfIntegerSyntax;
 import javax.print.attribute.SupportedValuesAttribute;
 
+import org.apache.harmony.print.internal.nls.Messages;
+
 public final class JobMediaSheetsSupported extends SetOfIntegerSyntax implements
         SupportedValuesAttribute {
     private static final long serialVersionUID = 2953685470388672940L;
@@ -28,9 +30,11 @@ public final class JobMediaSheetsSupport
     public JobMediaSheetsSupported(int lowerBound, int upperBound) {
         super(lowerBound, upperBound);
         if (lowerBound > upperBound) {
-            throw new IllegalArgumentException("Null range: lowerBound " + "> upperBound");
+            //print.1D= Null range: lowerBound > upperBound
+            throw new IllegalArgumentException(Messages.getString("print.1D")); //$NON-NLS-1$        
         } else if (lowerBound < 0) {
-            throw new IllegalArgumentException("Lower bound " + lowerBound + " is less then 0");
+            //print.1E=Lower bound {0} is less than 0
+            throw new IllegalArgumentException(Messages.getString("print.1E", lowerBound)); //$NON-NLs-1$        
         }
     }
 

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/standard/JobStateReasons.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/standard/JobStateReasons.java?rev=986497&r1=986496&r2=986497&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/standard/JobStateReasons.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/standard/JobStateReasons.java Tue Aug 17 21:36:10 2010
@@ -22,6 +22,8 @@ import java.util.HashSet;
 import javax.print.attribute.Attribute;
 import javax.print.attribute.PrintJobAttribute;
 
+import org.apache.harmony.print.internal.nls.Messages;
+
 public final class JobStateReasons extends HashSet<JobStateReason> implements PrintJobAttribute {
     private static final long serialVersionUID = 8849088261264331812L;
 
@@ -47,7 +49,8 @@ public final class JobStateReasons exten
     @Override
     public boolean add(JobStateReason reason) {
         if (reason == null) {
-            throw new NullPointerException("Null JobStateReason");
+            //print.1F=Null JobStateReason
+            throw new NullPointerException(Messages.getString("print.1F")); //$NON-NLS-1$            
         }
         return super.add(reason);
     }

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/standard/MediaPrintableArea.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/standard/MediaPrintableArea.java?rev=986497&r1=986496&r2=986497&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/standard/MediaPrintableArea.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/standard/MediaPrintableArea.java Tue Aug 17 21:36:10 2010
@@ -22,6 +22,8 @@ import javax.print.attribute.DocAttribut
 import javax.print.attribute.PrintJobAttribute;
 import javax.print.attribute.PrintRequestAttribute;
 
+import org.apache.harmony.print.internal.nls.Messages;
+
 public final class MediaPrintableArea implements DocAttribute, PrintJobAttribute,
         PrintRequestAttribute {
     private static final long serialVersionUID = -1597171464050795793L;
@@ -83,28 +85,32 @@ public final class MediaPrintableArea im
 
     public float getX(int units) {
         if (units < 1) {
-            throw new IllegalArgumentException("units is less than 1");
+             //print.11= Units is less than 1
+            throw new IllegalArgumentException(Messages.getString("print.11")); // $NON-NLS-1$        
         }
         return ((float) x) / units;
     }
 
     public float getY(int units) {
         if (units < 1) {
-            throw new IllegalArgumentException("units is less than 1");
+            //print.11= Units is less than 1
+            throw new IllegalArgumentException(Messages.getString("print.11")); // $NON-NLS-1$        
         }
         return ((float) y) / units;
     }
 
     public float getWidth(int units) {
         if (units < 1) {
-            throw new IllegalArgumentException("units is less than 1");
+            //print.11= Units is less than 1
+            throw new IllegalArgumentException(Messages.getString("print.11")); // $NON-NLS-1$        
         }
         return ((float) width) / units;
     }
 
     public float getHeight(int units) {
         if (units < 1) {
-            throw new IllegalArgumentException("units is less than 1");
+            //print.11= Units is less than 1
+            throw new IllegalArgumentException(Messages.getString("print.11")); // $NON-NLS-1$        
         }
         return ((float) height) / units;
     }

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/standard/MediaSize.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/standard/MediaSize.java?rev=986497&r1=986496&r2=986497&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/standard/MediaSize.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/standard/MediaSize.java Tue Aug 17 21:36:10 2010
@@ -25,6 +25,8 @@ import java.util.Map;
 import javax.print.attribute.Attribute;
 import javax.print.attribute.Size2DSyntax;
 
+import org.apache.harmony.print.internal.nls.Messages;
+
 @SuppressWarnings("unused")
 public class MediaSize extends Size2DSyntax implements Attribute {
     private static final long serialVersionUID = -1967958664615414771L;
@@ -338,8 +340,9 @@ public class MediaSize extends Size2DSyn
 
     public MediaSize(int x, int y, int units) {
         super(x, y, units);
-        if (x > y) {
-            throw new IllegalArgumentException("x > y");
+        if (x > y) {            
+            //print.20= x > y
+            throw new IllegalArgumentException(Messages.getString("print.20")); //$NON-NLS-1$            
         }
         synchronized (MediaSize.class) {
             sizesList.add(this);
@@ -348,8 +351,9 @@ public class MediaSize extends Size2DSyn
 
     public MediaSize(float x, float y, int units) {
         super(x, y, units);
-        if (x > y) {
-            throw new IllegalArgumentException("x > y");
+        if (x > y) {            
+            //print.20= x > y
+            throw new IllegalArgumentException(Messages.getString("print.20")); //$NON-NLS-1$      
         }
         synchronized (MediaSize.class) {
             sizesList.add(this);
@@ -358,8 +362,9 @@ public class MediaSize extends Size2DSyn
 
     public MediaSize(int x, int y, int units, MediaSizeName mediaSizeName) {
         super(x, y, units);
-        if (x > y) {
-            throw new IllegalArgumentException("x > y");
+        if (x > y) {            
+            //print.20= x > y
+            throw new IllegalArgumentException(Messages.getString("print.20")); //$NON-NLS-1$        
         }
         this.mediaSizeName = mediaSizeName;
         synchronized (MediaSize.class) {
@@ -370,8 +375,9 @@ public class MediaSize extends Size2DSyn
 
     public MediaSize(float x, float y, int units, MediaSizeName mediaSizeName) {
         super(x, y, units);
-        if (x > y) {
-            throw new IllegalArgumentException("x > y");
+        if (x > y) {           
+            //print.20= x > y
+            throw new IllegalArgumentException(Messages.getString("print.20")); //$NON-NLS-1$       
         }
         this.mediaSizeName = mediaSizeName;
         synchronized (MediaSize.class) {
@@ -389,9 +395,9 @@ public class MediaSize extends Size2DSyn
     }
 
     public static MediaSizeName findMedia(float x, float y, int units) {
-        if ((x <= 0.0) || (y <= 0.0) || (units < 1)) {
-            throw new IllegalArgumentException("Valid values are: "
-                    + "x > 0, y > 0, units >= 1");
+        if ((x <= 0.0) || (y <= 0.0) || (units < 1)) {            
+            //print.21=Valid values are: x > 0, y > 0, units >=1
+            throw new IllegalArgumentException(Messages.getString("print.21")); //$NON-NLs-1$            
         }
         synchronized (MediaSize.class) {
             MediaSize hit = null;

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/standard/NumberUpSupported.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/standard/NumberUpSupported.java?rev=986497&r1=986496&r2=986497&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/standard/NumberUpSupported.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/standard/NumberUpSupported.java Tue Aug 17 21:36:10 2010
@@ -21,6 +21,8 @@ import javax.print.attribute.Attribute;
 import javax.print.attribute.SetOfIntegerSyntax;
 import javax.print.attribute.SupportedValuesAttribute;
 
+import org.apache.harmony.print.internal.nls.Messages;
+
 public final class NumberUpSupported extends SetOfIntegerSyntax implements
         SupportedValuesAttribute {
     private static final long serialVersionUID = -1041573395759141805L;
@@ -28,31 +30,37 @@ public final class NumberUpSupported ext
     public NumberUpSupported(int value) {
         super(value);
         if (value < 1) {
-            throw new IllegalArgumentException("Value" + value + "is less than 1");
+            //print.1A= Value {0} is less than 1
+            throw new IllegalArgumentException(Messages.getString("print.1A", value)); //NON-NLS-1$        
         }
     }
 
     public NumberUpSupported(int lowerBound, int upperBound) {
         super(lowerBound, upperBound);
         if (lowerBound > upperBound) {
-            throw new IllegalArgumentException("Null range: lowerBound " + "> upperBound");
-        } else if (lowerBound < 1) {
-            throw new IllegalArgumentException("Lower bound " + lowerBound + " is less than 1");
+             //print.1D= Null range: lowerBound > upperBound
+            throw new IllegalArgumentException(Messages.getString("print.1D")); //$NON-NLS-1$        
+        } else if (lowerBound < 1) {             
+            //print.1C= Lower bound {0} is less than 1
+            throw new IllegalArgumentException(Messages.getString("print.1C", lowerBound)); //$NON-NLS-1$            
         }
     }
 
     public NumberUpSupported(int[][] members) {
         super(members);
         if (members == null) {
-            throw new NullPointerException("Null int[][] parameter");
+            //print.22=Null int [][] parameter
+            throw new NullPointerException(Messages.getString("print.22")); //$NON-NLS-1$            
         }
         int[][] canonicalArray = getMembers();
         if (canonicalArray.length == 0) {
-            throw new IllegalArgumentException("Zero-length array");
+            //print.23=Zero-length array
+            throw new IllegalArgumentException(Messages.getString("print.23")); //$NON-NLS-1$            
         }
         for (int i = 0; i < canonicalArray.length; i++) {
             if (canonicalArray[i][0] < 1) {
-                throw new IllegalArgumentException("Valid values are not " + "less than 1");
+                //print.24=Valid values are not less than 1
+                throw new IllegalArgumentException(Messages.getString("print.24")); //$NON-NLs-1$            
             }
         }
     }

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/standard/PageRanges.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/standard/PageRanges.java?rev=986497&r1=986496&r2=986497&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/standard/PageRanges.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/standard/PageRanges.java Tue Aug 17 21:36:10 2010
@@ -23,6 +23,8 @@ import javax.print.attribute.PrintJobAtt
 import javax.print.attribute.PrintRequestAttribute;
 import javax.print.attribute.SetOfIntegerSyntax;
 
+import org.apache.harmony.print.internal.nls.Messages;
+
 public final class PageRanges extends SetOfIntegerSyntax implements DocAttribute,
         PrintJobAttribute, PrintRequestAttribute {
     private static final long serialVersionUID = 8639895197656148392L;
@@ -30,23 +32,27 @@ public final class PageRanges extends Se
     public PageRanges(int value) {
         super(value);
         if (value < 1) {
-            throw new IllegalArgumentException("Value" + value + "is less than 1");
+            //print.1A= Value {0} is less than 1
+            throw new IllegalArgumentException(Messages.getString("print.1A", value)); //NON-NLS-1$        
         }
     }
 
     public PageRanges(int lowerBound, int upperBound) {
         super(lowerBound, upperBound);
         if (lowerBound > upperBound) {
-            throw new IllegalArgumentException("Null range: lowerBound " + "> upperBound");
+            //print.1D= Null range: lowerBound > upperBound
+            throw new IllegalArgumentException(Messages.getString("print.1D")); //$NON-NLS-1$        
         } else if (lowerBound < 1) {
-            throw new IllegalArgumentException("Lower bound " + lowerBound + " is less than 1");
+             //print.1C= Lower bound {0} is less than 1
+            throw new IllegalArgumentException(Messages.getString("print.1C", lowerBound)); //$NON-NLS-1$        
         }
     }
 
     public PageRanges(int[][] members) {
         super(members);
         if (members == null) {
-            throw new NullPointerException("Null int[][] parameter");
+             //print.22=Null int [][] parameter
+            throw new NullPointerException(Messages.getString("print.22")); //$NON-NLS-1$        
         }
         precisionCheck();
     }
@@ -54,7 +60,8 @@ public final class PageRanges extends Se
     public PageRanges(String string) {
         super(string);
         if (string == null) {
-            throw new NullPointerException("Null string parameter");
+            //print.25=Null string parameter
+            throw new NullPointerException(Messages.getString("print.25")); //$NON-NLs-1$            
         }
         precisionCheck();
     }
@@ -62,11 +69,13 @@ public final class PageRanges extends Se
     private void precisionCheck() {
         int[][] canonicalArray = getMembers();
         if (canonicalArray.length == 0) {
-            throw new IllegalArgumentException("Zero-length array");
+            //print.23=Zero-length array
+            throw new IllegalArgumentException(Messages.getString("print.23")); //$NON-NLS-1$        
         }
         for (int i = 0; i < canonicalArray.length; i++) {
             if (canonicalArray[i][0] < 1) {
-                throw new IllegalArgumentException("Valid values are not " + "less than 1");
+                //print.24= valid values are not less than 1
+                throw new IllegalArgumentException(Messages.getString("print.24")); //$NON-NLs-1$           
             }
         }
     }

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/standard/PrinterStateReasons.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/standard/PrinterStateReasons.java?rev=986497&r1=986496&r2=986497&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/standard/PrinterStateReasons.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/print/src/main/java/common/javax/print/attribute/standard/PrinterStateReasons.java Tue Aug 17 21:36:10 2010
@@ -25,6 +25,8 @@ import java.util.Set;
 import javax.print.attribute.Attribute;
 import javax.print.attribute.PrintServiceAttribute;
 
+import org.apache.harmony.print.internal.nls.Messages;
+
 /*
  * Table values are obtained from RFC2911: Internet Printing Protocol/1.1: 
  * Model and Semantics, section 4.4.11, http://ietf.org/rfc/rfc2911.txt?number=2911
@@ -63,17 +65,20 @@ public final class PrinterStateReasons e
     @Override
     public Severity put(PrinterStateReason reason, Severity severity) {
         if (reason == null) {
-            throw new NullPointerException("Reason is null");
+            //print.26=Reason is null
+            throw new NullPointerException(Messages.getString("print.26")); //$NON-NLS-1$            
         }
         if (severity == null) {
-            throw new NullPointerException("Severity is null");
+            //print.27=Severity is null
+            throw new NullPointerException(Messages.getString("print.27")); //$NON-NLS-1$
         }
         return super.put(reason, severity);
     }
 
     public Set<PrinterStateReason> printerStateReasonSet(Severity severity) {
         if (severity == null) {
-            throw new NullPointerException("Severity is null");
+            //print.27=Severity is null
+            throw new NullPointerException(Messages.getString("print.27")); //$NON-NLS-1$       
         }
         Set<PrinterStateReason> set = new HashSet<PrinterStateReason>();
         for (Map.Entry<PrinterStateReason, Severity> mapEntry : entrySet()) {

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/regex/src/main/java/java/util/regex/Matcher.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/regex/src/main/java/java/util/regex/Matcher.java?rev=986497&r1=986496&r2=986497&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/regex/src/main/java/java/util/regex/Matcher.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/regex/src/main/java/java/util/regex/Matcher.java Tue Aug 17 21:36:10 2010
@@ -687,4 +687,16 @@ public final class Matcher implements Ma
         matchResult = new MatchResultImpl(cs, leftBound, rightBound, pat
                 .groupCount(), pat.compCount(), pat.consCount());
     }
+
+    @Override
+    public String toString() {
+        String lastMatch = "";
+        try {
+            lastMatch = Integer.toString(start());
+        } catch (IllegalStateException e) {
+        }
+        return getClass().getCanonicalName() + "[pattern=" + pat + " region="
+                + matchResult.getLeftBound() + ","
+                + matchResult.getRightBound() + " lastmatch=" + lastMatch + "]";
+    }
 }

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/regex/src/test/java/org/apache/harmony/tests/java/util/regex/MatcherTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/regex/src/test/java/org/apache/harmony/tests/java/util/regex/MatcherTest.java?rev=986497&r1=986496&r2=986497&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/regex/src/test/java/org/apache/harmony/tests/java/util/regex/MatcherTest.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/regex/src/test/java/org/apache/harmony/tests/java/util/regex/MatcherTest.java Tue Aug 17 21:36:10 2010
@@ -735,6 +735,16 @@ public class MatcherTest extends TestCas
                 "----1 fish 2 fish red fish 5----", false);
     }
 
+    /*
+     * Test if Matcher's toString conatain pattern information
+     */
+    public void testToString() {
+        String result = Pattern.compile("(\\d{1,3})").matcher(
+                "aaaa123456789045").toString();
+        assertTrue("The result doesn't contain pattern info", result
+                .contains("(\\d{1,3})"));
+    }
+
     private void hitEndTest(boolean callFind, String testNo, String regex,
             String input, boolean hit) {
         Pattern pattern = Pattern.compile(regex);

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/swing/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/swing/META-INF/MANIFEST.MF?rev=986497&r1=986496&r2=986497&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/swing/META-INF/MANIFEST.MF (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/swing/META-INF/MANIFEST.MF Tue Aug 17 21:36:10 2010
@@ -51,7 +51,8 @@ Import-Package: java.applet,
  org.apache.harmony.misc,
  org.apache.harmony.security.asn1;version="1.0.0",
  org.xml.sax,
- org.xml.sax.helpers
+ org.xml.sax.helpers,
+ java_cup.runtime
 Export-Package: javax.swing,
  javax.swing.border,
  javax.swing.colorchooser,



Mime
View raw message