question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

JobBuilder#enableJmx(boolean) method should not take a parameter

See original GitHub issue

The 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:closed
  • Created 6 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
fmbenhassinecommented, Nov 10, 2017

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) or setEnableJmx(boolean) are not that bad in the end:

So I will revert the change and stick with the previous enableJmx(boolean) method.

0reactions
DanieleS82commented, Nov 10, 2017

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”.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found