-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[attribute][complex] extend to java.util.Map
#130
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 as long as you can confirm it works well ;)
@@ -34,7 +34,7 @@ private void populateSubAttributeList(Object attributeValue) { | |||
for (String key : data.getCompositeType().keySet()) { | |||
this.subAttributeList.put(key, new HashMap<String, Object>()); | |||
} | |||
} else if ("java.util.HashMap".equals(attributeType)) { | |||
} else if (("java.util.HashMap".equals(attributeType)) || ("java.util.Map".equals(attributeType))){ | |||
HashMap<String, Double> data = (HashMap<String, Double>) attributeValue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this cast will work in the general case when the underlying attributeValue
object is not a HashMap.
Have you tested this with a non-HashMap
Map
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(we could probably just cast attributeValue
to a Map
right?)
same applies to your change line 86
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right it should stay a Map
Add `java.util.Map` to the list of supported `JMXComplexAttribute` types.
Add
java.util.Map
to the list of supportedJMXComplexAttribute
types.
Fix #125