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

Always true condition in sun.nio.cs.CharsetMapping#readINDEXC2B

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P5 P5
    • 22
    • 17, 21
    • core-libs
    • None

      In the method 'sun.nio.cs.CharsetMapping#readINDEXC2B'

          void readINDEXC2B() {
              char[] map = readCharArray();
              for (int i = map.length - 1; i >= 0; i--) {
                  if (c2b == null && map[i] != -1) {
                      c2b = new char[map[i] + 256];
                      Arrays.fill(c2b, (char)UNMAPPABLE_ENCODING);
                      break;
                  }
              }
              c2bIndex = map;
          }

      Condition 'map[i] != -1' is always true. 'char' values range [0..65535]. It can't be equal to '-1'

            naoto Naoto Sato
            aturbanov Andrey Turbanov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: