Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
BlazingTwist opened this issue Aug 9, 2024 · 0 comments
Open

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

BlazingTwist opened this issue Aug 9, 2024 · 0 comments

Comments

@BlazingTwist
Copy link

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant