Remove null checks on previously dereferenced values, issue #778

Violations of Findbugs rule [RCN: Nullcheck of value previously dereferenced](http://findbugs.sourceforge.net/bugDescriptions.html#RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE) in class `BlockParentHandler` are fixed.
This commit is contained in:
Michal Kordas 2015-03-22 23:11:58 +01:00 committed by Roman Ivanov
parent 6cd514c9ac
commit 7138d731ce
1 changed files with 2 additions and 6 deletions

View File

@ -173,10 +173,7 @@ public class BlockParentHandler extends ExpressionHandler
final DetailAST lcurly = getLCurly();
final int lcurlyPos = expandedTabsColumnNo(lcurly);
if (lcurly == null
|| curlyLevel().accept(lcurlyPos)
|| !startsLine(lcurly))
{
if (curlyLevel().accept(lcurlyPos) || !startsLine(lcurly)) {
return;
}
@ -224,8 +221,7 @@ public class BlockParentHandler extends ExpressionHandler
final DetailAST rcurly = getRCurly();
final int rcurlyPos = expandedTabsColumnNo(rcurly);
if (rcurly == null
|| curlyLevel().accept(rcurlyPos)
if (curlyLevel().accept(rcurlyPos)
|| !rcurlyMustStart() && !startsLine(rcurly)
|| areOnSameLine(rcurly, lcurly))
{