cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntimof...@apache.org
Subject [01/11] cayenne git commit: Code check
Date Fri, 02 Feb 2018 13:07:35 GMT
Repository: cayenne
Updated Branches:
  refs/heads/master 96914de46 -> d8a944b0b


Code check


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/93510a7d
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/93510a7d
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/93510a7d

Branch: refs/heads/master
Commit: 93510a7dec00427154697ad1f16ade4f6d1c1327
Parents: 54bb53a
Author: Arseni Bulatski <ancarseni@gmail.com>
Authored: Wed Jan 24 10:28:03 2018 +0300
Committer: Arseni Bulatski <ancarseni@gmail.com>
Committed: Wed Jan 24 16:45:15 2018 +0300

----------------------------------------------------------------------
 .../src/main/resources/cayenne-checkstyle.xml   | 16 +---
 .../src/main/resources/cayenne-pmd.xml          | 97 ++++----------------
 .../main/resources/cayenne-tests-checkstyle.xml |  3 -
 .../src/main/resources/cayenne-tests-pmd.xml    | 48 +++++-----
 cayenne-cache-invalidation/pom.xml              | 15 +++
 .../CacheInvalidationModuleProvider.java        |  3 +-
 cayenne-cgen/pom.xml                            | 19 ++++
 .../org/apache/cayenne/gen/StringUtils.java     |  9 +-
 cayenne-client-jetty/pom.xml                    |  5 -
 .../rop/JettyHttpClientConnectionProvider.java  |  2 +-
 .../cayenne/rop/http/JettyHttpROPConnector.java |  5 +-
 cayenne-client/pom.xml                          |  5 -
 .../apache/cayenne/remote/BaseConnection.java   |  2 +-
 .../remote/hessian/DataRowDeserializer.java     |  2 +-
 .../java/org/apache/cayenne/rop/ROPUtil.java    | 15 ++-
 .../cayenne/rop/http/HttpROPConnector.java      |  2 +-
 cayenne-commitlog/pom.xml                       | 15 +++
 .../CommitLogServerModuleProvider.java          |  3 +-
 cayenne-crypto/pom.xml                          |  6 --
 cayenne-dbsync/pom.xml                          | 14 +++
 .../merge/factory/IngresMergerTokenFactory.java |  3 +-
 .../reverse/configuration/ToolsModule.java      |  2 +-
 .../reverse/dbimport/DefaultDbImportAction.java |  4 +-
 .../reverse/dbimport/FilterContainer.java       |  5 +-
 .../dbsync/reverse/dbimport/PatternParam.java   |  4 +-
 cayenne-di/pom.xml                              |  5 -
 .../main/java/org/apache/cayenne/di/Key.java    |  2 +-
 .../java/org/apache/cayenne/di/TypeLiteral.java | 10 +-
 .../java/org/apache/cayenne/di/spi/DIGraph.java |  3 +-
 .../di/spi/DefaultAdhocObjectFactory.java       |  6 +-
 .../apache/cayenne/di/spi/DefaultInjector.java  |  4 +-
 cayenne-jcache/pom.xml                          | 17 ++++
 .../apache/cayenne/jcache/JCacheConstants.java  |  7 +-
 .../jcache/JCacheServerModuleProvider.java      |  3 +-
 cayenne-joda/pom.xml                            | 25 +++--
 cayenne-lifecycle/pom.xml                       |  5 -
 .../cayenne/lifecycle/id/EntityIdCoder.java     |  2 +-
 .../apache/cayenne/lifecycle/id/IdCoder.java    |  2 +-
 .../cayenne/lifecycle/id/StringIdQuery.java     |  4 +-
 cayenne-osgi/pom.xml                            | 16 ++++
 .../configuration/osgi/OsgiModuleBuilder.java   |  2 +-
 cayenne-project-compatibility/pom.xml           | 16 ++++
 ...ompatibilityDataChannelDescriptorLoader.java |  4 +-
 .../compatibility/DefaultDocumentProvider.java  |  2 +-
 cayenne-project/pom.xml                         |  5 -
 .../cayenne/project/FileProjectSaver.java       |  2 +-
 .../project/upgrade/DefaultUpgradeService.java  | 12 ++-
 .../upgrade/handlers/UpgradeHandler_V9.java     |  6 +-
 cayenne-protostuff/pom.xml                      |  5 -
 cayenne-rop-server/pom.xml                      | 15 +++
 .../java/org/apache/cayenne/CayenneContext.java | 15 +--
 .../cayenne/CayenneContextChildDiffLoader.java  |  5 +-
 .../cayenne/CayenneContextMergeHandler.java     | 16 +---
 .../remote/RemoteIncrementalFaultList.java      |  9 +-
 .../apache/cayenne/remote/RemoteSession.java    | 11 ++-
 cayenne-server/pom.xml                          |  7 +-
 cayenne-velocity/pom.xml                        | 15 +++
 cayenne-web/pom.xml                             | 24 +++--
 pom.xml                                         | 34 +------
 59 files changed, 325 insertions(+), 295 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/build-tools/cayenne-checkers/src/main/resources/cayenne-checkstyle.xml
----------------------------------------------------------------------
diff --git a/build-tools/cayenne-checkers/src/main/resources/cayenne-checkstyle.xml b/build-tools/cayenne-checkers/src/main/resources/cayenne-checkstyle.xml
index 269ff41..90587cb 100644
--- a/build-tools/cayenne-checkers/src/main/resources/cayenne-checkstyle.xml
+++ b/build-tools/cayenne-checkers/src/main/resources/cayenne-checkstyle.xml
@@ -33,9 +33,7 @@
         <module name="IllegalCatch">
             <property name="severity" value="warning"/>
         </module>
-        <module name="DoubleCheckedLocking">
-            <property name="severity" value="warning"/>
-        </module>
+
         <module name="FallThrough">
             <property name="severity" value="warning"/>
         </module>
@@ -51,9 +49,6 @@
         <module name="CovariantEquals">
             <property name="severity" value="warning"/>
         </module>
-        <module name="VisibilityModifier">
-            <property name="severity" value="info"/>
-        </module>
         <module name="ConstantName">
             <property name="severity" value="info"/>
             <property name="format" value="^([A-Z][A-Z0-9]*(_[A-Z0-9]+)*|logger|log)$"/>
@@ -64,19 +59,10 @@
         <module name="ArrayTypeStyle">
             <property name="severity" value="info"/>
         </module>
-        <module name="LeftCurly">
-            <property name="severity" value="info"/>
-        </module>
-        <module name="AnonInnerLength">
-            <property name="severity" value="warning"/>
-        </module>
         <module name="EqualsAvoidNull">
             <property name="severity" value="warning"/>
             <property name="ignoreEqualsIgnoreCase" value="false"/>
         </module>
-        <module name="DeclarationOrder">
-            <property name="severity" value="info"/>
-        </module>
         <module name="AvoidNestedBlocks">
             <property name="severity" value="warning"/>
         </module>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/build-tools/cayenne-checkers/src/main/resources/cayenne-pmd.xml
----------------------------------------------------------------------
diff --git a/build-tools/cayenne-checkers/src/main/resources/cayenne-pmd.xml b/build-tools/cayenne-checkers/src/main/resources/cayenne-pmd.xml
index 04c88c2..7c26548 100644
--- a/build-tools/cayenne-checkers/src/main/resources/cayenne-pmd.xml
+++ b/build-tools/cayenne-checkers/src/main/resources/cayenne-pmd.xml
@@ -50,13 +50,13 @@
   <rule ref="rulesets/java/controversial.xml/DoNotCallGarbageCollectionExplicitly">
     <priority>3</priority>
   </rule>
-  <rule ref="rulesets/java/basic.xml/EmptyCatchBlock">
+  <rule ref="rulesets/java/empty.xml/EmptyCatchBlock">
     <priority>3</priority>
   </rule>
-  <rule ref="rulesets/java/basic.xml/EmptyFinallyBlock">
+  <rule ref="rulesets/java/empty.xml/EmptyFinallyBlock">
     <priority>1</priority>
   </rule>
-  <rule ref="rulesets/java/basic.xml/EmptyIfStmt">
+  <rule ref="rulesets/java/empty.xml/EmptyIfStmt">
     <priority>3</priority>
   </rule>
   <rule ref="rulesets/java/codesize.xml/ExcessiveClassLength">
@@ -65,9 +65,6 @@
   <rule ref="rulesets/java/codesize.xml/ExcessiveParameterList">
     <priority>3</priority>
   </rule>
-  <rule ref="rulesets/java/codesize.xml/ExcessivePublicCount">
-    <priority>4</priority>
-  </rule>
   <rule ref="rulesets/java/migrating.xml/AvoidEnumAsIdentifier">
     <priority>3</priority>
   </rule>
@@ -89,6 +86,9 @@
   <rule ref="rulesets/java/basic.xml/ClassCastExceptionWithToArray">
     <priority>3</priority>
   </rule>
+  <rule ref="rulesets/java/basic.xml/AvoidMultipleUnaryOperators">
+    <priority>3</priority>
+  </rule>
   <rule ref="rulesets/java/j2ee.xml/DoNotCallSystemExit">
     <priority>3</priority>
   </rule>
@@ -104,18 +104,9 @@
   <rule ref="rulesets/java/design.xml/AvoidDeeplyNestedIfStmts">
     <priority>3</priority>
   </rule>
-  <rule ref="rulesets/java/controversial.xml/AvoidFinalLocalVariable">
-    <priority>4</priority>
-  </rule>
   <rule ref="rulesets/java/strictexception.xml/AvoidThrowingNullPointerException">
     <priority>3</priority>
   </rule>
-  <rule ref="rulesets/java/naming.xml/BooleanGetMethodName">
-    <priority>4</priority>
-  </rule>
-  <rule ref="rulesets/java/controversial.xml/DefaultPackage">
-    <priority>5</priority>
-  </rule>
   <rule ref="rulesets/java/naming.xml/ClassNamingConventions">
     <priority>3</priority>
   </rule>
@@ -128,18 +119,13 @@
   <rule ref="rulesets/java/naming.xml/ShortMethodName">
     <priority>3</priority>
   </rule>
-  <rule ref="rulesets/java/naming.xml/PackageCase">
-    <priority>4</priority>
-  </rule>
   <rule ref="rulesets/java/braces.xml/WhileLoopsMustUseBraces">
     <priority>1</priority>
   </rule>
   <rule ref="rulesets/java/design.xml/AvoidInstanceofChecksInCatchClause">
     <priority>3</priority>
   </rule>
-  <rule ref="rulesets/java/basic.xml/AvoidMultipleUnaryOperators">
-    <priority>3</priority>
-  </rule>
+
   <rule ref="rulesets/java/braces.xml/ForLoopsMustUseBraces">
     <priority>1</priority>
   </rule>
@@ -155,12 +141,6 @@
       <property name="maxmethods" value="30" />
     </properties>
   </rule>
-  <rule ref="rulesets/java/unusedcode.xml/UnusedPrivateMethod">
-    <priority>4</priority>
-  </rule>
-  <rule ref="rulesets/java/unusedcode.xml/UnusedPrivateField">
-    <priority>4</priority>
-  </rule>
   <rule ref="rulesets/java/migrating.xml/ByteInstantiation">
     <priority>1</priority>
   </rule>
@@ -170,10 +150,10 @@
   <rule ref="rulesets/java/migrating.xml/ShortInstantiation">
     <priority>1</priority>
   </rule>
-  <rule ref="rulesets/java/basic.xml/EmptySynchronizedBlock">
+  <rule ref="rulesets/java/empty.xml/EmptySynchronizedBlock">
     <priority>3</priority>
   </rule>
-  <rule ref="rulesets/java/basic.xml/EmptyWhileStmt">
+  <rule ref="rulesets/java/empty.xml/EmptyWhileStmt">
     <priority>3</priority>
   </rule>
   <rule ref="rulesets/java/design.xml/EqualsNull">
@@ -191,10 +171,7 @@
   <rule ref="rulesets/java/j2ee.xml/UseProperClassLoader">
     <priority>1</priority>
   </rule>
-  <rule ref="rulesets/java/basic.xml/UselessOperationOnImmutable">
-    <priority>1</priority>
-  </rule>
-  <rule ref="rulesets/java/logging-jakarta-commons.xml/GuardDebugLogging">
+  <rule ref="rulesets/java/unnecessary.xml/UselessOperationOnImmutable">
     <priority>1</priority>
   </rule>
   <rule ref="rulesets/java/logging-java.xml/MoreThanOneLogger">
@@ -203,7 +180,7 @@
   <rule ref="rulesets/java/design.xml/AssignmentToNonFinalStatic">
     <priority>3</priority>
   </rule>
-  <rule ref="rulesets/java/design.xml/AvoidConstantsInterface">
+  <rule ref="rulesets/java/design.xml/ConstantsInInterface">
     <priority>3</priority>
   </rule>
   <rule ref="rulesets/java/logging-java.xml/AvoidPrintStackTrace">
@@ -230,21 +207,6 @@
   <rule ref="rulesets/java/naming.xml/SuspiciousEqualsMethodName">
     <priority>3</priority>
   </rule>
-  <rule ref="rulesets/java/strings.xml/AvoidStringBufferField">
-    <priority>5</priority>
-  </rule>
-  <rule ref="rulesets/java/controversial.xml/AvoidUsingShortType">
-    <priority>5</priority>
-  </rule>
-  <rule ref="rulesets/java/javabeans.xml/MissingSerialVersionUID">
-    <priority>3</priority>
-  </rule>
-  <rule ref="rulesets/java/controversial.xml/NullAssignment">
-    <priority>5</priority>
-  </rule>
-  <rule ref="rulesets/java/design.xml/ReturnEmptyArrayRatherThanNull">
-    <priority>5</priority>
-  </rule>
   <rule ref="rulesets/java/sunsecure.xml/MethodReturnsInternalArray">
     <priority>3</priority>
   </rule>
@@ -263,19 +225,19 @@
   <rule ref="rulesets/java/design.xml/BadComparison">
     <priority>3</priority>
   </rule>
-  <rule ref="rulesets/java/basic.xml/EmptyInitializer">
+  <rule ref="rulesets/java/empty.xml/EmptyInitializer">
     <priority>3</priority>
   </rule>
   <rule ref="rulesets/java/design.xml/CompareObjectsWithEquals">
     <priority>3</priority>
   </rule>
-  <rule ref="rulesets/java/basic.xml/EmptyStatementNotInLoop">
+  <rule ref="rulesets/java/empty.xml/EmptyStatementNotInLoop">
     <priority>3</priority>
   </rule>
   <rule ref="rulesets/java/design.xml/EmptyMethodInAbstractClassShouldBeAbstract">
     <priority>3</priority>
   </rule>
-  <rule ref="rulesets/java/basic.xml/EmptyTryBlock">
+  <rule ref="rulesets/java/empty.xml/EmptyTryBlock">
     <priority>3</priority>
   </rule>
   <rule ref="rulesets/java/strings.xml/StringToString">
@@ -284,52 +246,25 @@
   <rule ref="rulesets/java/optimizations.xml/UseArrayListInsteadOfVector">
     <priority>3</priority>
   </rule>
-  <rule ref="rulesets/java/optimizations.xml/UseStringBufferForStringAppends">
-    <priority>4</priority>
-  </rule>
-  <rule ref="rulesets/java/design.xml/UnnecessaryLocalBeforeReturn">
-    <priority>4</priority>
-  </rule>
-  <rule ref="rulesets/java/optimizations.xml/AvoidInstantiatingObjectsInLoops">
-    <priority>4</priority>
-  </rule>
-  <rule ref="rulesets/java/imports.xml/DontImportJavaLang">
-    <priority>4</priority>
-  </rule>
-  <rule ref="rulesets/java/controversial.xml/DontImportSun">
-    <priority>4</priority>
-  </rule>
-  <rule ref="rulesets/java/design.xml/UseCollectionIsEmpty">
-    <priority>4</priority>
-  </rule>
-  <rule ref="rulesets/java/strings.xml/UselessStringValueOf">
-    <priority>4</priority>
-  </rule>
   <rule ref="rulesets/java/clone.xml/CloneThrowsCloneNotSupportedException">
     <priority>3</priority>
   </rule>
   <rule ref="rulesets/java/design.xml/CloseResource">
     <priority>3</priority>
   </rule>
-  <rule ref="rulesets/java/j2ee.xml/DoNotUseThreads">
-    <priority>3</priority>
-  </rule>
   <rule ref="rulesets/java/basic.xml/DoubleCheckedLocking">
     <priority>3</priority>
   </rule>
-  <rule ref="rulesets/java/design.xml/AvoidSynchronizedAtMethodLevel">
-    <priority>3</priority>
-  </rule>
   <rule ref="rulesets/java/basic.xml/AvoidUsingOctalValues">
     <priority>3</priority>
   </rule>
   <rule ref="rulesets/java/design.xml/DefaultLabelNotLastInSwitchStmt">
     <priority>3</priority>
   </rule>
-  <rule ref="rulesets/java/basic.xml/EmptySwitchStatements">
+  <rule ref="rulesets/java/empty.xml/EmptySwitchStatements">
     <priority>3</priority>
   </rule>
-  <rule ref="rulesets/java/basic.xml/EmptyStaticInitializer">
+  <rule ref="rulesets/java/empty.xml/EmptyStaticInitializer">
     <priority>3</priority>
   </rule>
   <rule ref="rulesets/java/finalizers.xml/EmptyFinalizer">

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/build-tools/cayenne-checkers/src/main/resources/cayenne-tests-checkstyle.xml
----------------------------------------------------------------------
diff --git a/build-tools/cayenne-checkers/src/main/resources/cayenne-tests-checkstyle.xml b/build-tools/cayenne-checkers/src/main/resources/cayenne-tests-checkstyle.xml
index 249fd4b..fe58fda 100644
--- a/build-tools/cayenne-checkers/src/main/resources/cayenne-tests-checkstyle.xml
+++ b/build-tools/cayenne-checkers/src/main/resources/cayenne-tests-checkstyle.xml
@@ -30,9 +30,6 @@
             <property name="severity" value="warning"/>
             <property name="max" value="200"/>
         </module>
-        <module name="DoubleCheckedLocking">
-            <property name="severity" value="warning"/>
-        </module>
         <module name="FallThrough">
             <property name="severity" value="warning"/>
         </module>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/build-tools/cayenne-checkers/src/main/resources/cayenne-tests-pmd.xml
----------------------------------------------------------------------
diff --git a/build-tools/cayenne-checkers/src/main/resources/cayenne-tests-pmd.xml b/build-tools/cayenne-checkers/src/main/resources/cayenne-tests-pmd.xml
index 4e0f8f4..52ebc67 100644
--- a/build-tools/cayenne-checkers/src/main/resources/cayenne-tests-pmd.xml
+++ b/build-tools/cayenne-checkers/src/main/resources/cayenne-tests-pmd.xml
@@ -21,7 +21,7 @@
   <rule ref="rulesets/optimizations.xml/AvoidArrayLoops">
     <priority>3</priority>
   </rule>
-  <rule ref="rulesets/basic.xml/BooleanInstantiation">
+  <rule ref="rulesets/empty.xml/BooleanInstantiation">
     <priority>1</priority>
   </rule>
   <rule ref="rulesets/logging-java.xml/LoggerIsNotStaticFinal">
@@ -48,13 +48,13 @@
   <rule ref="rulesets/controversial.xml/DoNotCallGarbageCollectionExplicitly">
     <priority>3</priority>
   </rule>
-  <rule ref="rulesets/basic.xml/EmptyCatchBlock">
+  <rule ref="rulesets/empty.xml/EmptyCatchBlock">
     <priority>3</priority>
   </rule>
-  <rule ref="rulesets/basic.xml/EmptyFinallyBlock">
+  <rule ref="rulesets/empty.xml/EmptyFinallyBlock">
     <priority>1</priority>
   </rule>
-  <rule ref="rulesets/basic.xml/EmptyIfStmt">
+  <rule ref="rulesets/empty.xml/EmptyIfStmt">
     <priority>3</priority>
   </rule>
   <rule ref="rulesets/codesize.xml/ExcessiveClassLength">
@@ -75,16 +75,12 @@
   <rule ref="rulesets/strictexception.xml/AvoidCatchingThrowable">
     <priority>3</priority>
   </rule>
-  <rule ref="rulesets/basic.xml/AvoidDecimalLiteralsInBigDecimalConstructor">
-    <priority>3</priority>
-  </rule>
-  <rule ref="rulesets/basic.xml/AvoidUsingHardCodedIP">
-    <priority>3</priority>
-  </rule>
-  <rule ref="rulesets/basic.xml/BrokenNullCheck">
+
+
+  <rule ref="rulesets/empty.xml/BrokenNullCheck">
     <priority>1</priority>
   </rule>
-  <rule ref="rulesets/basic.xml/ClassCastExceptionWithToArray">
+  <rule ref="rulesets/empty.xml/ClassCastExceptionWithToArray">
     <priority>3</priority>
   </rule>
   <rule ref="rulesets/j2ee.xml/DoNotCallSystemExit">
@@ -135,7 +131,7 @@
   <rule ref="rulesets/design.xml/AvoidInstanceofChecksInCatchClause">
     <priority>3</priority>
   </rule>
-  <rule ref="rulesets/basic.xml/AvoidMultipleUnaryOperators">
+  <rule ref="rulesets/empty.xml/AvoidMultipleUnaryOperators">
     <priority>3</priority>
   </rule>
   <rule ref="rulesets/braces.xml/ForLoopsMustUseBraces">
@@ -412,28 +408,28 @@
       </property>
     </properties>
   </rule>
-  <rule ref="rulesets/basic.xml/EmptySynchronizedBlock">
+  <rule ref="rulesets/empty.xml/EmptySynchronizedBlock">
     <priority>3</priority>
   </rule>
-  <rule ref="rulesets/basic.xml/EmptyWhileStmt">
+  <rule ref="rulesets/empty.xml/EmptyWhileStmt">
     <priority>3</priority>
   </rule>
   <rule ref="rulesets/design.xml/EqualsNull">
     <priority>3</priority>
   </rule>
-  <rule ref="rulesets/basic.xml/MisplacedNullCheck">
+  <rule ref="rulesets/empty.xml/MisplacedNullCheck">
     <priority>1</priority>
   </rule>
   <rule ref="rulesets/design.xml/MissingBreakInSwitch">
     <priority>3</priority>
   </rule>
-  <rule ref="rulesets/basic.xml/UnconditionalIfStatement">
+  <rule ref="rulesets/empty.xml/UnconditionalIfStatement">
     <priority>1</priority>
   </rule>
   <rule ref="rulesets/j2ee.xml/UseProperClassLoader">
     <priority>1</priority>
   </rule>
-  <rule ref="rulesets/basic.xml/UselessOperationOnImmutable">
+  <rule ref="rulesets/empty.xml/UselessOperationOnImmutable">
     <priority>1</priority>
   </rule>
   <rule class="net.sourceforge.pmd.rules.XPathRule" message="Prevent of declaration @Transactional annotation on java intefaces and classes." name="EIS coding rules-TransactionalAllowedOnlyOnMethod">
@@ -453,7 +449,7 @@
   <rule ref="rulesets/design.xml/AssignmentToNonFinalStatic">
     <priority>3</priority>
   </rule>
-  <rule ref="rulesets/design.xml/AvoidConstantsInterface">
+  <rule ref="rulesets/design.xml/ConstantsInInterface">
     <priority>3</priority>
   </rule>
   <rule ref="rulesets/logging-java.xml/AvoidPrintStackTrace">
@@ -534,7 +530,7 @@
   <rule ref="rulesets/clone.xml/ProperCloneImplementation">
     <priority>3</priority>
   </rule>
-  <rule ref="rulesets/basic.xml/AvoidThreadGroup">
+  <rule ref="rulesets/empty.xml/AvoidThreadGroup">
     <priority>3</priority>
   </rule>
   <rule ref="rulesets/strictexception.xml/AvoidCatchingGenericException">
@@ -546,19 +542,19 @@
   <rule ref="rulesets/design.xml/BadComparison">
     <priority>3</priority>
   </rule>
-  <rule ref="rulesets/basic.xml/EmptyInitializer">
+  <rule ref="rulesets/empty.xml/EmptyInitializer">
     <priority>3</priority>
   </rule>
   <rule ref="rulesets/design.xml/CompareObjectsWithEquals">
     <priority>3</priority>
   </rule>
-  <rule ref="rulesets/basic.xml/EmptyStatementNotInLoop">
+  <rule ref="rulesets/empty.xml/EmptyStatementNotInLoop">
     <priority>3</priority>
   </rule>
   <rule ref="rulesets/design.xml/EmptyMethodInAbstractClassShouldBeAbstract">
     <priority>3</priority>
   </rule>
-  <rule ref="rulesets/basic.xml/EmptyTryBlock">
+  <rule ref="rulesets/empty.xml/EmptyTryBlock">
     <priority>3</priority>
   </rule>
   <rule ref="rulesets/strings.xml/StringToString">
@@ -625,10 +621,10 @@
   <rule ref="rulesets/design.xml/DefaultLabelNotLastInSwitchStmt">
     <priority>3</priority>
   </rule>
-  <rule ref="rulesets/basic.xml/EmptySwitchStatements">
+  <rule ref="rulesets/empty.xml/EmptySwitchStatements">
     <priority>3</priority>
   </rule>
-  <rule ref="rulesets/basic.xml/EmptyStaticInitializer">
+  <rule ref="rulesets/empty.xml/EmptyStaticInitializer">
     <priority>3</priority>
   </rule>
   <rule ref="rulesets/finalizers.xml/EmptyFinalizer">
@@ -652,7 +648,7 @@
   <rule ref="rulesets/strings.xml/InefficientEmptyStringCheck">
     <priority>3</priority>
   </rule>
-  <rule ref="rulesets/basic.xml/ReturnFromFinallyBlock">
+  <rule ref="rulesets/empty.xml/ReturnFromFinallyBlock">
     <priority>3</priority>
   </rule>
   <rule ref="rulesets/strictexception.xml/AvoidThrowingNewInstanceOfSameException">

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-cache-invalidation/pom.xml
----------------------------------------------------------------------
diff --git a/cayenne-cache-invalidation/pom.xml b/cayenne-cache-invalidation/pom.xml
index 9cfe965..346b3fc 100644
--- a/cayenne-cache-invalidation/pom.xml
+++ b/cayenne-cache-invalidation/pom.xml
@@ -84,5 +84,20 @@
             </plugin>
         </plugins>
     </build>
+    <profiles>
+        <profile>
+            <id>code-quality</id>
 
+            <build>
+                <plugins>
+                    <plugin>
+                        <artifactId>maven-checkstyle-plugin</artifactId>
+                    </plugin>
+                    <plugin>
+                        <artifactId>maven-pmd-plugin</artifactId>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
 </project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-cache-invalidation/src/main/java/org/apache/cayenne/cache/invalidation/CacheInvalidationModuleProvider.java
----------------------------------------------------------------------
diff --git a/cayenne-cache-invalidation/src/main/java/org/apache/cayenne/cache/invalidation/CacheInvalidationModuleProvider.java b/cayenne-cache-invalidation/src/main/java/org/apache/cayenne/cache/invalidation/CacheInvalidationModuleProvider.java
index d8a4004..3d3b34c 100644
--- a/cayenne-cache-invalidation/src/main/java/org/apache/cayenne/cache/invalidation/CacheInvalidationModuleProvider.java
+++ b/cayenne-cache-invalidation/src/main/java/org/apache/cayenne/cache/invalidation/CacheInvalidationModuleProvider.java
@@ -44,7 +44,6 @@ public class CacheInvalidationModuleProvider implements CayenneServerModuleProvi
     @SuppressWarnings("unchecked")
     @Override
     public Collection<Class<? extends Module>> overrides() {
-        Collection modules = Collections.singletonList(ServerModule.class);
-        return modules;
+        return Collections.singletonList(ServerModule.class);
     }
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-cgen/pom.xml
----------------------------------------------------------------------
diff --git a/cayenne-cgen/pom.xml b/cayenne-cgen/pom.xml
index d95761d..d99a409 100644
--- a/cayenne-cgen/pom.xml
+++ b/cayenne-cgen/pom.xml
@@ -76,4 +76,23 @@
             </plugin>
         </plugins>
     </build>
+    <profiles>
+        <profile>
+            <id>code-quality</id>
+
+            <build>
+                <plugins>
+                    <plugin>
+                        <artifactId>maven-checkstyle-plugin</artifactId>
+                        <!--<configuration>
+                            <suppressionsLocation>${project.basedir}/cayenne-checkstyle-suppression.xml</suppressionsLocation>
+                        </configuration>-->
+                    </plugin>
+                    <plugin>
+                        <artifactId>maven-pmd-plugin</artifactId>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
 </project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-cgen/src/main/java/org/apache/cayenne/gen/StringUtils.java
