[ https://issues.apache.org/jira/browse/AMQ-2287?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Torsten Mielke updated AMQ-2287: -------------------------------- Description: currently the AMQ implementation of javax.jms.Message.setXXXProperty() does not check if the property name is a valid Java identifier. This however is required according to the JMS spec. >From http://docs.oracle.com/javaee/6/api/javax/jms/Message.html: {quote} Property names must obey the rules for a message selector identifier. ... Identifiers: * An identifier is an unlimited-length sequence of letters and digits, the first of which must be a letter. A letter is any character for which the method Character.isJavaLetter returns true. This includes '_' and '$'. A letter or digit is any character for which the method Character.isJavaLetterOrDigit returns true. * Identifiers cannot be the names NULL, TRUE, and FALSE. * Identifiers cannot be NOT, AND, OR, BETWEEN, LIKE, IN, IS, or ESCAPE. * Identifiers are either header field references or property references. The type of a property value in a message selector corresponds to the type used to set the property. If a property that does not exist in a message is referenced, its value is NULL. * The conversions that apply to the get methods for properties do not apply when a property is used in a message selector expression. For example, suppose you set a property as a string value, as in the following: myMessage.setStringProperty("NumberOfOrders", "2"); The following expression in a message selector would evaluate to false, because a string cannot be used in an arithmetic expression: "NumberOfOrders > 1" * Identifiers are case-sensitive. * Message header field references are restricted to JMSDeliveryMode, JMSPriority, JMSMessageID, JMSTimestamp, JMSCorrelationID, and JMSType. JMSMessageID, JMSCorrelationID, and JMSType values may be null and if so are treated as a NULL value. * Any name beginning with 'JMSX' is a JMS defined property name. * Any name beginning with 'JMS_' is a provider-specific property name. * Any name that does not begin with 'JMS' is an application-specific property name. {quote} Checks for this need to be added to all ActiveMQMessage.setXXXProperty() methods. was: currently the AMQ implementation of javax.jms.Message.setXXXProperty() does not check if the property name is a valid Java identifier. This however is required according to the JMS spec. >From http://java.sun.com/javaee/6/docs/api/javax/jms/Message.html: {quote} Property names must obey the rules for a message selector identifier. ... Identifiers: * An identifier is an unlimited-length sequence of letters and digits, the first of which must be a letter. A letter is any character for which the method Character.isJavaLetter returns true. This includes '_' and '$'. A letter or digit is any character for which the method Character.isJavaLetterOrDigit returns true. * Identifiers cannot be the names NULL, TRUE, and FALSE. * Identifiers cannot be NOT, AND, OR, BETWEEN, LIKE, IN, IS, or ESCAPE. * Identifiers are either header field references or property references. The type of a property value in a message selector corresponds to the type used to set the property. If a property that does not exist in a message is referenced, its value is NULL. * The conversions that apply to the get methods for properties do not apply when a property is used in a message selector expression. For example, suppose you set a property as a string value, as in the following: myMessage.setStringProperty("NumberOfOrders", "2"); The following expression in a message selector would evaluate to false, because a string cannot be used in an arithmetic expression: "NumberOfOrders > 1" * Identifiers are case-sensitive. * Message header field references are restricted to JMSDeliveryMode, JMSPriority, JMSMessageID, JMSTimestamp, JMSCorrelationID, and JMSType. JMSMessageID, JMSCorrelationID, and JMSType values may be null and if so are treated as a NULL value. * Any name beginning with 'JMSX' is a JMS defined property name. * Any name beginning with 'JMS_' is a provider-specific property name. * Any name that does not begin with 'JMS' is an application-specific property name. {quote} Checks for this need to be added to all ActiveMQMessage.setXXXProperty() methods. > ActiveMQMessage.setXXXProperty() method needs to check if property name is a > valid Java identifier. > --------------------------------------------------------------------------------------------------- > > Key: AMQ-2287 > URL: https://issues.apache.org/jira/browse/AMQ-2287 > Project: ActiveMQ > Issue Type: Bug > Components: Broker > Affects Versions: 5.2.0 > Reporter: Torsten Mielke > Fix For: 5.x > > > currently the AMQ implementation of javax.jms.Message.setXXXProperty() does > not check if the property name is a valid Java identifier. > This however is required according to the JMS spec. > From http://docs.oracle.com/javaee/6/api/javax/jms/Message.html: > {quote} > Property names must obey the rules for a message selector identifier. > ... > Identifiers: > * An identifier is an unlimited-length sequence of letters and digits, > the first of which must be a letter. A letter is any character for which the > method Character.isJavaLetter returns true. This includes '_' and '$'. A > letter or digit is any character for which the method > Character.isJavaLetterOrDigit returns true. > * Identifiers cannot be the names NULL, TRUE, and FALSE. > * Identifiers cannot be NOT, AND, OR, BETWEEN, LIKE, IN, IS, or ESCAPE. > * Identifiers are either header field references or property references. > The type of a property value in a message selector corresponds to the type > used to set the property. If a property that does not exist in a message is > referenced, its value is NULL. > * The conversions that apply to the get methods for properties do not > apply when a property is used in a message selector expression. For example, > suppose you set a property as a string value, as in the following: > myMessage.setStringProperty("NumberOfOrders", "2"); > The following expression in a message selector would evaluate to false, > because a string cannot be used in an arithmetic expression: > "NumberOfOrders > 1" > * Identifiers are case-sensitive. > * Message header field references are restricted to JMSDeliveryMode, > JMSPriority, JMSMessageID, JMSTimestamp, JMSCorrelationID, and JMSType. > JMSMessageID, JMSCorrelationID, and JMSType values may be null and if so are > treated as a NULL value. > * Any name beginning with 'JMSX' is a JMS defined property name. > * Any name beginning with 'JMS_' is a provider-specific property name. > * Any name that does not begin with 'JMS' is an application-specific > property name. > {quote} > Checks for this need to be added to all ActiveMQMessage.setXXXProperty() > methods. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira