Bug 76530 [options] Warn about unused local variables and private members
I think we should warn about unused local variables and unused private members by default. These things are errors akin to unused imports, which we already warn about.
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/ConvertIterableLoopQuickFixTest.java
import org.eclipse.jdt.internal.ui.text.correction.ConvertIterableLoopProposal;
import org.eclipse.jdt.testplugin.JavaProjectHelper;
import org.eclipse.jdt.testplugin.TestOptions;
import org.eclipse.jdt.ui.tests.core.ProjectTestSetup;
public final class ConvertIterableLoopQuickFixTest extends QuickFixTest {
	private static final Class THIS= ConvertIterableLoopQuickFixTest.class;
	public static Test allTests() {
		return new ProjectTestSetup(new TestSuite(THIS));
	}
	public static Test setUpTest(Test test) {
		return new ProjectTestSetup(test);
	}
	public static Test suite() {
		return allTests();
	}
	private ConvertIterableLoopProposal fConvertLoopProposal;
	private IJavaProject fProject;
	private IPackageFragmentRoot fSourceFolder;
	public ConvertIterableLoopQuickFixTest(String name) {
		super(name);
	}
	private List fetchConvertingProposal(StringBuffer buf, ICompilationUnit cu) throws Exception {
		int offset= buf.toString().indexOf("for");
		AssistContext context= getCorrectionContext(cu, offset, 0);
		List proposals= collectAssists(context, false);
		for (Iterator it= proposals.iterator(); it.hasNext();) {
			CUCorrectionProposal proposal= (CUCorrectionProposal) it.next();
			if (proposal instanceof ConvertIterableLoopProposal) {
				fConvertLoopProposal= (ConvertIterableLoopProposal) proposal;
			}