diff --git a/artemis-selector/src/main/javacc/StrictParser.jj b/artemis-selector/src/main/javacc/StrictParser.jj index 0a318abc1b..46e5c2b077 100755 --- a/artemis-selector/src/main/javacc/StrictParser.jj +++ b/artemis-selector/src/main/javacc/StrictParser.jj @@ -131,6 +131,7 @@ TOKEN [IGNORE_CASE] : TOKEN [IGNORE_CASE] : { < ID : ["a"-"z", "_", "$"] (["a"-"z","0"-"9","_", "$"])* > + | < QUOTED_ID : "\"" ( ("\"\"") | ~["\""] )* "\"" > } // ---------------------------------------------------------------------------- @@ -556,6 +557,20 @@ PropertyExpression variable() : { left = new PropertyExpression(t.image); } + | + t = + { + // Decode the string value. + StringBuffer rc = new StringBuffer(); + String image = t.image; + for( int i=1; i < image.length()-1; i++ ) { + char c = image.charAt(i); + if( c == '"' ) + i++; + rc.append(c); + } + return new PropertyExpression(rc.toString()); + } ) { return left; 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 7e6a9a6631..5f1e4b812c 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 @@ -192,6 +192,16 @@ public class SelectorTest { assertSelector(message, "JMSType = 'crap'", false); } + @Test + public void testDottedProperty() throws Exception { + MockMessage message = createMessage(); + message.setJMSType("selector-test"); + message.setStringProperty("a.test", "value"); + message.setJMSMessageID("id:test:1:1:1:1"); + + assertSelector(message, "\"a.test\" = 'value'", true); + } + @Test public void testBasicSelectors() throws Exception { MockMessage message = createMessage();