Skip to content

Commit

Permalink
IGNITE-21032 Ensured all entries in AttributeList are Attributes (#11046
Browse files Browse the repository at this point in the history
)
  • Loading branch information
simon-greatrix authored Dec 14, 2023
1 parent b240ce3 commit e7a35b1
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package org.apache.ignite.spi.metric.jmx;

import java.util.List;
import javax.management.Attribute;
import javax.management.AttributeList;
import javax.management.AttributeNotFoundException;
Expand Down Expand Up @@ -58,12 +59,16 @@ else if ("invoke".equals(actionName))
/** {@inheritDoc} */
@Override public AttributeList getAttributes(String[] attributes) {
AttributeList list = new AttributeList();
List<Attribute> attrList = list.asList();

try {
for (String attr : attributes) {
Object val = getAttribute(attr);

list.add(val);
if (val instanceof Attribute)
attrList.add((Attribute)val);
else
attrList.add(new Attribute(attr, val));
}

return list;
Expand Down

0 comments on commit e7a35b1

Please sign in to comment.