Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
-
Linux
-
Novice
Description
The following test leads to stack overflow on Harmony, but works ok on RI:
import java.io.DataInput;
import java.io.DataInputStream;
import java.io.IOException;
public class Test {
public static void main(String[] args) throws Exception
static class MyDataInputStream implements DataInput {
public boolean readBoolean() throws IOException
public byte readByte() throws IOException
{ return (byte) 0; }public char readChar() throws IOException
{ return (char) 0; }public double readDouble() throws IOException
{ return 0.0; }public float readFloat() throws IOException
{ return (float) 0.0; } public void readFully(byte[] buffer) throws IOException {
}
public void readFully(byte[] buffer, int offset, int count)
throws IOException {
}
public int readInt() throws IOException
{ return 0; }public String readLine() throws IOException { return null; }
public long readLong() throws IOException { return (long) 0; }
public short readShort() throws IOException { return (short) 0; }
public int readUnsignedByte() throws IOException { return 0; }
public int readUnsignedShort() throws IOException
{ return 0; }public String readUTF() throws IOException { return DataInputStream.readUTF(this); }
public int skipBytes(int count) throws IOException { return 0; }
}
}
readUTF(DataInput in) static method of DataInputStream just calls 'return in.readUTF();' which lead to this problem. I'll provide the patch soon.