diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryCast.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryCast.xml index 03187c266c..8878e19adf 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryCast.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryCast.xml @@ -120,6 +120,19 @@ public class UnnecessaryCastSample { Map map = new HashMap<>(); String dataFromMap = (String) map.get("foo"); } +} + ]]> + + + + Avoid clone false-positive + 0 + strings = new ArrayList<>(); + List copy = (List) strings.clone(); + } } ]]>