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/10/13 14:38:26 UTC
[1/3] activemq-artemis git commit: Fix NPE in empty
InExpression.toString
Repository: activemq-artemis
Updated Branches:
refs/heads/master 586abba94 -> 0a1e6bdd5
Fix NPE in empty InExpression.toString
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/6fbafc44
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/6fbafc44
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/6fbafc44
Branch: refs/heads/master
Commit: 6fbafc4441791bd3883e695f395ef35a4d36e62e
Parents: 586abba
Author: Ville Skytt� <vi...@iki.fi>
Authored: Thu Oct 13 00:20:59 2016 +0300
Committer: Ville Skytt� <vi...@iki.fi>
Committed: Thu Oct 13 00:25:29 2016 +0300
----------------------------------------------------------------------
.../artemis/selector/filter/UnaryExpression.java | 13 +++++--------
.../artemis/selector/filter/UnaryExpressionTest.java | 11 +++++++++++
2 files changed, 16 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6fbafc44/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/UnaryExpression.java
----------------------------------------------------------------------
diff --git a/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/UnaryExpression.java b/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/UnaryExpression.java
index 4c106bd..e70de83 100755
--- a/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/UnaryExpression.java
+++ b/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/UnaryExpression.java
@@ -61,15 +61,12 @@ public abstract class UnaryExpression implements Expression {
final boolean not) {
// Use a HashSet if there are many elements.
- Collection<Object> t;
- if (elements.size() == 0) {
- t = null;
- } else if (elements.size() < 5) {
- t = elements;
+ final Collection<Object> inList;
+ if (elements.size() < 5) {
+ inList = elements;
} else {
- t = new HashSet<>(elements);
+ inList = new HashSet<>(elements);
}
- final Collection<Object> inList = t;
return new BooleanUnaryExpression(right) {
@Override
@@ -83,7 +80,7 @@ public abstract class UnaryExpression implements Expression {
return null;
}
- return (inList != null && inList.contains(rvalue)) ^ not;
+ return inList.contains(rvalue) ^ not;
}
@Override
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6fbafc44/artemis-selector/src/test/java/org/apache/activemq/artemis/selector/filter/UnaryExpressionTest.java
----------------------------------------------------------------------
diff --git a/artemis-selector/src/test/java/org/apache/activemq/artemis/selector/filter/UnaryExpressionTest.java b/artemis-selector/src/test/java/org/apache/activemq/artemis/selector/filter/UnaryExpressionTest.java
index 6e6ab43..8f1b1a1 100755
--- a/artemis-selector/src/test/java/org/apache/activemq/artemis/selector/filter/UnaryExpressionTest.java
+++ b/artemis-selector/src/test/java/org/apache/activemq/artemis/selector/filter/UnaryExpressionTest.java
@@ -16,6 +16,8 @@
*/
package org.apache.activemq.artemis.selector.filter;
+import java.util.Collections;
+
import org.apache.activemq.artemis.selector.impl.SelectorParser;
import org.junit.Assert;
import org.junit.Test;
@@ -30,4 +32,13 @@ public class UnaryExpressionTest {
Assert.assertTrue("Created unary expression 2", expr2 instanceof UnaryExpression);
Assert.assertEquals("Unary expressions are equal", expr1, expr2);
}
+
+ @Test
+ public void testInExpressionToString() throws Exception {
+ BooleanExpression expr;
+ expr = UnaryExpression.createInExpression(new PropertyExpression("foo"), Collections.<Object>singletonList("bar"), false);
+ Assert.assertTrue(expr.toString().matches("foo\\s+IN\\s+.*bar.*"));
+ expr = UnaryExpression.createInExpression(new PropertyExpression("foo"), Collections.emptyList(), false);
+ Assert.assertTrue(expr.toString().matches("foo\\s+IN\\s+.*"));
+ }
}
[2/3] activemq-artemis git commit: Fix NPE in JAAS PropertiesLoader
when in debug mode without baseDir
Posted by cl...@apache.org.
Fix NPE in JAAS PropertiesLoader when in debug mode without baseDir
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/a3527869
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/a3527869
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/a3527869
Branch: refs/heads/master
Commit: a3527869b4a90f4c9ee578c09d1ce9fc06bc1408
Parents: 6fbafc4
Author: Ville Skytt� <vi...@iki.fi>
Authored: Thu Oct 13 00:25:08 2016 +0300
Committer: Ville Skytt� <vi...@iki.fi>
Committed: Thu Oct 13 00:25:45 2016 +0300
----------------------------------------------------------------------
.../activemq/artemis/spi/core/security/jaas/PropertiesLoader.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/a3527869/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/PropertiesLoader.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/PropertiesLoader.java b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/PropertiesLoader.java
index 0a07658..616bb82 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/PropertiesLoader.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/PropertiesLoader.java
@@ -112,7 +112,7 @@ public class PropertiesLoader {
}
}
if (debug) {
- logger.debug("Using basedir=" + baseDir.getAbsolutePath());
+ logger.debug("Using basedir=" + (baseDir == null ? null : baseDir.getAbsolutePath()));
}
return baseDir;
}
[3/3] activemq-artemis git commit: This closes #842
Posted by cl...@apache.org.
This closes #842
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/0a1e6bdd
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/0a1e6bdd
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/0a1e6bdd
Branch: refs/heads/master
Commit: 0a1e6bdd5e1720f1d1b576af01644f20cb75cc3c
Parents: 586abba a352786
Author: Clebert Suconic <cl...@apache.org>
Authored: Thu Oct 13 16:38:11 2016 +0200
Committer: Clebert Suconic <cl...@apache.org>
Committed: Thu Oct 13 16:38:11 2016 +0200
----------------------------------------------------------------------
.../artemis/selector/filter/UnaryExpression.java | 13 +++++--------
.../artemis/selector/filter/UnaryExpressionTest.java | 11 +++++++++++
.../spi/core/security/jaas/PropertiesLoader.java | 2 +-
3 files changed, 17 insertions(+), 9 deletions(-)
----------------------------------------------------------------------