diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryBoxingRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryBoxingRule.java index 20adcb7e36..603854b411 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryBoxingRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryBoxingRule.java @@ -176,10 +176,7 @@ public class UnnecessaryBoxingRule extends AbstractJavaRulechainRule { private boolean isObjectConversionNecessary(ASTExpression e) { JavaNode parent = e.getParent(); - if (e.getIndexInParent() == 0) { - return parent instanceof QualifiableExpression; - } - return false; + return e.getIndexInParent() == 0 && parent instanceof QualifiableExpression; }