TRUE/FALSE_RETURNS at odds with NAB_NEEDLESS_BOOLEAN_CONSTANT_CONVERSION from fb-contrib
See original GitHub issueWith Pitest 1.7.2:
Given
Boolean getValue() {
return Boolean.TRUE;
}
the TRUE_RETURNS
mutator will produce the mutation
Boolean getValue() {
return true;
}
which will always survive as the true
will be auto-boxed to a Boolean
instance (unless we’re testing Boolean instance identity, which seems pointless). The problem is that changing the production code to match the mutation is at odds with the NAB_NEEDLESS_BOOLEAN_CONSTANT_CONVERSION
bug type from fb-contrib (See http://fb-contrib.sourceforge.net/bugdescriptions.html).
I might be missing some edge case here, but I think that the TRUE_RETURNS
mutator shouldn’t try to return true
in lieu of Boolean.TRUE
, due to the auto-boxing. I’d be happy to understand if it is indeed a relevant case.
The corresponding argument can be made for FALSE_RETURNS
, of course.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Booleans - Manual - PHP
The bool type only has two values, and is used to express a truth value. It can be either true or false ....
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 FreeTop 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
Top GitHub Comments
This repo has 2 response times: 3 years or 3 days.
I think you decreased the average response time with this one 😃