This closes #2507
This commit is contained in:
commit
5c47e71d4f
|
@ -342,7 +342,7 @@ public final class SimpleString implements CharSequence, Serializable, Comparabl
|
|||
byte high = (byte) (delim >> 8 & 0xFF); // high byte
|
||||
|
||||
int lasPos = 0;
|
||||
for (int i = 0; i < data.length; i += 2) {
|
||||
for (int i = 0; i + 1 < data.length; i += 2) {
|
||||
if (data[i] == low && data[i + 1] == high) {
|
||||
byte[] bytes = new byte[i - lasPos];
|
||||
System.arraycopy(data, lasPos, bytes, 0, bytes.length);
|
||||
|
@ -439,7 +439,7 @@ public final class SimpleString implements CharSequence, Serializable, Comparabl
|
|||
final byte low = (byte) (c & 0xFF); // low byte
|
||||
final byte high = (byte) (c >> 8 & 0xFF); // high byte
|
||||
|
||||
for (int i = 0; i < data.length; i += 2) {
|
||||
for (int i = 0; i + 1 < data.length; i += 2) {
|
||||
if (data[i] == low && data[i + 1] == high) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ public class ActiveMQJMSContext implements JMSContext {
|
|||
private volatile Message lastMessagesWaitingAck;
|
||||
|
||||
private final ActiveMQConnectionForContext connection;
|
||||
private Session session;
|
||||
private volatile Session session;
|
||||
private boolean autoStart = ActiveMQJMSContext.DEFAULT_AUTO_START;
|
||||
private MessageProducer innerProducer;
|
||||
private boolean xa;
|
||||
|
@ -91,6 +91,7 @@ public class ActiveMQJMSContext implements JMSContext {
|
|||
}
|
||||
|
||||
public Session getSession() {
|
||||
checkSession();
|
||||
return session;
|
||||
}
|
||||
|
||||
|
|
|
@ -345,7 +345,7 @@ public class ArtemisCreatePlugin extends ArtemisAbstractPlugin {
|
|||
Charset charset = StandardCharsets.UTF_8;
|
||||
|
||||
String content = new String(Files.readAllBytes(original), charset);
|
||||
for (int i = 0; i < replacePairs.length; i += 2) {
|
||||
for (int i = 0; i + 1 < replacePairs.length; i += 2) {
|
||||
content = content.replaceAll(replacePairs[i], replacePairs[i + 1]);
|
||||
}
|
||||
Files.write(target, content.getBytes(charset));
|
||||
|
|
|
@ -37,7 +37,7 @@ public enum QueueStatus {
|
|||
}
|
||||
|
||||
public static QueueStatus fromID(short id) {
|
||||
if (id < 0 || id > values.length) {
|
||||
if (id < 0 || id >= values.length) {
|
||||
return null;
|
||||
} else {
|
||||
return values[id];
|
||||
|
|
Loading…
Reference in New Issue