Bug 97442 [code manipulation] Smart paste adds import for type parameter
In RC1. Create class A: import java.util.List; public class A { class Counter<T, L extends List<T>> { private L _attribute; } } Now, copy the inner class "Counter", and paste it into empty class B: public class B { // PASTE HERE } imports are added: import L; import java.util.List; "import L" is wrong.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/ClipboardOperationAction.java
public static class ClipboardData {
		private String fOriginHandle;
		private String[] fTypeImports;
		private String[] fStaticImports;
		public ClipboardData(IJavaElement origin, String[] typeImports, String[] staticImports) {
			Assert.isNotNull(origin);
			Assert.isNotNull(typeImports);
			Assert.isNotNull(staticImports);
			fTypeImports= typeImports;
			fStaticImports= staticImports;
			fOriginHandle= origin.getHandleIdentifier();
		}
		public ClipboardData(byte[] bytes) throws IOException {
			DataInputStream dataIn = new DataInputStream(new ByteArrayInputStream(bytes));
			try {
				fOriginHandle= dataIn.readUTF();
				fTypeImports= readArray(dataIn);
				fStaticImports= readArray(dataIn);
			} finally {
				dataIn.close();
			}
		}
		private static String[] readArray(DataInputStream dataIn) throws IOException {
			int count= dataIn.readInt();
			String[] array= new String[count];
			for (int i = 0; i < count; i++) {
				array[i]= dataIn.readUTF();
			}
			return array;
		}