From 4352b53aece5d18c07c8778f8f1e1dc17a28cc00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Sun, 18 Aug 2024 19:40:51 -0300 Subject: [PATCH] Add tests regarding array accesses --- .../bestpractices/xml/GuardLogStatement.xml | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/GuardLogStatement.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/GuardLogStatement.xml index 23909014e3..f2f91314b8 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/GuardLogStatement.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/GuardLogStatement.xml @@ -619,6 +619,51 @@ public class GuardLogStatementTest { this ); } +} + ]]> + + + + #5153 array access to constants do not require guards + 0 + + + + + #5153 array access to method returned values require guards + 1 +