fix(tool): qualify Entry type in GeneratedFileCache LRU to fix compile error (closes #250)

This commit is contained in:
matevip 2026-06-03 23:21:31 +08:00
parent 478f169782
commit 6445f082a6

View File

@ -82,8 +82,12 @@ public class GeneratedFileCache {
*/
private final Map<String, Entry> entries = Collections.synchronizedMap(
new LinkedHashMap<>(16, 0.75f, true) {
// Fully qualify the value type: inside a LinkedHashMap subclass the
// inherited java.util.HashMap.Entry node type shadows the outer
// GeneratedFileCache.Entry record, so a bare `Entry` here resolves to
// the raw Map.Entry and the override silently fails to match.
@Override
protected boolean removeEldestEntry(Map.Entry<String, Entry> eldest) {
protected boolean removeEldestEntry(Map.Entry<String, GeneratedFileCache.Entry> eldest) {
return size() > MAX_MEMORY_ENTRIES;
}
});