----------------------------------------------------------------------
diff --git a/cayenne-cgen/src/main/java/org/apache/cayenne/gen/StringUtils.java b/cayenne-cgen/src/main/java/org/apache/cayenne/gen/StringUtils.java
index 85e328e..c48fd23 100644
--- a/cayenne-cgen/src/main/java/org/apache/cayenne/gen/StringUtils.java
+++ b/cayenne-cgen/src/main/java/org/apache/cayenne/gen/StringUtils.java
@@ -65,13 +65,15 @@ public class StringUtils {
      * @since 1.2
      */
     public String stripClass(String aString) {
-        if (aString == null || aString.length() == 0)
+        if (aString == null || aString.length() == 0) {
             return aString;
+        }
 
         int lastDot = aString.lastIndexOf('.');
 
-        if (-1 == lastDot)
+        if (-1 == lastDot) {
             return "";
+        }
 
         return aString.substring(0, lastDot);
     }
@@ -100,8 +102,9 @@ public class StringUtils {
      * @since 1.1
      */
     public String capitalizedAsConstant(String name) {
-        if (name == null || name.length() == 0)
+        if (name == null || name.length() == 0) {
             return name;
+        }
 
         // clear of non-java chars. While the method name implies that a passed identifier
         // is pure Java, it is used to build pk columns names and such, so extra safety

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-client-jetty/pom.xml
----------------------------------------------------------------------
diff --git a/cayenne-client-jetty/pom.xml b/cayenne-client-jetty/pom.xml
index 449f258..ea094c2 100644
--- a/cayenne-client-jetty/pom.xml
+++ b/cayenne-client-jetty/pom.xml
@@ -148,11 +148,6 @@
         <profile>
             <id>code-quality</id>
 
-            <activation>
-                <property>
-                    <name>!fast-and-dirty</name>
-                </property>
-            </activation>
             <build>
                 <plugins>
                     <plugin>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-client-jetty/src/main/java/org/apache/cayenne/rop/JettyHttpClientConnectionProvider.java
----------------------------------------------------------------------
diff --git a/cayenne-client-jetty/src/main/java/org/apache/cayenne/rop/JettyHttpClientConnectionProvider.java b/cayenne-client-jetty/src/main/java/org/apache/cayenne/rop/JettyHttpClientConnectionProvider.java
index 3a3fb25..ab4611d 100644
--- a/cayenne-client-jetty/src/main/java/org/apache/cayenne/rop/JettyHttpClientConnectionProvider.java
+++ b/cayenne-client-jetty/src/main/java/org/apache/cayenne/rop/JettyHttpClientConnectionProvider.java
@@ -43,7 +43,7 @@ import java.net.URI;
  */
 public class JettyHttpClientConnectionProvider implements Provider<ClientConnection> {
 
-    private static Logger logger = LoggerFactory.getLogger(JettyHttpROPConnector.class);
+    private static final Logger logger = LoggerFactory.getLogger(JettyHttpROPConnector.class);
 
     @Inject
     protected RuntimeProperties runtimeProperties;

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-client-jetty/src/main/java/org/apache/cayenne/rop/http/JettyHttpROPConnector.java
----------------------------------------------------------------------
diff --git a/cayenne-client-jetty/src/main/java/org/apache/cayenne/rop/http/JettyHttpROPConnector.java b/cayenne-client-jetty/src/main/java/org/apache/cayenne/rop/http/JettyHttpROPConnector.java
index 2a308dc..3e9642b 100644
--- a/cayenne-client-jetty/src/main/java/org/apache/cayenne/rop/http/JettyHttpROPConnector.java
+++ b/cayenne-client-jetty/src/main/java/org/apache/cayenne/rop/http/JettyHttpROPConnector.java
@@ -47,7 +47,7 @@ import java.util.concurrent.TimeUnit;
  */
 public class JettyHttpROPConnector implements ROPConnector {
 
-    private static Logger logger = LoggerFactory.getLogger(JettyHttpROPConnector.class);
+    private static final Logger logger = LoggerFactory.getLogger(JettyHttpROPConnector.class);
 
     public static final String SESSION_COOKIE_NAME = "JSESSIONID";
 
@@ -60,9 +60,10 @@ public class JettyHttpROPConnector implements ROPConnector {
     protected Long readTimeout = 5l;
 
     public JettyHttpROPConnector(HttpClient httpClient, String url, String username) {
-        if (httpClient == null)
+        if (httpClient == null) {
             throw new IllegalArgumentException("org.eclipse.jetty.client.HttpClient should be provided " +
                     "for this ROPConnector implementation.");
+        }
 
         this.httpClient = httpClient;
         this.url = url;

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-client/pom.xml
----------------------------------------------------------------------
diff --git a/cayenne-client/pom.xml b/cayenne-client/pom.xml
index 725b3a1..bef6926 100644
--- a/cayenne-client/pom.xml
+++ b/cayenne-client/pom.xml
@@ -200,11 +200,6 @@
         <profile>
             <id>code-quality</id>
 
-            <activation>
-                <property>
-                    <name>!fast-and-dirty</name>
-                </property>
-            </activation>
             <build>
                 <plugins>
                     <plugin>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-client/src/main/java/org/apache/cayenne/remote/BaseConnection.java
----------------------------------------------------------------------
diff --git a/cayenne-client/src/main/java/org/apache/cayenne/remote/BaseConnection.java b/cayenne-client/src/main/java/org/apache/cayenne/remote/BaseConnection.java
index b26a5a7..3fdee22 100644
--- a/cayenne-client/src/main/java/org/apache/cayenne/remote/BaseConnection.java
+++ b/cayenne-client/src/main/java/org/apache/cayenne/remote/BaseConnection.java
@@ -48,7 +48,7 @@ public abstract class BaseConnection implements ClientConnection {
      */
     public Object sendMessage(ClientMessage message) throws CayenneRuntimeException {
         if (message == null) {
-            throw new NullPointerException("Null message");
+            throw new IllegalArgumentException("Null message");
         }
 
         beforeSendMessage(message);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-client/src/main/java/org/apache/cayenne/remote/hessian/DataRowDeserializer.java
----------------------------------------------------------------------
diff --git a/cayenne-client/src/main/java/org/apache/cayenne/remote/hessian/DataRowDeserializer.java b/cayenne-client/src/main/java/org/apache/cayenne/remote/hessian/DataRowDeserializer.java
index fcf9e31..a941bd4 100644
--- a/cayenne-client/src/main/java/org/apache/cayenne/remote/hessian/DataRowDeserializer.java
+++ b/cayenne-client/src/main/java/org/apache/cayenne/remote/hessian/DataRowDeserializer.java
@@ -61,7 +61,7 @@ class DataRowDeserializer extends AbstractMapDeserializer {
         int size = in.readInt();
         DataRow row = new DataRow(size);
         try {
-            versionField.set(row, new Long(in.readLong()));
+            versionField.set(row, Long.valueOf(in.readLong()));
         }
         catch (Exception e) {
             throw new IOException("Error reading 'version' field");

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-client/src/main/java/org/apache/cayenne/rop/ROPUtil.java
----------------------------------------------------------------------
diff --git a/cayenne-client/src/main/java/org/apache/cayenne/rop/ROPUtil.java b/cayenne-client/src/main/java/org/apache/cayenne/rop/ROPUtil.java
index cb5cca9..44aa7b1 100644
--- a/cayenne-client/src/main/java/org/apache/cayenne/rop/ROPUtil.java
+++ b/cayenne-client/src/main/java/org/apache/cayenne/rop/ROPUtil.java
@@ -135,16 +135,21 @@ public class ROPUtil {
 
     public static char encode(long d) {
         d &= 0x3f;
-        if (d < 26)
+        if (d < 26) {
             return (char) (d + 'A');
-        else if (d < 52)
+        }
+        else if (d < 52) {
             return (char) (d + 'a' - 26);
-        else if (d < 62)
+        }
+        else if (d < 62) {
             return (char) (d + '0' - 52);
-        else if (d == 62)
+        }
+        else if (d == 62) {
             return '+';
-        else
+        }
+        else {
             return '/';
+        }
     }
 
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-client/src/main/java/org/apache/cayenne/rop/http/HttpROPConnector.java
----------------------------------------------------------------------
diff --git a/cayenne-client/src/main/java/org/apache/cayenne/rop/http/HttpROPConnector.java b/cayenne-client/src/main/java/org/apache/cayenne/rop/http/HttpROPConnector.java
index ee23ce3..50d6eb2 100644
--- a/cayenne-client/src/main/java/org/apache/cayenne/rop/http/HttpROPConnector.java
+++ b/cayenne-client/src/main/java/org/apache/cayenne/rop/http/HttpROPConnector.java
@@ -37,7 +37,7 @@ import java.util.Map;
 
 public class HttpROPConnector implements ROPConnector {
 
-    private static Logger logger = LoggerFactory.getLogger(HttpROPConnector.class);
+    private static final Logger logger = LoggerFactory.getLogger(HttpROPConnector.class);
 
     public static final String SESSION_COOKIE_NAME = "JSESSIONID";
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-commitlog/pom.xml
----------------------------------------------------------------------
diff --git a/cayenne-commitlog/pom.xml b/cayenne-commitlog/pom.xml
index 96989e2..e1026e9 100644
--- a/cayenne-commitlog/pom.xml
+++ b/cayenne-commitlog/pom.xml
@@ -89,5 +89,20 @@
             </plugin>
         </plugins>
     </build>
+    <profiles>
+        <profile>
+            <id>code-quality</id>
 
+            <build>
+                <plugins>
+                    <plugin>
+                        <artifactId>maven-checkstyle-plugin</artifactId>
+                    </plugin>
+                    <plugin>
+                        <artifactId>maven-pmd-plugin</artifactId>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
 </project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-commitlog/src/main/java/org/apache/cayenne/commitlog/CommitLogServerModuleProvider.java
----------------------------------------------------------------------
diff --git a/cayenne-commitlog/src/main/java/org/apache/cayenne/commitlog/CommitLogServerModuleProvider.java b/cayenne-commitlog/src/main/java/org/apache/cayenne/commitlog/CommitLogServerModuleProvider.java
index eed3de4..4294c3e 100644
--- a/cayenne-commitlog/src/main/java/org/apache/cayenne/commitlog/CommitLogServerModuleProvider.java
+++ b/cayenne-commitlog/src/main/java/org/apache/cayenne/commitlog/CommitLogServerModuleProvider.java
@@ -44,7 +44,6 @@ public class CommitLogServerModuleProvider implements CayenneServerModuleProvide
     @SuppressWarnings("unchecked")
     @Override
     public Collection<Class<? extends Module>> overrides() {
-        Collection modules = Collections.singletonList(ServerModule.class);
-        return modules;
+        return Collections.singletonList(ServerModule.class);
     }
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-crypto/pom.xml
----------------------------------------------------------------------
diff --git a/cayenne-crypto/pom.xml b/cayenne-crypto/pom.xml
index a7407d1..86836db 100644
--- a/cayenne-crypto/pom.xml
+++ b/cayenne-crypto/pom.xml
@@ -87,7 +87,6 @@
 				<configuration>
 					<map>${project.basedir}/src/test/resources/datamap.map.xml</map>
 					<destDir>${project.basedir}/src/test/java</destDir>
-					<defaultPackage>org.apache.cayenne.crypto.db</defaultPackage>
 					<superPkg>org.apache.cayenne.crypto.db.auto</superPkg>
 				</configuration>
 				<executions>
@@ -106,11 +105,6 @@
         <profile>
             <id>code-quality</id>
 
-            <activation>
-                <property>
-                    <name>!fast-and-dirty</name>
-                </property>
-            </activation>
             <build>
                 <plugins>
                     <plugin>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-dbsync/pom.xml
----------------------------------------------------------------------
diff --git a/cayenne-dbsync/pom.xml b/cayenne-dbsync/pom.xml
index 5c68b4d..09ab69e 100644
--- a/cayenne-dbsync/pom.xml
+++ b/cayenne-dbsync/pom.xml
@@ -234,5 +234,19 @@
 				</plugins>
 			</build>
 		</profile>
+		<profile>
+			<id>code-quality</id>
+
+			<build>
+				<plugins>
+					<plugin>
+						<artifactId>maven-checkstyle-plugin</artifactId>
+					</plugin>
+					<plugin>
+						<artifactId>maven-pmd-plugin</artifactId>
+					</plugin>
+				</plugins>
+			</build>
+		</profile>
 	</profiles>
 </project>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/merge/factory/IngresMergerTokenFactory.java
----------------------------------------------------------------------
diff --git a/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/merge/factory/IngresMergerTokenFactory.java b/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/merge/factory/IngresMergerTokenFactory.java
index 512d53b..e9f1d6c 100644
--- a/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/merge/factory/IngresMergerTokenFactory.java
+++ b/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/merge/factory/IngresMergerTokenFactory.java
@@ -103,8 +103,9 @@ public class IngresMergerTokenFactory extends DefaultMergerTokenFactory {
                         if (!first) {
                             buf.append(", ");
                             refBuf.append(", ");
-                        } else
+                        } else {
                             first = false;
+                        }
 
                         buf.append(context.quotedSourceName(join));
                         refBuf.append(context.quotedTargetName(join));

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/configuration/ToolsModule.java
----------------------------------------------------------------------
diff --git a/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/configuration/ToolsModule.java b/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/configuration/ToolsModule.java
index 8e3673d..5a96386 100644
--- a/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/configuration/ToolsModule.java
+++ b/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/configuration/ToolsModule.java
@@ -79,7 +79,7 @@ public class ToolsModule implements Module {
     public ToolsModule(Logger logger) {
 
         if (logger == null) {
-            throw new NullPointerException("Null logger");
+            throw new IllegalArgumentException("Null logger");
         }
 
         this.logger = logger;

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/dbimport/DefaultDbImportAction.java
----------------------------------------------------------------------
diff --git a/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/dbimport/DefaultDbImportAction.java b/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/dbimport/DefaultDbImportAction.java
index c31aaab..7446c5f 100644
--- a/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/dbimport/DefaultDbImportAction.java
+++ b/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/dbimport/DefaultDbImportAction.java
@@ -63,6 +63,8 @@ import java.util.Collections;
 import java.util.LinkedList;
 import java.util.List;
 
+import static org.apache.cayenne.util.Util.isBlank;
+
 /**
  * A default implementation of {@link DbImportAction} that can load DB schema and merge it to a new or an existing
  * DataMap.
@@ -194,7 +196,7 @@ public class DefaultDbImportAction implements DbImportAction {
 
     private boolean syncDataMapProperties(DataMap targetDataMap, DbImportConfiguration config) {
         String defaultPackage = config.getDefaultPackage();
-        if (defaultPackage == null || defaultPackage.trim().length() == 0) {
+        if (defaultPackage == null || isBlank(defaultPackage.trim())) {
             return false;
         }
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/dbimport/FilterContainer.java
----------------------------------------------------------------------
diff --git a/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/dbimport/FilterContainer.java b/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/dbimport/FilterContainer.java
index 552b6e7..a05f8dd 100644
--- a/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/dbimport/FilterContainer.java
+++ b/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/dbimport/FilterContainer.java
@@ -19,9 +19,12 @@
 
 package org.apache.cayenne.dbsync.reverse.dbimport;
 
+import org.apache.cayenne.util.Util;
+
 import java.util.Collection;
 import java.util.LinkedList;
 
+
 /**
  * @since 4.0.
  */
@@ -153,7 +156,7 @@ public abstract class FilterContainer {
     }
 
     public void addText(String name) {
-        if (name.trim().isEmpty()) {
+        if (Util.isBlank(name.trim())) {
             return;
         }
         setName(name);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/dbimport/PatternParam.java
----------------------------------------------------------------------
diff --git a/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/dbimport/PatternParam.java b/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/dbimport/PatternParam.java
index 4208e64..f0ec3ed 100644
--- a/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/dbimport/PatternParam.java
+++ b/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/dbimport/PatternParam.java
@@ -19,6 +19,8 @@
 
 package org.apache.cayenne.dbsync.reverse.dbimport;
 
+import static org.apache.cayenne.util.Util.isBlank;
+
 /**
  * @since 4.0.
  */
@@ -57,7 +59,7 @@ public class PatternParam {
      * Used by Ant task
      */
     public void addText(String pattern) {
-        if (pattern.trim().isEmpty()) {
+        if (isBlank(pattern.trim())) {
             return;
         }
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-di/pom.xml
----------------------------------------------------------------------
diff --git a/cayenne-di/pom.xml b/cayenne-di/pom.xml
index 5a67bb2..25a82bc 100644
--- a/cayenne-di/pom.xml
+++ b/cayenne-di/pom.xml
@@ -69,11 +69,6 @@
         <profile>
             <id>code-quality</id>
 
-            <activation>
-                <property>
-                    <name>!fast-and-dirty</name>
-                </property>
-            </activation>
             <build>
                 <plugins>
                     <plugin>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-di/src/main/java/org/apache/cayenne/di/Key.java
----------------------------------------------------------------------
diff --git a/cayenne-di/src/main/java/org/apache/cayenne/di/Key.java b/cayenne-di/src/main/java/org/apache/cayenne/di/Key.java
index d3c35df..47c9f1d 100644
--- a/cayenne-di/src/main/java/org/apache/cayenne/di/Key.java
+++ b/cayenne-di/src/main/java/org/apache/cayenne/di/Key.java
@@ -81,7 +81,7 @@ public class Key<T> {
 
     protected Key(TypeLiteral<T> type, String bindingName) {
         if (type == null) {
-            throw new NullPointerException("Null key type");
+            throw new IllegalArgumentException("Null key type");
         }
 
         this.typeLiteral = type;

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-di/src/main/java/org/apache/cayenne/di/TypeLiteral.java
----------------------------------------------------------------------
diff --git a/cayenne-di/src/main/java/org/apache/cayenne/di/TypeLiteral.java b/cayenne-di/src/main/java/org/apache/cayenne/di/TypeLiteral.java
index a43973f..7e729b2 100644
--- a/cayenne-di/src/main/java/org/apache/cayenne/di/TypeLiteral.java
+++ b/cayenne-di/src/main/java/org/apache/cayenne/di/TypeLiteral.java
@@ -69,12 +69,16 @@ class TypeLiteral<T> {
 
     @Override
     public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
+        if (this == o) { return true; }
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
 
         TypeLiteral<?> that = (TypeLiteral<?>) o;
 
-        if (!typeName.equals(that.typeName)) return false;
+        if (!typeName.equals(that.typeName)){
+            return false;
+        }
         return Arrays.equals(argumentsType, that.argumentsType);
     }
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-di/src/main/java/org/apache/cayenne/di/spi/DIGraph.java
----------------------------------------------------------------------
diff --git a/cayenne-di/src/main/java/org/apache/cayenne/di/spi/DIGraph.java b/cayenne-di/src/main/java/org/apache/cayenne/di/spi/DIGraph.java
index 6e8592b..4379df8 100644
--- a/cayenne-di/src/main/java/org/apache/cayenne/di/spi/DIGraph.java
+++ b/cayenne-di/src/main/java/org/apache/cayenne/di/spi/DIGraph.java
@@ -85,8 +85,9 @@ class DIGraph<V> {
 	 *             if either vertex doesn't exist.
 	 */
 	public void remove(V from, V to) {
-		if (!(this.contains(from) && this.contains(to)))
+		if (!(this.contains(from) && this.contains(to))) {
 			throw new IllegalArgumentException("Nonexistent vertex");
+		}
 
 		neighbors.get(from).remove(to);
 	}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-di/src/main/java/org/apache/cayenne/di/spi/DefaultAdhocObjectFactory.java
----------------------------------------------------------------------
diff --git a/cayenne-di/src/main/java/org/apache/cayenne/di/spi/DefaultAdhocObjectFactory.java b/cayenne-di/src/main/java/org/apache/cayenne/di/spi/DefaultAdhocObjectFactory.java
index ab2728d..241b6b6 100644
--- a/cayenne-di/src/main/java/org/apache/cayenne/di/spi/DefaultAdhocObjectFactory.java
+++ b/cayenne-di/src/main/java/org/apache/cayenne/di/spi/DefaultAdhocObjectFactory.java
@@ -50,11 +50,11 @@ public class DefaultAdhocObjectFactory implements AdhocObjectFactory {
     public <T> T newInstance(Class<? super T> superType, String className) {
 
         if (superType == null) {
-            throw new NullPointerException("Null superType");
+            throw new IllegalArgumentException("Null superType");
         }
 
         if (className == null) {
-            throw new NullPointerException("Null className");
+            throw new IllegalArgumentException("Null className");
         }
 
         Class<T> type = (Class<T>) getJavaClass(className);
@@ -82,7 +82,7 @@ public class DefaultAdhocObjectFactory implements AdhocObjectFactory {
         // is there a better way to get array class from string name?
 
         if (className == null) {
-            throw new NullPointerException("Null class name");
+            throw new IllegalArgumentException("Null class name");
         }
 
         ClassLoader classLoader = classLoaderManager.getClassLoader(className.replace('.', '/'));

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-di/src/main/java/org/apache/cayenne/di/spi/DefaultInjector.java
----------------------------------------------------------------------
diff --git a/cayenne-di/src/main/java/org/apache/cayenne/di/spi/DefaultInjector.java b/cayenne-di/src/main/java/org/apache/cayenne/di/spi/DefaultInjector.java
index a998cf4..e9dfdb4 100644
--- a/cayenne-di/src/main/java/org/apache/cayenne/di/spi/DefaultInjector.java
+++ b/cayenne-di/src/main/java/org/apache/cayenne/di/spi/DefaultInjector.java
@@ -80,7 +80,7 @@ public class DefaultInjector implements Injector {
 	<T> Binding<T> getBinding(Key<T> key) throws DIRuntimeException {
 
         if (key == null) {
-            throw new NullPointerException("Null key");
+            throw new IllegalArgumentException("Null key");
         }
 
         // may return null - this is intentionally allowed in this non-public method
@@ -148,7 +148,7 @@ public class DefaultInjector implements Injector {
     public <T> Provider<T> getProvider(Key<T> key) throws DIRuntimeException {
 
         if (key == null) {
-            throw new NullPointerException("Null key");
+            throw new IllegalArgumentException("Null key");
         }
 
         @SuppressWarnings("unchecked")

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-jcache/pom.xml
----------------------------------------------------------------------
diff --git a/cayenne-jcache/pom.xml b/cayenne-jcache/pom.xml
index 07fb5a3..3e91066 100644
--- a/cayenne-jcache/pom.xml
+++ b/cayenne-jcache/pom.xml
@@ -221,6 +221,23 @@
                 </plugins>
             </build>
         </profile>
+        <profile>
+            <id>code-quality</id>
+
+            <build>
+                <plugins>
+                    <plugin>
+                        <artifactId>maven-checkstyle-plugin</artifactId>
+                        <!--<configuration>
+                            <suppressionsLocation>${project.basedir}/cayenne-checkstyle-suppression.xml</suppressionsLocation>
+                        </configuration>-->
+                    </plugin>
+                    <plugin>
+                        <artifactId>maven-pmd-plugin</artifactId>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
     </profiles>
 
 </project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-jcache/src/main/java/org/apache/cayenne/jcache/JCacheConstants.java
----------------------------------------------------------------------
diff --git a/cayenne-jcache/src/main/java/org/apache/cayenne/jcache/JCacheConstants.java b/cayenne-jcache/src/main/java/org/apache/cayenne/jcache/JCacheConstants.java
index 63a2ca6..a2183f5 100644
--- a/cayenne-jcache/src/main/java/org/apache/cayenne/jcache/JCacheConstants.java
+++ b/cayenne-jcache/src/main/java/org/apache/cayenne/jcache/JCacheConstants.java
@@ -22,12 +22,13 @@ package org.apache.cayenne.jcache;
 /**
  * @since 4.0
  */
-public interface JCacheConstants {
+public final class JCacheConstants {
 
+    private JCacheConstants() {}
     /**
      * Default JCache cache name. This will be the cache used for queries with no explicit cache groups.
      */
-    String DEFAULT_CACHE_NAME = "cayenne.default.cache";
+    public static final String DEFAULT_CACHE_NAME = "cayenne.default.cache";
 
-    String JCACHE_PROVIDER_CONFIG = "cayenne.jcache.provider_config";
+    public static final String JCACHE_PROVIDER_CONFIG = "cayenne.jcache.provider_config";
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-jcache/src/main/java/org/apache/cayenne/jcache/JCacheServerModuleProvider.java
----------------------------------------------------------------------
diff --git a/cayenne-jcache/src/main/java/org/apache/cayenne/jcache/JCacheServerModuleProvider.java b/cayenne-jcache/src/main/java/org/apache/cayenne/jcache/JCacheServerModuleProvider.java
index 375f896..6dcd227 100644
--- a/cayenne-jcache/src/main/java/org/apache/cayenne/jcache/JCacheServerModuleProvider.java
+++ b/cayenne-jcache/src/main/java/org/apache/cayenne/jcache/JCacheServerModuleProvider.java
@@ -44,7 +44,6 @@ public class JCacheServerModuleProvider implements CayenneServerModuleProvider {
     @SuppressWarnings("unchecked")
     @Override
     public Collection<Class<? extends Module>> overrides() {
-        Collection modules = Collections.singletonList(ServerModule.class);
-        return modules;
+        return Collections.singletonList(ServerModule.class);
     }
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-joda/pom.xml
----------------------------------------------------------------------
diff --git a/cayenne-joda/pom.xml b/cayenne-joda/pom.xml
index af6c079..25d1ab5 100644
--- a/cayenne-joda/pom.xml
+++ b/cayenne-joda/pom.xml
@@ -120,18 +120,25 @@
 				<configuration>
 					<map>${project.basedir}/src/test/resources/joda.map.xml</map>
 					<destDir>${project.basedir}/src/test/java</destDir>
-					<defaultPackage>org.apache.cayenne.joda.db</defaultPackage>
 					<superPkg>org.apache.cayenne.joda.db.auto</superPkg>
 				</configuration>
 			</plugin>
-			<plugin>
-				<artifactId>maven-checkstyle-plugin</artifactId>
-				<!--<configuration> <suppressionsLocation>${project.basedir}/cayenne-checkstyle-suppression.xml</suppressionsLocation> 
-					</configuration> -->
-			</plugin>
-			<plugin>
-				<artifactId>maven-pmd-plugin</artifactId>
-			</plugin>
 		</plugins>
 	</build>
+	<profiles>
+		<profile>
+			<id>code-quality</id>
+
+			<build>
+				<plugins>
+					<plugin>
+						<artifactId>maven-checkstyle-plugin</artifactId>
+					</plugin>
+					<plugin>
+						<artifactId>maven-pmd-plugin</artifactId>
+					</plugin>
+				</plugins>
+			</build>
+		</profile>
+	</profiles>
 </project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-lifecycle/pom.xml
----------------------------------------------------------------------
diff --git a/cayenne-lifecycle/pom.xml b/cayenne-lifecycle/pom.xml
index e9f580a..d058c62 100644
--- a/cayenne-lifecycle/pom.xml
+++ b/cayenne-lifecycle/pom.xml
@@ -85,11 +85,6 @@
 		<profile>
 			<id>code-quality</id>
 
-			<activation>
-				<property>
-					<name>!fast-and-dirty</name>
-				</property>
-			</activation>
 			<build>
 				<plugins>
 					<plugin>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/id/EntityIdCoder.java
----------------------------------------------------------------------
diff --git a/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/id/EntityIdCoder.java b/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/id/EntityIdCoder.java
index 092aa27..d0a6227 100644
--- a/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/id/EntityIdCoder.java
+++ b/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/id/EntityIdCoder.java
@@ -216,7 +216,7 @@ public class EntityIdCoder {
     private Converter create(Class<?> type) {
 
         if (type == null) {
-            throw new NullPointerException("Null type");
+            throw new IllegalArgumentException("Null type");
         }
 
         if (Long.class.isAssignableFrom(type)) {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/id/IdCoder.java
----------------------------------------------------------------------
diff --git a/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/id/IdCoder.java b/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/id/IdCoder.java
index 696a2b4..bad72f6 100644
--- a/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/id/IdCoder.java
+++ b/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/id/IdCoder.java
@@ -63,7 +63,7 @@ public class IdCoder {
     public String getStringId(Persistent object) {
 
         if (object == null) {
-            throw new NullPointerException("Null object");
+            throw new IllegalArgumentException("Null object");
         }
 
         ObjectId id = object.getObjectId();

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/id/StringIdQuery.java
----------------------------------------------------------------------
diff --git a/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/id/StringIdQuery.java b/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/id/StringIdQuery.java
index 89646d2..d319f09 100644
--- a/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/id/StringIdQuery.java
+++ b/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/id/StringIdQuery.java
@@ -62,7 +62,7 @@ public class StringIdQuery implements Query {
     private static Collection<String> toCollection(String... stringIds) {
 
         if (stringIds == null) {
-            throw new NullPointerException("Null stringIds");
+            throw new IllegalArgumentException("Null stringIds");
         }
 
         return Arrays.asList(stringIds);
@@ -88,7 +88,7 @@ public class StringIdQuery implements Query {
 
     public void addStringIds(String... ids) {
         if (ids == null) {
-            throw new NullPointerException("Null ids");
+            throw new IllegalArgumentException("Null ids");
         }
 
         boolean changed = false;

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-osgi/pom.xml
----------------------------------------------------------------------
diff --git a/cayenne-osgi/pom.xml b/cayenne-osgi/pom.xml
index ffe3fdc..7dc3b16 100644
--- a/cayenne-osgi/pom.xml
+++ b/cayenne-osgi/pom.xml
@@ -89,4 +89,20 @@
             </plugin>
         </plugins>
     </build>
+    <profiles>
+        <profile>
+            <id>code-quality</id>
+
+            <build>
+                <plugins>
+                    <plugin>
+                        <artifactId>maven-checkstyle-plugin</artifactId>
+                    </plugin>
+                    <plugin>
+                        <artifactId>maven-pmd-plugin</artifactId>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
 </project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-osgi/src/main/java/org/apache/cayenne/configuration/osgi/OsgiModuleBuilder.java
----------------------------------------------------------------------
diff --git a/cayenne-osgi/src/main/java/org/apache/cayenne/configuration/osgi/OsgiModuleBuilder.java b/cayenne-osgi/src/main/java/org/apache/cayenne/configuration/osgi/OsgiModuleBuilder.java
index 481f220..6214452 100644
--- a/cayenne-osgi/src/main/java/org/apache/cayenne/configuration/osgi/OsgiModuleBuilder.java
+++ b/cayenne-osgi/src/main/java/org/apache/cayenne/configuration/osgi/OsgiModuleBuilder.java
@@ -34,7 +34,7 @@ public class OsgiModuleBuilder {
     public static OsgiModuleBuilder forProject(Class<?> typeFromProjectBundle) {
 
         if (typeFromProjectBundle == null) {
-            throw new NullPointerException("Null 'typeFromProjectBundle'");
+            throw new IllegalArgumentException("Null 'typeFromProjectBundle'");
         }
 
         return new OsgiModuleBuilder(typeFromProjectBundle);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-project-compatibility/pom.xml
----------------------------------------------------------------------
diff --git a/cayenne-project-compatibility/pom.xml b/cayenne-project-compatibility/pom.xml
index 7726786..37629f2 100644
--- a/cayenne-project-compatibility/pom.xml
+++ b/cayenne-project-compatibility/pom.xml
@@ -59,4 +59,20 @@
         </dependency>
     </dependencies>
 
+    <profiles>
+        <profile>
+            <id>code-quality</id>
+
+            <build>
+                <plugins>
+                    <plugin>
+                        <artifactId>maven-checkstyle-plugin</artifactId>
+                    </plugin>
+                    <plugin>
+                        <artifactId>maven-pmd-plugin</artifactId>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
 </project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-project-compatibility/src/main/java/org/apache/cayenne/configuration/xml/CompatibilityDataChannelDescriptorLoader.java
----------------------------------------------------------------------
diff --git a/cayenne-project-compatibility/src/main/java/org/apache/cayenne/configuration/xml/CompatibilityDataChannelDescriptorLoader.java b/cayenne-project-compatibility/src/main/java/org/apache/cayenne/configuration/xml/CompatibilityDataChannelDescriptorLoader.java
index 575f080..bbe7f1b 100644
--- a/cayenne-project-compatibility/src/main/java/org/apache/cayenne/configuration/xml/CompatibilityDataChannelDescriptorLoader.java
+++ b/cayenne-project-compatibility/src/main/java/org/apache/cayenne/configuration/xml/CompatibilityDataChannelDescriptorLoader.java
@@ -52,7 +52,7 @@ import org.xml.sax.XMLReader;
  */
 public class CompatibilityDataChannelDescriptorLoader extends XMLDataChannelDescriptorLoader {
 
-    private static Logger logger = LoggerFactory.getLogger(XMLDataChannelDescriptorLoader.class);
+    private static final Logger logger = LoggerFactory.getLogger(XMLDataChannelDescriptorLoader.class);
 
     @Inject
     Provider<UpgradeService> upgradeServiceProvider;
@@ -63,7 +63,7 @@ public class CompatibilityDataChannelDescriptorLoader extends XMLDataChannelDesc
     @Override
     public ConfigurationTree<DataChannelDescriptor> load(Resource configurationResource) throws ConfigurationException {
         if (configurationResource == null) {
-            throw new NullPointerException("Null configurationResource");
+            throw new IllegalArgumentException("Null configurationResource");
         }
 
         if(!(upgradeServiceProvider.get() instanceof CompatibilityUpgradeService)) {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-project-compatibility/src/main/java/org/apache/cayenne/project/compatibility/DefaultDocumentProvider.java
----------------------------------------------------------------------
diff --git a/cayenne-project-compatibility/src/main/java/org/apache/cayenne/project/compatibility/DefaultDocumentProvider.java b/cayenne-project-compatibility/src/main/java/org/apache/cayenne/project/compatibility/DefaultDocumentProvider.java
index 5682782..9ddae12 100644
--- a/cayenne-project-compatibility/src/main/java/org/apache/cayenne/project/compatibility/DefaultDocumentProvider.java
+++ b/cayenne-project-compatibility/src/main/java/org/apache/cayenne/project/compatibility/DefaultDocumentProvider.java
@@ -30,7 +30,7 @@ import org.w3c.dom.Document;
  */
 public class DefaultDocumentProvider implements DocumentProvider {
 
-    Map<String, Document> documentMap = new HashMap<>();
+    private Map<String, Document> documentMap = new HashMap<>();
 
     @Override
     public Document getDocument(URL url) {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-project/pom.xml
----------------------------------------------------------------------
diff --git a/cayenne-project/pom.xml b/cayenne-project/pom.xml
index 9869c52..f2acce3 100644
--- a/cayenne-project/pom.xml
+++ b/cayenne-project/pom.xml
@@ -94,11 +94,6 @@
         <profile>
             <id>code-quality</id>
 
-            <activation>
-                <property>
-                    <name>!fast-and-dirty</name>
-                </property>
-            </activation>
             <build>
                 <plugins>
                     <plugin>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-project/src/main/java/org/apache/cayenne/project/FileProjectSaver.java
----------------------------------------------------------------------
diff --git a/cayenne-project/src/main/java/org/apache/cayenne/project/FileProjectSaver.java b/cayenne-project/src/main/java/org/apache/cayenne/project/FileProjectSaver.java
index 0d6af44..e45ca89 100644
--- a/cayenne-project/src/main/java/org/apache/cayenne/project/FileProjectSaver.java
+++ b/cayenne-project/src/main/java/org/apache/cayenne/project/FileProjectSaver.java
@@ -88,7 +88,7 @@ public class FileProjectSaver implements ProjectSaver {
 	@Override
 	public void saveAs(Project project, Resource baseDirectory) {
 		if (baseDirectory == null) {
-			throw new NullPointerException("Null 'baseDirectory'");
+			throw new IllegalArgumentException("Null 'baseDirectory'");
 		}
 		save(project, baseDirectory, false);
 	}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-project/src/main/java/org/apache/cayenne/project/upgrade/DefaultUpgradeService.java
----------------------------------------------------------------------
diff --git a/cayenne-project/src/main/java/org/apache/cayenne/project/upgrade/DefaultUpgradeService.java b/cayenne-project/src/main/java/org/apache/cayenne/project/upgrade/DefaultUpgradeService.java
index 4e492e0..c4044a6 100644
--- a/cayenne-project/src/main/java/org/apache/cayenne/project/upgrade/DefaultUpgradeService.java
+++ b/cayenne-project/src/main/java/org/apache/cayenne/project/upgrade/DefaultUpgradeService.java
@@ -48,6 +48,8 @@ import org.apache.cayenne.project.ProjectSaver;
 import org.apache.cayenne.project.upgrade.handlers.UpgradeHandler;
 import org.apache.cayenne.resource.Resource;
 import org.apache.cayenne.util.Util;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.w3c.dom.Document;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
@@ -57,6 +59,8 @@ import org.xml.sax.SAXException;
 import org.xml.sax.XMLReader;
 import org.xml.sax.helpers.DefaultHandler;
 
+import static org.apache.cayenne.util.Util.isBlank;
+
 /**
  *
  * Upgrade service sequence is following:
@@ -81,6 +85,8 @@ import org.xml.sax.helpers.DefaultHandler;
  */
 public class DefaultUpgradeService implements UpgradeService {
 
+    private static final Logger logger = LoggerFactory.getLogger(DefaultUpgradeService.class);
+
     public static final String UNKNOWN_VERSION = "0";
     public static final String MIN_SUPPORTED_VERSION = "6";
 
@@ -221,7 +227,7 @@ public class DefaultUpgradeService implements UpgradeService {
                 resources.add(mapResource);
             }
         } catch (Exception ex) {
-            ex.printStackTrace();
+            logger.warn("Message: ", ex);
         }
         return resources;
     }
@@ -234,7 +240,7 @@ public class DefaultUpgradeService implements UpgradeService {
             Transformer transformer = TransformerFactory.newInstance().newTransformer();
             transformer.transform(input, output);
         } catch (Exception ex) {
-            ex.printStackTrace();
+            logger.warn("Message: ", ex);
         }
     }
 
@@ -261,7 +267,7 @@ public class DefaultUpgradeService implements UpgradeService {
     }
 
     protected static double decodeVersion(String version) {
-        if (version == null || version.trim().length() == 0) {
+        if (version == null || isBlank(version.trim())) {
             return 0;
         }
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-project/src/main/java/org/apache/cayenne/project/upgrade/handlers/UpgradeHandler_V9.java
----------------------------------------------------------------------
diff --git a/cayenne-project/src/main/java/org/apache/cayenne/project/upgrade/handlers/UpgradeHandler_V9.java b/cayenne-project/src/main/java/org/apache/cayenne/project/upgrade/handlers/UpgradeHandler_V9.java
index bc0d078..ac796ec 100644
--- a/cayenne-project/src/main/java/org/apache/cayenne/project/upgrade/handlers/UpgradeHandler_V9.java
+++ b/cayenne-project/src/main/java/org/apache/cayenne/project/upgrade/handlers/UpgradeHandler_V9.java
@@ -27,6 +27,8 @@ import javax.xml.xpath.XPathFactory;
 import org.apache.cayenne.configuration.DataChannelDescriptor;
 import org.apache.cayenne.project.upgrade.UpgradeUnit;
 import org.apache.cayenne.util.Util;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
@@ -36,6 +38,8 @@ import org.w3c.dom.Node;
  */
 public class UpgradeHandler_V9 implements UpgradeHandler {
 
+    private static final Logger logger = LoggerFactory.getLogger(UpgradeHandler_V9.class);
+
     @Override
     public String getVersion() {
         return "9";
@@ -71,7 +75,7 @@ public class UpgradeHandler_V9 implements UpgradeHandler {
                 dataMap.removeChild(reNode);
             }
         } catch (Exception ex) {
-            ex.printStackTrace();
+            logger.warn("Message: ", ex);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-protostuff/pom.xml
----------------------------------------------------------------------
diff --git a/cayenne-protostuff/pom.xml b/cayenne-protostuff/pom.xml
index c17a7dc..ff53438 100644
--- a/cayenne-protostuff/pom.xml
+++ b/cayenne-protostuff/pom.xml
@@ -126,11 +126,6 @@
         <profile>
             <id>code-quality</id>
 
-            <activation>
-                <property>
-                    <name>!fast-and-dirty</name>
-                </property>
-            </activation>
             <build>
                 <plugins>
                     <plugin>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-rop-server/pom.xml
----------------------------------------------------------------------
diff --git a/cayenne-rop-server/pom.xml b/cayenne-rop-server/pom.xml
index 4f0e92a..05f0817 100644
--- a/cayenne-rop-server/pom.xml
+++ b/cayenne-rop-server/pom.xml
@@ -90,5 +90,20 @@
             <scope>test</scope>
         </dependency>
     </dependencies>
+    <profiles>
+        <profile>
+            <id>code-quality</id>
 
+            <build>
+                <plugins>
+                    <plugin>
+                        <artifactId>maven-checkstyle-plugin</artifactId>
+                    </plugin>
+                    <plugin>
+                        <artifactId>maven-pmd-plugin</artifactId>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
 </project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-rop-server/src/main/java/org/apache/cayenne/CayenneContext.java
----------------------------------------------------------------------
diff --git a/cayenne-rop-server/src/main/java/org/apache/cayenne/CayenneContext.java b/cayenne-rop-server/src/main/java/org/apache/cayenne/CayenneContext.java
index c352ae0..c8b3620 100644
--- a/cayenne-rop-server/src/main/java/org/apache/cayenne/CayenneContext.java
+++ b/cayenne-rop-server/src/main/java/org/apache/cayenne/CayenneContext.java
@@ -240,7 +240,7 @@ public class CayenneContext extends BaseContext {
     @Override
     public <T> T newObject(Class<T> persistentClass) {
         if (persistentClass == null) {
-            throw new NullPointerException("Persistent class can't be null.");
+            throw new IllegalArgumentException("Persistent class can't be null.");
         }
 
         ObjEntity entity = getEntityResolver().getObjEntity(persistentClass);
@@ -262,7 +262,7 @@ public class CayenneContext extends BaseContext {
     @Override
     public void registerNewObject(Object object) {
         if (object == null) {
-            throw new NullPointerException("An attempt to register null object.");
+            throw new IllegalArgumentException("An attempt to register null object.");
         }
 
         ObjEntity entity = getEntityResolver().getObjEntity(object.getClass());
@@ -352,16 +352,7 @@ public class CayenneContext extends BaseContext {
         boolean childContext = this != originatingContext && changes != null;
 
         if (childContext) {
-
-            // PropertyChangeProcessingStrategy oldStrategy =
-            // getPropertyChangeProcessingStrategy();
-            // setPropertyChangeProcessingStrategy(PropertyChangeProcessingStrategy.RECORD);
-            try {
-                changes.apply(new CayenneContextChildDiffLoader(this));
-            } finally {
-                // setPropertyChangeProcessingStrategy(oldStrategy);
-            }
-
+            changes.apply(new CayenneContextChildDiffLoader(this));
             fireDataChannelChanged(originatingContext, changes);
         }
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-rop-server/src/main/java/org/apache/cayenne/CayenneContextChildDiffLoader.java
----------------------------------------------------------------------
diff --git a/cayenne-rop-server/src/main/java/org/apache/cayenne/CayenneContextChildDiffLoader.java b/cayenne-rop-server/src/main/java/org/apache/cayenne/CayenneContextChildDiffLoader.java
index 151b72e..94d30f2 100644
--- a/cayenne-rop-server/src/main/java/org/apache/cayenne/CayenneContextChildDiffLoader.java
+++ b/cayenne-rop-server/src/main/java/org/apache/cayenne/CayenneContextChildDiffLoader.java
@@ -120,10 +120,7 @@ class CayenneContextChildDiffLoader extends ChildDiffLoader {
                             .readProperty(source));
                 }
 
-                if (target[0] == null) {
-                    // ignore?
-                }
-                else {
+                if (target[0] != null) {
                     property.removeTargetDirectly(source, target[0]);
                 }
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-rop-server/src/main/java/org/apache/cayenne/CayenneContextMergeHandler.java
----------------------------------------------------------------------
diff --git a/cayenne-rop-server/src/main/java/org/apache/cayenne/CayenneContextMergeHandler.java b/cayenne-rop-server/src/main/java/org/apache/cayenne/CayenneContextMergeHandler.java
index f490128..1f03bb7 100644
--- a/cayenne-rop-server/src/main/java/org/apache/cayenne/CayenneContextMergeHandler.java
+++ b/cayenne-rop-server/src/main/java/org/apache/cayenne/CayenneContextMergeHandler.java
@@ -187,15 +187,11 @@ class CayenneContextMergeHandler implements GraphChangeHandler, DataChannelListe
             target = context.createFault((ObjectId) targetNodeId);
         }
 
-        try {
-            if (p instanceof ToManyProperty) {
-                ((ToManyProperty) p).addTargetDirectly(source, target);
-            }
-            else {
-                p.writePropertyDirectly(source, null, target);
-            }
+        if (p instanceof ToManyProperty) {
+            ((ToManyProperty) p).addTargetDirectly(source, target);
         }
-        finally {
+        else {
+            p.writePropertyDirectly(source, null, target);
         }
     }
 
@@ -221,16 +217,12 @@ class CayenneContextMergeHandler implements GraphChangeHandler, DataChannelListe
             target = context.createFault((ObjectId) targetNodeId);
         }
 
-        try {
             if (p instanceof ToManyProperty) {
                 ((ToManyProperty) p).removeTargetDirectly(source, target);
             }
             else {
                 p.writePropertyDirectly(source, target, null);
             }
-        }
-        finally {
-        }
     }
 
     private PropertyDescriptor propertyForId(Object nodeId, String propertyName) {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-rop-server/src/main/java/org/apache/cayenne/remote/RemoteIncrementalFaultList.java
----------------------------------------------------------------------
diff --git a/cayenne-rop-server/src/main/java/org/apache/cayenne/remote/RemoteIncrementalFaultList.java b/cayenne-rop-server/src/main/java/org/apache/cayenne/remote/RemoteIncrementalFaultList.java
index 7ed1004..1952db5 100644
--- a/cayenne-rop-server/src/main/java/org/apache/cayenne/remote/RemoteIncrementalFaultList.java
+++ b/cayenne-rop-server/src/main/java/org/apache/cayenne/remote/RemoteIncrementalFaultList.java
@@ -343,8 +343,9 @@ public class RemoteIncrementalFaultList implements List {
             }
 
             public Object next() {
-                if (listIndex >= elements.size())
+                if (listIndex >= elements.size()) {
                     throw new NoSuchElementException("no more elements");
+                }
 
                 return get(listIndex++);
             }
@@ -636,8 +637,9 @@ public class RemoteIncrementalFaultList implements List {
         }
 
         public Object next() {
-            if (listIndex >= elements.size())
+            if (listIndex >= elements.size()) {
                 throw new NoSuchElementException("at the end of the list");
+            }
 
             return get(listIndex++);
         }
@@ -647,8 +649,9 @@ public class RemoteIncrementalFaultList implements List {
         }
 
         public Object previous() {
-            if (listIndex < 1)
+            if (listIndex < 1) {
                 throw new NoSuchElementException("at the beginning of the list");
+            }
 
             return get(--listIndex);
         }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-rop-server/src/main/java/org/apache/cayenne/remote/RemoteSession.java
----------------------------------------------------------------------
diff --git a/cayenne-rop-server/src/main/java/org/apache/cayenne/remote/RemoteSession.java b/cayenne-rop-server/src/main/java/org/apache/cayenne/remote/RemoteSession.java
index 461e79d..7eae9d4 100644
--- a/cayenne-rop-server/src/main/java/org/apache/cayenne/remote/RemoteSession.java
+++ b/cayenne-rop-server/src/main/java/org/apache/cayenne/remote/RemoteSession.java
@@ -24,6 +24,7 @@ import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Map;
+import java.util.Objects;
 
 import org.apache.cayenne.CayenneRuntimeException;
 import org.apache.cayenne.DataChannel;
@@ -84,7 +85,15 @@ public class RemoteSession implements Serializable {
 
     @Override
     public int hashCode() {
-        return new HashCodeBuilder(71, 5).append(sessionId).toHashCode();
+        return Objects.hash(sessionId);
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+        RemoteSession that = (RemoteSession) o;
+        return Objects.equals(sessionId, that.sessionId);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-server/pom.xml
----------------------------------------------------------------------
diff --git a/cayenne-server/pom.xml b/cayenne-server/pom.xml
index 3d090e6..8bda80e 100644
--- a/cayenne-server/pom.xml
+++ b/cayenne-server/pom.xml
@@ -306,11 +306,6 @@
         <profile>
             <id>code-quality</id>
 
-            <activation>
-                <property>
-                    <name>!fast-and-dirty</name>
-                </property>
-            </activation>
             <build>
                 <plugins>
                     <plugin>
@@ -340,6 +335,8 @@
                                 <exclude>**/SimpleCharStream.java</exclude>
                                 <exclude>**/TokenMgrError.java</exclude>
                                 <exclude>org/apache/cayenne/ejbql/parser/*</exclude>
+								<exclude>org/apache/cayenne/exp/parser/*</exclude>
+								<exclude>org/apache/cayenne/template/parser/*</exclude>
                             </excludes>
                         </configuration>
                     </plugin>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-velocity/pom.xml
----------------------------------------------------------------------
diff --git a/cayenne-velocity/pom.xml b/cayenne-velocity/pom.xml
index da66ef6..4559bf2 100644
--- a/cayenne-velocity/pom.xml
+++ b/cayenne-velocity/pom.xml
@@ -88,5 +88,20 @@
             </plugin>
         </plugins>
     </build>
+    <profiles>
+        <profile>
+            <id>code-quality</id>
 
+            <build>
+                <plugins>
+                    <plugin>
+                        <artifactId>maven-checkstyle-plugin</artifactId>
+                    </plugin>
+                    <plugin>
+                        <artifactId>maven-pmd-plugin</artifactId>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
 </project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/cayenne-web/pom.xml
----------------------------------------------------------------------
diff --git a/cayenne-web/pom.xml b/cayenne-web/pom.xml
index c68c5f3..a058559 100644
--- a/cayenne-web/pom.xml
+++ b/cayenne-web/pom.xml
@@ -90,14 +90,22 @@
                     </execution>
                 </executions>
             </plugin>
-            <plugin>
-                <artifactId>maven-checkstyle-plugin</artifactId>
-                <!--<configuration> <suppressionsLocation>${project.basedir}/cayenne-checkstyle-suppression.xml</suppressionsLocation>
-                    </configuration> -->
-            </plugin>
-            <plugin>
-                <artifactId>maven-pmd-plugin</artifactId>
-            </plugin>
         </plugins>
     </build>
+    <profiles>
+        <profile>
+            <id>code-quality</id>
+
+            <build>
+                <plugins>
+                    <plugin>
+                        <artifactId>maven-checkstyle-plugin</artifactId>
+                    </plugin>
+                    <plugin>
+                        <artifactId>maven-pmd-plugin</artifactId>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
 </project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cayenne/blob/93510a7d/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index af8a347..51fbc47 100644
--- a/pom.xml
+++ b/pom.xml
@@ -41,9 +41,9 @@
 		<slf4j.version>1.7.25</slf4j.version>
 		<ant.version>1.9.9</ant.version>
 
-        <pmd.skip>true</pmd.skip>
-        <checkstyle.skip>true</checkstyle.skip>
-        <findbugs.skip>true</findbugs.skip>
+        <pmd.skip>false</pmd.skip>
+        <checkstyle.skip>false</checkstyle.skip>
+        <findbugs.skip>false</findbugs.skip>
 
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
@@ -962,11 +962,6 @@
         <profile>
             <id>code-quality</id>
 
-            <activation>
-                <property>
-                    <name>!fast-and-dirty</name>
-                </property>
-            </activation>
             <build>
                 <pluginManagement>
                     <plugins>
@@ -976,7 +971,7 @@
                             <version>2.17</version>
                             <configuration>
                                 <skip>${checkstyle.skip}</skip>
-                                <consoleOutput>true</consoleOutput>
+                                <consoleOutput>false</consoleOutput>
                                 <enableRulesSummary>false</enableRulesSummary>
                                 <failOnViolation>false</failOnViolation>
                                 <!-- TODO make it 'true' when we will be ready -->
@@ -1006,7 +1001,7 @@
                             <configuration>
                                 <skip>${pmd.skip}</skip>
                                 <sourceEncoding>utf-8</sourceEncoding>
-                                <targetJdk>1.7</targetJdk>
+                                <targetJdk>1.8</targetJdk>
                                 <verbose>true</verbose>
                                 <failOnViolation>false</failOnViolation>
                                 <!-- TODO make it 'true' when we will be ready -->
@@ -1034,25 +1029,6 @@
                         </plugin>
                         <plugin>
                             <groupId>org.codehaus.mojo</groupId>
-                            <artifactId>findbugs-maven-plugin</artifactId>
-                            <version>3.0.4</version>
-                            <configuration>
-                                <effort>Max</effort>
-                                <!-- do max effort at CI Server -->
-                                <threshold>Low</threshold>
-                                <!-- make it 'low' at CI Server -->
-                            </configuration>
-                            <executions>
-                                <execution>
-                                    <phase>process-classes</phase>
-                                    <goals>
-                                        <goal>check</goal>
-                                    </goals>
-                                </execution>
-                            </executions>
-                        </plugin>
-                        <plugin>
-                            <groupId>org.codehaus.mojo</groupId>
                             <artifactId>clirr-maven-plugin</artifactId>
                             <version>2.8</version>
                             <configuration>


Mime
View raw message