8356974: tools/launcher/ToolsOpts.java fails if the build id contains "-J"

Reviewed-by: jpai, thartmann
This commit is contained in:
Manuel Hässig 2025-05-19 10:15:56 +00:00 committed by Jaikiran Pai
parent 133c6fb4f3
commit 36c9be70e2

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -128,7 +128,8 @@ public class ToolsOpts extends TestHelper {
String jopts = "";
for (String pat : opts) {
jopts = jopts.concat(pat + " ");
if (tr.contains("-J")) {
if (tr.contains(" -J-")) {
System.err.println(tr);
throw new RuntimeException(
"failed: output should not contain option " + pat);
}