<?xml version="1.0" encoding="utf-8"?>
<ruleset name="pmd">
    <description>Java Rule in PMD</description>

    <!--
    <rule ref="category/java/bestpractices.xml">
        <exclude name="AbstractClassWithoutAbstractMethod"/>
        <exclude name="AccessorClassGeneration"/>
        <exclude name="AccessorMethodGeneration"/>
        <exclude name="ArrayIsStoredDirectly"/>
        <exclude name="AvoidPrintStackTrace"/>
        <exclude name="AvoidReassigningParameters"/>
        <exclude name="AvoidStringBufferField"/>
        <exclude name="AvoidUsingHardCodedIP"/>
        <exclude name="CheckResultSet"/>
        <exclude name="ConstantsInInterface"/>
        <exclude name="DefaultLabelNotLastInSwitchStmt"/>
        <exclude name="ForLoopCanBeForeach"/>
        <exclude name="GuardLogStatement"/>
        <exclude name="JUnit4SuitesShouldUseSuiteAnnotation"/>
        <exclude name="JUnit4TestShouldUseAfterAnnotation"/>
        <exclude name="JUnit4TestShouldUseBeforeAnnotation"/>
        <exclude name="JUnit4TestShouldUseTestAnnotation"/>
        <exclude name="JUnitAssertionsShouldIncludeMessage"/>
        <exclude name="JUnitTestContainsTooManyAsserts"/>
        <exclude name="JUnitTestsShouldIncludeAssert"/>
        <exclude name="JUnitUseExpected"/>
        <exclude name="LooseCoupling"/>
        <exclude name="MethodReturnsInternalArray"/>
        <exclude name="MissingOverride"/>
        <exclude name="OneDeclarationPerLine"/>
        <exclude name="PositionLiteralsFirstInCaseInsensitiveComparisons"/>
        <exclude name="PositionLiteralsFirstInComparisons"/>
        <exclude name="PreserveStackTrace"/>
        <exclude name="ReplaceEnumerationWithIterator"/>
        <exclude name="ReplaceHashtableWithMap"/>
        <exclude name="ReplaceVectorWithList"/>
        <exclude name="SwitchStmtsShouldHaveDefault"/>
        <exclude name="SystemPrintln"/>
        <exclude name="UnusedFormalParameter"/>
        <exclude name="UnusedImports"/>
        <exclude name="UnusedLocalVariable"/>
        <exclude name="UnusedPrivateField"/>
        <exclude name="UnusedPrivateMethod"/>
        <exclude name="UseAssertEqualsInsteadOfAssertTrue"/>
        <exclude name="UseAssertNullInsteadOfAssertTrue"/>
        <exclude name="UseAssertSameInsteadOfAssertTrue"/>
        <exclude name="UseAssertTrueInsteadOfAssertEquals"/>
        <exclude name="UseCollectionIsEmpty"/>
        <exclude name="UseVarargs"/>
    </rule>

    <rule ref="category/java/codestyle.xml">
        <exclude name="AbstractNaming"/>
        <exclude name="AtLeastOneConstructor"/>
        <exclude name="AvoidDollarSigns"/>
        <exclude name="AvoidFinalLocalVariable"/>
        <exclude name="AvoidPrefixingMethodParameters"/>
        <exclude name="AvoidProtectedFieldInFinalClass"/>
        <exclude name="AvoidProtectedMethodInFinalClassNotExtending"/>
        <exclude name="AvoidUsingNativeCode"/>
        <exclude name="BooleanGetMethodName"/>
        <exclude name="CallSuperInConstructor"/>
        <exclude name="ClassNamingConventions"/>
        <exclude name="CommentDefaultAccessModifier"/>
        <exclude name="ConfusingTernary"/>
        <exclude name="ControlStatementBraces"/>
        <exclude name="DefaultPackage"/>
        <exclude name="DontImportJavaLang"/>
        <exclude name="DuplicateImports"/>
        <exclude name="EmptyMethodInAbstractClassShouldBeAbstract"/>
        <exclude name="ExtendsObject"/>
        <exclude name="FieldDeclarationsShouldBeAtStartOfClass"/>
        <exclude name="FieldNamingConventions"/>
        <exclude name="ForLoopShouldBeWhileLoop"/>
        <exclude name="ForLoopsMustUseBraces"/>
        <exclude name="FormalParameterNamingConventions"/>
        <exclude name="GenericsNaming"/>
        <exclude name="IdenticalCatchBranches"/>
        <exclude name="IfElseStmtsMustUseBraces"/>
        <exclude name="IfStmtsMustUseBraces"/>
        <exclude name="LinguisticNaming"/>
        <exclude name="LocalHomeNamingConvention"/>
        <exclude name="LocalInterfaceSessionNamingConvention"/>
        <exclude name="LocalVariableCouldBeFinal"/>
        <exclude name="LocalVariableNamingConventions"/>
        <exclude name="LongVariable"/>
        <exclude name="MDBAndSessionBeanNamingConvention"/>
        <exclude name="MethodArgumentCouldBeFinal"/>
        <exclude name="MethodNamingConventions"/>
        <exclude name="MIsLeadingVariableName"/>
        <exclude name="NoPackage"/>
        <exclude name="OnlyOneReturn"/>
        <exclude name="PackageCase"/>
        <exclude name="PrematureDeclaration"/>
        <exclude name="RemoteInterfaceNamingConvention"/>
        <exclude name="RemoteSessionInterfaceNamingConvention"/>
        <exclude name="ShortClassName"/>
        <exclude name="ShortMethodName"/>
        <exclude name="ShortVariable"/>
        <exclude name="SuspiciousConstantFieldName"/>
        <exclude name="TooManyStaticImports"/>
        <exclude name="UnnecessaryAnnotationValueElement"/>
        <exclude name="UnnecessaryConstructor"/>
        <exclude name="UnnecessaryFullyQualifiedName"/>
        <exclude name="UnnecessaryLocalBeforeReturn"/>
        <exclude name="UnnecessaryModifier"/>
        <exclude name="UnnecessaryReturn"/>
        <exclude name="UselessParentheses"/>
        <exclude name="UselessQualifiedThis"/>
        <exclude name="VariableNamingConventions"/>
        <exclude name="WhileLoopsMustUseBraces"/>
    </rule>

    <rule ref="category/java/design.xml">
        <exclude name="AbstractClassWithoutAnyMethod"/>
        <exclude name="AvoidCatchingGenericException"/>
        <exclude name="AvoidDeeplyNestedIfStmts"/>
        <exclude name="AvoidRethrowingException"/>
        <exclude name="AvoidThrowingNewInstanceOfSameException"/>
        <exclude name="AvoidThrowingNullPointerException"/>
        <exclude name="AvoidThrowingRawExceptionTypes"/>
        <exclude name="ClassWithOnlyPrivateConstructorsShouldBeFinal"/>
        <exclude name="CollapsibleIfStatements"/>
        <exclude name="CouplingBetweenObjects"/>
        <exclude name="CyclomaticComplexity"/>
        <exclude name="DataClass"/>
        <exclude name="DoNotExtendJavaLangError"/>
        <exclude name="ExceptionAsFlowControl"/>
        <exclude name="ExcessiveClassLength"/>
        <exclude name="ExcessiveImports"/>
        <exclude name="ExcessiveMethodLength"/>
        <exclude name="ExcessiveParameterList"/>
        <exclude name="ExcessivePublicCount"/>
        <exclude name="FinalFieldCouldBeStatic"/>
        <exclude name="GodClass"/>
        <exclude name="ImmutableField"/>
        <exclude name="LawOfDemeter"/>
        <exclude name="LogicInversion"/>
        <exclude name="LoosePackageCoupling"/>
        <exclude name="ModifiedCyclomaticComplexity"/>
        <exclude name="NcssConstructorCount"/>
        <exclude name="NcssCount"/>
        <exclude name="NcssMethodCount"/>
        <exclude name="NcssTypeCount"/>
        <exclude name="NPathComplexity"/>
        <exclude name="SignatureDeclareThrowsException"/>
        <exclude name="SimplifiedTernary"/>
        <exclude name="SimplifyBooleanAssertion"/>
        <exclude name="SimplifyBooleanExpressions"/>
        <exclude name="SimplifyBooleanReturns"/>
        <exclude name="SimplifyConditional"/>
        <exclude name="SingularField"/>
        <exclude name="StdCyclomaticComplexity"/>
        <exclude name="SwitchDensity"/>
        <exclude name="TooManyFields"/>
        <exclude name="TooManyMethods"/>
        <exclude name="UselessOverridingMethod"/>
        <exclude name="UseObjectForClearerAPI"/>
        <exclude name="UseUtilityClass"/>
    </rule>

    <rule ref="category/java/documentation.xml">
        <exclude name="CommentContent"/>
        <exclude name="CommentRequired"/>
        <exclude name="CommentSize"/>
        <exclude name="UncommentedEmptyConstructor"/>
        <exclude name="UncommentedEmptyMethodBody"/>
    </rule>

    <rule ref="category/java/errorprone.xml">
        <exclude name="AssignmentInOperand"/>
        <exclude name="AssignmentToNonFinalStatic"/>
        <exclude name="AvoidAccessibilityAlteration"/>
        <exclude name="AvoidAssertAsIdentifier"/>
        <exclude name="AvoidBranchingStatementAsLastInLoop"/>
        <exclude name="AvoidCallingFinalize"/>
        <exclude name="AvoidCatchingNPE"/>
        <exclude name="AvoidCatchingThrowable"/>
        <exclude name="AvoidDecimalLiteralsInBigDecimalConstructor"/>
        <exclude name="AvoidDuplicateLiterals"/>
        <exclude name="AvoidEnumAsIdentifier"/>
        <exclude name="AvoidFieldNameMatchingMethodName"/>
        <exclude name="AvoidFieldNameMatchingTypeName"/>
        <exclude name="AvoidInstanceofChecksInCatchClause"/>
        <exclude name="AvoidLiteralsInIfCondition"/>
        <exclude name="AvoidLosingExceptionInformation"/>
        <exclude name="AvoidMultipleUnaryOperators"/>
        <exclude name="AvoidUsingOctalValues"/>
        <exclude name="BadComparison"/>
        <exclude name="BeanMembersShouldSerialize"/>
        <exclude name="BrokenNullCheck"/>
        <exclude name="CallSuperFirst"/>
        <exclude name="CallSuperLast"/>
        <exclude name="CheckSkipResult"/>
        <exclude name="ClassCastExceptionWithToArray"/>
        <exclude name="CloneMethodMustBePublic"/>
        <exclude name="CloneMethodMustImplementCloneable"/>
        <exclude name="CloneMethodReturnTypeMustMatchClassName"/>
        <exclude name="CloneThrowsCloneNotSupportedException"/>
        <exclude name="CloseResource"/>
        <exclude name="CompareObjectsWithEquals"/>
        <exclude name="ConstructorCallsOverridableMethod"/>
        <exclude name="DataflowAnomalyAnalysis"/>
        <exclude name="DoNotCallGarbageCollectionExplicitly"/>
        <exclude name="DoNotCallSystemExit"/>
        <exclude name="DoNotExtendJavaLangThrowable"/>
        <exclude name="DoNotHardCodeSDCard"/>
        <exclude name="DoNotThrowExceptionInFinally"/>
        <exclude name="DontImportSun"/>
        <exclude name="DontUseFloatTypeForLoopIndices"/>
        <exclude name="EmptyCatchBlock"/>
        <exclude name="EmptyFinalizer"/>
        <exclude name="EmptyFinallyBlock"/>
        <exclude name="EmptyIfStmt"/>
        <exclude name="EmptyInitializer"/>
        <exclude name="EmptyStatementBlock"/>
        <exclude name="EmptyStatementNotInLoop"/>
        <exclude name="EmptySwitchStatements"/>
        <exclude name="EmptySynchronizedBlock"/>
        <exclude name="EmptyTryBlock"/>
        <exclude name="EmptyWhileStmt"/>
        <exclude name="EqualsNull"/>
        <exclude name="FinalizeDoesNotCallSuperFinalize"/>
        <exclude name="FinalizeOnlyCallsSuperFinalize"/>
        <exclude name="FinalizeOverloaded"/>
        <exclude name="FinalizeShouldBeProtected"/>
        <exclude name="IdempotentOperations"/>
        <exclude name="ImportFromSamePackage"/>
        <exclude name="InstantiationToGetClass"/>
        <exclude name="InvalidSlf4jMessageFormat"/>
        <exclude name="JumbledIncrementer"/>
        <exclude name="JUnitSpelling"/>
        <exclude name="JUnitStaticSuite"/>
        <exclude name="LoggerIsNotStaticFinal"/>
        <exclude name="MethodWithSameNameAsEnclosingClass"/>
        <exclude name="MisplacedNullCheck"/>
        <exclude name="ImplicitSwitchFallThrough"/>
        <exclude name="MissingSerialVersionUID"/>
        <exclude name="MissingStaticMethodInNonInstantiatableClass"/>
        <exclude name="MoreThanOneLogger"/>
        <exclude name="NonCaseLabelInSwitchStatement"/>
        <exclude name="NonStaticInitializer"/>
        <exclude name="NullAssignment"/>
        <exclude name="OverrideBothEqualsAndHashcode"/>
        <exclude name="ProperCloneImplementation"/>
        <exclude name="ProperLogger"/>
        <exclude name="ReturnEmptyArrayRatherThanNull"/>
        <exclude name="ReturnFromFinallyBlock"/>
        <exclude name="SimpleDateFormatNeedsLocale"/>
        <exclude name="SingleMethodSingleton"/>
        <exclude name="SingletonClassReturningNewInstance"/>
        <exclude name="StaticEJBFieldShouldBeFinal"/>
        <exclude name="StringBufferInstantiationWithChar"/>
        <exclude name="SuspiciousEqualsMethodName"/>
        <exclude name="SuspiciousHashcodeMethodName"/>
        <exclude name="SuspiciousOctalEscape"/>
        <exclude name="TestClassWithoutTestCases"/>
        <exclude name="UnconditionalIfStatement"/>
        <exclude name="UnnecessaryBooleanAssertion"/>
        <exclude name="UnnecessaryCaseChange"/>
        <exclude name="UnnecessaryConversionTemporary"/>
        <exclude name="UnusedNullCheckInEquals"/>
        <exclude name="UseCorrectExceptionLogging"/>
        <exclude name="UseEqualsToCompareStrings"/>
        <exclude name="UselessOperationOnImmutable"/>
        <exclude name="UseLocaleWithCaseConversions"/>
        <exclude name="UseProperClassLoader"/>
    </rule>

    <rule ref="category/java/multithreading.xml">
        <exclude name="AvoidSynchronizedAtMethodLevel"/>
        <exclude name="AvoidThreadGroup"/>
        <exclude name="AvoidUsingVolatile"/>
        <exclude name="DoNotUseThreads"/>
        <exclude name="DontCallThreadRun"/>
        <exclude name="DoubleCheckedLocking"/>
        <exclude name="NonThreadSafeSingleton"/>
        <exclude name="UnsynchronizedStaticDateFormatter"/>
        <exclude name="UseConcurrentHashMap"/>
        <exclude name="UseNotifyAllInsteadOfNotify"/>
    </rule>

    <rule ref="category/java/performance.xml">
        <exclude name="AddEmptyString"/>
        <exclude name="AppendCharacterWithChar"/>
        <exclude name="AvoidArrayLoops"/>
        <exclude name="AvoidFileStream"/>
        <exclude name="AvoidInstantiatingObjectsInLoops"/>
        <exclude name="AvoidUsingShortType"/>
        <exclude name="BigIntegerInstantiation"/>
        <exclude name="BooleanInstantiation"/>
        <exclude name="ByteInstantiation"/>
        <exclude name="ConsecutiveAppendsShouldReuse"/>
        <exclude name="ConsecutiveLiteralAppends"/>
        <exclude name="InefficientEmptyStringCheck"/>
        <exclude name="InefficientStringBuffering"/>
        <exclude name="InsufficientStringBufferDeclaration"/>
        <exclude name="IntegerInstantiation"/>
        <exclude name="LongInstantiation"/>
        <exclude name="OptimizableToArrayCall"/>
        <exclude name="RedundantFieldInitializer"/>
        <exclude name="SimplifyStartsWith"/>
        <exclude name="ShortInstantiation"/>
        <exclude name="StringInstantiation"/>
        <exclude name="StringToString"/>
        <exclude name="TooFewBranchesForASwitchStatement"/>
        <exclude name="UnnecessaryWrapperObjectCreation"/>
        <exclude name="UseArrayListInsteadOfVector"/>
        <exclude name="UseArraysAsList"/>
        <exclude name="UseIndexOfChar"/>
        <exclude name="UselessStringValueOf"/>
        <exclude name="UseStringBufferForStringAppends"/>
        <exclude name="UseStringBufferLength"/>
    </rule>

    <rule ref="category/java/security.xml">
        <exclude name="HardCodedCryptoKey"/>
        <exclude name="InsecureCryptoIv"/>
    </rule>
    -->

    <rule ref="category/java/bestpractices.xml">
        <exclude name="ArrayIsStoredDirectly"/>
        <exclude name="AvoidReassigningParameters"/>
        <exclude name="AvoidUsingHardCodedIP"/>
        <exclude name="ConstantsInInterface"/>
        <exclude name="DefaultLabelNotLastInSwitchStmt"/>
        <exclude name="GuardLogStatement"/>
        <exclude name="JUnit4SuitesShouldUseSuiteAnnotation"/>
        <exclude name="JUnit4TestShouldUseAfterAnnotation"/>
        <exclude name="JUnit4TestShouldUseBeforeAnnotation"/>
        <exclude name="JUnit4TestShouldUseTestAnnotation"/>
        <exclude name="JUnitAssertionsShouldIncludeMessage"/>
        <exclude name="JUnitTestContainsTooManyAsserts"/>
        <exclude name="JUnitTestsShouldIncludeAssert"/>
        <exclude name="JUnitUseExpected"/>
        <exclude name="MethodReturnsInternalArray"/>
        <exclude name="UnusedPrivateMethod"/>
        <exclude name="UseVarargs"/>
    </rule>

    <rule ref="category/java/codestyle.xml">
        <exclude name="AbstractNaming"/>
        <exclude name="AtLeastOneConstructor"/>
        <exclude name="BooleanGetMethodName"/>
        <exclude name="CallSuperInConstructor"/>
        <exclude name="ClassNamingConventions"/>
        <exclude name="CommentDefaultAccessModifier"/>
        <exclude name="ConfusingTernary"/>
        <exclude name="DefaultPackage"/>
        <exclude name="EmptyMethodInAbstractClassShouldBeAbstract"/>
        <exclude name="FieldNamingConventions"/>
        <exclude name="LinguisticNaming"/>
        <exclude name="LocalVariableCouldBeFinal"/>
        <exclude name="LongVariable"/>
        <exclude name="MethodArgumentCouldBeFinal"/>
        <exclude name="MethodNamingConventions"/>
        <exclude name="OnlyOneReturn"/>
        <exclude name="PrematureDeclaration"/>
        <exclude name="ShortClassName"/>
        <exclude name="ShortMethodName"/>
        <exclude name="ShortVariable"/>
        <exclude name="UnnecessaryModifier"/>
        <exclude name="UselessParentheses"/>
        <exclude name="UseUnderscoresInNumericLiterals"/>
        <exclude name="VariableNamingConventions"/>
    </rule>

    <rule ref="category/java/design.xml">
        <exclude name="AvoidCatchingGenericException"/>
        <exclude name="AvoidDeeplyNestedIfStmts"/>
        <exclude name="AvoidThrowingNullPointerException"/>
        <exclude name="CollapsibleIfStatements"/>
        <exclude name="CognitiveComplexity"/>
        <exclude name="CyclomaticComplexity"/>
        <exclude name="DataClass"/>
        <exclude name="ExcessiveClassLength"/>
        <exclude name="ExcessiveImports"/>
        <exclude name="ExcessiveMethodLength"/>
        <exclude name="ExcessiveParameterList"/>
        <exclude name="ExcessivePublicCount"/>
        <exclude name="GodClass"/>
        <exclude name="ImmutableField"/>
        <exclude name="LawOfDemeter"/>
        <exclude name="LoosePackageCoupling"/>
        <exclude name="NcssConstructorCount"/>
        <exclude name="NcssCount"/>
        <exclude name="NcssMethodCount"/>
        <exclude name="NcssTypeCount"/>
        <exclude name="NPathComplexity"/>
        <exclude name="SwitchDensity"/>
        <exclude name="TooManyFields"/>
        <exclude name="TooManyMethods"/>
        <exclude name="UseObjectForClearerAPI"/>
    </rule>

    <!--
    <rule ref="category/java/documentation.xml"/>
    -->

    <rule ref="category/java/errorprone.xml">
        <exclude name="AssignmentInOperand"/>
        <exclude name="AvoidCatchingThrowable"/>
        <exclude name="AvoidDuplicateLiterals"/>
        <exclude name="AvoidFieldNameMatchingMethodName"/>
        <exclude name="AvoidFieldNameMatchingTypeName"/>
        <exclude name="AvoidInstanceofChecksInCatchClause"/>
        <exclude name="AvoidLiteralsInIfCondition"/>
        <exclude name="CloneMethodMustImplementCloneable"/>
        <exclude name="CloseResource"/>
        <exclude name="CompareObjectsWithEquals"/>
        <exclude name="DataflowAnomalyAnalysis"/>
        <exclude name="EmptyCatchBlock"/>
        <exclude name="EmptyIfStmt"/>
        <exclude name="JumbledIncrementer"/>
        <exclude name="LoggerIsNotStaticFinal"/>
        <exclude name="ImplicitSwitchFallThrough"/>
        <exclude name="MoreThanOneLogger"/>
        <exclude name="NonCaseLabelInSwitchStatement"/>
        <exclude name="NonStaticInitializer"/>
        <exclude name="NullAssignment"/>
        <exclude name="OverrideBothEqualsAndHashcode"/>
        <exclude name="ReturnEmptyArrayRatherThanNull"/>
        <exclude name="SimpleDateFormatNeedsLocale"/>
        <exclude name="UnnecessaryConversionTemporary"/>
        <exclude name="UseEqualsToCompareStrings"/>
        <exclude name="UseLocaleWithCaseConversions"/>
    </rule>

    <rule ref="category/java/multithreading.xml">
        <exclude name="AvoidSynchronizedAtMethodLevel"/>
        <exclude name="DoNotUseThreads"/>
    </rule>

    <rule ref="category/java/performance.xml">
        <exclude name="AddEmptyString"/>
        <exclude name="AvoidInstantiatingObjectsInLoops"/>
        <exclude name="ConsecutiveAppendsShouldReuse"/>
        <exclude name="InefficientStringBuffering"/>
        <exclude name="OptimizableToArrayCall"/>
        <exclude name="SimplifyStartsWith"/>
        <exclude name="TooFewBranchesForASwitchStatement"/>
        <exclude name="UseArrayListInsteadOfVector"/>
    </rule>

    <rule ref="category/java/security.xml"/>

</ruleset>
