JMXWrapper
JMXWrapper copied to clipboard
Read/Write Attributes are sorted incorrectly if sortValue is present only on the getter or setter.
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.