##### Overview

- Download PMD 3.9
- What's new in PMD 3.9
- PMD in the news
- PMD-related products and books
- Best practices
- Future directions
- Similar projects
- Credits
- License
- What does 'PMD' mean?

##### Usage

- Installation
- Command line usage
- Ant task usage
- Maven plugin usage
- IDE plugin usage
- Suppressing warnings
- Finding duplicated code
- JSP support

##### Customizing PMD

- Compiling PMD
- How to write a rule
- Writing XPath rules
- How to make a rule set
- How it works

##### For example

- Run PMD on a Sourceforge project

##### Rule Sets

- Index
- Basic
- Braces
- Code Size
- Clone
- Controversial
- Coupling
- Design
- Finalizers
- Import Statements
- J2EE
- Javabeans
- JUnit Tests
- Logging (Java)
- Logging (Jakarta)
- Migrating
- Naming
- Optimizations
- Strict Exceptions
- Strings
- Sun Security
- Unused Code
- Java Server Pages
- Java Server Faces

##### Project Documentation

- About PMD
- Project Info
- Project Reports
- Development Process

## Type Resolution Rules

These are rules which resolve java Class files for comparisson, as opposed to a String

### LooseCoupling

Avoid using implementation types (i.e., HashSet); use the interface (i.e, Set) instead

This rule is defined by the following Java class: net.sourceforge.pmd.typeresolution.rules.LooseCoupling

Here's an example of code that would trigger this rule:

    import java.util.ArrayList;
    import java.util.HashSet;
    public class Bar {
     // Use List instead
     private ArrayList list = new ArrayList();
     // Use Set instead
     public HashSet getFoo() {
      return new HashSet();
     }
    }

### CloneMethodMustImplementCloneable

The method clone() should only be implemented if the class implements the Cloneable interface with the exception of a final method that only throws CloneNotSupportedException. This version uses PMD's type resolution facilities, and can detect if the class implements or extends a Cloneable class

This rule is defined by the following Java class: net.sourceforge.pmd.typeresolution.rules.CloneMethodMustImplementCloneable

Here's an example of code that would trigger this rule:

    public class MyClass {
     public Object clone() throws CloneNotSupportedException {
      return foo;
     }
    }