Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 312174 - "Organize import" inserts useless import (junit.framework.TestCase)
Summary: "Organize import" inserts useless import (junit.framework.TestCase)
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-09 02:18 EDT by Daniel Le Berre CLA
Modified: 2010-05-10 08:27 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.