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/06/15 00:42:34 UTC

[1/2] activemq-artemis git commit: ARTEMIS-568 Catch broken JMS selector expressions

Repository: activemq-artemis
Updated Branches:
  refs/heads/master 369f2e006 -> 3a3f678e5


ARTEMIS-568 Catch broken JMS selector expressions

Enforce an EOF on the expression so the selector parser keeps going and
catches the broken selector statement.

Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/5c29cc9a
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/5c29cc9a
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/5c29cc9a

Branch: refs/heads/master
Commit: 5c29cc9a28b8dde1937c29cd8cd06c2d9def70f8
Parents: 369f2e0
Author: Timothy Bish <ta...@gmail.com>
Authored: Tue Jun 14 19:05:27 2016 -0400
Committer: Timothy Bish <ta...@gmail.com>
Committed: Tue Jun 14 19:05:27 2016 -0400

----------------------------------------------------------------------
 artemis-selector/src/main/javacc/HyphenatedParser.jj               | 2 +-
 artemis-selector/src/main/javacc/StrictParser.jj                   | 2 +-
 .../java/org/apache/activemq/artemis/selector/SelectorTest.java    | 2 ++
 3 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/5c29cc9a/artemis-selector/src/main/javacc/HyphenatedParser.jj
----------------------------------------------------------------------
diff --git a/artemis-selector/src/main/javacc/HyphenatedParser.jj b/artemis-selector/src/main/javacc/HyphenatedParser.jj
index 8beb85a..223e088 100755
--- a/artemis-selector/src/main/javacc/HyphenatedParser.jj
+++ b/artemis-selector/src/main/javacc/HyphenatedParser.jj
@@ -142,7 +142,7 @@ BooleanExpression JmsSelector() :
 }
 {
     (
-        left = orExpression()
+        left = orExpression() <EOF>
     )
     {
         return asBooleanExpression(left);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/5c29cc9a/artemis-selector/src/main/javacc/StrictParser.jj
----------------------------------------------------------------------
diff --git a/artemis-selector/src/main/javacc/StrictParser.jj b/artemis-selector/src/main/javacc/StrictParser.jj
index 2be6725..0a318ab 100755
--- a/artemis-selector/src/main/javacc/StrictParser.jj
+++ b/artemis-selector/src/main/javacc/StrictParser.jj
@@ -142,7 +142,7 @@ BooleanExpression JmsSelector() :
 }
 {
     (
-        left = orExpression()
+        left = orExpression() <EOF>
     )
     {
         return asBooleanExpression(left);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/5c29cc9a/artemis-selector/src/test/java/org/apache/activemq/artemis/selector/SelectorTest.java
----------------------------------------------------------------------
diff --git a/artemis-selector/src/test/java/org/apache/activemq/artemis/selector/SelectorTest.java b/artemis-selector/src/test/java/org/apache/activemq/artemis/selector/SelectorTest.java
index 223a0df..d612db0 100755
--- a/artemis-selector/src/test/java/org/apache/activemq/artemis/selector/SelectorTest.java
+++ b/artemis-selector/src/test/java/org/apache/activemq/artemis/selector/SelectorTest.java
@@ -470,6 +470,8 @@ public class SelectorTest {
       assertInvalidSelector(message, "3+5");
       assertInvalidSelector(message, "True AND 3+5");
       assertInvalidSelector(message, "=TEST 'test'");
+      assertInvalidSelector(message, "prop1 = prop2 foo AND string = 'Test'");
+      assertInvalidSelector(message, "a = 1 AMD  b = 2");
    }
 
    protected MockMessage createMessage() {


[2/2] activemq-artemis git commit: This closes #580

Posted by cl...@apache.org.
This closes #580


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/3a3f678e
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/3a3f678e
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/3a3f678e

Branch: refs/heads/master
Commit: 3a3f678e58facc97aa1d08942fcf7a9c9b9eb841
Parents: 369f2e0 5c29cc9
Author: Clebert Suconic <cl...@apache.org>
Authored: Tue Jun 14 20:38:00 2016 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Tue Jun 14 20:38:00 2016 -0400

----------------------------------------------------------------------
 artemis-selector/src/main/javacc/HyphenatedParser.jj               | 2 +-
 artemis-selector/src/main/javacc/StrictParser.jj                   | 2 +-
 .../java/org/apache/activemq/artemis/selector/SelectorTest.java    | 2 ++
 3 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------