diff --git a/pmd/regress/test/net/sourceforge/pmd/rules/design/LooseCouplingRuleTest.java b/pmd/regress/test/net/sourceforge/pmd/rules/design/LooseCouplingRuleTest.java index a86fd0c5d4..c0ea6adbef 100644 --- a/pmd/regress/test/net/sourceforge/pmd/rules/design/LooseCouplingRuleTest.java +++ b/pmd/regress/test/net/sourceforge/pmd/rules/design/LooseCouplingRuleTest.java @@ -44,4 +44,8 @@ public class LooseCouplingRuleTest extends RuleTst { public void test8() throws Throwable { runTest("LooseCoupling8.java", 1, rule); } + + public void testVector() throws Throwable { + runTest("LooseCoupling9.java", 1, rule); + } } diff --git a/pmd/src/net/sourceforge/pmd/rules/design/LooseCouplingRule.java b/pmd/src/net/sourceforge/pmd/rules/design/LooseCouplingRule.java index 8389e76d98..9266ca082d 100644 --- a/pmd/src/net/sourceforge/pmd/rules/design/LooseCouplingRule.java +++ b/pmd/src/net/sourceforge/pmd/rules/design/LooseCouplingRule.java @@ -27,6 +27,7 @@ public class LooseCouplingRule extends AbstractRule { implClassNames.add("LinkedHashSet"); implClassNames.add("TreeSet"); implClassNames.add("TreeMap"); + implClassNames.add("Vector"); implClassNames.add("java.util.HashSet"); implClassNames.add("java.util.HashMap"); implClassNames.add("java.util.ArrayList"); @@ -35,6 +36,7 @@ public class LooseCouplingRule extends AbstractRule { implClassNames.add("java.util.LinkedHashSet"); implClassNames.add("java.util.TreeSet"); implClassNames.add("java.util.TreeMap"); + implClassNames.add("java.util.Vector"); } public Object visit(ASTName node, Object data) { diff --git a/pmd/test-data/LooseCoupling9.java b/pmd/test-data/LooseCoupling9.java new file mode 100644 index 0000000000..4f9886a4b6 --- /dev/null +++ b/pmd/test-data/LooseCoupling9.java @@ -0,0 +1,4 @@ +import java.util.*; +public class LooseCoupling9 { + public void foo(Vector bar) {} +}