diff options
author | Eike Stepper | 2010-03-02 11:11:16 +0000 |
---|---|---|
committer | Eike Stepper | 2010-03-02 11:11:16 +0000 |
commit | af7a0bb91dd8a1139db33be3e45f3ca6a2e6adf3 (patch) | |
tree | 9976edc7fc084d88ebdf2c2793873ac3490026f7 | |
parent | 87ea0e205027d20ba555818f5cdae4afd4df56e2 (diff) | |
download | cdo-af7a0bb91dd8a1139db33be3e45f3ca6a2e6adf3.tar.gz cdo-af7a0bb91dd8a1139db33be3e45f3ca6a2e6adf3.tar.xz cdo-af7a0bb91dd8a1139db33be3e45f3ca6a2e6adf3.zip |
[304226] [UI] Include support for branching in CDOSessionView
https://bugs.eclipse.org/bugs/show_bug.cgi?id=304226
-rw-r--r-- | plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/branch/CDOBranchImpl.java | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/branch/CDOBranchImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/branch/CDOBranchImpl.java index 81647277d2..1bdb2c015f 100644 --- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/branch/CDOBranchImpl.java +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/branch/CDOBranchImpl.java @@ -192,19 +192,24 @@ public class CDOBranchImpl extends Container<CDOBranch> implements InternalCDOBr baseOrBranchManager = CDOBranchUtil.createBranchPoint(baseBranch, baseTimeStamp); } - public synchronized void addChild(InternalCDOBranch branch) + public void addChild(InternalCDOBranch branch) { - if (branches == null) - { - branches = new InternalCDOBranch[] { branch }; - } - else + synchronized (this) { - InternalCDOBranch[] newBranches = new InternalCDOBranch[branches.length + 1]; - System.arraycopy(branches, 0, newBranches, 0, branches.length); - newBranches[branches.length] = branch; - branches = newBranches; + if (branches == null) + { + branches = new InternalCDOBranch[] { branch }; + } + else + { + InternalCDOBranch[] newBranches = new InternalCDOBranch[branches.length + 1]; + System.arraycopy(branches, 0, newBranches, 0, branches.length); + newBranches[branches.length] = branch; + branches = newBranches; + } } + + fireElementAddedEvent(branch); } public int compareTo(CDOBranch o) |