From 3d6c544b83202e009af802cb8cea448f9947815c Mon Sep 17 00:00:00 2001 From: Miguel Griffa Date: Fri, 21 Jan 2005 14:35:51 +0000 Subject: [PATCH] added test case for rule that seems to work but an NPE stack trace is seen... git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@3182 51baf565-9d33-0410-a72c-fc3788e3496d --- .../pmd/rules/AvoidReassigningParametersTest.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pmd/regress/test/net/sourceforge/pmd/rules/AvoidReassigningParametersTest.java b/pmd/regress/test/net/sourceforge/pmd/rules/AvoidReassigningParametersTest.java index f36cbc0569..3eff4c728b 100644 --- a/pmd/regress/test/net/sourceforge/pmd/rules/AvoidReassigningParametersTest.java +++ b/pmd/regress/test/net/sourceforge/pmd/rules/AvoidReassigningParametersTest.java @@ -26,6 +26,7 @@ public class AvoidReassigningParametersTest extends SimpleAggregatorTst { new TestDescriptor(TEST5, "qualified name same as parameter", 0, rule), new TestDescriptor(TEST6, "assignment to parameter public field", 0, rule), new TestDescriptor(TEST7, "assignment to array parameter slot", 0, rule), + new TestDescriptor(TEST8, "TEST8", 1, rule), }); } @@ -81,4 +82,15 @@ public class AvoidReassigningParametersTest extends SimpleAggregatorTst { " bar[0] = 2;" + PMD.EOL + " }" + PMD.EOL + "}"; + + public static final String TEST8 = + "public class Foo {" + PMD.EOL + + " void foo(int x) {" + PMD.EOL + + " try {" + PMD.EOL + + " x = 2;" + PMD.EOL + + " } catch (Throwable t) { " + PMD.EOL + + " } " + PMD.EOL + + " }" + PMD.EOL + + "}"; + }