Skip to content

Commit

Permalink
javaJmx#setAttribute passing className bug parameter fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
zuazo committed May 13, 2013
1 parent 488be29 commit cf41408
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/javaJmx.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,13 @@ JavaJmx.prototype.setAttribute = function(mbean, attributeName, value, className
var self = this;

if (typeof classNameOrCallback === "string" && !conversions.isJavaPrimitiveClass(classNameOrCallback)) {
java.newInstance(classNameOrCallback, value, function(obj) {
var newInstanceArgs = [ classNameOrCallback ];
newInstanceArgs = newInstanceArgs.concat(value);
newInstanceArgs.push(function(err, obj) {
if (checkError(err, self)) return;
setAttribute.call(self, mbean, attributeName, obj, callback);
});
java.newInstance.apply(java, newInstanceArgs);
} else {
if (typeof callback === "undefined") {
callback = classNameOrCallback;
Expand Down

0 comments on commit cf41408

Please sign in to comment.