Skip to content

Commit c2dd383

Browse files
committed
RTSDK-10325 ArrayOutOfBoundsException when process message in EMA and ETA Java
1 parent 7ffc50e commit c2dd383

File tree

8 files changed

+93
-52
lines changed

8 files changed

+93
-52
lines changed

CMake/rtsdkInfo.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ unset(rtsdk_DEPENDS_LIST)
1313
set(rtsdk_INTERNAL_API_VERSION_MAJOR 3)
1414
set(rtsdk_INTERNAL_API_VERSION_MINOR 9)
1515
set(rtsdk_INTERNAL_API_VERSION_PATCH 1)
16-
set(rtsdk_INTERNAL_API_VERSION_TWEAK 1)
17-
set(rtsdk_INTERNAL_RELEASE_TWEAK G1)
16+
set(rtsdk_INTERNAL_API_VERSION_TWEAK 3)
17+
set(rtsdk_INTERNAL_RELEASE_TWEAK G2)
1818
set(rtsdk_RELEASE_TYPE rrg)
1919

2020
set( librssl_SO_VERSION 29 )

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ cmake_minimum_required (VERSION 3.22.0)
88
# guarantee of a successful build if changed.
99

1010
project (rtsdk
11-
VERSION 2.3.1.1
11+
VERSION 2.3.1.3
1212
LANGUAGES C CXX)
1313

1414
set(rtsdk_CMAKE_DIR "${rtsdk_SOURCE_DIR}/CMake")

Java/CHANGELOG.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,36 @@ There are three types of RTSDK releases that append a letter directly followed b
99
"E" releases (E-Loads) are emergency RTSDK releases that are uploaded to MyAccount and Developer Community but not to GitHub. Also note that emergency releases may only be partial (i.e., Java or C++/C only).
1010

1111
----------------------------------------------------------------------------------------
12-
CURRENT RELEASE HIGHLIGHTS - RTSDK Java 2.3.1.G1 aka EMA/ETA 3.9.1.G1 aka 3.9.1.1
12+
CURRENT RELEASE HIGHLIGHTS - RTSDK Java 2.3.1.G2 aka EMA/ETA 3.9.1.G2 aka 3.9.1.3
1313
----------------------------------------------------------------------------------------
1414

1515
This is a maintenance release with critical fixes for customer issues.
1616

1717
Customer Issues Resolved
1818
------------------------
19-
- [Case Number: 15088925] - [RTSDK-10072] - Fixes to exceptions with multiple Consumers started in one application
20-
- [Case Number: 15242251] - [RTSDK-10184] - EMA Java com.refinitiv.eta.json.util.UtilQueue.growPool threw ArrayIndexOutOfBoundsException
19+
- [Case Number: 15439870] - [RTSDK-10325] - ArrayOutOfBoundsException when process message in EMA and ETA Java
2120

2221
----------------------------------------------------------------------------------------
2322
FULL CHANGELOG
2423
----------------------------------------------------------------------------------------
2524

25+
--------------------------------------------
26+
RTSDK Java Release 2.3.1.G2 (Nov 25, 2025)
27+
--------------------------------------------
28+
29+
This is a maintenance release with a critical fix.
30+
31+
EMA Java 3.9.1.G2 Issues Resolved
32+
---------------------------------
33+
- [RTSDK-10325] - ArrayOutOfBoundsException when process message in EMA and ETA Java [Case Number: 15439870]
34+
2635
--------------------------------------------
2736
RTSDK Java Release 2.3.1.G1 (Sep 30, 2025)
2837
--------------------------------------------
2938

3039
This is a maintenance release with critical fixes for customer issues.
3140

32-
Both ETA Java and EMA Java 3.9.1.L2 Issues Resolved
41+
Both ETA Java and EMA Java 3.9.1.G1 Issues Resolved
3342
---------------------------------------------------
3443
- [RTSDK-10072] - Fixes to exceptions with multiple Consumers started in one application [Case Number: 15088925]
3544
- [RTSDK-10184] - EMA Java com.refinitiv.eta.json.util.UtilQueue.growPool threw ArrayIndexOutOfBoundsException [Case Number: 15242251]

