Source:
<code>public void removeExtension(Extension extension) { extensionList.remove(extension); extensionsMap.remove(extension.getClass()); ExtensionHook hook = extensionHooks.remove(extension); if (hook == null) { logger.error("ExtensionHook not found for: " + extension.getClass().getCanonicalName()); return; } unloadOptions(hook); unhookProxies(hook); removePersistentConnectionListener(hook); removeProxyListener(hook); removeOverrideMessageProxyListener(hook); removeConnectRequestProxyListener(hook); removeSiteMapListener(hook); for (ContextDataFactory contextDataFactory : hook.getContextDataFactories()) { try { model.removeContextDataFactory(contextDataFactory); } catch (Exception e) { logger.error( "Error while removing a ContextDataFactory from " + extension.getClass().getCanonicalName(), e); } } for (ApiImplementor apiImplementor : hook.getApiImplementors()) { try { API.getInstance().removeApiImplementor(apiImplementor); } catch (Exception e) { logger.error( "Error while removing an ApiImplementor from " + extension.getClass().getCanonicalName(), e); } } for (HttpSenderListener httpSenderListener : hook.getHttpSenderListeners()) { try { HttpSender.removeListener(httpSenderListener); } catch (Exception e) { logger.error( "Error while removing an HttpSenderListener from " + extension.getClass().getCanonicalName(), e); } } for (Variant variant : hook.getVariants()) { try { model.getSession().getVariantFactory().removeVariant(variant); <START> ; <END> } catch (Exception e) { logger.error( "Error while removing a Variant from " + extension.getClass().getCanonicalName(), e); } } removeViewInEDT(extension, hook); }</code><technical_language>removed</technical_language>

Target:
public void removeExtension(Extension extension) { extensionList.remove(extension); extensionsMap.remove(extension.getClass()); ExtensionHook hook = extensionHooks.remove(extension); if (hook == null) { logger.error("ExtensionHook not found for: " + extension.getClass().getCanonicalName()); return; } unloadOptions(hook); unhookProxies(hook); removePersistentConnectionListener(hook); removeProxyListener(hook); removeOverrideMessageProxyListener(hook); removeConnectRequestProxyListener(hook); removeSiteMapListener(hook); for (ContextDataFactory contextDataFactory : hook.getContextDataFactories()) { try { model.removeContextDataFactory(contextDataFactory); } catch (Exception e) { logger.error( "Error while removing a ContextDataFactory from " + extension.getClass().getCanonicalName(), e); } } for (ApiImplementor apiImplementor : hook.getApiImplementors()) { try { API.getInstance().removeApiImplementor(apiImplementor); } catch (Exception e) { logger.error( "Error while removing an ApiImplementor from " + extension.getClass().getCanonicalName(), e); } } for (HttpSenderListener httpSenderListener : hook.getHttpSenderListeners()) { try { HttpSender.removeListener(httpSenderListener); } catch (Exception e) { logger.error( "Error while removing an HttpSenderListener from " + extension.getClass().getCanonicalName(), e); } } for (Class<? extends Variant> variant : hook.getVariants()) { try { model.getVariantFactory().removeVariant(variant); } catch (Exception e) { logger.error( "Error while removing a Variant from " + extension.getClass().getCanonicalName(), e); } } removeViewInEDT(extension, hook); }