Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,21 @@ public String getUserProperty(final String name) {
return this.getProperty(name);
}

/**
* Returns the value of the named property, or {@code null} if the property is not set
* or the properties map has not been initialized.
* <p>
* Note: this method is read-only and does <b>not</b> lazily initialize the internal
* properties map. To add properties, use {@link #putProperty(String, String)} which
* creates the map on demand.
*
* @param name the property key
* @return the property value, or {@code null}
*/
public String getProperty(final String name) {
if (null == this.properties) {
this.properties = new HashMap<>();
return null;
Comment thread
wang-jiahua marked this conversation as resolved.
}

return this.properties.get(name);
}

Expand Down Expand Up @@ -164,7 +174,11 @@ public void setPriority(int priority) {
}

public int getPriority() {
return NumberUtils.toInt(this.getProperty(MessageConst.PROPERTY_PRIORITY), -1);
String value = this.getProperty(MessageConst.PROPERTY_PRIORITY);
if (value == null || value.isEmpty()) {
return -1;
}
return NumberUtils.toInt(value, -1);
Comment thread
wang-jiahua marked this conversation as resolved.
}

public boolean isWaitStoreMsgOK() {
Expand Down
Loading