Java/Ema/Core/src/main/java/com/refinitiv/ema/access/EmaObjectManager.java

Lines changed: 56 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,15 @@
99
package com.refinitiv.ema.access;
1010

1111
import java.nio.ByteBuffer;
12+
1213
import java.util.ArrayList;
14+
import java.util.ArrayDeque;
1315
import java.util.Deque;
1416
import java.util.List;
17+
1518
import java.util.concurrent.ConcurrentLinkedDeque;
16-
import java.util.ArrayDeque;
19+
import java.util.concurrent.locks.Lock;
20+
import java.util.concurrent.locks.ReentrantLock;
1721

1822
import com.refinitiv.eta.valueadd.common.VaPool;
1923

@@ -25,6 +29,7 @@ class EmaObjectManager
2529
private final static int MAX_BYTE_BUFFER_CAPABILITY = 2000;
2630
private final static int DEFAULT_ETA_CONTAINER_SIZE = 10;
2731

32+
private Lock _byteBufferLock = null;
2833
private List<ByteBuffer>[] _byteBufferList;
2934
private boolean _intialized;
3035

@@ -113,6 +118,11 @@ class EmaObjectManager
113118

114119
EmaObjectManager(boolean globalLock)
115120
{
121+
if (globalLock)
122+
{
123+
_byteBufferLock = new ReentrantLock();
124+
}
125+
116126
_ommIntPool = new VaPool(globalLock);
117127
_ommUIntPool = new VaPool(globalLock);
118128
_ommFloatPool = new VaPool(globalLock);
@@ -375,33 +385,44 @@ ByteBuffer acquireByteBuffer(int length)
375385
int pos = length / DEFAULT_BYTE_BUFFER_SIZE;
376386
ByteBuffer retVal;
377387

378-
if (pos < MAX_NUM_BYTE_BUFFER)
388+
if (_byteBufferLock != null)
389+
_byteBufferLock.lock();
390+
391+
try
379392
{
380-
if (!_byteBufferList[pos].isEmpty())
393+
if (pos < MAX_NUM_BYTE_BUFFER)
381394
{
382-
retVal = _byteBufferList[pos].remove(_byteBufferList[pos].size() - 1);
383-
retVal.clear();
384-
return retVal;
385-
}
395+
if (!_byteBufferList[pos].isEmpty())
396+
{
397+
retVal = _byteBufferList[pos].remove(_byteBufferList[pos].size() - 1);
398+
retVal.clear();
399+
return retVal;
400+
}
386401

387-
return ByteBuffer.allocate((pos + 1) * DEFAULT_BYTE_BUFFER_SIZE);
388-
} else
389-
{
390-
if (!_byteBufferList[MAX_NUM_BYTE_BUFFER].isEmpty())
402+
return ByteBuffer.allocate((pos + 1) * DEFAULT_BYTE_BUFFER_SIZE);
403+
} else
391404
{
392-
int size = _byteBufferList[MAX_NUM_BYTE_BUFFER].size() - 1;
393-
for (int index = size; index >= 0; --index)
405+
if (!_byteBufferList[MAX_NUM_BYTE_BUFFER].isEmpty())
394406
{
395-
if (length < _byteBufferList[MAX_NUM_BYTE_BUFFER].get(index).capacity())
407+
int size = _byteBufferList[MAX_NUM_BYTE_BUFFER].size() - 1;
408+
for (int index = size; index >= 0; --index)
396409
{
397-
retVal = _byteBufferList[MAX_NUM_BYTE_BUFFER].remove(index);
398-
retVal.clear();
399-
return retVal;
410+
if (length < _byteBufferList[MAX_NUM_BYTE_BUFFER].get(index).capacity())
411+
{
412+
retVal = _byteBufferList[MAX_NUM_BYTE_BUFFER].remove(index);
413+
retVal.clear();
414+
return retVal;
415+
}
400416
}
401417
}
402-
}
403418

404-
return ByteBuffer.allocate(length);
419+
return ByteBuffer.allocate(length);
420+
}
421+
}
422+
finally
423+
{
424+
if (_byteBufferLock != null)
425+
_byteBufferLock.unlock();
405426
}
406427
}
407428

