@@ -88,7 +88,7 @@ private int getLastChange(final HistoryNode node) {
88
88
} else if (node instanceof EventChild ) {
89
89
lastChangeIndex = ((Event ) node .getParent ()).getChangeEndIndex ();
90
90
} else if (node instanceof IndexedHistoryNode ) {
91
- lastChangeIndex = ((IndexedHistoryNode ) node ).getChangeStartIndex ();
91
+ lastChangeIndex = ((IndexedHistoryNode ) node ).getChangeEndIndex ();
92
92
} else {
93
93
lastChangeIndex = 0 ;
94
94
}
@@ -114,7 +114,7 @@ public Change getDelta(final HistoryNode start, final HistoryNode end) {
114
114
/** Changes the game state to reflect the historical state at {@code node}. */
115
115
public synchronized void gotoNode (final HistoryNode node ) {
116
116
assertCorrectThread ();
117
- getGameData () .acquireWriteLock ();
117
+ gameData .acquireWriteLock ();
118
118
try {
119
119
if (currentNode == null ) {
120
120
currentNode = getLastNode ();
@@ -125,7 +125,7 @@ public synchronized void gotoNode(final HistoryNode node) {
125
125
gameData .performChange (dataChange );
126
126
}
127
127
} finally {
128
- getGameData () .releaseWriteLock ();
128
+ gameData .releaseWriteLock ();
129
129
}
130
130
}
131
131
@@ -136,7 +136,7 @@ public synchronized void gotoNode(final HistoryNode node) {
136
136
public synchronized void removeAllHistoryAfterNode (final HistoryNode removeAfterNode ) {
137
137
gotoNode (removeAfterNode );
138
138
assertCorrectThread ();
139
- getGameData () .acquireWriteLock ();
139
+ gameData .acquireWriteLock ();
140
140
try {
141
141
final int lastChange = getLastChange (removeAfterNode ) + 1 ;
142
142
while (changes .size () > lastChange ) {
@@ -163,7 +163,7 @@ public synchronized void removeAllHistoryAfterNode(final HistoryNode removeAfter
163
163
this .removeNodeFromParent (nodesToRemove .remove (0 ));
164
164
}
165
165
} finally {
166
- getGameData () .releaseWriteLock ();
166
+ gameData .releaseWriteLock ();
167
167
}
168
168
}
169
169
0 commit comments