Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 131305 - [organize import] incorrectly removes import for Map.Entry
Summary: [organize import] incorrectly removes import for Map.Entry
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2 RC2   Edit
Assignee: Martin Aeschlimann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 131306 131809 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-03-10 06:29 EST by Jilles van Gurp CLA
Modified: 2006-04-24 17:52 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jilles van Gurp CLA 2006-03-10 06:29:36 EST
I have a class that compiles with this  import:
import java.util.Map.Entry;

If I do an organize import on the class or the project, this import is removed and the project no longer compiles. There is no warning about unused classes though (correct).

I am using eclipse 3.2 M5.
Comment 1 Jerome Lanneluc CLA 2006-03-10 06:32:11 EST
Moving to JDT UI
Comment 2 Jerome Lanneluc CLA 2006-03-10 06:36:17 EST
*** Bug 131306 has been marked as a duplicate of this bug. ***
Comment 3 Jilles van Gurp CLA 2006-03-10 06:43:35 EST
A test case that reproduces the problem:

import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

public class Test extends HashMap<String, String> {
	public Test(Map<String,Object> m) {
		Set<Entry<String, Object>> entries = m.entrySet();
		for (Entry<String, Object> entry : entries) {
			if(entry.getValue() != null) {
				put(entry.getKey(), entry.getValue().toString());
			}
		}
	}
}
Comment 4 Markus Keller CLA 2006-03-24 07:16:29 EST
*** Bug 131809 has been marked as a duplicate of this bug. ***
Comment 5 Martin Aeschlimann CLA 2006-04-24 17:52:32 EDT
fixed > 20060424