Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2010-01-09 22:37:37 -0500
committerspingel2010-01-09 22:37:37 -0500
commit6960154b860612f2d9f1f435c3a59cc76361f4aa (patch)
tree5a433f8703726aa206be74ff193937142c1553ba /org.eclipse.mylyn.tasks.core
parent4d2ad5e510e79912df46403df0d141eb5f811f16 (diff)
downloadorg.eclipse.mylyn.tasks-6960154b860612f2d9f1f435c3a59cc76361f4aa.tar.gz
org.eclipse.mylyn.tasks-6960154b860612f2d9f1f435c3a59cc76361f4aa.tar.xz
org.eclipse.mylyn.tasks-6960154b860612f2d9f1f435c3a59cc76361f4aa.zip
REOPENED - bug 296894: [releng] fix failing tests for 3.4
https://bugs.eclipse.org/bugs/show_bug.cgi?id=296894
Diffstat (limited to 'org.eclipse.mylyn.tasks.core')
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskRepositoryManager.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskRepositoryManager.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskRepositoryManager.java
index eb240c271..66eb6943a 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskRepositoryManager.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskRepositoryManager.java
@@ -115,7 +115,9 @@ public class TaskRepositoryManager implements IRepositoryManager {
} else {
repositories = repositoryMap.get(repository.getConnectorKind());
}
- repositories.add(repository);
+ if (!repositories.add(repository)) {
+ throw new RuntimeException("Repository " + repository + " already present"); //$NON-NLS-1$//$NON-NLS-2$
+ }
repository.addChangeListener(PROPERTY_CHANGE_LISTENER);
}
@@ -142,13 +144,17 @@ public class TaskRepositoryManager implements IRepositoryManager {
synchronized (this) {
Set<TaskRepository> repositories = repositoryMap.get(repository.getConnectorKind());
if (repositories != null) {
+ if (!repositories.remove(repository)) {
+ throw new RuntimeException("Repository " + repository + " not present"); //$NON-NLS-1$//$NON-NLS-2$
+ }
//if (!CoreUtil.TEST_MODE) {
// FIXME 3.4 this is causing Trac tests to fail for an unknown reason
repository.flushAuthenticationCredentials();
//}
- repositories.remove(repository);
+ repository.removeChangeListener(PROPERTY_CHANGE_LISTENER);
+ } else {
+ throw new RuntimeException("Repository " + repository + " not present"); //$NON-NLS-1$//$NON-NLS-2$
}
- repository.removeChangeListener(PROPERTY_CHANGE_LISTENER);
}
for (final IRepositoryListener listener : listeners) {
SafeRunner.run(new ISafeRunnable() {
@@ -177,7 +183,7 @@ public class TaskRepositoryManager implements IRepositoryManager {
Assert.isNotNull(url);
StringBuilder sb = new StringBuilder(url.trim());
while (sb.length() > 0 && sb.charAt(sb.length() - 1) == '/') {
- sb.deleteCharAt(sb.length() - 1);
+ sb.setLength(sb.length() - 1);
}
return sb.toString();
}

Back to the top