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

Bad assert in SignatureParser class

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P5 P5
    • 9
    • 7u80, 8-pool, 9
    • core-libs

      FULL PRODUCT VERSION :
      java -version
      java version "1.7.0_80"
      Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
      Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)


      ADDITIONAL OS VERSION INFORMATION :
      Linux Ubuntu 3.2.0-84-generic #121-Ubuntu SMP Tue May 5 18:54:05 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux


      A DESCRIPTION OF THE PROBLEM :
      Hello,

      The assert should be:
              assert this.index < this.input.length;

      as the max index is (length-1):


      /usr/lib/jvm/java-7-oracle/jre/lib/rt.jar!/sun/reflect/generics/parser/SignatureParser.class

          private char current() {
              assert this.index <= this.input.length;

              try {
                  return this.input[this.index];
              } catch (ArrayIndexOutOfBoundsException var2) {
                  return ':';
              }
          }

      Regards,
      Jay


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Look at source code.

      ACTUAL -
      ArrayIndexOutOfBoundsException

      REPRODUCIBILITY :
      This bug can be reproduced always.

            sadayapalam Srikanth Adayapalam (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: