From ed18c9d746a815f29c6d7a311d3f74d0f5a5e878 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Thu, 16 May 2024 13:52:29 +0200 Subject: [PATCH] Fix PMD warning --- .../pmd/lang/java/rule/codestyle/UnnecessaryBoxingRule.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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; }