From 3b83c44f6725783d1e9d00b9a79c58b514a23dfe Mon Sep 17 00:00:00 2001 From: spingel Date: Fri, 2 Oct 2009 21:49:30 +0000 Subject: RESOLVED - bug 289663: remove circular dependency between BugzillaCorePlugin and BugzillaTaskDataHandler https://bugs.eclipse.org/bugs/show_bug.cgi?id=289663 --- .../internal/bugzilla/core/BugzillaClient.java | 23 ++++++++++------------ 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'org.eclipse.mylyn.bugzilla.core') diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java index 1074776d2..9b39f87b9 100644 --- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java +++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java @@ -172,36 +172,33 @@ public class BugzillaClient { private final AbstractWebLocation location; - private BugzillaRepositoryConnector connector; + private final BugzillaRepositoryConnector connector; public BugzillaClient(AbstractWebLocation location, String characterEncoding, Map configParameters, - BugzillaLanguageSettings languageSettings) throws MalformedURLException { + BugzillaLanguageSettings languageSettings, BugzillaRepositoryConnector connector) + throws MalformedURLException { this.repositoryUrl = new URL(location.getUrl()); this.location = location; this.characterEncoding = characterEncoding; this.configParameters = configParameters; this.bugzillaLanguageSettings = languageSettings; + this.connector = connector; this.proxy = location.getProxyForHost(location.getUrl(), IProxyData.HTTP_PROXY_TYPE); WebUtil.configureHttpClient(httpClient, USER_AGENT); - } public BugzillaClient(AbstractWebLocation location, TaskRepository taskRepository, BugzillaRepositoryConnector connector) throws MalformedURLException { + this(location, taskRepository.getCharacterEncoding(), taskRepository.getProperties(), + getLanguageSettings(taskRepository), connector); + } + + private static BugzillaLanguageSettings getLanguageSettings(TaskRepository taskRepository) { String language = taskRepository.getProperty(IBugzillaConstants.BUGZILLA_LANGUAGE_SETTING); if (language == null || language.equals("")) { //$NON-NLS-1$ language = IBugzillaConstants.DEFAULT_LANG; } - - this.connector = connector; - this.repositoryUrl = new URL(location.getUrl()); - this.location = location; - this.characterEncoding = taskRepository.getCharacterEncoding(); - this.configParameters = taskRepository.getProperties(); - this.bugzillaLanguageSettings = connector.getLanguageSetting(language); - this.proxy = location.getProxyForHost(location.getUrl(), IProxyData.HTTP_PROXY_TYPE); - WebUtil.configureHttpClient(httpClient, USER_AGENT); - + return BugzillaRepositoryConnector.getLanguageSetting(language); } public void validate(IProgressMonitor monitor) throws IOException, CoreException { -- cgit v1.2.3