Details
-
Bug
-
Resolution: Fixed
-
P4
-
8, 9, 10, 11
-
All UNIX.
-
b14
Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8258035 | 11-pool | Unassigned | P4 | Open | Unresolved | |
JDK-8219359 | 11.0.3 | Andrew Haley | P4 | Resolved | Fixed | master |
JDK-8252082 | openjdk8u272 | Andrew Haley | P4 | Resolved | Fixed | b05 |
Description
Java_java_io_Console_echo looks like this:
JNIEXPORT jboolean JNICALL
Java_java_io_Console_echo(JNIEnv *env, jclass cls, jboolean on)
{
DWORD fdwMode;
jboolean old;
...
old = (fdwMode & ENABLE_ECHO_INPUT);
...
return old;
}
It only works by accident. jboolean is an unsigned byte. ENABLE_ECHO_INPUT on the systems I know of is 0000010, so fdwMode & ENABLE_ECHO_INPUT fits into the result. We should do things properly and return a clean boolean.
JNIEXPORT jboolean JNICALL
Java_java_io_Console_echo(JNIEnv *env, jclass cls, jboolean on)
{
DWORD fdwMode;
jboolean old;
...
old = (fdwMode & ENABLE_ECHO_INPUT);
...
return old;
}
It only works by accident. jboolean is an unsigned byte. ENABLE_ECHO_INPUT on the systems I know of is 0000010, so fdwMode & ENABLE_ECHO_INPUT fits into the result. We should do things properly and return a clean boolean.
Attachments
Issue Links
- backported by
-
JDK-8258035 UNIX version of Java_java_io_Console_echo does not return a clean boolean
- Open
-
JDK-8219359 UNIX version of Java_java_io_Console_echo does not return a clean boolean
- Resolved
-
JDK-8252082 UNIX version of Java_java_io_Console_echo does not return a clean boolean
- Resolved