diff options
author | fbecker | 2011-01-30 19:17:37 +0000 |
---|---|---|
committer | fbecker | 2011-01-30 19:17:37 +0000 |
commit | 89b6e7c3c2320fd77d41944915a49092737d2c85 (patch) | |
tree | b5e9082ad4b671187b876a179d41ae9c6caf2892 /org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist | |
parent | 866ae0d3cba2b4427ca85d6a072759419d222b3d (diff) | |
download | org.eclipse.mylyn.tasks-89b6e7c3c2320fd77d41944915a49092737d2c85.tar.gz org.eclipse.mylyn.tasks-89b6e7c3c2320fd77d41944915a49092737d2c85.tar.xz org.eclipse.mylyn.tasks-89b6e7c3c2320fd77d41944915a49092737d2c85.zip |
ASSIGNED - bug 333779: better way to handle configuration changes
https://bugs.eclipse.org/bugs/show_bug.cgi?id=333779
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist')
-rw-r--r-- | org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java index 36bcf105f..e8a7fe8f3 100644 --- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java +++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java @@ -461,21 +461,19 @@ public class BugzillaRepositorySettingsPage extends AbstractRepositorySettingsPa AuthenticationCredentials httpAuth = repository.getCredentials(AuthenticationType.HTTP); AuthenticationCredentials proxyAuth = repository.getCredentials(AuthenticationType.PROXY); boolean changed = repository.getCharacterEncoding() != getCharacterEncoding(); - String descriptorFileName = repository.getProperty(IBugzillaConstants.BUGZILLA_DESCRIPTOR_FILE); - if (descriptorFileName == null) { - descriptorFileName = ""; //$NON-NLS-1$ - } changed = changed || repository.getSavePassword(AuthenticationType.REPOSITORY) != getSavePassword(); changed = changed || repositoryAuth.getUserName().compareTo(getUserName()) != 0; changed = changed || repositoryAuth.getPassword().compareTo(getPassword()) != 0; changed = changed || Boolean.parseBoolean(repository.getProperty(IBugzillaConstants.BUGZILLA_USE_XMLRPC)) != useXMLRPCstatusTransitions.getSelection(); - changed = changed || descriptorFileName.compareTo(descriptorFile.getText()) != 0; + changed = changed + || !equals(repository.getProperty(IBugzillaConstants.BUGZILLA_DESCRIPTOR_FILE), + descriptorFile.getText()); if (httpAuth != null) { changed = changed || httpAuth.getUserName().compareTo(getHttpAuthUserId()) != 0 || httpAuth.getPassword().compareTo(getHttpAuthPassword()) != 0 - || repository.getProperty(TaskRepository.PROXY_HOSTNAME).compareTo(getProxyHostname()) != 0 - || repository.getProperty(TaskRepository.PROXY_PORT).compareTo(getProxyPort()) != 0; + || !equals(repository.getProperty(TaskRepository.PROXY_HOSTNAME), getProxyHostname()) + || !equals(repository.getProperty(TaskRepository.PROXY_PORT), getProxyPort()); } if (proxyAuth != null) { changed = changed || proxyAuth.getUserName().compareTo(getProxyUserName()) != 0 @@ -506,6 +504,19 @@ public class BugzillaRepositorySettingsPage extends AbstractRepositorySettingsPa } } + /** + * Treats null as equal to the empty string + */ + private boolean equals(String s1, String s2) { + if (s1 == null) { + s1 = ""; + } + if (s2 == null) { + s2 = ""; + } + return s1.equals(s2); + } + public void performUpdate(final TaskRepository repository, final AbstractRepositoryConnector connector, IProgressMonitor monitor) { try { |