Fix error in insertAfter
method
This commit is contained in:
parent
0aeb39d677
commit
882130f703
1 changed files with 1 additions and 1 deletions
|
@ -198,7 +198,7 @@ public class MyList extends AbstractList<Object> {
|
||||||
* The item to insert.
|
* The item to insert.
|
||||||
*/
|
*/
|
||||||
protected void insertAfter(IListNode node, Object item) {
|
protected void insertAfter(IListNode node, Object item) {
|
||||||
IListNode newNode = new ListNode(item, node, node.getNextNode());
|
IListNode newNode = new ListNode(item, node.getNextNode(), node);
|
||||||
node.setNextNode(newNode);
|
node.setNextNode(newNode);
|
||||||
newNode.getNextNode().setPreviousNode(newNode);
|
newNode.getNextNode().setPreviousNode(newNode);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue