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

Bug in char input

    XMLWordPrintable

Details

    • generic
    • generic

    Description

      FULL PRODUCT VERSION :


      A DESCRIPTION OF THE PROBLEM :
      If I have a few lines of code to input three characters as such:

      char a=(char)br.read();
      char b=(char)br.read();
      char c=(char)br.read();
      System.out.println(a+b+c)

      in a main function, in the class etc, upon running the program, I am only allowed to enter a and b after which the line of code to enter c seems to "skipped" and the lines of code after that are executed, that is, a annd b are prined, followed by ' ' being printed, that is, the default value of c.

      Basically, the issue seems to be like, if I write the code to enter 5 characters, I can enter only 4 and so on.


      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      Have an extra 'empty' character besides the no. of characters you want.

      Attachments

        Activity

          People

            psonal Pallavi Sonal (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: