JDK-8221913 : Add GC.selected() jtreg-ext function
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 13
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2019-04-03
  • Updated: 2019-10-31
  • Resolved: 2019-04-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 13
11.0.6-oracleFixed 13 b17Fixed
Description
Instead of having to write:
 for (GC gc: GC.values()) {
   if (gc.isSelected()) {
     test(gc);
   }
 }
  
to know what the currently selected GC is, it would be nice to be able to simply write:
 test(GC.selected())
Comments
Fix Request (11u) Backporting this test infra fix provides the grounds for clean backport of JDK-8231503. Patch applies cleanly to 11u, does not regress tier1, tier2 (since there are no uses yet).
14-10-2019