On Tue, 22 Nov 2022 23:32:51 GMT, Magnus Ihse Bursie <i...@openjdk.org> wrote:

>> make/langtools/tools/javacserver/client/Client.java line 148:
>> 
>>> 146:         cmd.addAll(Arrays.asList(conf.javaCommand().split(" ")));
>>> 147:         // javacserver.server.Server is the server main class
>>> 148:         cmd.add("javacserver.server.Server");
>> 
>> Did you consider referencing the class name using `Server.class.getName()`?
>
> No, can't say I have. Do you think there is anything to gain by doing that? 
> (Apart from possibly getting this right automatically if the class is renamed 
> by IDE tools) (I'm not sure it would be a win in readability)

I like to reference class names that way so that it's typed instead of just a 
string. If the class changes name, you get a compilation error, and the IDE 
would handle refactoring automatically. Not a strong need in this particular 
instance, just something I generally tend to do.

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

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

Reply via email to