You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ro...@apache.org on 2011/03/04 12:01:14 UTC
svn commit: r1077869 -
/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/NotificationObject.java
Author: robbie
Date: Fri Mar 4 11:01:13 2011
New Revision: 1077869
URL: http://svn.apache.org/viewvc?rev=1077869&view=rev
Log:
QPID-3110: unquote the key values for recieved Notifications to ensure they align with unquoted names used elsewhere in the console
Modified:
qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/NotificationObject.java
Modified: qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/NotificationObject.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/NotificationObject.java?rev=1077869&r1=1077868&r2=1077869&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/NotificationObject.java (original)
+++ qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/NotificationObject.java Fri Mar 4 11:01:13 2011
@@ -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;
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org