Skip to content

Commit 51be57d

Browse files
simon-greatrixNSAmelchev
authored andcommitted
IGNITE-21032 Ensured all entries in AttributeList are Attributes (#11046)
(cherry picked from commit e7a35b1)
1 parent 4d53fc3 commit 51be57d

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

modules/core/src/main/java/org/apache/ignite/spi/metric/jmx/ReadOnlyDynamicMBean.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

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

20+
import java.util.List;
2021
import javax.management.Attribute;
2122
import javax.management.AttributeList;
2223
import javax.management.AttributeNotFoundException;
@@ -58,12 +59,16 @@ else if ("invoke".equals(actionName))
5859
/** {@inheritDoc} */
5960
@Override public AttributeList getAttributes(String[] attributes) {
6061
AttributeList list = new AttributeList();
62+
List<Attribute> attrList = list.asList();
6163

6264
try {
6365
for (String attribute : attributes) {
6466
Object val = getAttribute(attribute);
6567

66-
list.add(val);
68+
if (val instanceof Attribute)
69+
attrList.add((Attribute)val);
70+
else
71+
attrList.add(new Attribute(attr, val));
6772
}
6873

6974
return list;

0 commit comments

Comments
 (0)