Skip to content

Commit

Permalink
[GSCOLLECT-1410] Fix array index bug in <Primitive>ArrayList.sortThis…
Browse files Browse the repository at this point in the history
…(). Fixes #16.

git-svn-id: svn+ssh://gscollections.svn.services.gs.com/svnroot/gscollections-svn/trunk@646 d5c9223b-1aff-41ac-aadd-f810b4a99ac4
  • Loading branch information
Kristen O'Leary committed Aug 22, 2014
1 parent 3d6d064 commit c93576e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,7 @@ public final class <name>ArrayList

public <name>ArrayList sortThis()
{
Arrays.sort(this.items, 0, this.items.length);
Arrays.sort(this.items, 0, this.size);
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,11 @@ public abstract class Abstract<name>ListTestCase extends AbstractMutable<name>Co
Mutable<name>List sameList = this.newWith(<["3", "1", "9", "7"]:(literal.(type))(); separator=", ">);
Assert.assertSame(sameList, sameList.sortThis());
Assert.assertEquals(<name>ArrayList.newListWith(<["1", "3", "7", "8", "9"]:(literal.(type))(); separator=", ">), this.newWith(<["8", "1", "7", "3", "9"]:(literal.(type))(); separator=", ">).sortThis());
Mutable<name>List list = this.newWith();
list.add(<(literal.(type))("2")>);
list.add(<(literal.(type))("1")>);
list.sortThis();
Assert.assertEquals(<(literal.(type))("1")>, list.get(0)<(wideDelta.(type))>);
}

@Test
Expand Down

0 comments on commit c93576e

Please sign in to comment.