diff options
author | Robert Gemmell <robbie@apache.org> | 2011-03-04 11:01:13 +0000 |
---|---|---|
committer | Robert Gemmell <robbie@apache.org> | 2011-03-04 11:01:13 +0000 |
commit | 2d61d79419442818cce5b58ff33db081c0a5d304 (patch) | |
tree | 1378a69b1b02861dd324326ef16b0c01522bb08a | |
parent | 8bb0075098258b003e5f13eb8cdd6122eea6ff2b (diff) | |
download | qpid-python-2d61d79419442818cce5b58ff33db081c0a5d304.tar.gz |
QPID-3110: unquote the key values for recieved Notifications to ensure they align with unquoted names used elsewhere in the console
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1077869 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/NotificationObject.java | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/NotificationObject.java b/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/NotificationObject.java index e42b3c53b6..35cc9f6e27 100644 --- a/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/NotificationObject.java +++ b/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/NotificationObject.java @@ -61,7 +61,7 @@ public class NotificationObject { if (_source instanceof ObjectName) { - return ((ObjectName)_source).getKeyProperty("name"); + return unquote(((ObjectName)_source).getKeyProperty("name")); } return null; @@ -71,12 +71,31 @@ public class NotificationObject { if (_source instanceof ObjectName) { - return ((ObjectName)_source).getKeyProperty(VIRTUAL_HOST); + return unquote(((ObjectName)_source).getKeyProperty(VIRTUAL_HOST)); } return null; } - + + private String unquote(String value) + { + if(value != null) + { + try + { + //if the value is quoted in the ObjectName, unquote it + value = ObjectName.unquote(value); + } + catch(IllegalArgumentException e) + { + //ignore, this just means the value is not quoted + //and can be left unchanged + } + } + + return value; + } + public String getMessage() { return _message; |