Source:
<code>private void loadTemplateRepositories() { TaskRepository local = getLocalTaskRepository(); repositoryManager.applyMigrators(local); for (AbstractRepositoryConnector connector : repositoryManager.getRepositoryConnectors()) { for (RepositoryTemplate template : repositoryTemplateManager.getTemplates(connector.getConnectorKind())) { if (template.addAutomatically && !TaskRepositoryUtil.isAddAutomaticallyDisabled(template.repositoryUrl)) { try { String repositoryUrl = TaskRepositoryManager.stripSlashes(template.repositoryUrl); TaskRepository taskRepository = repositoryManager.getRepository(connector.getConnectorKind(), repositoryUrl); if (taskRepository == null) { taskRepository = new TaskRepository(connector.getConnectorKind(), repositoryUrl); taskRepository.setVersion(template.version); taskRepository.setRepositoryLabel(template.label); taskRepository.setCharacterEncoding(template.characterEncoding); if (template.anonymous) { taskRepository.setProperty("org.eclipse.mylyn.tasklist.repositories.enabled", String.valueOf(false)); } taskRepository.setCreatedFromTemplate(true); repositoryManager.addRepository(taskRepository); repositoryManager.applyMigrators(taskRepository); } Map<String, String> templateAttributes = template.getAttributes(); <START> for (String key : templateAttributes.keySet()) { <END> taskRepository.setProperty(IRepositoryConstants.TEMPLATE_VALUE + key, templateAttributes.get(key)); } } catch (Throwable t) { StatusHandler.log(new Status(IStatus.WARNING, TasksUiPlugin.ID_PLUGIN, NLS.bind( "Could not load repository template for repository {0}", template.repositoryUrl), t)); } } } } }</code><technical_language>Consider iterating entrySet() instead</technical_language>

Target:
private void loadTemplateRepositories() { TaskRepository local = getLocalTaskRepository(); repositoryManager.applyMigrators(local); for (AbstractRepositoryConnector connector : repositoryManager.getRepositoryConnectors()) { for (RepositoryTemplate template : repositoryTemplateManager.getTemplates(connector.getConnectorKind())) { if (template.addAutomatically && !TaskRepositoryUtil.isAddAutomaticallyDisabled(template.repositoryUrl)) { try { String repositoryUrl = TaskRepositoryManager.stripSlashes(template.repositoryUrl); TaskRepository taskRepository = repositoryManager.getRepository(connector.getConnectorKind(), repositoryUrl); if (taskRepository == null) { taskRepository = new TaskRepository(connector.getConnectorKind(), repositoryUrl); taskRepository.setVersion(template.version); taskRepository.setRepositoryLabel(template.label); taskRepository.setCharacterEncoding(template.characterEncoding); if (template.anonymous) { taskRepository.setProperty("org.eclipse.mylyn.tasklist.repositories.enabled", String.valueOf(false)); } taskRepository.setCreatedFromTemplate(true); repositoryManager.addRepository(taskRepository); repositoryManager.applyMigrators(taskRepository); } Map<String, String> templateAttributes = template.getAttributes(); for (Map.Entry<String, String> entry : templateAttributes.entrySet()) { taskRepository.setProperty(IRepositoryConstants.TEMPLATE_VALUE_PREFIX + entry.getKey(), entry.getValue()); } } catch (Throwable t) { StatusHandler.log(new Status(IStatus.WARNING, TasksUiPlugin.ID_PLUGIN, NLS.bind( "Could not load repository template for repository {0}", template.repositoryUrl), t)); } } } } }