Bug 81135 Organize Imports throws away annotation imports [5.0]
M4 test pass (I20041214-2000-gtk) 1. have this code: package com.example.m4testing; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; public class Test { @Documented @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.ANNOTATION_TYPE) static @interface ThrowAwayMethod { } } 2. press Ctrl+shift+O -> imported anntations disappear Note that Ctrl+Shift+M on a single annotation works as expected.
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/ImportOrganizeTest.java
buf.append("\n");
		buf.append("public class C {\n");
		buf.append("    Vector v;\n");
		buf.append("    Set v2;\n");
		buf.append("    Map v3;\n");
		buf.append("    List v4;\n");
		buf.append("    String v6;\n");
		buf.append("}\n");
		assertEqualString(cu.getSource(), buf.toString());
	}	
	
	
	public void testImportToStarWithExplicit5() throws Exception {
		
		
		
		IJavaProject project2 = JavaProjectHelper.createJavaProject("TestProject2", "bin");
		try {
			assertTrue("rt not found", JavaProjectHelper.addRTJar(project2) != null);
			IPackageFragmentRoot sourceFolder2= JavaProjectHelper.addSourceContainer(project2, "src");
		
			IPackageFragment pack22= sourceFolder2.createPackageFragment("packx", false, null);
			StringBuffer buf= new StringBuffer();
			buf.append("package pack;\n");
			buf.append("public class Vector {\n");
			buf.append("}\n");
			pack22.createCompilationUnit("List.java", buf.toString(), false, null);
			
			buf= new StringBuffer();
			buf.append("package pack;\n");