Github user michaelandrepearce commented on a diff in the pull request: https://github.com/apache/activemq-artemis/pull/2427#discussion_r233491147 --- Diff: artemis-core-client/src/main/java/org/apache/activemq/artemis/core/message/impl/CoreMessage.java --- @@ -946,119 +994,103 @@ public Integer getIntProperty(final String key) throws ActiveMQPropertyConversio @Override public CoreMessage putLongProperty(final SimpleString key, final long value) { messageChanged(); - checkProperties(); - properties.putLongProperty(key, value); + checkProperties().putLongProperty(key, value); return this; } @Override public CoreMessage putLongProperty(final String key, final long value) { messageChanged(); - checkProperties(); - properties.putLongProperty(SimpleString.toSimpleString(key, getPropertyKeysPool()), value); + checkProperties().putLongProperty(SimpleString.toSimpleString(key, getPropertyKeysPool()), value); return this; } @Override public Long getLongProperty(final SimpleString key) throws ActiveMQPropertyConversionException { - checkProperties(); - return properties.getLongProperty(key); + return checkProperties().getLongProperty(key); } @Override public Long getLongProperty(final String key) throws ActiveMQPropertyConversionException { - checkProperties(); return getLongProperty(SimpleString.toSimpleString(key)); } @Override public CoreMessage putFloatProperty(final SimpleString key, final float value) { messageChanged(); - checkProperties(); - properties.putFloatProperty(key, value); + checkProperties().putFloatProperty(key, value); return this; } @Override public CoreMessage putFloatProperty(final String key, final float value) { messageChanged(); - checkProperties(); - properties.putFloatProperty(SimpleString.toSimpleString(key, getPropertyKeysPool()), value); + checkProperties().putFloatProperty(SimpleString.toSimpleString(key, getPropertyKeysPool()), value); return this; } @Override public CoreMessage putDoubleProperty(final SimpleString key, final double value) { messageChanged(); - checkProperties(); - properties.putDoubleProperty(key, value); + checkProperties().putDoubleProperty(key, value); return this; } @Override public CoreMessage putDoubleProperty(final String key, final double value) { messageChanged(); - checkProperties(); - properties.putDoubleProperty(SimpleString.toSimpleString(key, getPropertyKeysPool()), value); + checkProperties().putDoubleProperty(SimpleString.toSimpleString(key, getPropertyKeysPool()), value); return this; } @Override public Double getDoubleProperty(final SimpleString key) throws ActiveMQPropertyConversionException { - checkProperties(); - return properties.getDoubleProperty(key); + return checkProperties().getDoubleProperty(key); } @Override public Double getDoubleProperty(final String key) throws ActiveMQPropertyConversionException { - checkProperties(); return getDoubleProperty(SimpleString.toSimpleString(key)); } @Override public CoreMessage putStringProperty(final SimpleString key, final SimpleString value) { messageChanged(); - checkProperties(); - properties.putSimpleStringProperty(key, value); + checkProperties().putSimpleStringProperty(key, value); return this; } @Override public CoreMessage putStringProperty(final SimpleString key, final String value) { messageChanged(); - checkProperties(); - properties.putSimpleStringProperty(key, SimpleString.toSimpleString(value, getPropertyValuesPool())); + checkProperties().putSimpleStringProperty(key, SimpleString.toSimpleString(value, getPropertyValuesPool())); return this; } @Override public CoreMessage putStringProperty(final String key, final String value) { messageChanged(); - checkProperties(); - properties.putSimpleStringProperty(SimpleString.toSimpleString(key, getPropertyKeysPool()), SimpleString.toSimpleString(value, getPropertyValuesPool())); + checkProperties().putSimpleStringProperty(SimpleString.toSimpleString(key, getPropertyKeysPool()), SimpleString.toSimpleString(value, getPropertyValuesPool())); --- End diff -- delegate to public CoreMessage putStringProperty(final SimpleString key, final String value) {
---