Permalink
Browse files

Not as clever as I thought

  • Loading branch information...
1 parent e973e72 commit 539b0124002a504edb33c4c4118619a18ca29f0f @dmlloyd dmlloyd committed Jan 5, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/main/java/org/jboss/dmr/ListModelValue.java
@@ -25,8 +25,6 @@
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@@ -147,7 +145,9 @@ ModelNode getChild(final int index) {
final List<ModelNode> list = this.list;
final int size = list.size();
if (size <= index) {
- list.addAll(Collections.nCopies(index - size + 1, new ModelNode()));
+ for (int i = 0; i < index - size + 1; i ++) {
+ list.add(new ModelNode());
+ }
}
return list.get(index);
}

0 comments on commit 539b012

Please sign in to comment.