Uploaded image for project: 'Code Tools'
  1. Code Tools
  2. CODETOOLS-7903808

IOOBE in compile action when processing class files only

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • jtreg7.5
    • jtreg7.5
    • tools
    • None

      Tags like `@compile/process -cp . -processor TypeToString -proc:only Test` lead to a -1 values as the insert position in jtreg compile action.

      Source: https://github.com/openjdk/jdk/blob/ffd850f17efc88dddfeab629f829a03ad22dc49d/test/langtools/tools/javac/TypeToString.java#L32

      Fix: check for -1 values and use 0 instead - this will prepend `--enable-preview` and `--source N` before any variadic arguments.

      ```
      java.lang.IndexOutOfBoundsException: Index: -1, Size: 6
      at java.base/java.util.ArrayList.rangeCheckForAdd(ArrayList.java:839)
      at java.base/java.util.ArrayList.add(ArrayList.java:511)
      at com.sun.javatest.regtest.exec.CompileAction.run(CompileAction.java:370)
      at com.sun.javatest.regtest.exec.RegressionScript.run(RegressionScript.java:267)
      at com.sun.javatest.Script.run(Script.java:431)
      at com.sun.javatest.DefaultTestRunner.runTest(DefaultTestRunner.java:183)
      at com.sun.javatest.DefaultTestRunner$1.run(DefaultTestRunner.java:76)
      ```

            cstein Christian Stein
            cstein Christian Stein
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: