Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 576952

Summary: wrong "The import is never used" error
Product: [Eclipse Project] JDT Reporter: Jörg Kubitz <jkubitz-eclipse>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED MOVED QA Contact:
Severity: normal    
Priority: P3 CC: srikanth.sankaran
Version: 4.22   
Target Milestone: ---   
Hardware: PC   
OS: Windows 10   
Whiteboard:

Description Jörg Kubitz CLA 2021-10-29 05:14:02 EDT
Today on an Oomphed eclipse installation i got an error when checking out https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/186086/9

Boils down to:

import java.util.LinkedHashMap;
import java.util.Map.Entry; // <------ "The import java.util.Map.Entry is never used"

class LruMap extends LinkedHashMap<Object, Object> {
	LruMap(int cacheSize) {
		super(cacheSize);
	}

	@Override
	protected boolean removeEldestEntry(Entry<Object, Object> eldest) { // <----- used!!
		return false;
	}
}

Version: 2021-12 M2 (4.22.0 M2)
Build id: 20211028-1435

I can however not reproduce it with 20210312-0638 nor I20211027-1800.
Comment 1 Srikanth Sankaran CLA 2023-06-01 01:07:36 EDT
See https://github.com/eclipse-jdt/eclipse.jdt.core/issues/392 - this issue can be tracked alongside that one.