JMXWrapper icon indicating copy to clipboard operation
JMXWrapper copied to clipboard

Read/Write Attributes are sorted incorrectly if sortValue is present only on the getter or setter.

Open BlazingTwist opened this issue 1 year ago • 0 comments

https://github.com/uklimaschewski/JMXWrapper/blob/80fad1cb25a7af68ba412c298ca11e7edc979eca/src/com/udojava/jmx/wrapper/JMXBeanWrapper.java#L637 and https://github.com/uklimaschewski/JMXWrapper/blob/80fad1cb25a7af68ba412c298ca11e7edc979eca/src/com/udojava/jmx/wrapper/JMXBeanWrapper.java#L653

The description is updated if the annotation without a description is found first. However the sortValue is not updated.

Example

      @JMXBean(sorted=true)
      public class MyBean {
          int level = 0;
  
          @JMXBeanAttribute(descriptionKey="levelDescription", sortValue="1")
          public int getLevel() {
              return level;
          }

          @JMXBeanAttribute()
          public void setLevel(int level) {
              this.level = level;
          }
          
          @JMXBeanOperation(sortValue="2")
          public String methodX(String p1) {
              return p1;
          }
      }

will sometimes sort correctly (1, 2) or incorrectly (2, level) depending on which Method is processed first.

BlazingTwist avatar Aug 09 '24 13:08 BlazingTwist