RFR: 8355065: ConcurrentModificationException in RichDiagnosticFormatter [v2]

Liam Miller-Cushon cushon at openjdk.org
Mon Apr 21 18:20:22 UTC 2025


On Mon, 21 Apr 2025 17:50:45 GMT, Chen Liang <liach at openjdk.org> wrote:

>> Liam Miller-Cushon has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Detect recursion in RichDiagnosticFormatter#format
>>   
>>   The class is not designed to be re-entered, and will produce incorrect
>>   results if that happens.
>
> src/jdk.compiler/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java line 90:
> 
>> 88: 
>> 89:         WhereClauses() {
>> 90:             Map<WhereClauseKind, Map<Type, JCDiagnostic>> whereClauses = new LinkedHashMap<>();
> 
> Looks like a great candidate for `EnumMap`.

Thanks, fixed. (The outer map was an EnumMap before, this was an oversight.)

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24769#discussion_r2052815566


More information about the compiler-dev mailing list