You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by hi...@apache.org on 2010/02/12 21:23:08 UTC
svn commit: r909597 - in
/harmony/enhanced/classlib/trunk/modules/luni/src/main/java: java/io/
org/apache/harmony/luni/internal/nls/
Author: hindessm
Date: Fri Feb 12 20:23:04 2010
New Revision: 909597
URL: http://svn.apache.org/viewvc?rev=909597&view=rev
Log:
More nls refactoring.
Modified:
harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/BufferedInputStream.java
harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/BufferedOutputStream.java
harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/BufferedReader.java
harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/BufferedWriter.java
harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ByteArrayOutputStream.java
harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/CharArrayReader.java
harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/CharArrayWriter.java
harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/DataInputStream.java
harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/DataOutputStream.java
harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/File.java
harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FileInputStream.java
harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FileOutputStream.java
harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FilePermission.java
harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FilterOutputStream.java
harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/InputStream.java
harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/InputStreamReader.java
harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/LineNumberInputStream.java
harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/RandomAccessFile.java
harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/nls/messages.properties
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/BufferedInputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/BufferedInputStream.java?rev=909597&r1=909596&r2=909597&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/BufferedInputStream.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/BufferedInputStream.java Fri Feb 12 20:23:04 2010
@@ -17,7 +17,7 @@
package java.io;
-import org.apache.harmony.luni.util.Msg;
+import org.apache.harmony.luni.internal.nls.Messages;
/**
* Wraps an existing {@link InputStream} and <em>buffers</em> the input.
@@ -90,8 +90,8 @@
public BufferedInputStream(InputStream in, int size) {
super(in);
if (size <= 0) {
- // K0058=size must be > 0
- throw new IllegalArgumentException(Msg.getString("K0058")); //$NON-NLS-1$
+ // luni.A3=size must be > 0
+ throw new IllegalArgumentException(Messages.getString("luni.A3")); //$NON-NLS-1$
}
buf = new byte[size];
}
@@ -109,8 +109,8 @@
public synchronized int available() throws IOException {
InputStream localIn = in; // 'in' could be invalidated by close()
if (buf == null || localIn == null) {
- // K0059=Stream is closed
- throw new IOException(Msg.getString("K0059")); //$NON-NLS-1$
+ // luni.24=Stream is closed
+ throw new IOException(Messages.getString("luni.24")); //$NON-NLS-1$
}
return count - pos + localIn.available();
}
@@ -217,8 +217,8 @@
byte[] localBuf = buf;
InputStream localIn = in;
if (localBuf == null || localIn == null) {
- // K0059=Stream is closed
- throw new IOException(Msg.getString("K0059")); //$NON-NLS-1$
+ // luni.24=Stream is closed
+ throw new IOException(Messages.getString("luni.24")); //$NON-NLS-1$
}
/* Are there buffered bytes available? */
@@ -229,8 +229,8 @@
if (localBuf != buf) {
localBuf = buf;
if (localBuf == null) {
- // K0059=Stream is closed
- throw new IOException(Msg.getString("K0059")); //$NON-NLS-1$
+ // luni.24=Stream is closed
+ throw new IOException(Messages.getString("luni.24")); //$NON-NLS-1$
}
}
@@ -273,8 +273,8 @@
// close()
byte[] localBuf = buf;
if (localBuf == null) {
- // K0059=Stream is closed
- throw new IOException(Msg.getString("K0059")); //$NON-NLS-1$
+ // luni.24=Stream is closed
+ throw new IOException(Messages.getString("luni.24")); //$NON-NLS-1$
}
// avoid int overflow
if (offset > buffer.length - length || offset < 0 || length < 0) {
@@ -285,8 +285,8 @@
}
InputStream localIn = in;
if (localIn == null) {
- // K0059=Stream is closed
- throw new IOException(Msg.getString("K0059")); //$NON-NLS-1$
+ // luni.24=Stream is closed
+ throw new IOException(Messages.getString("luni.24")); //$NON-NLS-1$
}
int required;
@@ -323,8 +323,8 @@
if (localBuf != buf) {
localBuf = buf;
if (localBuf == null) {
- // K0059=Stream is closed
- throw new IOException(Msg.getString("K0059")); //$NON-NLS-1$
+ // luni.24=Stream is closed
+ throw new IOException(Messages.getString("luni.24")); //$NON-NLS-1$
}
}
@@ -355,12 +355,12 @@
@Override
public synchronized void reset() throws IOException {
if (buf == null) {
- // K0059=Stream is closed
- throw new IOException(Msg.getString("K0059")); //$NON-NLS-1$
+ // luni.24=Stream is closed
+ throw new IOException(Messages.getString("luni.24")); //$NON-NLS-1$
}
if (-1 == markpos) {
- // K005a=Mark has been invalidated.
- throw new IOException(Msg.getString("K005a")); //$NON-NLS-1$
+ // luni.A4=Mark has been invalidated.
+ throw new IOException(Messages.getString("luni.A4")); //$NON-NLS-1$
}
pos = markpos;
}
@@ -384,15 +384,15 @@
byte[] localBuf = buf;
InputStream localIn = in;
if (localBuf == null) {
- // K0059=Stream is closed
- throw new IOException(Msg.getString("K0059")); //$NON-NLS-1$
+ // luni.24=Stream is closed
+ throw new IOException(Messages.getString("luni.24")); //$NON-NLS-1$
}
if (amount < 1) {
return 0;
}
if (localIn == null) {
- // K0059=Stream is closed
- throw new IOException(Msg.getString("K0059")); //$NON-NLS-1$
+ // luni.24=Stream is closed
+ throw new IOException(Messages.getString("luni.24")); //$NON-NLS-1$
}
if (count - pos >= amount) {
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/BufferedOutputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/BufferedOutputStream.java?rev=909597&r1=909596&r2=909597&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/BufferedOutputStream.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/BufferedOutputStream.java Fri Feb 12 20:23:04 2010
@@ -17,7 +17,7 @@
package java.io;
-import org.apache.harmony.luni.util.Msg;
+import org.apache.harmony.luni.internal.nls.Messages;
/**
* Wraps an existing {@link OutputStream} and <em>buffers</em> the output.
@@ -73,8 +73,8 @@
public BufferedOutputStream(OutputStream out, int size) {
super(out);
if (size <= 0) {
- // K0058=size must be > 0
- throw new IllegalArgumentException(Msg.getString("K0058")); //$NON-NLS-1$
+ // luni.A3=size must be > 0
+ throw new IllegalArgumentException(Messages.getString("luni.A3")); //$NON-NLS-1$
}
buf = new byte[size];
}
@@ -89,7 +89,7 @@
@Override
public synchronized void flush() throws IOException {
if (buf == null) {
- throw new IOException(Msg.getString("K0059")); //$NON-NLS-1$
+ throw new IOException(Messages.getString("luni.24")); //$NON-NLS-1$
}
flushInternal();
@@ -126,12 +126,12 @@
throws IOException {
byte[] internalBuffer = buf;
if (internalBuffer == null) {
- throw new IOException(Msg.getString("K0059")); //$NON-NLS-1$
+ throw new IOException(Messages.getString("luni.24")); //$NON-NLS-1$
}
if (buffer == null) {
- // K0047=buffer is null
- throw new NullPointerException(Msg.getString("K0047")); //$NON-NLS-1$
+ // luni.11=buffer is null
+ throw new NullPointerException(Messages.getString("luni.11")); //$NON-NLS-1$
}
if (length >= internalBuffer.length) {
@@ -141,13 +141,13 @@
}
if (offset < 0 || offset > buffer.length - length) {
- // K002e=Offset out of bounds \: {0}
- throw new ArrayIndexOutOfBoundsException(Msg.getString("K002e", offset)); //$NON-NLS-1$
+ // luni.12=Offset out of bounds \: {0}
+ throw new ArrayIndexOutOfBoundsException(Messages.getString("luni.12", offset)); //$NON-NLS-1$
}
if (length < 0) {
- // K0031=Length out of bounds \: {0}
- throw new ArrayIndexOutOfBoundsException(Msg.getString("K0031", length)); //$NON-NLS-1$
+ // luni.18=Length out of bounds \: {0}
+ throw new ArrayIndexOutOfBoundsException(Messages.getString("luni.18", length)); //$NON-NLS-1$
}
// flush the internal buffer first if we have not enough space left
@@ -188,7 +188,7 @@
public synchronized void write(int oneByte) throws IOException {
byte[] internalBuffer = buf;
if (internalBuffer == null) {
- throw new IOException(Msg.getString("K0059")); //$NON-NLS-1$
+ throw new IOException(Messages.getString("luni.24")); //$NON-NLS-1$
}
if (count == internalBuffer.length) {
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/BufferedReader.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/BufferedReader.java?rev=909597&r1=909596&r2=909597&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/BufferedReader.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/BufferedReader.java Fri Feb 12 20:23:04 2010
@@ -17,7 +17,7 @@
package java.io;
-import org.apache.harmony.luni.util.Msg;
+import org.apache.harmony.luni.internal.nls.Messages;
/**
* Wraps an existing {@link Reader} and <em>buffers</em> the input. Expensive
@@ -97,7 +97,7 @@
public BufferedReader(Reader in, int size) {
super(in);
if (size <= 0) {
- throw new IllegalArgumentException(Msg.getString("K0058")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Messages.getString("luni.A3")); //$NON-NLS-1$
}
this.in = in;
buf = new char[size];
@@ -200,7 +200,7 @@
}
synchronized (lock) {
if (isClosed()) {
- throw new IOException(Msg.getString("K005b")); //$NON-NLS-1$
+ throw new IOException(Messages.getString("luni.A5")); //$NON-NLS-1$
}
this.markLimit = markLimit;
mark = pos;
@@ -236,7 +236,7 @@
public int read() throws IOException {
synchronized (lock) {
if (isClosed()) {
- throw new IOException(Msg.getString("K005b")); //$NON-NLS-1$
+ throw new IOException(Messages.getString("luni.A5")); //$NON-NLS-1$
}
/* Are there buffered characters available? */
if (pos < end || fillBuf() != -1) {
@@ -276,7 +276,7 @@
public int read(char[] buffer, int offset, int length) throws IOException {
synchronized (lock) {
if (isClosed()) {
- throw new IOException(Msg.getString("K005b")); //$NON-NLS-1$
+ throw new IOException(Messages.getString("luni.A5")); //$NON-NLS-1$
}
if (offset < 0 || offset > buffer.length - length || length < 0) {
throw new IndexOutOfBoundsException();
@@ -361,7 +361,7 @@
public String readLine() throws IOException {
synchronized (lock) {
if (isClosed()) {
- throw new IOException(Msg.getString("K005b")); //$NON-NLS-1$
+ throw new IOException(Messages.getString("luni.A5")); //$NON-NLS-1$
}
/* has the underlying stream been exhausted? */
if (pos == end && fillBuf() == -1) {
@@ -451,7 +451,7 @@
public boolean ready() throws IOException {
synchronized (lock) {
if (isClosed()) {
- throw new IOException(Msg.getString("K005b")); //$NON-NLS-1$
+ throw new IOException(Messages.getString("luni.A5")); //$NON-NLS-1$
}
return ((end - pos) > 0) || in.ready();
}
@@ -471,10 +471,10 @@
public void reset() throws IOException {
synchronized (lock) {
if (isClosed()) {
- throw new IOException(Msg.getString("K005b")); //$NON-NLS-1$
+ throw new IOException(Messages.getString("luni.A5")); //$NON-NLS-1$
}
if (mark == -1) {
- throw new IOException(Msg.getString("K005c")); //$NON-NLS-1$
+ throw new IOException(Messages.getString("luni.A6")); //$NON-NLS-1$
}
pos = mark;
}
@@ -504,7 +504,7 @@
}
synchronized (lock) {
if (isClosed()) {
- throw new IOException(Msg.getString("K005b")); //$NON-NLS-1$
+ throw new IOException(Messages.getString("luni.A5")); //$NON-NLS-1$
}
if (amount < 1) {
return 0;
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/BufferedWriter.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/BufferedWriter.java?rev=909597&r1=909596&r2=909597&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/BufferedWriter.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/BufferedWriter.java Fri Feb 12 20:23:04 2010
@@ -19,7 +19,7 @@
import java.security.AccessController;
-import org.apache.harmony.luni.util.Msg;
+import org.apache.harmony.luni.internal.nls.Messages;
import org.apache.harmony.luni.util.PriviAction;
import org.apache.harmony.luni.util.SneakyThrow;
@@ -79,7 +79,7 @@
public BufferedWriter(Writer out, int size) {
super(out);
if (size <= 0) {
- throw new IllegalArgumentException(Msg.getString("K0058")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Messages.getString("luni.A3")); //$NON-NLS-1$
}
this.out = out;
this.buf = new char[size];
@@ -134,7 +134,7 @@
public void flush() throws IOException {
synchronized (lock) {
if (isClosed()) {
- throw new IOException(Msg.getString("K005d")); //$NON-NLS-1$
+ throw new IOException(Messages.getString("luni.A7")); //$NON-NLS-1$
}
flushInternal();
out.flush();
@@ -195,7 +195,7 @@
public void write(char[] cbuf, int offset, int count) throws IOException {
synchronized (lock) {
if (isClosed()) {
- throw new IOException(Msg.getString("K005d")); //$NON-NLS-1$
+ throw new IOException(Messages.getString("luni.A7")); //$NON-NLS-1$
}
if (offset < 0 || offset > cbuf.length - count || count < 0) {
throw new IndexOutOfBoundsException();
@@ -244,7 +244,7 @@
public void write(int oneChar) throws IOException {
synchronized (lock) {
if (isClosed()) {
- throw new IOException(Msg.getString("K005d")); //$NON-NLS-1$
+ throw new IOException(Messages.getString("luni.A7")); //$NON-NLS-1$
}
if (pos >= buf.length) {
out.write(buf, 0, buf.length);
@@ -278,7 +278,7 @@
public void write(String str, int offset, int count) throws IOException {
synchronized (lock) {
if (isClosed()) {
- throw new IOException(Msg.getString("K005d")); //$NON-NLS-1$
+ throw new IOException(Messages.getString("luni.A7")); //$NON-NLS-1$
}
if (count <= 0) {
return;
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ByteArrayOutputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ByteArrayOutputStream.java?rev=909597&r1=909596&r2=909597&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ByteArrayOutputStream.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ByteArrayOutputStream.java Fri Feb 12 20:23:04 2010
@@ -17,7 +17,7 @@
package java.io;
-import org.apache.harmony.luni.util.Msg;
+import org.apache.harmony.luni.internal.nls.Messages;
/**
* A specialized {@link OutputStream} for class for writing content to an
@@ -64,7 +64,7 @@
if (size >= 0) {
buf = new byte[size];
} else {
- throw new IllegalArgumentException(Msg.getString("K005e")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Messages.getString("luni.A8")); //$NON-NLS-1$
}
}
@@ -199,7 +199,7 @@
// avoid int overflow
if (offset < 0 || offset > buffer.length || len < 0
|| len > buffer.length - offset) {
- throw new IndexOutOfBoundsException(Msg.getString("K002f")); //$NON-NLS-1$
+ throw new IndexOutOfBoundsException(Messages.getString("luni.13")); //$NON-NLS-1$
}
if (len == 0) {
return;
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/CharArrayReader.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/CharArrayReader.java?rev=909597&r1=909596&r2=909597&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/CharArrayReader.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/CharArrayReader.java Fri Feb 12 20:23:04 2010
@@ -17,7 +17,7 @@
package java.io;
-import org.apache.harmony.luni.util.Msg;
+import org.apache.harmony.luni.internal.nls.Messages;
/**
* A specialized {@link Reader} for reading the contents of a char array.
@@ -139,7 +139,7 @@
public void mark(int readLimit) throws IOException {
synchronized (lock) {
if (isClosed()) {
- throw new IOException(Msg.getString("K0060")); //$NON-NLS-1$
+ throw new IOException(Messages.getString("luni.A9")); //$NON-NLS-1$
}
markedPos = pos;
}
@@ -172,7 +172,7 @@
public int read() throws IOException {
synchronized (lock) {
if (isClosed()) {
- throw new IOException(Msg.getString("K0060")); //$NON-NLS-1$
+ throw new IOException(Messages.getString("luni.A9")); //$NON-NLS-1$
}
if (pos == count) {
return -1;
@@ -206,18 +206,18 @@
@Override
public int read(char buffer[], int offset, int len) throws IOException {
if (offset < 0 || offset > buffer.length) {
- // K002e=Offset out of bounds \: {0}
+ // luni.12=Offset out of bounds \: {0}
throw new ArrayIndexOutOfBoundsException(
- Msg.getString("K002e", offset)); //$NON-NLS-1$
+ Messages.getString("luni.12", offset)); //$NON-NLS-1$
}
if (len < 0 || len > buffer.length - offset) {
- // K0031=Length out of bounds \: {0}
+ // luni.18=Length out of bounds \: {0}
throw new ArrayIndexOutOfBoundsException(
- Msg.getString("K0031", len)); //$NON-NLS-1$
+ Messages.getString("luni.18", len)); //$NON-NLS-1$
}
synchronized (lock) {
if (isClosed()) {
- throw new IOException(Msg.getString("K0060")); //$NON-NLS-1$
+ throw new IOException(Messages.getString("luni.A9")); //$NON-NLS-1$
}
if (pos < this.count) {
int bytesRead = pos + len > this.count ? this.count - pos : len;
@@ -245,7 +245,7 @@
public boolean ready() throws IOException {
synchronized (lock) {
if (isClosed()) {
- throw new IOException(Msg.getString("K0060")); //$NON-NLS-1$
+ throw new IOException(Messages.getString("luni.A9")); //$NON-NLS-1$
}
return pos != count;
}
@@ -264,7 +264,7 @@
public void reset() throws IOException {
synchronized (lock) {
if (isClosed()) {
- throw new IOException(Msg.getString("K0060")); //$NON-NLS-1$
+ throw new IOException(Messages.getString("luni.A9")); //$NON-NLS-1$
}
pos = markedPos != -1 ? markedPos : 0;
}
@@ -285,7 +285,7 @@
public long skip(long n) throws IOException {
synchronized (lock) {
if (isClosed()) {
- throw new IOException(Msg.getString("K0060")); //$NON-NLS-1$
+ throw new IOException(Messages.getString("luni.A9")); //$NON-NLS-1$
}
if (n <= 0) {
return 0;
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/CharArrayWriter.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/CharArrayWriter.java?rev=909597&r1=909596&r2=909597&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/CharArrayWriter.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/CharArrayWriter.java Fri Feb 12 20:23:04 2010
@@ -17,7 +17,7 @@
package java.io;
-import org.apache.harmony.luni.util.Msg;
+import org.apache.harmony.luni.internal.nls.Messages;
/**
* A specialized {@link Writer} for class for writing content to an (internal)
@@ -63,7 +63,7 @@
public CharArrayWriter(int initialSize) {
super();
if (initialSize < 0) {
- throw new IllegalArgumentException(Msg.getString("K005e")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Messages.getString("luni.A8")); //$NON-NLS-1$
}
buf = new char[initialSize];
lock = buf;
@@ -214,7 +214,7 @@
@Override
public void write(String str, int offset, int len) {
if (str == null) {
- throw new NullPointerException(Msg.getString("K0047")); //$NON-NLS-1$
+ throw new NullPointerException(Messages.getString("luni.11")); //$NON-NLS-1$
}
// avoid int overflow
if (offset < 0 || offset > str.length() || len < 0
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/DataInputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/DataInputStream.java?rev=909597&r1=909596&r2=909597&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/DataInputStream.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/DataInputStream.java Fri Feb 12 20:23:04 2010
@@ -17,7 +17,7 @@
package java.io;
-import org.apache.harmony.luni.util.Msg;
+import org.apache.harmony.luni.internal.nls.Messages;
import org.apache.harmony.luni.util.Util;
/**
@@ -244,10 +244,10 @@
return;
}
if (in == null) {
- throw new NullPointerException(Msg.getString("KA00b")); //$NON-NLS-1$
+ throw new NullPointerException(Messages.getString("luni.AA")); //$NON-NLS-1$
}
if (buffer == null) {
- throw new NullPointerException(Msg.getString("K0047")); //$NON-NLS-1$
+ throw new NullPointerException(Messages.getString("luni.11")); //$NON-NLS-1$
}
if (offset < 0 || offset > buffer.length - length) {
throw new IndexOutOfBoundsException();
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/DataOutputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/DataOutputStream.java?rev=909597&r1=909596&r2=909597&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/DataOutputStream.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/DataOutputStream.java Fri Feb 12 20:23:04 2010
@@ -17,7 +17,7 @@
package java.io;
-import org.apache.harmony.luni.util.Msg;
+import org.apache.harmony.luni.internal.nls.Messages;
/**
* Wraps an existing {@link OutputStream} and writes typed data to it.
@@ -93,7 +93,7 @@
@Override
public void write(byte buffer[], int offset, int count) throws IOException {
if (buffer == null) {
- throw new NullPointerException(Msg.getString("K0047")); //$NON-NLS-1$
+ throw new NullPointerException(Messages.getString("luni.11")); //$NON-NLS-1$
}
out.write(buffer, offset, count);
written += count;
@@ -332,7 +332,7 @@
public final void writeUTF(String str) throws IOException {
long utfCount = countUTFBytes(str);
if (utfCount > 65535) {
- throw new UTFDataFormatException(Msg.getString("K0068")); //$NON-NLS-1$
+ throw new UTFDataFormatException(Messages.getString("luni.AB")); //$NON-NLS-1$
}
byte[] buffer = new byte[(int)utfCount + 2];
int offset = 0;
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/File.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/File.java?rev=909597&r1=909596&r2=909597&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/File.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/File.java Fri Feb 12 20:23:04 2010
@@ -27,7 +27,7 @@
import org.apache.harmony.luni.internal.io.FileCanonPathCache;
import org.apache.harmony.luni.util.DeleteOnExit;
-import org.apache.harmony.luni.util.Msg;
+import org.apache.harmony.luni.internal.nls.Messages;
import org.apache.harmony.luni.util.PriviAction;
import org.apache.harmony.luni.util.Util;
@@ -199,33 +199,33 @@
@SuppressWarnings("nls")
private void checkURI(URI uri) {
if (!uri.isAbsolute()) {
- throw new IllegalArgumentException(Msg.getString("K031a", uri));
+ throw new IllegalArgumentException(Messages.getString("luni.AD", uri));
} else if (!uri.getRawSchemeSpecificPart().startsWith("/")) {
- throw new IllegalArgumentException(Msg.getString("K031b", uri));
+ throw new IllegalArgumentException(Messages.getString("luni.AE", uri));
}
String temp = uri.getScheme();
if (temp == null || !temp.equals("file")) {
- throw new IllegalArgumentException(Msg.getString("K031c", uri));
+ throw new IllegalArgumentException(Messages.getString("luni.AF", uri));
}
temp = uri.getRawPath();
if (temp == null || temp.length() == 0) {
- throw new IllegalArgumentException(Msg.getString("K031d", uri));
+ throw new IllegalArgumentException(Messages.getString("luni.B0", uri));
}
if (uri.getRawAuthority() != null) {
- throw new IllegalArgumentException(Msg.getString("K031e",
+ throw new IllegalArgumentException(Messages.getString("luni.B1",
new String[] { "authority", uri.toString() }));
}
if (uri.getRawQuery() != null) {
- throw new IllegalArgumentException(Msg.getString("K031e",
+ throw new IllegalArgumentException(Messages.getString("luni.B1",
new String[] { "query", uri.toString() }));
}
if (uri.getRawFragment() != null) {
- throw new IllegalArgumentException(Msg.getString("K031e",
+ throw new IllegalArgumentException(Messages.getString("luni.B1",
new String[] { "fragment", uri.toString() }));
}
}
@@ -895,7 +895,7 @@
*/
public boolean setLastModified(long time) {
if (time < 0) {
- throw new IllegalArgumentException(Msg.getString("K006a")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Messages.getString("luni.B2")); //$NON-NLS-1$
}
SecurityManager security = System.getSecurityManager();
if (security != null) {
@@ -1221,7 +1221,7 @@
security.checkWrite(path);
}
if (0 == path.length()) {
- throw new IOException(Msg.getString("KA012")); //$NON-NLS-1$
+ throw new IOException(Messages.getString("luni.B3")); //$NON-NLS-1$
}
int result = newFileImpl(properPath(true));
switch (result) {
@@ -1230,7 +1230,7 @@
case 1:
return false;
default:
- throw new IOException(Msg.getString("K01c2", path)); //$NON-NLS-1$
+ throw new IOException(Messages.getString("luni.B4", path)); //$NON-NLS-1$
}
}
@@ -1281,7 +1281,7 @@
File directory) throws IOException {
// Force a prefix null check first
if (prefix.length() < 3) {
- throw new IllegalArgumentException(Msg.getString("K006b"));
+ throw new IllegalArgumentException(Messages.getString("luni.B5"));
}
String newSuffix = suffix == null ? ".tmp" : suffix;
File tmpDirFile;
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FileInputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FileInputStream.java?rev=909597&r1=909596&r2=909597&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FileInputStream.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FileInputStream.java Fri Feb 12 20:23:04 2010
@@ -21,7 +21,7 @@
import org.apache.harmony.luni.platform.IFileSystem;
import org.apache.harmony.luni.platform.Platform;
-import org.apache.harmony.luni.util.Msg;
+import org.apache.harmony.luni.internal.nls.Messages;
import org.apache.harmony.nio.FileChannelFactory;
/**
@@ -74,8 +74,8 @@
security.checkRead(filePath);
}
if (file == null) {
- // KA001=Argument must not be null
- throw new NullPointerException(Msg.getString("KA001")); //$NON-NLS-1$
+ // luni.4D=Argument must not be null
+ throw new NullPointerException(Messages.getString("luni.4D")); //$NON-NLS-1$
}
fd = new FileDescriptor();
fd.readOnly = true;
@@ -316,8 +316,8 @@
return 0;
}
if (count < 0) {
- // KA013=Number of bytes to skip cannot be negative
- throw new IOException(Msg.getString("KA013")); //$NON-NLS-1$
+ // luni.AC=Number of bytes to skip cannot be negative
+ throw new IOException(Messages.getString("luni.AC")); //$NON-NLS-1$
}
// stdin requires special handling
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FileOutputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FileOutputStream.java?rev=909597&r1=909596&r2=909597&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FileOutputStream.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FileOutputStream.java Fri Feb 12 20:23:04 2010
@@ -21,7 +21,7 @@
import org.apache.harmony.luni.platform.IFileSystem;
import org.apache.harmony.luni.platform.Platform;
-import org.apache.harmony.luni.util.Msg;
+import org.apache.harmony.luni.internal.nls.Messages;
import org.apache.harmony.nio.FileChannelFactory;
/**
@@ -116,7 +116,7 @@
public FileOutputStream(FileDescriptor fd) {
super();
if (fd == null) {
- throw new NullPointerException(Msg.getString("K006c")); //$NON-NLS-1$
+ throw new NullPointerException(Messages.getString("luni.B6")); //$NON-NLS-1$
}
SecurityManager security = System.getSecurityManager();
if (security != null) {
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FilePermission.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FilePermission.java?rev=909597&r1=909596&r2=909597&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FilePermission.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FilePermission.java Fri Feb 12 20:23:04 2010
@@ -22,7 +22,7 @@
import java.security.PermissionCollection;
import java.security.PrivilegedAction;
-import org.apache.harmony.luni.util.Msg;
+import org.apache.harmony.luni.internal.nls.Messages;
/**
* A permission for accessing a file or directory. The FilePermission is made up
@@ -93,12 +93,12 @@
private void init(final String path, String pathActions) {
if (pathActions == null || pathActions.equals("")) { //$NON-NLS-1$
- throw new IllegalArgumentException(Msg.getString("K006d")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Messages.getString("luni.B7")); //$NON-NLS-1$
}
this.actions = toCanonicalActionString(pathActions);
if (path == null) {
- throw new NullPointerException(Msg.getString("K006e")); //$NON-NLS-1$
+ throw new NullPointerException(Messages.getString("luni.B8")); //$NON-NLS-1$
}
if (path.equals("<<ALL FILES>>")) { //$NON-NLS-1$
includeAll = true;
@@ -181,8 +181,8 @@
} else if (action.equals("delete")) { //$NON-NLS-1$
actionInt |= 1;
} else {
- throw new IllegalArgumentException(Msg.getString(
- "K006f", action)); //$NON-NLS-1$
+ throw new IllegalArgumentException(Messages.getString(
+ "luni.B9", action)); //$NON-NLS-1$
}
head = tail + 1;
} while (tail > 0);
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FilterOutputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FilterOutputStream.java?rev=909597&r1=909596&r2=909597&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FilterOutputStream.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FilterOutputStream.java Fri Feb 12 20:23:04 2010
@@ -17,7 +17,7 @@
package java.io;
-import org.apache.harmony.luni.util.Msg;
+import org.apache.harmony.luni.internal.nls.Messages;
import org.apache.harmony.luni.util.SneakyThrow;
/**
@@ -124,12 +124,12 @@
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$
+ // luni.12=Offset out of bounds \: {0}
+ throw new ArrayIndexOutOfBoundsException(Messages.getString("luni.12", 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$
+ // luni.18=Length out of bounds \: {0}
+ throw new ArrayIndexOutOfBoundsException(Messages.getString("luni.18", length)); //$NON-NLS-1$
}
for (int i = 0; i < length; i++) {
// Call write() instead of out.write() since subclasses could
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/InputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/InputStream.java?rev=909597&r1=909596&r2=909597&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/InputStream.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/InputStream.java Fri Feb 12 20:23:04 2010
@@ -17,7 +17,7 @@
package java.io;
-import org.apache.harmony.luni.util.Msg;
+import org.apache.harmony.luni.internal.nls.Messages;
/**
* The base class for all input streams. An input stream is a means of reading
@@ -151,12 +151,12 @@
public int read(byte b[], int offset, int length) throws IOException {
// 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$
+ // luni.12=Offset out of bounds \: {0}
+ throw new ArrayIndexOutOfBoundsException(Messages.getString("luni.12", 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$
+ // luni.18=Length out of bounds \: {0}
+ throw new ArrayIndexOutOfBoundsException(Messages.getString("luni.18", length)); //$NON-NLS-1$
}
for (int i = 0; i < length; i++) {
int c;
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/InputStreamReader.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/InputStreamReader.java?rev=909597&r1=909596&r2=909597&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/InputStreamReader.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/InputStreamReader.java Fri Feb 12 20:23:04 2010
@@ -28,7 +28,7 @@
import java.security.AccessController;
import org.apache.harmony.luni.util.HistoricalNamesUtil;
-import org.apache.harmony.luni.util.Msg;
+import org.apache.harmony.luni.internal.nls.Messages;
import org.apache.harmony.luni.util.PriviAction;
/**
@@ -189,8 +189,8 @@
public int read() throws IOException {
synchronized (lock) {
if (!isOpen()) {
- // K0070=InputStreamReader is closed.
- throw new IOException(Msg.getString("K0070")); //$NON-NLS-1$
+ // luni.BA=InputStreamReader is closed.
+ throw new IOException(Messages.getString("luni.BA")); //$NON-NLS-1$
}
char buf[] = new char[1];
@@ -226,8 +226,8 @@
public int read(char[] buf, int offset, int length) throws IOException {
synchronized (lock) {
if (!isOpen()) {
- // K0070=InputStreamReader is closed.
- throw new IOException(Msg.getString("K0070")); //$NON-NLS-1$
+ // luni.BA=InputStreamReader is closed.
+ throw new IOException(Messages.getString("luni.BA")); //$NON-NLS-1$
}
if (offset < 0 || offset > buf.length - length || length < 0) {
throw new IndexOutOfBoundsException();
@@ -326,8 +326,8 @@
public boolean ready() throws IOException {
synchronized (lock) {
if (in == null) {
- // K0070=InputStreamReader is closed.
- throw new IOException(Msg.getString("K0070")); //$NON-NLS-1$
+ // luni.BA=InputStreamReader is closed.
+ throw new IOException(Messages.getString("luni.BA")); //$NON-NLS-1$
}
try {
return bytes.hasRemaining() || in.available() > 0;
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/LineNumberInputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/LineNumberInputStream.java?rev=909597&r1=909596&r2=909597&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/LineNumberInputStream.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/LineNumberInputStream.java Fri Feb 12 20:23:04 2010
@@ -17,7 +17,7 @@
package java.io;
-import org.apache.harmony.luni.util.Msg;
+import org.apache.harmony.luni.internal.nls.Messages;
/**
* Wraps an existing {@link InputStream} and counts the line terminators
@@ -171,12 +171,12 @@
public int read(byte[] buffer, int offset, int length) throws IOException {
// 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$
+ // luni.12=Offset out of bounds \: {0}
+ throw new ArrayIndexOutOfBoundsException(Messages.getString("luni.12", 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$
+ // luni.18=Length out of bounds \: {0}
+ throw new ArrayIndexOutOfBoundsException(Messages.getString("luni.18", length)); //$NON-NLS-1$
}
for (int i = 0; i < length; i++) {
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/RandomAccessFile.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/RandomAccessFile.java?rev=909597&r1=909596&r2=909597&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/RandomAccessFile.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/RandomAccessFile.java Fri Feb 12 20:23:04 2010
@@ -21,7 +21,7 @@
import org.apache.harmony.luni.platform.IFileSystem;
import org.apache.harmony.luni.platform.Platform;
-import org.apache.harmony.luni.util.Msg;
+import org.apache.harmony.luni.internal.nls.Messages;
import org.apache.harmony.luni.util.Util;
import org.apache.harmony.nio.FileChannelFactory;
@@ -125,7 +125,7 @@
options = IFileSystem.O_RDWRSYNC;
}
} else {
- throw new IllegalArgumentException(Msg.getString("K0081")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Messages.getString("luni.A2")); //$NON-NLS-1$
}
SecurityManager security = System.getSecurityManager();
@@ -479,7 +479,7 @@
public final void readFully(byte[] buffer, int offset, int count)
throws IOException {
if (buffer == null) {
- throw new NullPointerException(Msg.getString("K0047")); //$NON-NLS-1$
+ throw new NullPointerException(Messages.getString("luni.11")); //$NON-NLS-1$
}
// avoid int overflow
if (offset < 0 || offset > buffer.length || count < 0
@@ -691,7 +691,7 @@
public void seek(long pos) throws IOException {
if (pos < 0) {
// seek position is negative
- throw new IOException(Msg.getString("K0347")); //$NON-NLS-1$
+ throw new IOException(Messages.getString("luni.BB")); //$NON-NLS-1$
}
openCheck();
synchronized (repositionLock) {
@@ -1036,7 +1036,7 @@
}
}
if (utfCount > 65535) {
- throw new UTFDataFormatException(Msg.getString("K0068")); //$NON-NLS-1$
+ throw new UTFDataFormatException(Messages.getString("luni.AB")); //$NON-NLS-1$
}
byte utfBytes[] = new byte[utfCount + 2];
int utfIndex = 2;
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/nls/messages.properties
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/nls/messages.properties?rev=909597&r1=909596&r2=909597&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/nls/messages.properties (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/nls/messages.properties Fri Feb 12 20:23:04 2010
@@ -176,4 +176,29 @@
luni.9F=Authority expected
luni.A0=Expected host
luni.A1=Package is sealed
-luni.A2=package is sealed
+luni.A2=Mode must be one of "r" or "rw"
+luni.A3=size must be > 0
+luni.A4=Mark has been invalidated.
+luni.A5=BufferedReader is closed
+luni.A6=Invalid Mark.
+luni.A7=Writer is closed.
+luni.A8=size must be >\= 0
+luni.A9=CharArrayReader is closed.
+luni.AA=InputStream is null
+luni.AB=String is too long
+luni.AC=Number of bytes to skip cannot be negative
+luni.AD=URI is not absolute\: {0}
+luni.AE=URI is not hierarchical\: {0}
+luni.AF=Expected file scheme in URI\: {0}
+luni.B0=Expected non-empty path in URI\: {0}
+luni.B1=Found {0} component in URI\: {1}
+luni.B2=time must be positive
+luni.B3=No such file or directory
+luni.B4=Cannot create\: {0}
+luni.B5=Prefix must be at least 3 characters
+luni.B6=FileDescriptor is null
+luni.B7=actions invalid
+luni.B8=path is null
+luni.B9=invalid permission\: {0}
+luni.BA=InputStreamReader is closed.
+luni.BB=seek position is negative