RFR: 8255416: Investigate err_msg to detect unnecessary uses

Aleksey Shipilev shade at openjdk.java.net
Wed Oct 28 18:18:54 UTC 2020


On Wed, 28 Oct 2020 18:13:55 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> Hi,
>> 
>> When a single string without formatting arguments is provided to `err_msg`, it's redundancy, as the same message could be used without any err_msg. This is a follow-up to the discussion https://github.com/openjdk/jdk/pull/812#discussion_r511784050
>> 
>> Please review a change that makes `err_msg` with a single string to fail compilation. 
>> 
>> Detected uses of err_msg with a single string were eliminated as well.
>
> src/hotspot/share/gc/shenandoah/mode/shenandoahMode.hpp line 35:
> 
>> 33:   do {                                                                      \
>> 34:     if (!(name)) {                                                          \
>> 35:       const char *msg = "GC mode needs -XX:+" #name " to work correctly";   \
> 
> Please decide which way the `*` leans in this change. I prefer `const char* msg`, like in the change below.

In fact, maybe just inline this literal down in `vm_exit_during_initialization` invocation.

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

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


More information about the shenandoah-dev mailing list