The smartics PMD configuration

The documented PMD configuration file content (Download houserules.xml).

<ruleset xmlns="http://pmd.sf.net/ruleset/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="smartics" xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd" xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd">
  <description>Rulessets used for smartics projects.</description>

  <exclude-pattern>.*/target/.*</exclude-pattern>

  <!-- Basic -->
  <!-- http://pmd.sourceforge.net/rules/java/basic.html  -->
  <rule ref="rulesets/java/basic.xml/EmptyCatchBlock">
    <properties>
      <property name="allowCommentedBlocks" value="true"/>
    </properties>
  </rule>
  <rule ref="rulesets/java/basic.xml/EmptyIfStmt"/>
  <rule ref="rulesets/java/basic.xml/EmptyWhileStmt"/>
  <rule ref="rulesets/java/basic.xml/EmptyTryBlock"/>
  <rule ref="rulesets/java/basic.xml/EmptyFinallyBlock"/>
  <rule ref="rulesets/java/basic.xml/EmptySwitchStatements"/>
  <rule ref="rulesets/java/basic.xml/JumbledIncrementer"/>
  <rule ref="rulesets/java/basic.xml/ForLoopShouldBeWhileLoop"/>
  <rule ref="rulesets/java/basic.xml/UnnecessaryConversionTemporary"/>
  <rule ref="rulesets/java/basic.xml/OverrideBothEqualsAndHashcode"/>
  <rule ref="rulesets/java/basic.xml/DoubleCheckedLocking"/>
  <rule ref="rulesets/java/basic.xml/ReturnFromFinallyBlock"/>
  <rule ref="rulesets/java/basic.xml/EmptySynchronizedBlock"/>
  <rule ref="rulesets/java/basic.xml/UnnecessaryReturn"/>
  <rule ref="rulesets/java/basic.xml/EmptyStaticInitializer"/>
  <!--
    We use UnconditionalIfStatement to warn their use in production
    code...
  -->
  <rule ref="rulesets/java/basic.xml/UnconditionalIfStatement"/>
  <rule ref="rulesets/java/basic.xml/EmptyStatementNotInLoop"/>
  <rule ref="rulesets/java/basic.xml/BooleanInstantiation"/>
  <rule ref="rulesets/java/basic.xml/UnnecessaryFinalModifier"/>
  <rule ref="rulesets/java/basic.xml/CollapsibleIfStatements"/>
  <rule ref="rulesets/java/basic.xml/UselessOverridingMethod"/>
  <rule ref="rulesets/java/basic.xml/ClassCastExceptionWithToArray"/>
  <rule ref="rulesets/java/basic.xml/AvoidDecimalLiteralsInBigDecimalConstructor"/>
  <rule ref="rulesets/java/basic.xml/UselessOperationOnImmutable"/>
  <rule ref="rulesets/java/basic.xml/MisplacedNullCheck"/>
  <rule ref="rulesets/java/basic.xml/UnusedNullCheckInEquals"/>
  <rule ref="rulesets/java/basic.xml/AvoidThreadGroup"/>
  <rule ref="rulesets/java/basic.xml/BrokenNullCheck"/>
  <rule ref="rulesets/java/basic.xml/BigIntegerInstantiation"/>
  <rule ref="rulesets/java/basic.xml/AvoidUsingOctalValues"/>
  <rule ref="rulesets/java/basic.xml/AvoidUsingHardCodedIP"/>
  <rule ref="rulesets/java/basic.xml/CheckResultSet"/>
  <rule ref="rulesets/java/basic.xml/AvoidMultipleUnaryOperators"/>
  <!--
    not yet supported by maven-pmd-plugin-2.4... <rule
    ref="rulesets/java/basic.xml/EmptyInitializer" />
  -->

  <!-- Braces -->
  <!-- http://pmd.sourceforge.net/rules/java/braces.html -->
  <rule ref="rulesets/java/braces.xml/IfStmtsMustUseBraces"/>
  <rule ref="rulesets/java/braces.xml/WhileLoopsMustUseBraces"/>
  <rule ref="rulesets/java/braces.xml/IfElseStmtsMustUseBraces"/>
  <rule ref="rulesets/java/braces.xml/ForLoopsMustUseBraces"/>


  <!-- Code Size -->
  <!-- http://pmd.sourceforge.net/rules/java/codesize.html -->
  <rule ref="rulesets/java/codesize.xml/NPathComplexity"/>
  <!--
    This goes with Robert Martin's rule (Clean Code p.34). Unfortunately
    this rule also counts comments and empty lines. So we rely on the
    checkstyle rule and rules checking for NCSS.
  -->
  <!-- Duplicate of a checkstyle rule: MethodLength
    <rule ref="rulesets/java/codesize.xml/ExcessiveMethodLength">
      <properties>
        <property name="minimum" value="40" />
      </properties>
    </rule>
  -->
  <!-- Duplicate of a Checkstyle rule: ParameterNumber
  <rule ref="rulesets/java/codesize.xml/ExcessiveParameterList">
    <properties>
      <property name="minimum" value="6" />
    </properties>
  </rule>
   -->

  <!-- Duplicate of Checkstyle rule: JavaNCSS#fileMaximum
  <rule ref="rulesets/java/codesize.xml/ExcessiveClassLength">
    <properties>
      <property name="minimum" value="1500" />
    </properties>
  </rule> -->
  <!-- Duplicate of Checkstyle rule: CyclomaticComplexity
  <rule ref="rulesets/java/codesize.xml/CyclomaticComplexity">
    <properties>
      <property name="reportLevel" value="8" />
    </properties>
  </rule> -->
  <rule ref="rulesets/java/codesize.xml/ExcessivePublicCount"/>
  <rule ref="rulesets/java/codesize.xml/TooManyFields"/>
  <!-- Duplicate of Checkstyle rule: MethodLength#max
       Identical to codesize.xml/ExcessiveMethodLength.
  <rule ref="rulesets/java/codesize.xml/NcssMethodCount">
    <properties>
      <property
        name="minimum"
        value="40" />
    </properties>
  </rule> -->
  <!-- Duplicate of Checkstyle rule: JavaNCSS#classMaximum
       codesize.xml/ExcessiveClassLength includes comments.
  <rule ref="rulesets/java/codesize.xml/NcssTypeCount">
    <properties>
      <property
        name="minimum"
        value="1000" />
    </properties>
  </rule> -->
  <rule ref="rulesets/java/codesize.xml/NcssConstructorCount">
    <!-- Identical to codesize.xml/NcssMethodCount. -->
    <properties>
      <property name="minimum" value="40"/>
    </properties>
  </rule>
  <rule ref="rulesets/java/codesize.xml/TooManyMethods"/>


  <!-- Clone implementation -->
  <!-- http://pmd.sourceforge.net/rules/java/clone.html -->
  <rule ref="rulesets/java/clone.xml/ProperCloneImplementation"/>
  <rule ref="rulesets/java/clone.xml/CloneThrowsCloneNotSupportedException"/>
  <rule ref="rulesets/java/clone.xml/CloneMethodMustImplementCloneable"/>


  <!-- Controversial -->
  <!-- http://pmd.sourceforge.net/rules/java/controversial.html -->
  <!--
    We allow the default constructor to be explicitly stated. This makes
    it less problematic for extensions where constructors are added and
    break subclasses that rely on a constructor with no arguments to be
    present.
  -->
  <!--
    <rule ref="rulesets/java/controversial.xml/UnnecessaryConstructor" />
  -->
  <!--
    We encourage the setting to 'null' as a means to indicate garbage
    collection. Furthermore we often set references to 'null' in the tear
    down of unit tests.
  -->
  <!--
    <rule ref="rulesets/java/controversial.xml/NullAssignment" />
  -->
  <!--
    Although having only one return may make the code clearer, but there
    are times where breaking this rule really makes sense. Therefore we
    regard one return statement as a guide line and not a hard rule to be
    checked.
  -->
  <!--
    <rule ref="rulesets/java/controversial.xml/OnlyOneReturn" />
  -->
  <rule ref="rulesets/java/controversial.xml/AssignmentInOperand"/>
  <!-- Classes are allowed to use the default constructor.
  <rule ref="rulesets/java/controversial.xml/AtLeastOneConstructor" />
   -->
  <rule ref="rulesets/java/controversial.xml/DontImportSun"/>
  <rule ref="rulesets/java/controversial.xml/SuspiciousOctalEscape"/>
  <!--
    We do not require to place a call to the super constructor that is
    implicit.
  -->
  <!--
    <rule ref="rulesets/java/controversial.xml/CallSuperInConstructor" />
  -->
  <!-- We allow any parenthesis to make the code clearer. -->
  <!--
    <rule ref="rulesets/java/controversial.xml/UnnecessaryParentheses" />
  -->

  <!-- It is sometimes intended to have a class or method invisble outside the
       package to keep the API clean.
  <rule ref="rulesets/java/controversial.xml/DefaultPackage" />
   -->

  <!--
    We do not think that the performance gain is a good trade of for the
    readability of the code.
  -->
  <!--
    <rule ref="rulesets/java/controversial.xml/BooleanInversion" />
  -->
  <!-- We see no gain in this rule.
  <rule ref="rulesets/java/controversial.xml/DataflowAnomalyAnalysis" />
   -->
  <!--
    Local variables should always be declared final.
   -->
  <!--
    <rule ref="rulesets/java/controversial.xml/AvoidFinalLocalVariable" />
  -->
  <rule ref="rulesets/java/controversial.xml/AvoidUsingShortType"/>
  <!--
    We consider using volatile necessary.
   -->
  <!--
    <rule ref="rulesets/java/controversial.xml/AvoidUsingVolatile" />
  -->
  <!--
    We consider using native code as a tool to be considered carefully,
    yet to be considered.
  -->
  <!--
    <rule ref="rulesets/java/controversial.xml/AvoidUsingNativeCode" />
  -->
  <!--
    In code using reflection this may be necessary and therefore we do not
    want to have a strict rule for this. Nonetheless we think that
    reflection should be avoided where other means yield the same result.
  -->
  <!--
    <rule ref="rulesets/java/controversial.xml/AvoidAccessibilityAlteration" />
  -->
  <!--
    We see the call for garbage collection as a hint and trust the
    programmer to know what s/he does.
  -->
  <!--
    <rule
    ref="rulesets/java/controversial.xml/DoNotCallGarbageCollectionExplicitly"
    />
  -->


  <!-- Coupling -->
  <!-- http://pmd.sourceforge.net/rules/java/coupling.html -->
  <rule ref="rulesets/java/coupling.xml/CouplingBetweenObjects"/>
  <rule ref="rulesets/java/coupling.xml/ExcessiveImports">
    <properties>
      <!--
        We do not see the number of imports to problematic. Still we want to
        get hinted to a possible problem.
      -->
      <property name="minimum" value="50"/>
    </properties>
  </rule>
  <rule ref="rulesets/java/coupling.xml/LooseCoupling"/>


  <!-- Design -->
  <!-- http://pmd.sourceforge.net/rules/java/design.html -->
  <rule ref="rulesets/java/design.xml/UseSingleton"/>
  <rule ref="rulesets/java/design.xml/SimplifyBooleanReturns"/>
  <rule ref="rulesets/java/design.xml/SimplifyBooleanExpressions"/>
  <rule ref="rulesets/java/design.xml/SwitchStmtsShouldHaveDefault"/>
  <rule ref="rulesets/java/design.xml/AvoidDeeplyNestedIfStmts"/>
  <rule ref="rulesets/java/design.xml/AvoidReassigningParameters"/>
  <rule ref="rulesets/java/design.xml/SwitchDensity"/>
  <rule ref="rulesets/java/design.xml/ConstructorCallsOverridableMethod"/>
  <!-- Our builder pattern demands this to be commented out.
  <rule ref="rulesets/java/design.xml/AccessorClassGeneration" />
   -->
  <rule ref="rulesets/java/design.xml/FinalFieldCouldBeStatic"/>
  <!--  Unfortunately the rule finds also non-sql classes.
        Statements are not all closeable, so we make it explicit, but
        unfortunately the rule only matches the declared type without a real
        resolution. Effectively this rule will not find statements, etc., if
        imports are used.
         http://pmd.sourceforge.net/rules/java/design.html#CloseResource
         http://tasks.smartics.de/show_bug.cgi?id=490
   -->
  <rule ref="rulesets/java/design.xml/CloseResource">
    <properties>
      <property name="types" value="java.sql.Connection,java.sql.Statement,java.sql.ResultSet"/>
    </properties>
  </rule>
  <rule ref="rulesets/java/design.xml/NonStaticInitializer"/>
  <rule ref="rulesets/java/design.xml/DefaultLabelNotLastInSwitchStmt"/>
  <rule ref="rulesets/java/design.xml/NonCaseLabelInSwitchStatement"/>
  <rule ref="rulesets/java/design.xml/OptimizableToArrayCall"/>
  <rule ref="rulesets/java/design.xml/BadComparison"/>
  <rule ref="rulesets/java/design.xml/EqualsNull"/>
  <!-- We do not bother with the ternary operator. -->
  <!--
     <rule ref="rulesets/java/design.xml/ConfusingTernary" />
    -->
  <rule ref="rulesets/java/design.xml/InstantiationToGetClass"/>
  <rule ref="rulesets/java/design.xml/IdempotentOperations"/>
  <rule ref="rulesets/java/design.xml/SimpleDateFormatNeedsLocale"/>
  <rule ref="rulesets/java/design.xml/ImmutableField"/>
  <rule ref="rulesets/java/design.xml/UseLocaleWithCaseConversions"/>
  <rule ref="rulesets/java/design.xml/AvoidProtectedFieldInFinalClass"/>
  <rule ref="rulesets/java/design.xml/AssignmentToNonFinalStatic"/>
  <!-- A class that has private constructors and does not have any static
       methods or fields usually uses the builder pattern. Therefore we skip
       this checker.
  <rule ref="rulesets/java/design.xml/MissingStaticMethodInNonInstantiatableClass" />
   -->
  <!--
    If the whole body should be synchronized using the synchronized
    modifier is more readable. The modifier is also automatically visible
    in the API documentation. Therefore we see this rule as a guide line
    but not as a rule.
  -->
  <!--
    <rule ref="rulesets/java/design.xml/AvoidSynchronizedAtMethodLevel" />
  -->
  <rule ref="rulesets/java/design.xml/MissingBreakInSwitch"/>
  <!--
    If you know what you are doing, notify will be enough. <rule
    ref="rulesets/java/design.xml/UseNotifyAllInsteadOfNotify" />
  -->
  <rule ref="rulesets/java/design.xml/AvoidInstanceofChecksInCatchClause"/>
  <!--
    We think that declaring a class as abstract is a design decision not
    an implementation aspect. So it is reasonable to declare classes
    abstract even if they do not provide abstract methods. In addition to
    that abstract classes may provide default implementation for protected
    methods that may or may not be overridden by subclasses.
    <rule ref="rulesets/java/design.xml/AbstractClassWithoutAbstractMethod" />
  -->
  <rule ref="rulesets/java/design.xml/SimplifyConditional"/>
  <rule ref="rulesets/java/design.xml/CompareObjectsWithEquals"/>
  <rule ref="rulesets/java/design.xml/PositionLiteralsFirstInComparisons"/>
  <!--
    It may be more verbose to give the value to be returned a name. We
    expect the compiler to make any optimaizations that may be applied.
    Therfore we allow setting a local variable to a value to be returned.
  -->
  <!--
    <rule ref="rulesets/java/design.xml/UnnecessaryLocalBeforeReturn" />
  -->
  <rule ref="rulesets/java/design.xml/NonThreadSafeSingleton"/>

  <!-- Empty methods may provide a no-op implementation that can be
       overridden by subclasses. It is annoying to repeat the comments from
       the Javadoc to the body.
  <rule ref="rulesets/java/design.xml/UncommentedEmptyMethod" />
  -->
  <!--
    The empty constructor is often the default constructor that is
    specified to state that the default constructor is supported.
    Therefore there is no need to document that. It would only make sense
    if we forbid stating the default constructor, but we want to make it
    explicit.
  -->
  <!--
    <rule ref="rulesets/java/design.xml/UncommentedEmptyConstructor" />
  -->
  <rule ref="rulesets/java/design.xml/AvoidConstantsInterface"/>
  <rule ref="rulesets/java/design.xml/UnsynchronizedStaticDateFormatter"/>
  <rule ref="rulesets/java/design.xml/PreserveStackTrace"/>
  <rule ref="rulesets/java/design.xml/UseCollectionIsEmpty"/>
  <rule ref="rulesets/java/design.xml/ClassWithOnlyPrivateConstructorsShouldBeFinal"/>
  <!--
    We think that an empty method may be a proper default behaviour for an
    abstract class.
  -->
  <!--
    <rule
    ref="rulesets/java/design.xml/EmptyMethodInAbstractClassShouldBeAbstract"
    />
  -->
  <rule ref="rulesets/java/design.xml/SingularField"/>
  <rule ref="rulesets/java/design.xml/ReturnEmptyArrayRatherThanNull"/>
  <rule ref="rulesets/java/design.xml/AbstractClassWithoutAnyMethod"/>
  <!--
    It is the responsibility of the programmer to know what is more
    readable in a particular case: if or switch.
  -->
  <!--
    <rule ref="rulesets/java/design.xml/TooFewBranchesForASwitchStatement" />
  -->


  <!-- Finalizer -->
  <!-- http://pmd.sourceforge.net/rules/java/finalizers.html -->
  <rule ref="rulesets/java/finalizers.xml/EmptyFinalizer"/>
  <rule ref="rulesets/java/finalizers.xml/FinalizeOnlyCallsSuperFinalize"/>
  <rule ref="rulesets/java/finalizers.xml/FinalizeOverloaded"/>
  <rule ref="rulesets/java/finalizers.xml/FinalizeDoesNotCallSuperFinalize"/>
  <rule ref="rulesets/java/finalizers.xml/FinalizeShouldBeProtected"/>
  <rule ref="rulesets/java/finalizers.xml/AvoidCallingFinalize"/>

  <!-- Import Statement -->
  <!-- http://pmd.sourceforge.net/rules/java/imports.html -->
  <rule ref="rulesets/java/imports.xml/DuplicateImports"/>
  <rule ref="rulesets/java/imports.xml/DontImportJavaLang"/>
  <rule ref="rulesets/java/imports.xml/ImportFromSamePackage"/>
  <!--
    This is a general rule. Either state each import (static or not)
    explicitly or use the asterisk (*). We currently decide to make each
    import explicit. We do not bother with imports since the are hidden in
    the IDE editor and if we examine a class outside the IDE (e.g. in a
    Source-Zip), we are happy to have the explicit reference. Even more if
    the referenced class got lost in a new version of a library.
  -->
  <!--
    <rule ref="rulesets/java/imports.xml/TooManyStaticImports" />
   -->

  <!-- JEE -->
  <!-- http://pmd.sourceforge.net/rules/javaj2ee.html -->
  <rule ref="rulesets/java/j2ee.xml/UseProperClassLoader"/>
  <rule ref="rulesets/java/j2ee.xml/MDBAndSessionBeanNamingConvention"/>
  <rule ref="rulesets/java/j2ee.xml/RemoteSessionInterfaceNamingConvention"/>
  <rule ref="rulesets/java/j2ee.xml/LocalInterfaceSessionNamingConvention"/>
  <rule ref="rulesets/java/j2ee.xml/LocalHomeNamingConvention"/>
  <rule ref="rulesets/java/j2ee.xml/RemoteInterfaceNamingConvention"/>
  <rule ref="rulesets/java/j2ee.xml/DoNotCallSystemExit"/>
  <rule ref="rulesets/java/j2ee.xml/StaticEJBFieldShouldBeFinal"/>
  <rule ref="rulesets/java/j2ee.xml/DoNotUseThreads"/>

  <!-- JavaBean -->
  <!-- http://pmd.sourceforge.net/rules/java/beans.html -->
  <!--
    Do not know the benefit of this rule. Not every class is a bean and
    therefore has the right to have some internal state that is not
    exposed but is not transient or static. Maybe we are missing something
    here?
    <rule ref="rulesets/java/javabeans.xml/BeanMembersShouldSerialize" />
  -->
  <rule ref="rulesets/java/javabeans.xml/MissingSerialVersionUID"/>

  <!-- JUnit -->
  <!-- http://pmd.sourceforge.net/rules/java/junit.html -->
  <rule ref="rulesets/java/junit.xml/JUnitStaticSuite"/>

  <!-- Name it as you like
  <rule ref="rulesets/java/junit.xml/JUnitSpelling" />
   -->
  <!-- Often messages do not add any value to the understanding.
  <rule ref="rulesets/java/junit.xml/JUnitAssertionsShouldIncludeMessage" />
   -->
  <!-- JUnit Rule annotations do not require assertions.
  <rule ref="rulesets/java/junit.xml/JUnitTestsShouldIncludeAssert" />
   -->
  <!-- Seems not to be designed for JUnit 4. None of our test methods should start
       with "test".
  <rule ref="rulesets/java/junit.xml/TestClassWithoutTestCases" />
  -->
  <!--
    We want to use assertTrue(true) as a signal that we expect to get into
    this path. This is only neccessary if we want to catch a specific
    exception and test its contents.
  -->
  <!--
    <rule ref="rulesets/java/junit.xml/UnnecessaryBooleanAssertion" />
  -->
  <rule ref="rulesets/java/junit.xml/UseAssertEqualsInsteadOfAssertTrue"/>
  <rule ref="rulesets/java/junit.xml/UseAssertSameInsteadOfAssertTrue"/>
  <rule ref="rulesets/java/junit.xml/UseAssertNullInsteadOfAssertTrue"/>
  <rule ref="rulesets/java/junit.xml/SimplifyBooleanAssertion"/>


  <!-- Java Logging -->
  <!-- http://pmd.sourceforge.net/rules/java/logging-java.html -->
  <rule ref="rulesets/java/logging-java.xml/MoreThanOneLogger"/>
  <!-- While logger should be static in applications, they should not be
       static in libraries.
  <rule ref="rulesets/java/logging-java.xml/LoggerIsNotStaticFinal" />
  -->
  <rule ref="rulesets/java/logging-java.xml/SystemPrintln"/>
  <rule ref="rulesets/java/logging-java.xml/AvoidPrintStackTrace"/>


  <!-- Jakarta Commons Logging -->
  <!-- http://pmd.sourceforge.net/rules/java/logging-jakarta-commons.html -->
  <rule ref="rulesets/java/logging-jakarta-commons.xml/UseCorrectExceptionLogging"/>
  <!--
    Since a static logger is not a good idea for libraries (see
    http://wiki.apache.org/jakarta-commons/Logging/StaticLog), we cannot
    enforce this rule.
  -->
  <!--
    <rule ref="rulesets/java/logging-jakarta-commons.xml/ProperLogger">
    <properties> <property name="staticLoggerName" value="LOG" />
    </properties> </rule>
  -->


  <!-- Migration Rules -->
  <!-- http://pmd.sourceforge.net/rules/java/migrating.html -->
  <rule ref="rulesets/java/migrating.xml/ReplaceVectorWithList"/>
  <rule ref="rulesets/java/migrating.xml/ReplaceHashtableWithMap"/>
  <rule ref="rulesets/java/migrating.xml/ReplaceEnumerationWithIterator"/>
  <rule ref="rulesets/java/migrating.xml/AvoidEnumAsIdentifier"/>
  <rule ref="rulesets/java/migrating.xml/AvoidAssertAsIdentifier"/>
  <rule ref="rulesets/java/migrating.xml/IntegerInstantiation"/>
  <rule ref="rulesets/java/migrating.xml/ByteInstantiation"/>
  <rule ref="rulesets/java/migrating.xml/ShortInstantiation"/>
  <rule ref="rulesets/java/migrating.xml/LongInstantiation"/>
  <rule ref="rulesets/java/migrating.xml/JUnit4TestShouldUseBeforeAnnotation"/>
  <rule ref="rulesets/java/migrating.xml/JUnit4TestShouldUseAfterAnnotation"/>
  <rule ref="rulesets/java/migrating.xml/JUnit4TestShouldUseTestAnnotation"/>
  <rule ref="rulesets/java/migrating.xml/JUnit4SuitesShouldUseSuiteAnnotation"/>
  <rule ref="rulesets/java/migrating.xml/JUnitUseExpected"/>

  <!-- Naming -->
  <!-- http://pmd.sourceforge.net/rules/java/naming.html -->
  <!--
    We do not want to impose a rule on the length of a variable name. "i"
    for an iterator is ok, "e" for an exception also.
    <rule ref="rulesets/java/naming.xml/ShortVariable" />
   -->
  <!--
    We do not want to impose a rule on the length of a variable name.
    <rule ref="rulesets/java/naming.xml/LongVariable" />
   -->
  <!--
    We do not want to impose a rule on the length of a method name.
  -->
  <!--
    <rule ref="rulesets/java/naming.xml/ShortMethodName" />
  -->
  <rule ref="rulesets/java/naming.xml/VariableNamingConventions"/>
  <rule ref="rulesets/java/naming.xml/MethodNamingConventions"/>
  <rule ref="rulesets/java/naming.xml/ClassNamingConventions"/>
  <rule ref="rulesets/java/naming.xml/AbstractNaming"/>
  <rule ref="rulesets/java/naming.xml/AvoidDollarSigns"/>
  <rule ref="rulesets/java/naming.xml/MethodWithSameNameAsEnclosingClass"/>
  <rule ref="rulesets/java/naming.xml/SuspiciousHashcodeMethodName"/>
  <rule ref="rulesets/java/naming.xml/SuspiciousConstantFieldName"/>
  <rule ref="rulesets/java/naming.xml/SuspiciousEqualsMethodName"/>
  <rule ref="rulesets/java/naming.xml/AvoidFieldNameMatchingTypeName"/>
  <rule ref="rulesets/java/naming.xml/AvoidFieldNameMatchingMethodName"/>
  <rule ref="rulesets/java/naming.xml/NoPackage"/>
  <rule ref="rulesets/java/naming.xml/PackageCase"/>
  <!-- We do not use prefixes so we do not use this rule. -->
  <!--
    <rule ref="rulesets/java/naming.xml/MisleadingVariableName" />
  -->
  <rule ref="rulesets/java/naming.xml/BooleanGetMethodName"/>


  <!-- Optimization -->
  <!-- http://pmd.sourceforge.net/rules/java/optimizations.html -->
  <rule ref="rulesets/java/optimizations.xml/LocalVariableCouldBeFinal"/>
  <rule ref="rulesets/java/optimizations.xml/MethodArgumentCouldBeFinal"/>
  <!--
    Sometimes this is all the loop is for. Therefore we discard it...
  <rule ref="rulesets/java/optimizations.xml/AvoidInstantiatingObjectsInLoops" />
  -->
  <rule ref="rulesets/java/optimizations.xml/UseArrayListInsteadOfVector"/>
  <!--
    Maybe the other form is more clear and we should skip this rule?
  -->
  <rule ref="rulesets/java/optimizations.xml/SimplifyStartsWith"/>
  <!-- Should be a StringBuilder... -->
  <rule ref="rulesets/java/optimizations.xml/UseStringBufferForStringAppends"/>
  <rule ref="rulesets/java/optimizations.xml/UseArraysAsList"/>
  <rule ref="rulesets/java/optimizations.xml/AvoidArrayLoops"/>
  <rule ref="rulesets/java/optimizations.xml/UnnecessaryWrapperObjectCreation"/>
  <rule ref="rulesets/java/optimizations.xml/AddEmptyString"/>


  <!-- Strict Exception -->
  <!-- http://pmd.sourceforge.net/rules/java/strictexception.html -->
  <!-- If you have to, comment with NOPMD. -->
  <rule ref="rulesets/java/strictexception.xml/AvoidCatchingThrowable"/>
  <!-- In some cases we have no choice, so we skip this rule. -->
  <!--
    <rule
    ref="rulesets/java/strictexception.xml/SignatureDeclareThrowsException" />
  -->
  <rule ref="rulesets/java/strictexception.xml/ExceptionAsFlowControl"/>
  <rule ref="rulesets/java/strictexception.xml/AvoidCatchingNPE"/>
  <rule ref="rulesets/java/strictexception.xml/AvoidThrowingRawExceptionTypes"/>
  <!--
    If an argument has a value of 'null' and this value is not allowed, we
    want to throw a NPE. We will include a proper comment so that the
    programmer realizes where the exception came from.
  -->
  <!--
    <rule
    ref="rulesets/java/strictexception.xml/AvoidThrowingNullPointerException"
    />
  -->
  <!--
    Somethimes it is necessary if you want to avoid to have certain
    exceptions be handled in the default catch block but instead be
    rethrown.
  -->
  <!--
    <rule ref="rulesets/java/strictexception.xml/AvoidRethrowingException" />
  -->
  <rule ref="rulesets/java/strictexception.xml/DoNotExtendJavaLangError"/>
  <rule ref="rulesets/java/strictexception.xml/DoNotThrowExceptionInFinally"/>


  <!-- String and StringBuffer -->
  <!-- http://pmd.sourceforge.net/rules/java/strings.html -->
  <rule ref="rulesets/java/strings.xml/AvoidDuplicateLiterals"/>
  <rule ref="rulesets/java/strings.xml/StringInstantiation"/>
  <rule ref="rulesets/java/strings.xml/StringToString"/>
  <rule ref="rulesets/java/strings.xml/InefficientStringBuffering"/>
  <rule ref="rulesets/java/strings.xml/UnnecessaryCaseChange"/>
  <rule ref="rulesets/java/strings.xml/UseStringBufferLength"/>
  <rule ref="rulesets/java/strings.xml/AppendCharacterWithChar"/>
  <rule ref="rulesets/java/strings.xml/ConsecutiveLiteralAppends"/>
  <rule ref="rulesets/java/strings.xml/UseIndexOfChar"/>
  <rule ref="rulesets/java/strings.xml/InefficientEmptyStringCheck"/>
  <rule ref="rulesets/java/strings.xml/InsufficientStringBufferDeclaration"/>
  <rule ref="rulesets/java/strings.xml/UselessStringValueOf"/>
  <rule ref="rulesets/java/strings.xml/StringBufferInstantiationWithChar"/>
  <rule ref="rulesets/java/strings.xml/UseEqualsToCompareStrings"/>
  <rule ref="rulesets/java/strings.xml/AvoidStringBufferField"/>


  <!-- Security Code -->
  <!-- http://pmd.sourceforge.net/rules/java/sunsecure.html -->
  <rule ref="rulesets/java/sunsecure.xml/MethodReturnsInternalArray"/>
  <rule ref="rulesets/java/sunsecure.xml/ArrayIsStoredDirectly"/>


  <!-- Unused Code -->
  <!-- http://pmd.sourceforge.net/rules/java/unusedcode.html -->
  <rule ref="rulesets/java/unusedcode.xml/UnusedPrivateField"/>
  <rule ref="rulesets/java/unusedcode.xml/UnusedLocalVariable"/>
  <rule ref="rulesets/java/unusedcode.xml/UnusedPrivateMethod"/>
  <rule ref="rulesets/java/unusedcode.xml/UnusedFormalParameter"/>
  <rule ref="rulesets/java/unusedcode.xml/UnusedModifier"/>
</ruleset>