RFR: 8347958: Minor compiler cleanups relating to MandatoryWarningHandler [v2]

Maurizio Cimadamore mcimadamore at openjdk.org
Wed Feb 5 11:05:16 UTC 2025


On Wed, 5 Feb 2025 11:01:12 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> Archie Cobbs has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains two commits:
>> 
>>  - Merge branch 'master' into JDK-8347958 to fix conflict.
>>  - Some cleanups relating to MandatoryWarningHandler.
>
> src/jdk.compiler/share/classes/com/sun/tools/javac/util/MandatoryWarningHandler.java line 155:
> 
>> 153: 
>> 154:         // Infer the log prefix from the lint category if not given explicitly
>> 155:         if (prefix == null)
> 
> Honestly, I'm not sure if I would call this an improvement. The code used to be strict -- only one kind of warning allowed per handler. Now the handler starts off empty, and the first `report` determines the kind. But the same kind is then used for _all_ deferred logging... my feeling is that this would be better left alone (in the sense that I'm not sure the outcome of this PR is _objectively_ better than the code it replaces?)

(of course the part that removes the sunapi handler is ok and orthogonal)

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23167#discussion_r1942666297


More information about the compiler-dev mailing list