Skip to content

Conversation

@BCcjeris
Copy link

@BCcjeris BCcjeris commented Jun 4, 2012

When create-bean is used according to the documentation, that is, with a ref to a map whose keys are attribute names and whose values are simple attribute values (e.g., (create-bean (ref {:success 0}))), the resulting object has a .getAttribute method that yields the simple attribute value, rather than a javax.management.Attribute object. This means that trying to add the attributes into an AttributeList causes a ClassCastException.

This commit attempts to fix this bug by wrapping the result of .getAttribute in a javax.management.Attribute. However, then jmx/read returns the Attribute where you'd expect it to return the simple value, so I added an implementation of objects->data for Attributes. The tests pass, and it works for my case, but I do not know whether that is the correct approach in general.

…ute method (conforming to java interface), and change bean reading accordingly to unwrap Attribute wrappers.
@nickmbailey
Copy link
Member

@BCcjeris, unfortunately clojure can't accept pull requests for contributions. Additionally there is a little bit of process involved before contributing. See http://clojure.org/contributing.

Would you consider submitting a CA and adding a patch to jira?

@BCcjeris
Copy link
Author

Thanks for pointing me in the right direction -- sorry for the trouble! I will see if I can get all the legal stuff pointing in the right direction and then re-submit.

@BCcjeris BCcjeris closed this Jun 11, 2012
@nickmbailey
Copy link
Member

fwiw, i think this bug/fix is correct. java 1.6 (and i guess some vendor specific versions of 1.5) have an 'add(Object obj)' version of the add method on AttributeList which is somewhat strange and why the tests weren't already breaking.

looking forward to a patch on jira.

@nickmbailey
Copy link
Member

@BCcjeris wanted to check in and see if you still had plans to submit this patch through jira?

@BCcjeris
Copy link
Author

BCcjeris commented Jul 9, 2012

Yes, I do; the Contributor Agreement is still working its way through legal review. Sorry for the delay. I hope to be able to submit it properly soon.

@nickmbailey
Copy link
Member

Great, no problems at all. Just wanted to double check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants