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

Avoid instantiating Boolean objects; reference Boolean.TRUE or Boolean.FALSE or call Boolean.valueOf() instead. #424

Closed
carlwilson opened this issue Mar 26, 2019 · 2 comments
Assignees
Labels
bug A product defect that needs fixing P3 Low priority bugs

Comments

@carlwilson
Copy link
Member

carlwilson commented Mar 26, 2019

There are seven occurrences of this issue.
Why is this an issue?
Since: PMD 1.2

Avoid instantiating Boolean objects; you can reference Boolean.TRUE, Boolean.FALSE, or call Boolean.valueOf() instead.

Example(s):

Boolean bar = new Boolean("true");		// unnecessary creation, just reference Boolean.TRUE;
Boolean buz = Boolean.valueOf(false);	// ...., just reference Boolean.FALSE;

The full list of occurrences can be found here on Codacy

@carlwilson carlwilson added bug A product defect that needs fixing P3 Low priority bugs labels Mar 26, 2019
@carlwilson
Copy link
Member Author

Hi @nvanderperren this is just a quick one really and not my final choice for you. I needed a quick choice as I have to drive to an office now. I suspect it won’t take long and I’ll be ready with another issue in a couple of hours.

@carlwilson
Copy link
Member Author

Closed by #444

@carlwilson carlwilson removed this from the Hack week tasks milestone Apr 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A product defect that needs fixing P3 Low priority bugs
Projects
None yet
Development

No branches or pull requests

2 participants