Skip to content

ReadMe Getter/Setter example does not work correctly. #23

@BlazingTwist

Description

@BlazingTwist

The readme example:

 @JMXBean(description = "My first JMX bean test")
 public class MyBean {
 	int level = 0;
 
 	@JMXBeanAttribute(name = "Floor Level", description = "The current floor level")
 	public int getLevel() {
 		return level;
 	}
 
 	@JMXBeanAttribute
 	public void setLevel(int newLevel) {
 		level = newLevel;
 	}
 }

Creates two distinct attributes instead of correctly matching getter and setter:
image

To blame are these lines:

BeanAttribute att = beanAttributes.get(name);

BeanAttribute att = beanAttributes.get(name);

Intuitively, the method name should always be used to match getters and setters.
(I may be biased by my reliance on IntelliJs boilerplate generation here)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions