You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sk...@apache.org on 2023/12/14 08:55:37 UTC

(ignite) branch master updated: IGNITE-21032 Ensured all entries in AttributeList are Attributes (#11046)

This is an automated email from the ASF dual-hosted git repository.

sk0x50 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
     new e7a35b198ae IGNITE-21032 Ensured all entries in AttributeList are Attributes (#11046)
e7a35b198ae is described below

commit e7a35b198ae684ac0073608d985fefb3cd7e02db
Author: Simon Greatrix <si...@pippsford.com>
AuthorDate: Thu Dec 14 08:55:30 2023 +0000

    IGNITE-21032 Ensured all entries in AttributeList are Attributes (#11046)
---
 .../org/apache/ignite/spi/metric/jmx/ReadOnlyDynamicMBean.java     | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/modules/core/src/main/java/org/apache/ignite/spi/metric/jmx/ReadOnlyDynamicMBean.java b/modules/core/src/main/java/org/apache/ignite/spi/metric/jmx/ReadOnlyDynamicMBean.java
index e59763064ab..9a8cd5f2625 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/metric/jmx/ReadOnlyDynamicMBean.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/metric/jmx/ReadOnlyDynamicMBean.java
@@ -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;
@@ -58,12 +59,16 @@ public abstract class ReadOnlyDynamicMBean implements DynamicMBean {
     /** {@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;