RFR: 8348611: Eliminate DeferredLintHandler and emit warnings after attribution [v10]

Vicente Romero vromero at openjdk.org
Wed Aug 13 19:02:16 UTC 2025


On Wed, 13 Aug 2025 18:10:14 GMT, Archie Cobbs <acobbs at openjdk.org> wrote:

>> src/jdk.compiler/share/classes/com/sun/tools/javac/code/LintMapper.java line 75:
>> 
>>> 73: 
>>> 74:     // Per-source file information. Note: during the parsing of a file, an entry exists but the FileInfo value is null
>>> 75:     private final Map<JavaFileObject, FileInfo> fileInfoMap = new HashMap<>();
>> 
>> would it makes sense to make this map a WeakHashMap? I'm thinking about cases where we are not using a ReusableContext and thus this map wont be cleared.
>
>> would it makes sense to make this map a WeakHashMap? I'm thinking about cases where we are not using a ReusableContext and thus this map wont be cleared.
> 
> Frankly I'm a little fuzzy on that. If there were an issue with `LintMapper.fileInfoMap`, then wouldn't the same issue exist with `AbstractLog.sourceMap`? Note `LintMapper.clear()` and `Log.clear()` are called at the same time, so it seems in any given scenario, they are going to either both be cleared or both not be cleared.

yes you are right we have other DSs with the same `issue` if any. I guess discuss and address it as a separate issue

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24584#discussion_r2274354834


More information about the compiler-dev mailing list