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

Bug 312174

Summary: "Organize import" inserts useless import (junit.framework.TestCase)
Product: [Eclipse Project] JDT Reporter: Daniel Le Berre <leberre>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert
Version: 3.6   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Daniel Le Berre CLA 2010-05-09 02:18:25 EDT
I have a few examples of JUnit tests cases for SAT4J that inherit a custom TestCase class. See e.g. that one:

http://www.sat4j.org/maven21/org.sat4j.core/xref-test/index.html

I use the automatic organize import on save action.

If I remove the 

import junit.framework.TestCase;

statement in the code, organize import will add it on save.

When I compile that code using eclipse compiler, I got a warning that the import is not used.

I guess that such issue has been around for a while (at least one year).
I just noticed it today.

I am running

Version: 3.6.0
Build id: I20100426-0852

on Linux GTK2/64.
Comment 1 Dani Megert CLA 2010-05-10 08:27:40 EDT
It looks like TestCase is used in Javadoc and hence if Javadoc processing is enabled (Java > Compiler > Javadoc) it will add the import. Of course if you then compile it without that option enabled then it will complain about the import.