On Thu, 13 May 2021 05:56:00 GMT, Yasumasa Suenaga <ysuen...@openjdk.org> wrote:

>> Ok, this explanation seems reasonable, but is not something that is really 
>> conveyed with the the name `--prefix` or with the help "Sets the prefix to 
>> distinguish SA debugee". We are at the same giving too much and too little 
>> info. Too much in that we are saying that it is a prefix of some sort, which 
>> then leads to that fact that we don't explain how it is used in the RMI URL.
>> 
>> I'm not saying that we need to explain how  the `--connect 
>> [<id>@]<host>[:registryport][/prefix]` option is converted into an RMI URL 
>> (although perhaps we should), but it seems we at least need to describe the 
>> relation between `<id>` and `/prefix`. Otherwise no one is really going to 
>> understand how/why to use it.
>> 
>> Also, having the prefix at the end of the "serverID" string seems odd. Maybe 
>> it should be:
>> 
>>    [[prefix/]unique_id@]host[:port]
>
> Finally, all parameters will be transformed to 
> `//host[:port]/<serverNamePrefix>['_'<unique_id>]`.
> `--prefix` and `id` affect to RMI object name to be precise. So ID is object 
> name, then the prefix will be added to it.
> 
> Based on them, how about this?
> 
> 
> --prefix <url prefix> Set the prefix to add to debug server instance name.
> 
> 
> I understand is is odd the value is added to the tail even if it is named 
> "prefix".
> Both `prefix` and `id` are optional, so we can specify `prefix` only, then 
> `prefix/@host` is strange for me.
> 
> How about this pattern? Use ":" instead of "/" like a URL.
> 
> 
> [prefix:][unique_id@]host[:port]
> 
> 
> I thought to give new name instead of "prefix", but I give up because I have 
> not good idea and would be inconsistent system property. 
> (`sun.jvm.hotspot.rmi.serverNamePrefix`)

I think this is better, but I think better help output is needed. `prefix` has 
a default and `unique_id` does not. I think both of these need to be mentioned 
in the help output. Also, if `unique_id` is not specified, then the value of 
`prefix` is the name of the RMI object, which seems a bit odd because it is 
suppose to be a prefix to a name, not the entire name.

I think maybe the property name of `sun.jvm.hotspot.rmi.serverNamePrefix` was 
not a good choice, and is making it harder to come up with good argument names 
and syntax. If designing this from scratch, I would have called it 
`sun.jvm.hotspot.rmi.serverName`, and then appending an optional `unique_id` to 
it would make more sense.

What if instead of `prefix` you used `servername` and possibly also rename 
`sun.jvm.hotspot.rmi.serverNamePrefix` to `sun.jvm.hotspot.rmi.serverName`, but 
also keep legacy support in case someone is already using 
`sun.jvm.hotspot.rmi.serverNamePrefix` and decides to set it?

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

PR: https://git.openjdk.java.net/jdk/pull/3669

Reply via email to