Merge lp:~sgaflv/workcraft/trunk-bug1379453 into lp:workcraft

Proposed by Stan
Status: Merged
Merged at revision: 574
Proposed branch: lp:~sgaflv/workcraft/trunk-bug1379453
Merge into: lp:workcraft
Diff against target: 18 lines (+6/-2)
1 file modified
WorkcraftCore/src/org/workcraft/dom/DefaultMathNodeRemover.java (+6/-2)
To merge this branch: bzr merge lp:~sgaflv/workcraft/trunk-bug1379453
Reviewer Review Type Date Requested Status
Danil Sokolov Disapprove
Review via email: mp+239426@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Danil Sokolov (danilovesky) wrote :

It would be safer to use HashSet for referencing nodes instead of a counter.

review: Disapprove

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'WorkcraftCore/src/org/workcraft/dom/DefaultMathNodeRemover.java'
2--- WorkcraftCore/src/org/workcraft/dom/DefaultMathNodeRemover.java 2009-09-22 21:01:45 +0000
3+++ WorkcraftCore/src/org/workcraft/dom/DefaultMathNodeRemover.java 2014-10-23 17:41:19 +0000
4@@ -35,8 +35,12 @@
5 private void incRef (MathNode node) {
6 if (refCount.get(node) == null)
7 refCount.put(node, 1);
8- else
9- refCount.put(node, refCount.get(node)+1);
10+ else {
11+// throw new RuntimeException("The element "+node.toString()+" was added before already!");
12+ // TODO: why would we increase the counter more than once? which objects use that?
13+ // TODO: with the counter, the reparenting in GroupImplementation still needs to be fixed not to cause double increase of the counter
14+// refCount.put(node, refCount.get(node)+1);
15+ }
16 }
17
18 private void decRef (MathNode node) {

Subscribers

People subscribed via source and target branches