Bug 75711 AstProvider should not create AST if requested by SelectionListenerWithASTManager
3.1 M2 If SelectionListenerWithASTManager waits for an AST and the editor closes we should not create an AST for that one but return null instead.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/ClipboardOperationAction.java
target.beginCompoundChange();		
			}
			try {
				fOperationTarget.doOperation(fOperationCode);
				addImports((ICompilationUnit) inputElement, importsData);
			} catch (CoreException e) {
				JavaPlugin.log(e);
			} finally {
				if (target != null) {
					target.endCompoundChange();		
				}
			}
		} else {
			fOperationTarget.doOperation(fOperationCode);
		}
	}
	
	
	private void addImports(ICompilationUnit unit, ClipboardData data) throws CoreException {
		CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings();
		ImportsStructure importsStructure= new ImportsStructure(unit, settings.importOrder, settings.importThreshold, true);
		importsStructure.setFindAmbiguousImports(false);
		String[] imports= data.getImports();
		for (int i= 0; i < imports.length; i++) {
			importsStructure.addImport(imports[i]);
		}
		importsStructure.create(false, null);
	}
}