Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8211163

UNIX version of Java_java_io_Console_echo does not return a clean boolean

    XMLWordPrintable

Details

    • b14

    Backports

      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.

        Attachments

          Issue Links

            Activity

              People

                aph Andrew Haley
                aph Andrew Haley
                Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: