StringIndexOutOfBoundsException in ReportOnlyTest

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • None
    • Affects Version/s: None
    • Component/s: tools
    • None

      While working on ReportOnlyTest recently, a hitherto unnoticed stack trace was noticed in a log file from running jtreg.

      Directory ".../open/build/test/Volumes/J2GWork/jtreg/jtreg.dev/open/build/test/ReportOnlyTest" not found: creating
      Test results: passed: 93; failed: 44; error: 88
      Error: Unexpected exception occurred! java.lang.StringIndexOutOfBoundsException: String index out of range: -1
      java.lang.StringIndexOutOfBoundsException: String index out of range: -1
              at java.base/java.lang.StringLatin1.charAt(StringLatin1.java:47)
              at java.base/java.lang.String.charAt(String.java:693)
              at com.sun.javatest.InitialUrlFilter.isInitialUrlMatch(InitialUrlFilter.java:133)
              at com.sun.javatest.InitialUrlFilter.accepts(InitialUrlFilter.java:159)
              at com.sun.javatest.ParameterFilter.accepts(ParameterFilter.java:149)
              at com.sun.javatest.ParameterFilter.accepts(ParameterFilter.java:96)
              at com.sun.javatest.TRT_Iterator.wouldAccept(TRT_Iterator.java:914)
              at com.sun.javatest.TRT_Iterator.findNext(TRT_Iterator.java:752)
              at com.sun.javatest.TRT_Iterator.init(TRT_Iterator.java:697)
              at com.sun.javatest.TRT_Iterator.<init>(TRT_Iterator.java:157)
              at com.sun.javatest.TestResultTable.getIterator(TestResultTable.java:1206)
              at com.sun.javatest.TestResultTable.getIterator(TestResultTable.java:1116)
              at com.sun.javatest.report.ReportSettings.setupSortedResults(ReportSettings.java:523)
              at com.sun.javatest.report.Report.writeReports(Report.java:177)
              at com.sun.javatest.regtest.report.RegressionReporter.report(RegressionReporter.java:106)
              at com.sun.javatest.regtest.tool.Tool.batchHarness(Tool.java:1992)
              at com.sun.javatest.regtest.tool.Tool.run(Tool.java:1338)
              at com.sun.javatest.regtest.tool.Tool.run(Tool.java:1082)
              at com.sun.javatest.regtest.tool.Tool.main(Tool.java:155)
              at com.sun.javatest.regtest.Main.main(Main.java:46)


      The immediate cause was an empty string for a test file being passed down into JT Harness from jtreg,

      The root cause is a bad check in `TestManager`, comparing the wrong form of a path (relative, not canonical) against the canonical file for the test suite root. This indirectly leads to computing an empty relative path between the two, causing the issue.

            Assignee:
            Jonathan Gibbons
            Reporter:
            Jonathan Gibbons
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: