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

QPathTest might fail to catch errors due to GC bug in test

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 10
    • 9, 10
    • javafx

      QPathTest checks whether any exceptions are logged from the Marlin rasterizer as a result of running the test program. However, since it does not hold a strong reference to the logger, the logger is subject to garbage collection, which means that if an exception were to be logged by Marlin, the test would likely not catch it (depending on whether GC runs or not).

      I discovered this error while debugging the test programs for JDK-8177566, since I used the same approach for some of the unit tests for that bug.

      The fix is to declare the "log" variable, which is currently a local variable in the static block, as a private static class variable.

            lbourges Laurent Bourgès
            kcr Kevin Rushforth
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: