Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2003-11-27 03:19:12 +0000
committerJean Michel-Lemieux2003-11-27 03:19:12 +0000
commit89f481167fb13e0166ce03ebb28332b9ada32ac5 (patch)
treea3fd49a3efdac052c4c72c2b64630844feb220be /bundles
parent0a1aa8d91b9dcd33e081e2b78c00e60fa189dc89 (diff)
downloadeclipse.platform.team-branch_20031125_participantStateBugs.tar.gz
eclipse.platform.team-branch_20031125_participantStateBugs.tar.xz
eclipse.platform.team-branch_20031125_participantStateBugs.zip
fixing participant init/restore bugsbranch_20031125_participantStateBugs
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeSynchronizeParticipant.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java26
2 files changed, 22 insertions, 8 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeSynchronizeParticipant.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeSynchronizeParticipant.java
index 2eec69f0a..cb1c469c5 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeSynchronizeParticipant.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeSynchronizeParticipant.java
@@ -142,7 +142,7 @@ public class MergeSynchronizeParticipant extends TeamSubscriberParticipant {
IMemento[] rootNodes = memento.getChildren(CTX_ROOT);
if(rootNodes == null || rootNodes.length == 0) {
- throw new CVSException(Policy.bind("MergeSynchronizeParticipant.10",id.toString())); //$NON-NLS-1$
+ throw new CVSException(Policy.bind("MergeSynchronizeParticipant.10", id.toString())); //$NON-NLS-1$
}
List resources = new ArrayList();
@@ -154,7 +154,7 @@ public class MergeSynchronizeParticipant extends TeamSubscriberParticipant {
resources.add(resource);
} else {
// log that a resource previously in the merge set is no longer in the workspace
- CVSProviderPlugin.log(CVSStatus.INFO, Policy.bind("MergeSynchronizeParticipant.11", resource.getFullPath().toString()), null); //$NON-NLS-1$
+ CVSProviderPlugin.log(CVSStatus.INFO, Policy.bind("MergeSynchronizeParticipant.11", path.toString()), null); //$NON-NLS-1$
}
}
if(resources.isEmpty()) {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java
index 92190c933..bcab73a60 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java
@@ -128,13 +128,19 @@ public class SynchronizeManager implements ISynchronizeManager {
participant.init(savedState);
} catch (PartInitException e2) {
TeamUIPlugin.log(IStatus.ERROR, Policy.bind("SynchronizeManager.11"), e2); //$NON-NLS-1$
+ participant = null;
} catch (CoreException e) {
TeamUIPlugin.log(IStatus.ERROR, Policy.bind("SynchronizeManager.11"), e); //$NON-NLS-1$
+ participant = null;
}
}
return participant;
}
+ public boolean isParticipantInitialized() {
+ return participant != null;
+ }
+
public boolean equals(Object other) {
if(other == this) return true;
if (other instanceof ISynchronizeParticipant) {
@@ -207,6 +213,7 @@ public class SynchronizeManager implements ISynchronizeManager {
participant.init(null);
} catch (PartInitException e) {
TeamUIPlugin.log(IStatus.ERROR, Policy.bind("SynchronizeManager.13"), e); //$NON-NLS-1$
+ continue;
}
added.add(participant);
}
@@ -266,7 +273,10 @@ public class SynchronizeManager implements ISynchronizeManager {
List participants = new ArrayList(instances.size());
for (Iterator it = instances.iterator(); it.hasNext(); ) {
ParticipantInstance instance = (ParticipantInstance) it.next();
- participants.add(instance.getParticipant());
+ ISynchronizeParticipant participant = instance.getParticipant();
+ if(participant != null) {
+ participants.add(participant);
+ }
}
return (ISynchronizeParticipant[]) participants.toArray(new ISynchronizeParticipant[participants.size()]);
}
@@ -380,7 +390,7 @@ public class SynchronizeManager implements ISynchronizeManager {
/**
* Saves a file containing the list of participant ids that are registered
- * with this manager. Each participant is also given the chance to save
+ * with this manager. Each initialized participant is also given the chance to save
* it's state.
*/
private void saveState() {
@@ -391,10 +401,14 @@ public class SynchronizeManager implements ISynchronizeManager {
List participants = (List) synchronizeParticipants.get(id);
for (Iterator it2 = participants.iterator(); it2.hasNext(); ) {
ParticipantInstance instance = (ParticipantInstance) it2.next();
- ISynchronizeParticipant participant = instance.getParticipant();
- IMemento participantNode = xmlMemento.createChild(CTX_PARTICIPANT);
- participantNode.putString(CTX_ID, participant.getId());
- participant.saveState(participantNode.createChild(CTX_PARTICIPANT_DATA));
+ // An un-instantiated participant can't have any state to save, also
+ // we don't want to trigger class creation when saving state.
+ if(instance.isParticipantInitialized()) {
+ ISynchronizeParticipant participant = instance.getParticipant();
+ IMemento participantNode = xmlMemento.createChild(CTX_PARTICIPANT);
+ participantNode.putString(CTX_ID, participant.getId());
+ participant.saveState(participantNode.createChild(CTX_PARTICIPANT_DATA));
+ }
}
}
try {

Back to the top