Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2109539 | 1.4.1 | Thomas Ng | P4 | Closed | Fixed | hopper |
In Console.java, we did not convert the ASCII value to the string correctly:
in the write(int b) method, we do:
insert(Byte.toString((byte)b));
this would not convert int(ASCII value) into the repsective string, e.g int 60 should represent the string "<", the above conversion will only convert int 60 to a string "60".
It should be
insert(String.valueOf((char)b));
instead. It will return the string "<" if int b = 60.
the attached test.java will demonstrate the problem and the fix clearly.
in the write(int b) method, we do:
insert(Byte.toString((byte)b));
this would not convert int(ASCII value) into the repsective string, e.g int 60 should represent the string "<", the above conversion will only convert int 60 to a string "60".
It should be
insert(String.valueOf((char)b));
instead. It will return the string "<" if int b = 60.
the attached test.java will demonstrate the problem and the fix clearly.
- backported by
-
JDK-2109539 Console output ASCII value instead of the character
- Closed