[
https://issues.redhat.com/browse/JGRP-2448?page=com.atlassian.jira.plugin...
]
Bela Ban updated JGRP-2448:
---------------------------
Comment: was deleted
(was: Hmm, I'm computing {{index+1 % size}}, but when size is 0, this won't work.
I guess I'll add a check for isEmpty() and return null in that case...)
FD_SOCK IndexOutOfBoundsException
---------------------------------
Key: JGRP-2448
URL:
https://issues.redhat.com/browse/JGRP-2448
Project: JGroups
Issue Type: Bug
Affects Versions: 4.1.8
Reporter: Dan Berindei
Assignee: Bela Ban
Priority: Minor
Fix For: 5.0, 4.2.0
{{PD_SOCK.pickNext()}} should iterate up to {{size - 1}}:
{noformat}
java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
at
java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248)
at java.base/java.util.Objects.checkIndex(Objects.java:372)
at java.base/java.util.ArrayList.get(ArrayList.java:458)
at java.base/java.util.Collections$SynchronizedList.get(Collections.java:2424)
at org.jgroups.util.Util.pickNext(Util.java:2686)
at org.jgroups.protocols.FD_SOCK.determinePingDest(FD_SOCK.java:762)
at org.jgroups.protocols.FD_SOCK.run(FD_SOCK.java:408)
at java.base/java.lang.Thread.run(Thread.java:834)
{noformat}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)