Skip to content

Commit 02ec8b7

Browse files
Artem LabazinArtem Labazin
authored andcommitted
Add the pool and limit queue
1 parent 5162235 commit 02ec8b7

File tree

6 files changed

+621
-4
lines changed

6 files changed

+621
-4
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1212
- Add more tests.
1313
- Add `JavaDoc`.
1414

15+
## [1.15.0](https://github.com/appulse-projects/utils-java/releases/tag/1.15.0) - 2019-04-17
16+
17+
### Added
18+
19+
- `BytesPool` class for managing `Bytes` instances.
20+
21+
### Changed
22+
23+
- Added text messages to exceptions in bytes buffers wrappers.
24+
1525
## [1.14.1](https://github.com/appulse-projects/utils-java/releases/tag/1.14.1) - 2019-04-14
1626

1727
### Changed

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ limitations under the License.
2424

2525
<groupId>io.appulse</groupId>
2626
<artifactId>utils-java</artifactId>
27-
<version>1.14.1</version>
27+
<version>1.15.0</version>
2828
<packaging>jar</packaging>
2929

3030
<properties>
@@ -66,7 +66,7 @@ limitations under the License.
6666
<url>https://github.com/appulse-projects/utils-java</url>
6767
<connection>scm:git:https://github.com/appulse-projects/utils-java.git</connection>
6868
<developerConnection>scm:git:https://github.com/appulse-projects/utils-java.git</developerConnection>
69-
<tag>1.14.1</tag>
69+
<tag>1.15.0</tag>
7070
</scm>
7171

7272
<distributionManagement>

src/main/java/io/appulse/utils/BytesFixedArray.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,11 @@ public int writerIndex () {
261261
@Override
262262
public Bytes writerIndex (int newIndex) {
263263
if (newIndex < readerIndex() || newIndex > capacity()) {
264-
throw new IndexOutOfBoundsException();
264+
val msg = String.format(
265+
"Writer index error: newIndex(%d) < readerIndex(%d) || newIndex(%d) > capacity(%d)",
266+
newIndex, readerIndex(), newIndex, capacity()
267+
);
268+
throw new IndexOutOfBoundsException(msg);
265269
}
266270
writerIndex = newIndex;
267271
return this;
@@ -275,7 +279,11 @@ public int readerIndex () {
275279
@Override
276280
public Bytes readerIndex (int newIndex) {
277281
if (newIndex < 0 || newIndex > writerIndex()) {
278-
throw new IndexOutOfBoundsException();
282+
val msg = String.format(
283+
"Reader index error: newIndex(%d) < 0 || newIndex(%d) > writerIndex(%d)",
284+
newIndex, newIndex, writerIndex()
285+
);
286+
throw new IndexOutOfBoundsException(msg);
279287
}
280288
readerIndex = newIndex;
281289
return this;

0 commit comments

Comments
 (0)