@@ -410,12 +431,23 @@ void releaseByteBuffer(ByteBuffer buffer)
410431
if (buffer == null)
411432
return;
412433

413-
int pos = buffer.capacity() / DEFAULT_BYTE_BUFFER_SIZE - 1;
434+
if (_byteBufferLock != null)
435+
_byteBufferLock.lock();
414436

415-
if (pos < MAX_NUM_BYTE_BUFFER)
416-
_byteBufferList[pos].add(buffer);
417-
else
418-
_byteBufferList[MAX_NUM_BYTE_BUFFER].add(buffer);
437+
try
438+
{
439+
int pos = buffer.capacity() / DEFAULT_BYTE_BUFFER_SIZE - 1;
440+
441+
if (pos < MAX_NUM_BYTE_BUFFER)
442+
_byteBufferList[pos].add(buffer);
443+
else
444+
_byteBufferList[MAX_NUM_BYTE_BUFFER].add(buffer);
445+
}
446+
finally
447+
{
448+
if (_byteBufferLock != null)
449+
_byteBufferLock.unlock();
450+
}
419451
}
420452

421453
@SuppressWarnings("unchecked")

Java/Ema/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ In addtion, HTML documentation is available in Java/Ema/Docs. For addtional docu
7272

7373
Library Name Package Version
7474
------------ ----------------
75-
ema-3.9.1.0.jar ema3.9.1.L1
75+
ema-3.9.1.3.jar ema3.9.1.G2
7676

77-
NOTE: ema-3.9.1.0-test.jar containing test utilities is available and published to Maven Central. This may also be built using `gradlew packageTests`.
77+
NOTE: ema-3.9.1.3-test.jar containing test utilities is available and published to Maven Central. This may also be built using `gradlew packageTests`.
7878

7979
# EMA Java Issues and Workarounds
8080

Java/Eta/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,21 +121,21 @@ The distribution contains several JAR files and other non-Java libraries, intend
121121

122122
Library Name Package Version Description
123123
------------ ---------------- -----------
124-
eta-3.9.1.0.jar eta3.9.1.L1 The ETA - Java Edition library. Includes
124+
eta-3.9.1.3.jar eta3.9.1.G2 The ETA - Java Edition library. Includes
125125
the ETA transport package and the RWF codec.
126126

127-
etaValueAdd-3.9.1.0.jar eta3.9.1.L1 The Value Add library for ETA Java Edition.
127+
etaValueAdd-3.9.1.3.jar eta3.9.1.G2 The Value Add library for ETA Java Edition.
128128
Includes the ETA Value Add Reactor and
129129
Administration Domain Model Representations.
130130

131-
etaValueAddCache-3.9.1.0.jar eta3.9.1.L1 The Value Add payload cache library for ETA
131+
etaValueAddCache-3.9.1.3.jar eta3.9.1.G2 The Value Add payload cache library for ETA
132132
Java Edition.
133133

134-
etajConverter-3.9.1.0.jar eta3.9.1.L1 The RWF/JSON Converter library.
134+
etajConverter-3.9.1.3.jar eta3.9.1.G2 The RWF/JSON Converter library.
135135

136136
jDacsEtalib.jar dacs7.12 The ETA Java DACS library.
137137

138-
ansipage-3.9.1.0.jar eta3.9.1.L1 The ANSI decoders and encoders.
138+
ansipage-3.9.1.3.jar eta3.9.1.G2 The ANSI decoders and encoders.
139139
140140

141141
ETAC/ETA/RSSL JNI Libs eta3.9.1.L1 The JNI libraries for Reliable Multicast

Java/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -225,40 +225,40 @@ You can download RTSDK libraries and dependencies from Maven Central using sever
225225
<dependency>
226226
<groupId>com.refinitiv.ema</groupId>
227227
<artifactId>ema</artifactId>
228-
<version>3.9.1.0</version>
228+
<version>3.9.1.3</version>
229229
</dependency>
230230

231231
<dependency>
232232
<groupId>com.refinitiv.eta</groupId>
233233
<artifactId>eta</artifactId>
234-
<version>3.9.1.0</version>
234+
<version>3.9.1.3</version>
235235
</dependency>
236236

237237
<dependency>
238238
<groupId>com.refinitiv.eta.valueadd</groupId>
239239
<artifactId>etaValueAdd</artifactId>
240-
<version>3.9.1.0</version>
240+
<version>3.9.1.3</version>
241241
</dependency>
242242

243243
<dependency>
244244
<groupId>com.refinitiv.eta.valueadd.cache</groupId>
245245
<artifactId>etaValueAddCache</artifactId>
246-
<version>3.9.1.0</version>
246+
<version>3.9.1.3</version>
247247
</dependency>
248248

249249
<dependency>
250250
<groupId>com.refinitiv.eta.ansi</groupId>
251251
<artifactId>ansipage</artifactId>
252-
<version>3.9.1.0</version>
252+
<version>3.9.1.3</version>
253253
</dependency>
254254

255255
Gradle uses the following syntax to specify RTSDK dependencies:
256256

257-
compile group: 'com.refinitiv.ema', name: 'ema', version: '3.9.1.0'
258-
compile group: 'com.refinitiv.eta', name: 'eta', version: '3.9.1.0'
259-
compile group: 'com.refinitiv.eta.valueadd', name: 'etaValueAdd', version: '3.9.1.0'
260-
compile group: 'com.refinitiv.eta.valueadd.cache', name: 'etaValueAddCache', version: '3.9.1.0'
261-
compile group: 'com.refinitiv.eta.ansi', name: 'ansipage', version: '3.9.1.0'
257+
compile group: 'com.refinitiv.ema', name: 'ema', version: '3.9.1.3'
258+
compile group: 'com.refinitiv.eta', name: 'eta', version: '3.9.1.3'
259+
compile group: 'com.refinitiv.eta.valueadd', name: 'etaValueAdd', version: '3.9.1.3'
260+
compile group: 'com.refinitiv.eta.valueadd.cache', name: 'etaValueAddCache', version: '3.9.1.3'
261+
compile group: 'com.refinitiv.eta.ansi', name: 'ansipage', version: '3.9.1.3'
262262

263263
# Developing
264264

Java/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,16 @@ repositories {
3737

3838
ext.YEAR = '2025'
3939

40-
ext.BuildDate = 'Tue Sep 30 8:00:00 CDT ' + "$YEAR"
41-
ext.SpecificationVersion = '3.9.1.1'
40+
ext.BuildDate = 'Thu Nov 20 8:00:00 CDT ' + "$YEAR"
41+
ext.SpecificationVersion = '3.9.1.3'
4242
ext.SpecificationVersionShort = '3.9.1'
4343

4444
// Comment out line below to publish offical release
4545
// ext.SpecificationVersion = "$SpecificationVersion" + "-SNAPSHOT"
4646

4747
// Update below to L1.all.rrg, G1.all.gload, or E1.all.eload when needed
48-
ext.etaImplementationVersion = 'etaj' + "$SpecificationVersionShort" + '.G1.all.rrg'
49-
ext.emaImplementationVersion = 'emaj' + "$SpecificationVersionShort" + '.G1.all.rrg'
48+
ext.etaImplementationVersion = 'etaj' + "$SpecificationVersionShort" + '.G2.all.rrg'
49+
ext.emaImplementationVersion = 'emaj' + "$SpecificationVersionShort" + '.G2.all.rrg'
5050

5151
// NOTE! update with new asset version
5252
ext.BINARY_PACK_VERSION_TO_DOWNLOAD = '2.3.1.L1'

0 commit comments

Comments
 (0)