JobBuilder#enableJmx(boolean) method should not take a parameter
See original GitHub issueThe enableJmx parameter is false by default.
According to the method org.easybatch.core.job.JobBuilder#enableJmx(boolean) name, JMX monitoring will be set (so no need to specify enableJmx(true)). Hence, this method should not take a parameter.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Avoid Passing Booleans to Functions - Alex Kondov
So a common approach is to pass a boolean parameter, also known as a flag. While this may be initially convenient it is...
Read more >Is it wrong to use a boolean parameter to determine behavior?
using a boolean variable to a method and 2. using a variable (boolean or not) to determine behavior. The first part shows a...
Read more >Clean code: The curse of a boolean parameter | by Alex Curran
The main issue with a method which has a boolean parameter is that it forces the method body to handle logic it should...
Read more >What is wrong with boolean parameters?
To put it short: boolean arguments are the easy way to make the feature work. But we should not stop here. We have...
Read more >Writing a Junit test for a boolean method with no parameters
I have a class where I want to write a junit test for. This method has no parameters, can this method accordingly?
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Indeed, nothing wrong, just more code for the client in the end (which we don’t want!).
Looking at how some other open source projects deal with that, I find that
enableJmx(boolean)orsetEnableJmx(boolean)are not that bad in the end:eclipse kura
apache james
apache camel
So I will revert the change and stick with the previous
enableJmx(boolean)method.It’s not wrong, it’s only for “elegance” because providing the setter method, you can write a single inline instruction to configure the JobBuilerd but more important, you save a “if”.