Primitive Boolean expression used in FileTarget.java#555
Primitive Boolean expression used in FileTarget.java#555tanmaysharma2001 wants to merge 1 commit into
Conversation
|
@yegor256 Can you review and merge this PR? |
|
@tanmaysharma2001 what is the point of this modification? |
|
@yegor256 In the issue #554, as we discussed that in cases where this.overwrite is null, attempting to evaluate it in a boolean context (if (this.overwrite)) will throw a NullPointerException, which can lead to unexpected crashes or behavior. Having a primitive Boolean Expression, properly evaluates it, in case where it is null, it will be treated in the 'else' condition making it much safer against these exceptions. |
@tanmaysharma2001 Also using static variables is the heresy in the Elegant Object ideology |
|
@tanmaysharma2001 before making a fix, we must introduce a unit test, which will reproduce the error |
Closes #554