Many jtreg tests use non-product command line options for one reason or another (a common reason is to achieve the state to be tested more easily or reliably than could be done without the use of the option). However, without additional work this will result in the test failing when run against a product build.
The present idiom for dealing with this problem is to use -XX:+IgnoreUnrecognizedVMOptions, so that the non-product options are ignored by product builds. There are several problems with this idiom that make it less than an ideal solution.
- A typo in an option of interest will cause it to simply be ignored, which could lead to an inappropriate pass even for non-product builds.
- A variation of the typo problem is that an obsolete/removed option could linger in a test.
- Simply discarding the non-product options could result in an option set that isn't an actually valid combination.
A better approach would be to use `@requires vm.debug` to limit the test to a non-product build. A few tests are already doing this, but there are a lot of tests still using the -XX:+IgnoreUnrecognizedVMOptions idiom.
Some of these issues are particularly pernicious because -XX:+IgnoreUnrecognizedVMOptions applies to all of the options, not just those that follow it.