Skip to content

Commit

Permalink
fix fast statement list overflow inconsistency
Browse files Browse the repository at this point in the history
  • Loading branch information
fwbrasil committed Feb 11, 2014
1 parent 18d55c5 commit 4bf148f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public void add(Statement element)
catch (ArrayIndexOutOfBoundsException oob)
{
// overflow-conscious code
size--;

This comment has been minimized.

Copy link
@ams2990

ams2990 Feb 12, 2014

Contributor

Mixed spaces and tabs in this line

int oldCapacity = elementData.length;
int newCapacity = oldCapacity << 2;
Statement[] newElementData = new Statement[newCapacity];
Expand Down
5 changes: 5 additions & 0 deletions src/test/java/com/zaxxer/hikari/TestFastStatementList.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.zaxxer.hikari;

import org.junit.Assert;
import org.junit.Test;

import com.zaxxer.hikari.performance.StubStatement;
Expand All @@ -15,5 +16,9 @@ public void testOverflow()
{
list.add(new StubStatement());
}
for (int i = 0; i < 100; i++)
{
Assert.assertNotNull(list.get(i));

This comment has been minimized.

Copy link
@ams2990

ams2990 Feb 12, 2014

Contributor

Here too

}
}
}

1 comment on commit 4bf148f

@brettwooldridge
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merged.

Please sign in to comment.