You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2016/04/19 15:50:23 UTC
[1/2] activemq-artemis git commit: ARTEMIS-493 - NullPointerException
when trying a null connection remote properties are passed by client
Repository: activemq-artemis
Updated Branches:
refs/heads/master bfa3b27cf -> b4a6427d6
ARTEMIS-493 - NullPointerException when trying a null connection remote properties are passed by client
adde a check and fixed a couple of other potential NPE's
https://issues.apache.org/jira/browse/ARTEMIS-493
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/97f3fb24
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/97f3fb24
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/97f3fb24
Branch: refs/heads/master
Commit: 97f3fb241ccc72d230dabef4deb028219f8ac8ad
Parents: bfa3b27
Author: Andy Taylor <an...@gmail.com>
Authored: Tue Apr 19 11:21:14 2016 +0100
Committer: Andy Taylor <an...@gmail.com>
Committed: Tue Apr 19 11:21:33 2016 +0100
----------------------------------------------------------------------
.../plug/ProtonSessionIntegrationCallback.java | 30 ++++++++++++--------
.../plug/context/AbstractConnectionContext.java | 6 +++-
2 files changed, 23 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/97f3fb24/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/plug/ProtonSessionIntegrationCallback.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/plug/ProtonSessionIntegrationCallback.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/plug/ProtonSessionIntegrationCallback.java
index aa42a92..2dccc30 100644
--- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/plug/ProtonSessionIntegrationCallback.java
+++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/plug/ProtonSessionIntegrationCallback.java
@@ -242,23 +242,29 @@ public class ProtonSessionIntegrationCallback implements AMQPSessionCallback, Se
@Override
public void rollbackCurrentTX() throws Exception {
- recoverContext();
- try {
- serverSession.rollback(false);
- }
- finally {
- resetContext();
+ //need to check here as this can be called if init fails
+ if (serverSession != null) {
+ recoverContext();
+ try {
+ serverSession.rollback(false);
+ }
+ finally {
+ resetContext();
+ }
}
}
@Override
public void close() throws Exception {
- recoverContext();
- try {
- serverSession.close(false);
- }
- finally {
- resetContext();
+ //need to check here as this can be called if init fails
+ if (serverSession != null) {
+ recoverContext();
+ try {
+ serverSession.close(false);
+ }
+ finally {
+ resetContext();
+ }
}
}
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/97f3fb24/artemis-protocols/artemis-proton-plug/src/main/java/org/proton/plug/context/AbstractConnectionContext.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-proton-plug/src/main/java/org/proton/plug/context/AbstractConnectionContext.java b/artemis-protocols/artemis-proton-plug/src/main/java/org/proton/plug/context/AbstractConnectionContext.java
index fd1ae99..93442de 100644
--- a/artemis-protocols/artemis-proton-plug/src/main/java/org/proton/plug/context/AbstractConnectionContext.java
+++ b/artemis-protocols/artemis-proton-plug/src/main/java/org/proton/plug/context/AbstractConnectionContext.java
@@ -182,7 +182,11 @@ public abstract class AbstractConnectionContext extends ProtonInitializable impl
connection.open();
}
initialise();
- if (!connection.getRemoteProperties().containsKey(CONNECTION_OPEN_FAILED)) {
+ /*
+ * This can be null which is in effect an empty map, also we really dont need to check this for in bound connections
+ * but its here in case we add support for outbound connections.
+ * */
+ if (connection.getRemoteProperties() == null || !connection.getRemoteProperties().containsKey(CONNECTION_OPEN_FAILED)) {
long nextKeepAliveTime = handler.tick(true);
flushBytes();
if (nextKeepAliveTime > 0 && scheduledPool != null) {
[2/2] activemq-artemis git commit: This closes #472
Posted by cl...@apache.org.
This closes #472
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/b4a6427d
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/b4a6427d
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/b4a6427d
Branch: refs/heads/master
Commit: b4a6427d6505190f7f57c8c0d8cdc100ea585980
Parents: bfa3b27 97f3fb2
Author: Clebert Suconic <cl...@apache.org>
Authored: Tue Apr 19 09:49:59 2016 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Tue Apr 19 09:49:59 2016 -0400
----------------------------------------------------------------------
.../plug/ProtonSessionIntegrationCallback.java | 30 ++++++++++++--------
.../plug/context/AbstractConnectionContext.java | 6 +++-
2 files changed, 23 insertions(+), 13 deletions(-)
----------------------------------------------------------------------