RFR: JDK-8299470: sun/jvm/hotspot/SALauncher.java handling of negative rmiport args [v2]

Christoph Langer clanger at openjdk.org
Wed Jan 4 12:44:50 UTC 2023


On Wed, 4 Jan 2023 12:10:11 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:

>> The test serviceability/sa/sadebugd/SADebugDTest.java can pass under some circumstances a negative rmiport (--rmiport -1) to SALauncher.java.
>> This leads to a somewhat misleading message 
>> `[debugd] Argument is expected for 'rmiport' `
>> (we set an argument [-1] but probably this is not what is really expected) and additionally the real exception is not shown.
>> Probably also a warning in case of negative rmiport values should be printed because they seem to lead to errors.
>
> Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Improve exception message for SAGetoptException

I've got one suggestion, plus, the copyright year now is 2023 😉

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/SALauncher.java line 503:

> 501:             }
> 502:         } catch (SAGetoptException e) {
> 503:             System.err.println("SA agent option related exception occured");

Maybe you could do here:
`System.err.println("SA agent option exception occured: " + e.getMessage);`
and remove the `System.err.println(e.getMessage());` in line 505.

-------------

Changes requested by clanger (Reviewer).

PR: https://git.openjdk.org/jdk/pull/11811


More information about the serviceability-dev mailing list