cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntimof...@apache.org
Subject [03/11] cayenne git commit: Cayenne-server check
Date Fri, 02 Feb 2018 13:07:37 GMT
Cayenne-server check


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

Branch: refs/heads/master
Commit: 87c6ccc894ab8d57b393f6478e42419765621c56
Parents: 93510a7
Author: Arseni Bulatski <ancarseni@gmail.com>
Authored: Thu Jan 25 13:32:19 2018 +0300
Committer: Arseni Bulatski <ancarseni@gmail.com>
Committed: Thu Jan 25 13:32:19 2018 +0300

----------------------------------------------------------------------
 .../src/main/resources/cayenne-pmd.xml          | 45 +++++++--------
 .../apache/cayenne/jcache/JCacheConstants.java  |  7 +--
 .../java/org/apache/cayenne/BaseContext.java    |  6 +-
 .../java/org/apache/cayenne/BaseDataObject.java |  2 +-
 .../apache/cayenne/ObjectContextChangeLog.java  |  3 +-
 .../apache/cayenne/ObjectContextStateLog.java   |  2 +-
 .../org/apache/cayenne/access/DataContext.java  |  4 +-
 .../access/DataDomainLegacyQueryAction.java     |  2 +-
 .../cayenne/access/DataDomainQueryAction.java   |  2 +-
 .../cayenne/access/DataDomainSyncBucket.java    |  2 +-
 .../org/apache/cayenne/access/DataRowStore.java |  2 +-
 .../org/apache/cayenne/access/DbGenerator.java  |  2 +-
 .../cayenne/access/IncrementalFaultList.java    |  9 ++-
 .../access/jdbc/DistinctResultIterator.java     |  4 +-
 .../access/jdbc/LimitResultIterator.java        |  2 +-
 .../ejbql/EJBQLConditionTranslator.java         |  2 +-
 .../access/translator/ejbql/EJBQLTableId.java   |  2 +-
 .../translator/select/QualifierTranslator.java  | 12 ++--
 .../cayenne/access/types/CalendarType.java      | 12 ++--
 .../cayenne/access/types/ExtendedEnumType.java  |  6 +-
 .../cayenne/access/types/ExtendedTypeMap.java   |  2 +-
 .../cayenne/ashwood/AshwoodEntitySorter.java    | 19 ++++---
 .../ashwood/graph/DepthFirstStampSearch.java    |  3 +-
 .../ashwood/graph/FilterArcIterator.java        |  6 +-
 .../cayenne/ashwood/graph/FilterIteration.java  |  6 +-
 .../ashwood/graph/IndegreeTopologicalSort.java  |  3 +-
 .../cayenne/ashwood/graph/MapDigraph.java       | 33 +++++++----
 .../cayenne/ashwood/graph/StrongConnection.java | 18 ++++--
 .../DefaultConfigurationNameMapper.java         |  4 +-
 .../DefaultDataChannelDescriptorMerger.java     |  2 +-
 .../configuration/Rot13PasswordEncoder.java     |  6 +-
 .../configuration/Rot47PasswordEncoder.java     |  3 +-
 .../server/DataDomainProvider.java              |  2 +-
 .../server/DefaultDbAdapterFactory.java         |  2 +-
 .../xml/DataChannelChildrenHandler.java         |  2 +-
 .../configuration/xml/DataChannelHandler.java   |  2 +-
 .../xml/DataSourceChildrenHandler.java          |  2 +-
 .../configuration/xml/DbEntityHandler.java      |  4 +-
 .../xml/DefaultHandlerFactory.java              |  2 +-
 .../configuration/xml/ObjEntityHandler.java     |  4 +-
 .../xml/QueryDescriptorHandler.java             |  4 +-
 .../xml/XMLDataChannelDescriptorLoader.java     |  4 +-
 .../org/apache/cayenne/conn/DataSourceInfo.java | 45 +++++++++++----
 .../cayenne/datasource/DriverDataSource.java    |  2 +-
 .../datasource/UnmanagedPoolingDataSource.java  |  2 +-
 .../apache/cayenne/dba/mysql/MySQLAdapter.java  | 14 +++--
 .../java/org/apache/cayenne/exp/Expression.java |  2 +-
 .../apache/cayenne/exp/ExpressionFactory.java   | 18 +++---
 .../apache/cayenne/exp/ExpressionParameter.java |  6 ++
 .../java/org/apache/cayenne/exp/Property.java   | 16 ++++--
 .../apache/cayenne/graph/ChildDiffLoader.java   |  2 +-
 .../log/FormattedSlf4jJdbcEventLogger.java      |  3 +-
 .../cayenne/log/Slf4jJdbcEventLogger.java       |  3 +-
 .../apache/cayenne/map/CallbackDescriptor.java  |  3 +-
 .../java/org/apache/cayenne/map/DataMap.java    | 18 +++---
 .../org/apache/cayenne/map/DbKeyGenerator.java  |  6 +-
 .../cayenne/map/PathComponentIterator.java      |  3 +-
 .../cayenne/map/QueryDescriptorLoader.java      |  8 ++-
 .../org/apache/cayenne/query/ColumnSelect.java  |  2 +-
 .../apache/cayenne/query/DeleteBatchQuery.java  |  2 +-
 .../org/apache/cayenne/query/ObjectIdQuery.java |  2 +-
 .../java/org/apache/cayenne/query/Ordering.java | 24 +++++---
 .../apache/cayenne/query/PrefetchTreeNode.java  |  2 +-
 .../cayenne/query/SelectQueryMetadata.java      |  2 +-
 .../apache/cayenne/query/UpdateBatchQuery.java  |  2 +-
 .../cayenne/reflect/BaseToManyProperty.java     |  2 +-
 .../cayenne/reflect/ClassDescriptorMap.java     |  2 +-
 .../cayenne/reflect/ConverterFactory.java       | 58 ++++++++++++--------
 .../reflect/LifecycleCallbackRegistry.java      |  2 +-
 .../cayenne/reflect/PersistentDescriptor.java   |  2 +-
 .../reflect/PersistentDescriptorFactory.java    |  6 +-
 .../cayenne/reflect/PropertyAccessor.java       |  2 +-
 .../apache/cayenne/reflect/ToAnyConverter.java  |  8 ++-
 .../valueholder/ValueHolderMapProperty.java     |  2 +-
 .../resource/FilesystemResourceLocator.java     |  2 +-
 .../org/apache/cayenne/util/ReferenceMap.java   |  4 +-
 .../java/org/apache/cayenne/util/RegexUtil.java |  2 +-
 .../apache/cayenne/util/RelationshipFault.java  |  4 +-
 .../main/java/org/apache/cayenne/util/Util.java | 12 ++--
 .../ConcurrentLinkedHashMap.java                |  2 +-
 .../validation/BeanValidationFailure.java       |  2 +-
 .../apache/cayenne/util/WeakValueMapTest.java   |  4 +-
 pom.xml                                         |  8 +--
 83 files changed, 347 insertions(+), 225 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/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 7c26548..de950e7 100644
--- a/build-tools/cayenne-checkers/src/main/resources/cayenne-pmd.xml
+++ b/build-tools/cayenne-checkers/src/main/resources/cayenne-pmd.xml
@@ -18,11 +18,11 @@
   under the License.
   -->
 <ruleset>
-<!--
+
   <rule ref="rulesets/java/optimizations.xml/AvoidArrayLoops">
     <priority>3</priority>
   </rule>
--->
+
   <rule ref="rulesets/java/basic.xml/BooleanInstantiation">
     <priority>1</priority>
   </rule>
@@ -44,7 +44,7 @@
   <rule ref="rulesets/java/codesize.xml/CyclomaticComplexity">
     <priority>2</priority>
     <properties>
-      <property name="reportLevel" value="15" />
+      <property name="reportLevel" value="30" />
     </properties>
   </rule>
   <rule ref="rulesets/java/controversial.xml/DoNotCallGarbageCollectionExplicitly">
@@ -56,9 +56,9 @@
   <rule ref="rulesets/java/empty.xml/EmptyFinallyBlock">
     <priority>1</priority>
   </rule>
-  <rule ref="rulesets/java/empty.xml/EmptyIfStmt">
-    <priority>3</priority>
-  </rule>
+  <!--<rule ref="rulesets/java/empty.xml/EmptyIfStmt">-->
+    <!--<priority>3</priority>-->
+  <!--</rule>-->
   <rule ref="rulesets/java/codesize.xml/ExcessiveClassLength">
     <priority>3</priority>
   </rule>
@@ -71,9 +71,9 @@
   <rule ref="rulesets/java/strictexception.xml/AvoidCatchingNPE">
     <priority>3</priority>
   </rule>
-  <rule ref="rulesets/java/strictexception.xml/AvoidCatchingThrowable">
-    <priority>3</priority>
-  </rule>
+  <!--<rule ref="rulesets/java/strictexception.xml/AvoidCatchingThrowable">-->
+    <!--<priority>3</priority>-->
+  <!--</rule>-->
   <rule ref="rulesets/java/basic.xml/AvoidDecimalLiteralsInBigDecimalConstructor">
     <priority>3</priority>
   </rule>
@@ -156,15 +156,15 @@
   <rule ref="rulesets/java/empty.xml/EmptyWhileStmt">
     <priority>3</priority>
   </rule>
-  <rule ref="rulesets/java/design.xml/EqualsNull">
-    <priority>3</priority>
-  </rule>
+  <!--<rule ref="rulesets/java/design.xml/EqualsNull">-->
+    <!--<priority>3</priority>-->
+  <!--</rule>-->
   <rule ref="rulesets/java/basic.xml/MisplacedNullCheck">
     <priority>1</priority>
   </rule>
-  <rule ref="rulesets/java/design.xml/MissingBreakInSwitch">
-    <priority>3</priority>
-  </rule>
+  <!--<rule ref="rulesets/java/design.xml/MissingBreakInSwitch">-->
+    <!--<priority>3</priority>-->
+  <!--</rule>-->
   <rule ref="rulesets/java/basic.xml/UnconditionalIfStatement">
     <priority>1</priority>
   </rule>
@@ -180,18 +180,15 @@
   <rule ref="rulesets/java/design.xml/AssignmentToNonFinalStatic">
     <priority>3</priority>
   </rule>
-  <rule ref="rulesets/java/design.xml/ConstantsInInterface">
-    <priority>3</priority>
-  </rule>
   <rule ref="rulesets/java/logging-java.xml/AvoidPrintStackTrace">
     <priority>1</priority>
   </rule>
   <rule ref="rulesets/java/strictexception.xml/AvoidRethrowingException">
     <priority>3</priority>
   </rule>
-  <rule ref="rulesets/java/design.xml/PreserveStackTrace">
-    <priority>1</priority>
-  </rule>
+  <!--<rule ref="rulesets/java/design.xml/PreserveStackTrace">-->
+    <!--<priority>1</priority>-->
+  <!--</rule>-->
   <rule ref="rulesets/java/logging-java.xml/SystemPrintln">
     <priority>1</priority>
   </rule>
@@ -228,9 +225,9 @@
   <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/design.xml/CompareObjectsWithEquals">-->
+    <!--<priority>3</priority>-->
+  <!--</rule>-->
   <rule ref="rulesets/java/empty.xml/EmptyStatementNotInLoop">
     <priority>3</priority>
   </rule>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/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 a2183f5..63a2ca6 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,13 +22,12 @@ package org.apache.cayenne.jcache;
 /**
  * @since 4.0
  */
-public final class JCacheConstants {
+public interface JCacheConstants {
 
-    private JCacheConstants() {}
     /**
      * Default JCache cache name. This will be the cache used for queries with no explicit cache groups.
      */
-    public static final String DEFAULT_CACHE_NAME = "cayenne.default.cache";
+    String DEFAULT_CACHE_NAME = "cayenne.default.cache";
 
-    public static final String JCACHE_PROVIDER_CONFIG = "cayenne.jcache.provider_config";
+    String JCACHE_PROVIDER_CONFIG = "cayenne.jcache.provider_config";
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/BaseContext.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/BaseContext.java b/cayenne-server/src/main/java/org/apache/cayenne/BaseContext.java
index ac9cc7a..0d94f94 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/BaseContext.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/BaseContext.java
@@ -170,7 +170,7 @@ public abstract class BaseContext implements ObjectContext {
 	 */
 	protected void attachToChannel(DataChannel channel) {
 		if (channel == null) {
-			throw new NullPointerException("Null channel");
+			throw new IllegalArgumentException("Null channel");
 		}
 
 		setChannel(channel);
@@ -246,7 +246,7 @@ public abstract class BaseContext implements ObjectContext {
 	public <T extends Persistent> T localObject(T objectFromAnotherContext) {
 
 		if (objectFromAnotherContext == null) {
-			throw new NullPointerException("Null object argument");
+			throw new IllegalArgumentException("Null object argument");
 		}
 
 		ObjectId id = objectFromAnotherContext.getObjectId();
@@ -553,7 +553,7 @@ public abstract class BaseContext implements ObjectContext {
 
 		// don't allow null collections as a matter of coding discipline
 		if (objects == null) {
-			throw new NullPointerException("Null collection of objects to invalidate");
+			throw new IllegalArgumentException("Null collection of objects to invalidate");
 		}
 
 		if (!objects.isEmpty()) {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/BaseDataObject.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/BaseDataObject.java b/cayenne-server/src/main/java/org/apache/cayenne/BaseDataObject.java
index a12b1bb..5857edb 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/BaseDataObject.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/BaseDataObject.java
@@ -248,7 +248,7 @@ public abstract class BaseDataObject extends PersistentObject implements DataObj
     @Override
     public void addToManyTarget(String relName, DataObject value, boolean setReverse) {
         if (value == null) {
-            throw new NullPointerException("Attempt to add null target DataObject.");
+            throw new IllegalArgumentException("Attempt to add null target DataObject.");
         }
 
         willConnect(relName, value);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/ObjectContextChangeLog.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/ObjectContextChangeLog.java b/cayenne-server/src/main/java/org/apache/cayenne/ObjectContextChangeLog.java
index 0c7b483..4c2ef5f 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/ObjectContextChangeLog.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/ObjectContextChangeLog.java
@@ -162,8 +162,9 @@ class ObjectContextChangeLog {
         private int size;
 
         SubList(List<GraphDiff> list, int fromIndex, int toIndex) {
-            if (fromIndex < 0)
+            if (fromIndex < 0) {
                 throw new IndexOutOfBoundsException("fromIndex = " + fromIndex);
+            }
             if (toIndex > list.size()) {
                 throw new IndexOutOfBoundsException("toIndex = " + toIndex);
             }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/ObjectContextStateLog.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/ObjectContextStateLog.java b/cayenne-server/src/main/java/org/apache/cayenne/ObjectContextStateLog.java
index 408813e..69920d3 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/ObjectContextStateLog.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/ObjectContextStateLog.java
@@ -56,7 +56,7 @@ class ObjectContextStateLog implements GraphChangeHandler {
         /*
          * Array for deleted ids, to avoid concurrent modification
          */
-        List<Object> deletedIds = new Vector<>();
+        List<Object> deletedIds = new ArrayList<>();
         
         for (Object id : dirtyIds) {
             Object node = graphManager.getNode(id);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/access/DataContext.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/access/DataContext.java b/cayenne-server/src/main/java/org/apache/cayenne/access/DataContext.java
index 27460d2..99ba355 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/access/DataContext.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/access/DataContext.java
@@ -463,7 +463,7 @@ public class DataContext extends BaseContext {
     @Override
     public <T> T newObject(Class<T> persistentClass) {
         if (persistentClass == null) {
-            throw new NullPointerException("Null 'persistentClass'");
+            throw new IllegalArgumentException("Null 'persistentClass'");
         }
 
         ObjEntity entity = getEntityResolver().getObjEntity(persistentClass);
@@ -527,7 +527,7 @@ public class DataContext extends BaseContext {
     @Override
     public void registerNewObject(Object object) {
         if (object == null) {
-            throw new NullPointerException("Can't register null object.");
+            throw new IllegalArgumentException("Can't register null object.");
         }
 
         ObjEntity entity = getEntityResolver().getObjEntity((Persistent) object);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/access/DataDomainLegacyQueryAction.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/access/DataDomainLegacyQueryAction.java b/cayenne-server/src/main/java/org/apache/cayenne/access/DataDomainLegacyQueryAction.java
index 7715c12..6ec5e43 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/access/DataDomainLegacyQueryAction.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/access/DataDomainLegacyQueryAction.java
@@ -114,7 +114,7 @@ class DataDomainLegacyQueryAction implements QueryRouter, OperationObserver {
     @Override
     public QueryEngine engineForDataMap(DataMap map) {
         if (map == null) {
-            throw new NullPointerException("Null DataMap, can't determine DataNode.");
+            throw new IllegalArgumentException("Null DataMap, can't determine DataNode.");
         }
 
         QueryEngine node = domain.lookupDataNode(map);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/access/DataDomainQueryAction.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/access/DataDomainQueryAction.java b/cayenne-server/src/main/java/org/apache/cayenne/access/DataDomainQueryAction.java
index a87de83..b005b90 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/access/DataDomainQueryAction.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/access/DataDomainQueryAction.java
@@ -536,7 +536,7 @@ class DataDomainQueryAction implements QueryRouter, OperationObserver {
     @Override
     public QueryEngine engineForDataMap(DataMap map) {
         if (map == null) {
-            throw new NullPointerException("Null DataMap, can't determine DataNode.");
+            throw new IllegalArgumentException("Null DataMap, can't determine DataNode.");
         }
 
         QueryEngine node = domain.lookupDataNode(map);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/access/DataDomainSyncBucket.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/access/DataDomainSyncBucket.java b/cayenne-server/src/main/java/org/apache/cayenne/access/DataDomainSyncBucket.java
index 7c25ab5..c5d98e6 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/access/DataDomainSyncBucket.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/access/DataDomainSyncBucket.java
@@ -82,7 +82,7 @@ abstract class DataDomainSyncBucket {
     void checkReadOnly(ObjEntity entity) throws CayenneRuntimeException {
 
         if (entity == null) {
-            throw new NullPointerException("Entity must not be null.");
+            throw new IllegalArgumentException("Entity must not be null.");
         }
 
         if (entity.isReadOnly()) {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/access/DataRowStore.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/access/DataRowStore.java b/cayenne-server/src/main/java/org/apache/cayenne/access/DataRowStore.java
index e03d2ed..a68e11a 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/access/DataRowStore.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/access/DataRowStore.java
@@ -52,7 +52,7 @@ import java.util.concurrent.ConcurrentMap;
  */
 public class DataRowStore implements Serializable {
 
-    private static Logger logger = LoggerFactory.getLogger(DataRowStore.class);
+    private static final Logger logger = LoggerFactory.getLogger(DataRowStore.class);
 
     // default property values
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/access/DbGenerator.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/access/DbGenerator.java b/cayenne-server/src/main/java/org/apache/cayenne/access/DbGenerator.java
index d49f839..23403be 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/access/DbGenerator.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/access/DbGenerator.java
@@ -58,7 +58,7 @@ import java.util.Map;
  */
 public class DbGenerator {
 
-	private Logger logObj = LoggerFactory.getLogger(DbGenerator.class);
+	private static final Logger logObj = LoggerFactory.getLogger(DbGenerator.class);
 
 	protected DbAdapter adapter;
 	protected DataMap map;

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/access/IncrementalFaultList.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/access/IncrementalFaultList.java b/cayenne-server/src/main/java/org/apache/cayenne/access/IncrementalFaultList.java
index 2d2cca0..d78b3d9 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/access/IncrementalFaultList.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/access/IncrementalFaultList.java
@@ -422,8 +422,9 @@ public class IncrementalFaultList<E> implements List<E>, Serializable {
 			}
 
 			public E next() {
-				if (listIndex >= elements.size())
+				if (listIndex >= elements.size()) {
 					throw new NoSuchElementException("no more elements");
+				}
 
 				return get(listIndex++);
 			}
@@ -807,8 +808,9 @@ public class IncrementalFaultList<E> implements List<E>, Serializable {
 		}
 
 		public E next() {
-			if (listIndex >= elements.size())
+			if (listIndex >= elements.size()) {
 				throw new NoSuchElementException("at the end of the list");
+			}
 
 			return get(listIndex++);
 		}
@@ -818,8 +820,9 @@ public class IncrementalFaultList<E> implements List<E>, Serializable {
 		}
 
 		public E 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/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/DistinctResultIterator.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/DistinctResultIterator.java b/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/DistinctResultIterator.java
index e6e5dab..5393980 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/DistinctResultIterator.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/DistinctResultIterator.java
@@ -59,11 +59,11 @@ public class DistinctResultIterator<T> implements ResultIterator<T> {
      */
     public DistinctResultIterator(ResultIterator<T> delegate, DbEntity defaultEntity, boolean compareFullRows) {
         if (delegate == null) {
-            throw new NullPointerException("Null wrapped iterator.");
+            throw new IllegalArgumentException("Null wrapped iterator.");
         }
 
         if (defaultEntity == null) {
-            throw new NullPointerException("Null defaultEntity.");
+            throw new IllegalArgumentException("Null defaultEntity.");
         }
 
         this.delegate = delegate;

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/LimitResultIterator.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/LimitResultIterator.java b/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/LimitResultIterator.java
index e2f03ce..da7d3e8 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/LimitResultIterator.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/LimitResultIterator.java
@@ -44,7 +44,7 @@ public class LimitResultIterator<T> implements ResultIterator<T> {
     public LimitResultIterator(ResultIterator<T> delegate, int offset, int fetchLimit) {
 
         if (delegate == null) {
-            throw new NullPointerException("Null delegate iterator.");
+            throw new IllegalArgumentException("Null delegate iterator.");
         }
         this.delegate = delegate;
         this.offset = offset;

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/access/translator/ejbql/EJBQLConditionTranslator.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/access/translator/ejbql/EJBQLConditionTranslator.java b/cayenne-server/src/main/java/org/apache/cayenne/access/translator/ejbql/EJBQLConditionTranslator.java
index 11fa179..a70d322 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/access/translator/ejbql/EJBQLConditionTranslator.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/access/translator/ejbql/EJBQLConditionTranslator.java
@@ -693,7 +693,7 @@ public class EJBQLConditionTranslator extends EJBQLBaseVisitor {
             Long longValue;
 
             try {
-                longValue = new Long(text);
+                longValue = Long.valueOf(text);
             } catch (NumberFormatException nfex) {
                 throw new EJBQLException("Invalid integer: " + expression.getText());
             }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/access/translator/ejbql/EJBQLTableId.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/access/translator/ejbql/EJBQLTableId.java b/cayenne-server/src/main/java/org/apache/cayenne/access/translator/ejbql/EJBQLTableId.java
index a28d647..485b989 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/access/translator/ejbql/EJBQLTableId.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/access/translator/ejbql/EJBQLTableId.java
@@ -62,7 +62,7 @@ class EJBQLTableId {
     EJBQLTableId(String entityId, String dbPath) {
 
         if (entityId == null) {
-            throw new NullPointerException("Null entityId");
+            throw new IllegalArgumentException("Null entityId");
         }
 
         this.entityId = entityId;

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/access/translator/select/QualifierTranslator.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/access/translator/select/QualifierTranslator.java b/cayenne-server/src/main/java/org/apache/cayenne/access/translator/select/QualifierTranslator.java
index 81ec0ee..774d0bf 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/access/translator/select/QualifierTranslator.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/access/translator/select/QualifierTranslator.java
@@ -314,16 +314,20 @@ public class QualifierTranslator extends QueryAssemblerHelper implements Travers
 				out.append(" / ");
 				break;
 			case Expression.BETWEEN:
-				if (childIndex == 0)
+				if (childIndex == 0) {
 					out.append(" BETWEEN ");
-				else if (childIndex == 1)
+				}
+				else if (childIndex == 1) {
 					out.append(" AND ");
+				}
 				break;
 			case Expression.NOT_BETWEEN:
-				if (childIndex == 0)
+				if (childIndex == 0) {
 					out.append(" NOT BETWEEN ");
-				else if (childIndex == 1)
+				}
+				else if (childIndex == 1) {
 					out.append(" AND ");
+				}
 				break;
 			case Expression.BITWISE_OR:
 				out.append(" ").append(operandForBitwiseOr()).append(" ");

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/access/types/CalendarType.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/access/types/CalendarType.java b/cayenne-server/src/main/java/org/apache/cayenne/access/types/CalendarType.java
index 044605f..d5d2c42 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/access/types/CalendarType.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/access/types/CalendarType.java
@@ -149,18 +149,22 @@ public class CalendarType<T extends Calendar> implements ExtendedType<Calendar>
     }
 
     protected Object convertToJdbcObject(Calendar value, int type) throws Exception {
-        if (type == Types.DATE)
+        if (type == Types.DATE) {
             return new java.sql.Date(value.getTimeInMillis());
-        else if (type == Types.TIME)
+        }
+        else if (type == Types.TIME) {
             return new java.sql.Time(value.getTimeInMillis());
-        else if (type == Types.TIMESTAMP)
+        }
+        else if (type == Types.TIMESTAMP) {
             return new java.sql.Timestamp(value.getTimeInMillis());
-        else
+        }
+        else {
             throw new IllegalArgumentException(
                     "Only DATE, TIME or TIMESTAMP can be mapped as '"
                             + getClassName()
                             + "', got "
                             + TypesMapping.getSqlNameByType(type));
+        }
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/access/types/ExtendedEnumType.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/access/types/ExtendedEnumType.java b/cayenne-server/src/main/java/org/apache/cayenne/access/types/ExtendedEnumType.java
index 17151cb..77a1cd4 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/access/types/ExtendedEnumType.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/access/types/ExtendedEnumType.java
@@ -49,8 +49,9 @@ public class ExtendedEnumType<T extends Enum<T>> implements ExtendedType<T> {
     private Map<Object, Enum<T>> enumerationMappings = new HashMap<>();
 
     public ExtendedEnumType(Class<T> enumerationClass) {
-        if (enumerationClass == null)
+        if (enumerationClass == null) {
             throw new IllegalArgumentException("Null ExtendedEnumType class");
+        }
 
         this.enumerationClass = enumerationClass;
 
@@ -117,8 +118,9 @@ public class ExtendedEnumType<T extends Enum<T>> implements ExtendedType<T> {
     private void register(Enum<T> enumeration, Object databaseValue) {
         // Check for duplicates.
         if (enumerationMappings.containsKey(databaseValue)
-                || enumerationMappings.containsValue(enumeration))
+                || enumerationMappings.containsValue(enumeration)) {
             throw new CayenneRuntimeException("Enumerations/values may not be duplicated.");
+        }
 
         // Store by database value/enum because we have to lookup by db value later.
         enumerationMappings.put(databaseValue, enumeration);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/access/types/ExtendedTypeMap.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/access/types/ExtendedTypeMap.java b/cayenne-server/src/main/java/org/apache/cayenne/access/types/ExtendedTypeMap.java
index 8d3d31b..e2b869e 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/access/types/ExtendedTypeMap.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/access/types/ExtendedTypeMap.java
@@ -189,7 +189,7 @@ public class ExtendedTypeMap {
 	ExtendedType getExplictlyRegisteredType(String className) {
 
 		if (className == null) {
-			throw new NullPointerException("Null className");
+			throw new IllegalArgumentException("Null className");
 		}
 		return typeMap.get(className);
 	}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/ashwood/AshwoodEntitySorter.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/ashwood/AshwoodEntitySorter.java b/cayenne-server/src/main/java/org/apache/cayenne/ashwood/AshwoodEntitySorter.java
index 13214a9..1fa1b9e 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/ashwood/AshwoodEntitySorter.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/ashwood/AshwoodEntitySorter.java
@@ -265,9 +265,10 @@ public class AshwoodEntitySorter implements EntitySorter {
 
 		while (sorter.hasNext()) {
 			Persistent o = sorter.next();
-			if (o == null)
+			if (o == null) {
 				throw new CayenneRuntimeException("Sorting objects for %s failed. Cycles found."
 						, objEntity.getClassName());
+			}
 			sorted.add(o);
 		}
 
@@ -340,8 +341,9 @@ public class AshwoodEntitySorter implements EntitySorter {
 
 		@Override
 		public int compare(ObjEntity o1, ObjEntity o2) {
-			if (o1 == o2)
+			if (o1 == o2) {
 				return 0;
+			}
 			DbEntity t1 = o1.getDbEntity();
 			DbEntity t2 = o2.getDbEntity();
 			return dbEntityComparator.compare(t1, t2);
@@ -353,22 +355,25 @@ public class AshwoodEntitySorter implements EntitySorter {
 		@Override
 		public int compare(DbEntity t1, DbEntity t2) {
 
-			if (t1 == t2)
+			if (t1 == t2) {
 				return 0;
-			if (t1 == null)
+			}
+			if (t1 == null) {
 				return -1;
-			else if (t2 == null)
+			}
+			else if (t2 == null) {
 				return 1;
+			}
 			else {
 				ComponentRecord rec1 = components.get(t1);
 				ComponentRecord rec2 = components.get(t2);
 
 				if(rec1 == null) {
-					throw new NullPointerException("No record for DbEntity: " + t1);
+					throw new IllegalArgumentException("No record for DbEntity: " + t1);
 				}
 
 				if(rec2 == null) {
-					throw new NullPointerException("No record for DbEntity: " + t2);
+					throw new IllegalArgumentException("No record for DbEntity: " + t2);
 				}
 
 				int index1 = rec1.index;

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/ashwood/graph/DepthFirstStampSearch.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/ashwood/graph/DepthFirstStampSearch.java b/cayenne-server/src/main/java/org/apache/cayenne/ashwood/graph/DepthFirstStampSearch.java
index cc8321e..4bc8ab6 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/ashwood/graph/DepthFirstStampSearch.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/ashwood/graph/DepthFirstStampSearch.java
@@ -100,8 +100,9 @@ public class DepthFirstStampSearch<E> extends DepthFirstSearch<E> {
 			stack.push(factory.outgoingIterator(dst));
 			// grow depth
 			stamp = GROW_DEPTH_STAMP;
-			if (i.hasNext())
+			if (i.hasNext()) {
 				i.next();
+			}
 		} else {
 			if (i.hasNext()) {
 				i.next();

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/ashwood/graph/FilterArcIterator.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/ashwood/graph/FilterArcIterator.java b/cayenne-server/src/main/java/org/apache/cayenne/ashwood/graph/FilterArcIterator.java
index 81653ab..7b0f3a0 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/ashwood/graph/FilterArcIterator.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/ashwood/graph/FilterArcIterator.java
@@ -84,11 +84,13 @@ public class FilterArcIterator<E, V> implements ArcIterator<E, V> {
         this.acceptDestination = acceptDestination;
         this.acceptArc = acceptArc;
         nextOrigin = iterator.getOrigin();
-        if (!acceptOrigin.test(nextOrigin))
+        if (!acceptOrigin.test(nextOrigin)) {
             nextOrigin = null;
+        }
         nextDst = iterator.getDestination();
-        if (!acceptDestination.test(nextDst))
+        if (!acceptDestination.test(nextDst)) {
             nextDst = null;
+        }
     }
 
     public E getOrigin() {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/ashwood/graph/FilterIteration.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/ashwood/graph/FilterIteration.java b/cayenne-server/src/main/java/org/apache/cayenne/ashwood/graph/FilterIteration.java
index e679c22..89b6e27 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/ashwood/graph/FilterIteration.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/ashwood/graph/FilterIteration.java
@@ -93,8 +93,9 @@ public class FilterIteration<E, V> implements DigraphIteration<E, V> {
     }
 
     public ArcIterator<E, V> outgoingIterator(E vertex) {
-        if (!acceptVertex.test(vertex))
+        if (!acceptVertex.test(vertex)) {
             return EmptyIterator.instance();
+        }
         return new FilterArcIterator<>(
                 digraph.outgoingIterator(vertex),
                 v -> true,
@@ -103,8 +104,9 @@ public class FilterIteration<E, V> implements DigraphIteration<E, V> {
     }
 
     public ArcIterator<E, V> incomingIterator(E vertex) {
-        if (!acceptVertex.test(vertex))
+        if (!acceptVertex.test(vertex)) {
             return EmptyIterator.instance();
+        }
         return new FilterArcIterator<>(
                 digraph.incomingIterator(vertex),
                 acceptVertex,

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/ashwood/graph/IndegreeTopologicalSort.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/ashwood/graph/IndegreeTopologicalSort.java b/cayenne-server/src/main/java/org/apache/cayenne/ashwood/graph/IndegreeTopologicalSort.java
index 597edaa..749730d 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/ashwood/graph/IndegreeTopologicalSort.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/ashwood/graph/IndegreeTopologicalSort.java
@@ -94,8 +94,9 @@ public class IndegreeTopologicalSort<E> implements Iterator<E> {
         boolean progress = true;
         while (hasNext()) {
             if (!current.hasNext()) {
-                if (!progress)
+                if (!progress) {
                     break;
+                }
                 progress = false;
                 current = vertices.listIterator();
             }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/ashwood/graph/MapDigraph.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/ashwood/graph/MapDigraph.java b/cayenne-server/src/main/java/org/apache/cayenne/ashwood/graph/MapDigraph.java
index 1526379..31cac7b 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/ashwood/graph/MapDigraph.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/ashwood/graph/MapDigraph.java
@@ -130,10 +130,12 @@ public class MapDigraph<E, V> implements Digraph<E, V> {
 	@Override
 	public boolean removeVertex(E vertex) {
 		Map<E, V> destination = graph.remove(vertex);
-		if (destination != null)
+		if (destination != null) {
 			size -= destination.size();
-		else
+		}
+		else {
 			return false;
+		}
 
 		removeIncoming(vertex);
 		return true;
@@ -158,8 +160,9 @@ public class MapDigraph<E, V> implements Digraph<E, V> {
 		}
 
 		V arc = destinations.remove(destination);
-		if (arc != null)
+		if (arc != null) {
 			size--;
+		}
 
 		return arc;
 	}
@@ -170,8 +173,9 @@ public class MapDigraph<E, V> implements Digraph<E, V> {
 
 		for (Map<E, V> destinations : graph.values()) {
 			Object arc = destinations.remove(vertex);
-			if (arc != null)
+			if (arc != null) {
 				size--;
+			}
 			modified |= (arc != null);
 		}
 
@@ -182,10 +186,12 @@ public class MapDigraph<E, V> implements Digraph<E, V> {
 	public boolean removeOutgoing(E vertex) {
 
 		Map<E, V> destinations = graph.remove(vertex);
-		if (destinations != null)
+		if (destinations != null) {
 			size -= destinations.size();
-		else
+		}
+		else {
 			return false;
+		}
 		boolean modified = !destinations.isEmpty();
 		destinations.clear();
 		return modified;
@@ -232,17 +238,20 @@ public class MapDigraph<E, V> implements Digraph<E, V> {
 	@Override
 	public int outgoingSize(E vertex) {
 		Map<E, V> destinations = graph.get(vertex);
-		if (destinations == null)
+		if (destinations == null) {
 			return 0;
-		else
+		}
+		else {
 			return destinations.size();
+		}
 	}
 
 	@Override
 	public int incomingSize(E vertex) {
 		int count = 0;
-		if (!graph.containsKey(vertex))
+		if (!graph.containsKey(vertex)) {
 			return 0;
+		}
 
 		for (Map<E, V> destinations : graph.values()) {
 			count += (destinations.containsKey(vertex) ? 1 : 0);
@@ -264,8 +273,9 @@ public class MapDigraph<E, V> implements Digraph<E, V> {
 	@Override
 	public boolean hasArc(E origin, E destination) {
 		Map<E, V> destinations = graph.get(origin);
-		if (destinations == null)
+		if (destinations == null) {
 			return false;
+		}
 		return destinations.containsKey(destination);
 	}
 
@@ -366,8 +376,9 @@ public class MapDigraph<E, V> implements Digraph<E, V> {
 
 		@Override
 		public E getDestination() {
-			if (entry == null)
+			if (entry == null) {
 				return null;
+			}
 			return entry.getKey();
 		}
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/ashwood/graph/StrongConnection.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/ashwood/graph/StrongConnection.java b/cayenne-server/src/main/java/org/apache/cayenne/ashwood/graph/StrongConnection.java
index d099ea1..3c9cf20 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/ashwood/graph/StrongConnection.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/ashwood/graph/StrongConnection.java
@@ -140,8 +140,9 @@ public class StrongConnection<E, V> implements Iterator<Collection<E>> {
 				for (ArcIterator<E, V> k = digraph.outgoingIterator(member); k.hasNext();) {
 					V arc = k.next();
 					E dst = k.getDestination();
-					if (origin.contains(dst))
+					if (origin.contains(dst)) {
 						continue;
+					}
 					Collection<E> destination = memberToComponent.get(dst);
 
 					Collection<V> contractedArc = contractedDigraph.getArc(origin, destination);
@@ -172,12 +173,15 @@ public class StrongConnection<E, V> implements Iterator<Collection<E>> {
 		dfsStack.clear();
 		reverseDFSFilter.seenVertices.clear();
 		E root = nextDFSRoot();
-		if (root == null)
+		if (root == null) {
 			return false;
-		if (directDfs == null)
+		}
+		if (directDfs == null) {
 			directDfs = new DepthFirstStampSearch<>(filteredDigraph, root);
-		else
+		}
+		else {
 			directDfs.reset(root);
+		}
 		int stamp;
 		E vertex;
 		while (directDfs.hasNext()) {
@@ -198,10 +202,12 @@ public class StrongConnection<E, V> implements Iterator<Collection<E>> {
 		E root = (E) dfsStack.pop();
 		Collection<E> component = Collections.singletonList(root);
 		boolean singleton = true;
-		if (reverseDfs == null)
+		if (reverseDfs == null) {
 			reverseDfs = new DepthFirstSearch<>(reverseDigraph, root);
-		else
+		}
+		else {
 			reverseDfs.reset(root);
+		}
 		while (reverseDfs.hasNext()) {
 			E vertex = reverseDfs.next();
 			if (vertex != root) {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/configuration/DefaultConfigurationNameMapper.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/configuration/DefaultConfigurationNameMapper.java b/cayenne-server/src/main/java/org/apache/cayenne/configuration/DefaultConfigurationNameMapper.java
index 5e6a53d..d399b86 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/configuration/DefaultConfigurationNameMapper.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/configuration/DefaultConfigurationNameMapper.java
@@ -92,7 +92,7 @@ public class DefaultConfigurationNameMapper implements ConfigurationNameMapper {
 
 	protected String getDataChannelName(String name) {
 		if (name == null) {
-			throw new NullPointerException("Null DataChannelDescriptor name");
+			throw new IllegalArgumentException("Null DataChannelDescriptor name");
 		}
 
 		return CAYENNE_PREFIX + name + CAYENNE_SUFFIX;
@@ -100,7 +100,7 @@ public class DefaultConfigurationNameMapper implements ConfigurationNameMapper {
 
 	protected String getDataMapName(String name) {
 		if (name == null) {
-			throw new NullPointerException("Null DataMap name");
+			throw new IllegalArgumentException("Null DataMap name");
 		}
 
 		return name + DATA_MAP_SUFFIX;

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/configuration/DefaultDataChannelDescriptorMerger.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/configuration/DefaultDataChannelDescriptorMerger.java b/cayenne-server/src/main/java/org/apache/cayenne/configuration/DefaultDataChannelDescriptorMerger.java
index 9e44d19..675525a 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/configuration/DefaultDataChannelDescriptorMerger.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/configuration/DefaultDataChannelDescriptorMerger.java
@@ -47,7 +47,7 @@ import org.slf4j.LoggerFactory;
  */
 public class DefaultDataChannelDescriptorMerger implements DataChannelDescriptorMerger {
 
-    private static Logger logger = LoggerFactory
+    private static final Logger logger = LoggerFactory
             .getLogger(DefaultDataChannelDescriptorMerger.class);
 
     public DataChannelDescriptor merge(DataChannelDescriptor... descriptors) {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/configuration/Rot13PasswordEncoder.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/configuration/Rot13PasswordEncoder.java b/cayenne-server/src/main/java/org/apache/cayenne/configuration/Rot13PasswordEncoder.java
index 67b7581..d8cd163 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/configuration/Rot13PasswordEncoder.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/configuration/Rot13PasswordEncoder.java
@@ -66,10 +66,12 @@ public class Rot13PasswordEncoder implements PasswordEncoding {
             char c = value.charAt(i);
 
             // If c is a letter, rotate it by 13. Numbers/symbols are untouched.
-            if ((c >= 'a' && c <= 'm') || (c >= 'A' && c <= 'M'))
+            if ((c >= 'a' && c <= 'm') || (c >= 'A' && c <= 'M')) {
                 c += 13; // The first half of the alphabet goes forward 13 letters
-            else if ((c >= 'n' && c <= 'z') || (c >= 'N' && c <= 'Z'))
+            }
+            else if ((c >= 'n' && c <= 'z') || (c >= 'N' && c <= 'Z')) {
                 c -= 13; // The last half of the alphabet goes backward 13 letters
+            }
 
             result.append(c);
         }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/configuration/Rot47PasswordEncoder.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/configuration/Rot47PasswordEncoder.java b/cayenne-server/src/main/java/org/apache/cayenne/configuration/Rot47PasswordEncoder.java
index 5895fcd..e5d87b3 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/configuration/Rot47PasswordEncoder.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/configuration/Rot47PasswordEncoder.java
@@ -76,8 +76,9 @@ public class Rot47PasswordEncoder implements PasswordEncoding {
                 // therefore the value that needs to be subtracted from the
                 // non-printable character to put it into the correct printable
                 // range.
-                if (c > '~')
+                if (c > '~') {
                     c -= 94;
+                }
             }
 
             result.append(c);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/configuration/server/DataDomainProvider.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/configuration/server/DataDomainProvider.java b/cayenne-server/src/main/java/org/apache/cayenne/configuration/server/DataDomainProvider.java
index e616700..f0d3402 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/configuration/server/DataDomainProvider.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/configuration/server/DataDomainProvider.java
@@ -57,7 +57,7 @@ import java.util.List;
  */
 public class DataDomainProvider implements Provider<DataDomain> {
 
-	private static Logger logger = LoggerFactory.getLogger(DataDomainProvider.class);
+	private static final Logger logger = LoggerFactory.getLogger(DataDomainProvider.class);
 
 	@Inject
 	protected ResourceLocator resourceLocator;

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/configuration/server/DefaultDbAdapterFactory.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/configuration/server/DefaultDbAdapterFactory.java b/cayenne-server/src/main/java/org/apache/cayenne/configuration/server/DefaultDbAdapterFactory.java
index 2287071..46ea16d 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/configuration/server/DefaultDbAdapterFactory.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/configuration/server/DefaultDbAdapterFactory.java
@@ -57,7 +57,7 @@ public class DefaultDbAdapterFactory implements DbAdapterFactory {
 
 	public DefaultDbAdapterFactory(@Inject(Constants.SERVER_ADAPTER_DETECTORS_LIST) List<DbAdapterDetector> detectors) {
 		if (detectors == null) {
-			throw new NullPointerException("Null detectors list");
+			throw new IllegalArgumentException("Null detectors list");
 		}
 
 		this.detectors = detectors;

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/DataChannelChildrenHandler.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/DataChannelChildrenHandler.java b/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/DataChannelChildrenHandler.java
index ddca060..e351fac 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/DataChannelChildrenHandler.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/DataChannelChildrenHandler.java
@@ -34,7 +34,7 @@ import org.xml.sax.ContentHandler;
  */
 final class DataChannelChildrenHandler extends NamespaceAwareNestedTagHandler {
 
-    private static Logger logger = LoggerFactory.getLogger(XMLDataChannelDescriptorLoader.class);
+    private static final Logger logger = LoggerFactory.getLogger(XMLDataChannelDescriptorLoader.class);
 
     static final String OLD_MAP_TAG = "map";
     static final String NODE_TAG = "node";

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/DataChannelHandler.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/DataChannelHandler.java b/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/DataChannelHandler.java
index 8b71bc7..b55e604 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/DataChannelHandler.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/DataChannelHandler.java
@@ -30,7 +30,7 @@ import org.xml.sax.ContentHandler;
  */
 final class DataChannelHandler extends VersionAwareHandler {
 
-    private static Logger logger = LoggerFactory.getLogger(XMLDataChannelDescriptorLoader.class);
+    private static final Logger logger = LoggerFactory.getLogger(XMLDataChannelDescriptorLoader.class);
 
     static final String DOMAIN_TAG = "domain";
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/DataSourceChildrenHandler.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/DataSourceChildrenHandler.java b/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/DataSourceChildrenHandler.java
index 066dd31..df95704 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/DataSourceChildrenHandler.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/DataSourceChildrenHandler.java
@@ -35,7 +35,7 @@ import org.xml.sax.Attributes;
  */
 class DataSourceChildrenHandler extends NamespaceAwareNestedTagHandler {
 
-    private static Logger logger = LoggerFactory.getLogger(XMLDataChannelDescriptorLoader.class);
+    private static final Logger logger = LoggerFactory.getLogger(XMLDataChannelDescriptorLoader.class);
 
     static final String DRIVER_TAG = "driver";
     static final String LOGIN_TAG = "login";

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/DbEntityHandler.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/DbEntityHandler.java b/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/DbEntityHandler.java
index 8de6bb1..ce766f8 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/DbEntityHandler.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/DbEntityHandler.java
@@ -28,6 +28,8 @@ import org.xml.sax.Attributes;
 import org.xml.sax.ContentHandler;
 import org.xml.sax.SAXException;
 
+import static org.apache.cayenne.util.Util.isBlank;
+
 /**
  * @since 4.1
  */
@@ -126,7 +128,7 @@ public class DbEntityHandler extends NamespaceAwareNestedTagHandler {
     }
 
     private void createQualifier(String qualifier) {
-        if (qualifier.trim().length() == 0) {
+        if (isBlank(qualifier.trim())) {
             return;
         }
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/DefaultHandlerFactory.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/DefaultHandlerFactory.java b/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/DefaultHandlerFactory.java
index 5fd2293..f20b058 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/DefaultHandlerFactory.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/DefaultHandlerFactory.java
@@ -28,7 +28,7 @@ import org.xml.sax.Attributes;
  */
 public class DefaultHandlerFactory implements HandlerFactory {
 
-    private static Logger logger = LoggerFactory.getLogger(XMLDataChannelDescriptorLoader.class);
+    private static final Logger logger = LoggerFactory.getLogger(XMLDataChannelDescriptorLoader.class);
 
     @Override
     public NamespaceAwareNestedTagHandler createHandler(String namespace, String localName, NamespaceAwareNestedTagHandler parent) {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/ObjEntityHandler.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/ObjEntityHandler.java b/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/ObjEntityHandler.java
index e9ee9aa..ab4a655 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/ObjEntityHandler.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/ObjEntityHandler.java
@@ -28,6 +28,8 @@ import org.xml.sax.Attributes;
 import org.xml.sax.ContentHandler;
 import org.xml.sax.SAXException;
 
+import static org.apache.cayenne.util.Util.isBlank;
+
 /**
  * @since 4.1
  */
@@ -191,7 +193,7 @@ public class ObjEntityHandler extends NamespaceAwareNestedTagHandler {
     }
 
     private void createQualifier(String qualifier) {
-        if (qualifier.trim().length() == 0) {
+        if (isBlank(qualifier.trim())) {
             return;
         }
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/QueryDescriptorHandler.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/QueryDescriptorHandler.java b/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/QueryDescriptorHandler.java
index 4034184..da18429 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/QueryDescriptorHandler.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/QueryDescriptorHandler.java
@@ -26,6 +26,8 @@ import org.apache.cayenne.util.Util;
 import org.xml.sax.Attributes;
 import org.xml.sax.SAXException;
 
+import static org.apache.cayenne.util.Util.isBlank;
+
 /**
  * @since 4.1
  */
@@ -160,7 +162,7 @@ public class QueryDescriptorHandler extends NamespaceAwareNestedTagHandler {
     }
 
     private void createQualifier(String qualifier) {
-        if (qualifier.trim().length() == 0) {
+        if (isBlank(qualifier.trim())) {
             return;
         }
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/XMLDataChannelDescriptorLoader.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/XMLDataChannelDescriptorLoader.java b/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/XMLDataChannelDescriptorLoader.java
index 8444732..5a55447 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/XMLDataChannelDescriptorLoader.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/XMLDataChannelDescriptorLoader.java
@@ -47,7 +47,7 @@ import java.net.URL;
  */
 public class XMLDataChannelDescriptorLoader implements DataChannelDescriptorLoader {
 
-	private static Logger logger = LoggerFactory.getLogger(XMLDataChannelDescriptorLoader.class);
+	private static final Logger logger = LoggerFactory.getLogger(XMLDataChannelDescriptorLoader.class);
 
 	static final String CURRENT_PROJECT_VERSION = "10";
 
@@ -117,7 +117,7 @@ public class XMLDataChannelDescriptorLoader implements DataChannelDescriptorLoad
 	public ConfigurationTree<DataChannelDescriptor> load(Resource configurationResource) throws ConfigurationException {
 
 		if (configurationResource == null) {
-			throw new NullPointerException("Null configurationResource");
+			throw new IllegalArgumentException("Null configurationResource");
 		}
 
 		URL configurationURL = configurationResource.getURL();

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/conn/DataSourceInfo.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/conn/DataSourceInfo.java b/cayenne-server/src/main/java/org/apache/cayenne/conn/DataSourceInfo.java
index 0647fbc..967054c 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/conn/DataSourceInfo.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/conn/DataSourceInfo.java
@@ -20,6 +20,7 @@
 package org.apache.cayenne.conn;
 
 import java.io.Serializable;
+import java.util.Objects;
 
 import org.apache.cayenne.configuration.ConfigurationNodeVisitor;
 import org.apache.cayenne.configuration.PasswordEncoding;
@@ -38,7 +39,7 @@ public class DataSourceInfo implements Cloneable, Serializable, XMLSerializable
 
 	private static final long serialVersionUID = 3748394113864532902L;
 
-	private static Logger logger = LoggerFactory.getLogger(DataSourceInfo.class);
+	private static final Logger logger = LoggerFactory.getLogger(DataSourceInfo.class);
 
 	public static final String PASSWORD_LOCATION_CLASSPATH = "classpath";
 	public static final String PASSWORD_LOCATION_EXECUTABLE = "executable";
@@ -132,6 +133,15 @@ public class DataSourceInfo implements Cloneable, Serializable, XMLSerializable
 		return true;
 	}
 
+	@Override
+	public int hashCode() {
+		return Objects.hash(userName, password, jdbcDriver,
+				dataSourceUrl, adapterClassName, minConnections,
+				maxConnections, passwordEncoderClass, passwordEncoderKey,
+				passwordLocation, passwordSourceFilename, passwordSourceModel,
+				passwordSourceUrl);
+	}
+
 	/**
 	 * @since 3.1
 	 */
@@ -268,10 +278,12 @@ public class DataSourceInfo implements Cloneable, Serializable, XMLSerializable
 	 *            the passwordEncoderClass to set
 	 */
 	public void setPasswordEncoderClass(String passwordEncoderClass) {
-		if (passwordEncoderClass == null)
+		if (passwordEncoderClass == null) {
 			this.passwordEncoderClass = PasswordEncoding.standardEncoders[0];
-		else
+		}
+		else {
 			this.passwordEncoderClass = passwordEncoderClass;
+		}
 	}
 
 	/**
@@ -342,26 +354,33 @@ public class DataSourceInfo implements Cloneable, Serializable, XMLSerializable
 	}
 
 	public String getPasswordSource() {
-		if (getPasswordLocation().equals(PASSWORD_LOCATION_CLASSPATH))
+		if (getPasswordLocation().equals(PASSWORD_LOCATION_CLASSPATH)) {
 			return getPasswordSourceFilename();
-		else if (getPasswordLocation().equals(PASSWORD_LOCATION_EXECUTABLE))
+		}
+		else if (getPasswordLocation().equals(PASSWORD_LOCATION_EXECUTABLE)) {
 			return getPasswordSourceExecutable();
-		else if (getPasswordLocation().equals(PASSWORD_LOCATION_MODEL))
+		}
+		else if (getPasswordLocation().equals(PASSWORD_LOCATION_MODEL)) {
 			return getPasswordSourceModel();
-		else if (getPasswordLocation().equals(PASSWORD_LOCATION_URL))
+		}
+		else if (getPasswordLocation().equals(PASSWORD_LOCATION_URL)) {
 			return getPasswordSourceUrl();
+		}
 
 		throw new RuntimeException("Invalid password source detected");
 	}
 
 	public void setPasswordSource(String passwordSource) {
 		// The location for the model is omitted since it cannot change
-		if (getPasswordLocation().equals(PASSWORD_LOCATION_CLASSPATH))
+		if (getPasswordLocation().equals(PASSWORD_LOCATION_CLASSPATH)) {
 			setPasswordSourceFilename(passwordSource);
-		else if (getPasswordLocation().equals(PASSWORD_LOCATION_EXECUTABLE))
+		}
+		else if (getPasswordLocation().equals(PASSWORD_LOCATION_EXECUTABLE)) {
 			setPasswordSourceExecutable(passwordSource);
-		else if (getPasswordLocation().equals(PASSWORD_LOCATION_URL))
+		}
+		else if (getPasswordLocation().equals(PASSWORD_LOCATION_URL)) {
 			setPasswordSourceUrl(passwordSource);
+		}
 	}
 
 	/**
@@ -376,10 +395,12 @@ public class DataSourceInfo implements Cloneable, Serializable, XMLSerializable
 	 *            the passwordLocation to set
 	 */
 	public void setPasswordLocation(String passwordLocation) {
-		if (passwordLocation == null)
+		if (passwordLocation == null) {
 			this.passwordLocation = DataSourceInfo.PASSWORD_LOCATION_MODEL;
-		else
+		}
+		else {
 			this.passwordLocation = passwordLocation;
+		}
 	}
 
 	@Override

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/datasource/DriverDataSource.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/datasource/DriverDataSource.java b/cayenne-server/src/main/java/org/apache/cayenne/datasource/DriverDataSource.java
index b5ccc5a..33e8f9f 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/datasource/DriverDataSource.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/datasource/DriverDataSource.java
@@ -58,7 +58,7 @@ public class DriverDataSource implements DataSource {
 	public DriverDataSource(Driver driver, String connectionUrl, String userName, String password) {
 
 		if (connectionUrl == null) {
-			throw new NullPointerException("Null 'connectionUrl'");
+			throw new IllegalArgumentException("Null 'connectionUrl'");
 		}
 
 		this.driver = driver;

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/datasource/UnmanagedPoolingDataSource.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/datasource/UnmanagedPoolingDataSource.java b/cayenne-server/src/main/java/org/apache/cayenne/datasource/UnmanagedPoolingDataSource.java
index da40900..a51fe55 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/datasource/UnmanagedPoolingDataSource.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/datasource/UnmanagedPoolingDataSource.java
@@ -88,7 +88,7 @@ public class UnmanagedPoolingDataSource implements PoolingDataSource {
 	 */
 	public static final int MAX_QUEUE_WAIT_DEFAULT = 20000;
 
-	private static Logger LOGGER = LoggerFactory.getLogger(UnmanagedPoolingDataSource.class);
+	private static final Logger LOGGER = LoggerFactory.getLogger(UnmanagedPoolingDataSource.class);
 
 	private DataSource nonPoolingDataSource;
 	private long maxQueueWaitTime;

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/dba/mysql/MySQLAdapter.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/dba/mysql/MySQLAdapter.java b/cayenne-server/src/main/java/org/apache/cayenne/dba/mysql/MySQLAdapter.java
index 24d39ae..4c53225 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/dba/mysql/MySQLAdapter.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/dba/mysql/MySQLAdapter.java
@@ -197,8 +197,8 @@ public class MySQLAdapter extends JdbcAdapter {
 		else if (typeName != null && typeName.endsWith(" unsigned")) {
 			// per
 			// http://dev.mysql.com/doc/refman/5.0/en/connector-j-reference-type-conversions.html
-			if (typeName.equals("int unsigned") || typeName.equals("integer unsigned")
-					|| typeName.equals("mediumint unsigned")) {
+			if ("int unsigned".equals(typeName) || "integer unsigned".equals(typeName)
+					|| "mediumint unsigned".equals(typeName)) {
 				type = Types.BIGINT;
 			}
 			// BIGINT UNSIGNED maps to BigInteger according to MySQL docs, but
@@ -288,10 +288,12 @@ public class MySQLAdapter extends JdbcAdapter {
             sqlBuffer.append(", PRIMARY KEY (");
             boolean firstPk = true;
             while (pkit.hasNext()) {
-                if (firstPk)
-                    firstPk = false;
-                else
-                    sqlBuffer.append(", ");
+                if (firstPk) {
+					firstPk = false;
+				}
+                else {
+					sqlBuffer.append(", ");
+				}
 
                 DbAttribute at = pkit.next();
                 sqlBuffer.append(quotingStrategy.quotedName(at));

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/exp/Expression.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/exp/Expression.java b/cayenne-server/src/main/java/org/apache/cayenne/exp/Expression.java
index ce2636f..02a7ca5 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/exp/Expression.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/exp/Expression.java
@@ -524,7 +524,7 @@ public abstract class Expression implements Serializable, XMLSerializable {
 	 */
 	public void traverse(TraversalHandler visitor) {
 		if (visitor == null) {
-			throw new NullPointerException("Null Visitor.");
+			throw new IllegalArgumentException("Null Visitor.");
 		}
 
 		traverse(null, visitor);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/exp/ExpressionFactory.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/exp/ExpressionFactory.java b/cayenne-server/src/main/java/org/apache/cayenne/exp/ExpressionFactory.java
index 6c227a9..7a27469 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/exp/ExpressionFactory.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/exp/ExpressionFactory.java
@@ -107,17 +107,21 @@ public class ExpressionFactory {
 		int min = 0;
 		int allLen = allTypes.length;
 		for (int i = 0; i < allLen; i++) {
-			if (allTypes[i] > max)
+			if (allTypes[i] > max) {
 				max = allTypes[i];
-			else if (allTypes[i] < min)
+			}
+			else if (allTypes[i] < min) {
 				min = allTypes[i];
+			}
 		}
 
 		// sanity check....
-		if (max > 500)
+		if (max > 500) {
 			throw new RuntimeException("Types values are too big: " + max);
-		if (min < 0)
+		}
+		if (min < 0) {
 			throw new RuntimeException("Types values are too small: " + min);
+		}
 
 		// now we know that if types are used as indexes,
 		// they will fit in array "max + 1" long (though gaps are possible)
@@ -285,7 +289,7 @@ public class ExpressionFactory {
 	public static Expression matchAllExp(String path, Collection<?> values) {
 
 		if (values == null) {
-			throw new NullPointerException("Null values collection");
+			throw new IllegalArgumentException("Null values collection");
 		}
 
 		if (values.size() == 0) {
@@ -301,7 +305,7 @@ public class ExpressionFactory {
 	public static Expression matchAllExp(String path, Object... values) {
 
 		if (values == null) {
-			throw new NullPointerException("Null values collection");
+			throw new IllegalArgumentException("Null values collection");
 		}
 
 		if (values.length == 0) {
@@ -1321,7 +1325,7 @@ public class ExpressionFactory {
 	private static Expression fromString(String expressionString) {
 
 		if (expressionString == null) {
-			throw new NullPointerException("Null expression string.");
+			throw new IllegalArgumentException("Null expression string.");
 		}
 
 		// optimizing parser buffers per CAY-1667...

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/exp/ExpressionParameter.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/exp/ExpressionParameter.java b/cayenne-server/src/main/java/org/apache/cayenne/exp/ExpressionParameter.java
index 5562b12..c89169e 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/exp/ExpressionParameter.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/exp/ExpressionParameter.java
@@ -22,6 +22,7 @@ package org.apache.cayenne.exp;
 import org.apache.cayenne.util.Util;
 
 import java.io.Serializable;
+import java.util.Objects;
 
 /**
  * Named parameter for parameterized expressions.
@@ -60,4 +61,9 @@ public class ExpressionParameter implements Serializable {
 		ExpressionParameter parameter = (ExpressionParameter) o;
 		return Util.nullSafeEquals(name, parameter.name);
 	}
+
+	@Override
+	public int hashCode() {
+		return Objects.hash(name);
+	}
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/exp/Property.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/exp/Property.java b/cayenne-server/src/main/java/org/apache/cayenne/exp/Property.java
index 8260333..6872615 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/exp/Property.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/exp/Property.java
@@ -168,12 +168,20 @@ public class Property<E> {
 
     @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;
+        }
 
         Property<?> property = (Property<?>) o;
-        if (name != null ? !name.equals(property.name) : property.name != null) return false;
-        if (name == null && !expressionProvider.get().equals(property.expressionProvider.get())) return false;
+        if (name != null ? !name.equals(property.name) : property.name != null) {
+            return false;
+        }
+        if (name == null && !expressionProvider.get().equals(property.expressionProvider.get())) {
+            return false;
+        }
         return (type == null ? property.type == null : type.equals(property.type));
     }
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/graph/ChildDiffLoader.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/graph/ChildDiffLoader.java b/cayenne-server/src/main/java/org/apache/cayenne/graph/ChildDiffLoader.java
index 4777fd3..54ee014 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/graph/ChildDiffLoader.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/graph/ChildDiffLoader.java
@@ -94,7 +94,7 @@ public class ChildDiffLoader implements GraphChangeHandler {
 		try {
 			ObjectId id = (ObjectId) nodeId;
 			if (id.getEntityName() == null) {
-				throw new NullPointerException("Null entity name in id " + id);
+				throw new IllegalArgumentException("Null entity name in id " + id);
 			}
 
 			ObjEntity entity = context.getEntityResolver().getObjEntity(id.getEntityName());

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/log/FormattedSlf4jJdbcEventLogger.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/log/FormattedSlf4jJdbcEventLogger.java b/cayenne-server/src/main/java/org/apache/cayenne/log/FormattedSlf4jJdbcEventLogger.java
index b38c90e..aa8e7e6 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/log/FormattedSlf4jJdbcEventLogger.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/log/FormattedSlf4jJdbcEventLogger.java
@@ -70,8 +70,9 @@ public class FormattedSlf4jJdbcEventLogger extends Slf4jJdbcEventLogger {
         for (int pos = 0; pos < sql.length(); pos++) {
             if (sql.charAt(pos) == '\'') {
                 apixCount++;
-                if (pos > 0 && sql.charAt(pos - 1) == '\'')
+                if (pos > 0 && sql.charAt(pos - 1) == '\'') {
                     apixCount = apixCount - 2;
+                }
             }
             if (apixCount % 2 != 0) {
                 continue;

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/log/Slf4jJdbcEventLogger.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/log/Slf4jJdbcEventLogger.java b/cayenne-server/src/main/java/org/apache/cayenne/log/Slf4jJdbcEventLogger.java
index d29b585..9eef8e9 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/log/Slf4jJdbcEventLogger.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/log/Slf4jJdbcEventLogger.java
@@ -75,8 +75,9 @@ public class Slf4jJdbcEventLogger implements JdbcEventLogger {
 	}
 
 	private boolean isInserting(String query) {
-		if (query == null || query.length() == 0)
+		if (query == null || query.length() == 0) {
 			return false;
+		}
 
 		char firstCharacter = query.charAt(0);
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/map/CallbackDescriptor.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/map/CallbackDescriptor.java b/cayenne-server/src/main/java/org/apache/cayenne/map/CallbackDescriptor.java
index 6d6b341..b2d73d5 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/map/CallbackDescriptor.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/map/CallbackDescriptor.java
@@ -83,9 +83,10 @@ public class CallbackDescriptor implements Serializable {
     public boolean moveMethod(String callbackMethod, int destinationIndex) {
         List<String> callbackMethodsList = new ArrayList<>(callbackMethods);
         int currentIndex = callbackMethodsList.indexOf(callbackMethod);
-        if (currentIndex < 0)
+        if (currentIndex < 0) {
             throw new IllegalArgumentException("Unknown callback method: "
                     + callbackMethod);
+        }
 
         boolean changed = false;
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/map/DataMap.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/map/DataMap.java b/cayenne-server/src/main/java/org/apache/cayenne/map/DataMap.java
index f52f5b5..64f5aff 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/map/DataMap.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/map/DataMap.java
@@ -455,11 +455,11 @@ public class DataMap implements Serializable, ConfigurationNode, XMLSerializable
 	 */
 	public void addQueryDescriptor(QueryDescriptor queryDescriptor) {
 		if (queryDescriptor == null) {
-			throw new NullPointerException("Can't add null query.");
+			throw new IllegalArgumentException("Can't add null query.");
 		}
 
 		if (queryDescriptor.getName() == null) {
-			throw new NullPointerException("Query name can't be null.");
+			throw new IllegalArgumentException("Query name can't be null.");
 		}
 
 		// TODO: change method signature to return replaced procedure and make
@@ -553,11 +553,11 @@ public class DataMap implements Serializable, ConfigurationNode, XMLSerializable
 	 */
 	public void addEmbeddable(Embeddable embeddable) {
 		if (embeddable == null) {
-			throw new NullPointerException("Null embeddable");
+			throw new IllegalArgumentException("Null embeddable");
 		}
 
 		if (embeddable.getClassName() == null) {
-			throw new NullPointerException("Attempt to add Embeddable with no class name.");
+			throw new IllegalArgumentException("Attempt to add Embeddable with no class name.");
 		}
 
 		// TODO: change method signature to return replaced entity and make sure
@@ -583,11 +583,11 @@ public class DataMap implements Serializable, ConfigurationNode, XMLSerializable
 	 */
 	public void addResult(SQLResult result) {
 		if (result == null) {
-			throw new NullPointerException("Null result");
+			throw new IllegalArgumentException("Null result");
 		}
 
 		if (result.getName() == null) {
-			throw new NullPointerException("Attempt to add resultSetMapping with no name.");
+			throw new IllegalArgumentException("Attempt to add resultSetMapping with no name.");
 		}
 
 		Object existing = results.get(result.getName());
@@ -607,7 +607,7 @@ public class DataMap implements Serializable, ConfigurationNode, XMLSerializable
 	 */
 	public void addObjEntity(ObjEntity entity) {
 		if (entity.getName() == null) {
-			throw new NullPointerException("Attempt to add ObjEntity with no name.");
+			throw new IllegalArgumentException("Attempt to add ObjEntity with no name.");
 		}
 
 		// TODO: change method signature to return replaced entity and make sure
@@ -631,7 +631,7 @@ public class DataMap implements Serializable, ConfigurationNode, XMLSerializable
 	 */
 	public void addDbEntity(DbEntity entity) {
 		if (entity.getName() == null) {
-			throw new NullPointerException("Attempt to add DbEntity with no name.");
+			throw new IllegalArgumentException("Attempt to add DbEntity with no name.");
 		}
 
 		// TODO: change method signature to return replaced entity and make sure
@@ -922,7 +922,7 @@ public class DataMap implements Serializable, ConfigurationNode, XMLSerializable
 	 */
 	public void addProcedure(Procedure procedure) {
 		if (procedure.getName() == null) {
-			throw new NullPointerException("Attempt to add procedure with no name.");
+			throw new IllegalArgumentException("Attempt to add procedure with no name.");
 		}
 
 		// TODO: change method signature to return replaced procedure and make

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/map/DbKeyGenerator.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/map/DbKeyGenerator.java b/cayenne-server/src/main/java/org/apache/cayenne/map/DbKeyGenerator.java
index d91e787..30e54e1 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/map/DbKeyGenerator.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/map/DbKeyGenerator.java
@@ -109,8 +109,9 @@ public class DbKeyGenerator implements CayenneMapEntry, XMLSerializable, Seriali
         if (this.generatorType != null) {
             this.generatorType = this.generatorType.trim().toUpperCase();
             if (!(ORACLE_TYPE.equals(this.generatorType)
-                    || NAMED_SEQUENCE_TABLE_TYPE.equals(this.generatorType)))
+                    || NAMED_SEQUENCE_TABLE_TYPE.equals(this.generatorType))) {
                 this.generatorType = null;
+            }
         }
     }
 
@@ -133,8 +134,9 @@ public class DbKeyGenerator implements CayenneMapEntry, XMLSerializable, Seriali
         this.generatorName = generatorName;
         if (this.generatorName != null) {
             this.generatorName = this.generatorName.trim();
-            if (this.generatorName.length() == 0)
+            if (this.generatorName.length() == 0) {
                 this.generatorName = null;
+            }
         }
     }
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/map/PathComponentIterator.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/map/PathComponentIterator.java b/cayenne-server/src/main/java/org/apache/cayenne/map/PathComponentIterator.java
index d4f7d54..e631156 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/map/PathComponentIterator.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/map/PathComponentIterator.java
@@ -64,13 +64,14 @@ class PathComponentIterator implements Iterator<PathComponent<Attribute, Relatio
         Attribute attr = currentEntity.getAttribute(pathComp);
         if (attr != null) {
             // do a sanity check...
-            if (toks.hasMoreTokens())
+            if (toks.hasMoreTokens()) {
                 throw new ExpressionException(
                         "Attribute must be the last component of the path: '"
                                 + pathComp
                                 + "'.",
                         path,
                         null);
+            }
 
             return new AttributePathComponent<Attribute, Relationship>(attr);
         }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/map/QueryDescriptorLoader.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/map/QueryDescriptorLoader.java b/cayenne-server/src/main/java/org/apache/cayenne/map/QueryDescriptorLoader.java
index cd5235f..fe4382b 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/map/QueryDescriptorLoader.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/map/QueryDescriptorLoader.java
@@ -30,6 +30,8 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import static org.apache.cayenne.util.Util.isBlank;
+
 /**
  * A builder that constructs Cayenne queries from abstract configuration information
  * defined in cayenne-data-map*.dtd. This abstract builder supports values declared in the
@@ -189,7 +191,7 @@ public class QueryDescriptorLoader {
     }
 
     public void setQualifier(String qualifier) {
-        if (qualifier == null || qualifier.trim().length() == 0) {
+        if (qualifier == null || isBlank(qualifier.trim())) {
             this.qualifier = null;
         }
         else {
@@ -210,7 +212,7 @@ public class QueryDescriptorLoader {
             orderings = new ArrayList<>();
         }
 
-        if (path != null && path.trim().length() == 0) {
+        if (path != null && isBlank(path.trim())) {
             path = null;
         }
         boolean isDescending = "true".equalsIgnoreCase(descending);
@@ -233,7 +235,7 @@ public class QueryDescriptorLoader {
     }
 
     public void addPrefetch(String path) {
-        if (path == null || (path != null && path.trim().length() == 0)) {
+        if (path == null || (path != null && isBlank(path.trim()))) {
             // throw??
             return;
         }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/query/ColumnSelect.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/query/ColumnSelect.java b/cayenne-server/src/main/java/org/apache/cayenne/query/ColumnSelect.java
index ca9db48..d16fbae 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/query/ColumnSelect.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/query/ColumnSelect.java
@@ -462,7 +462,7 @@ public class ColumnSelect<T> extends FluentSelect<T> {
     @SuppressWarnings("unchecked")
     public ColumnSelect<Object[]> columns(Collection<Property<?>> properties) {
         if (properties == null){
-            throw new NullPointerException("properties is null");
+            throw new IllegalArgumentException("properties is null");
         }
         if (properties.isEmpty()) {
             throw new IllegalArgumentException("properties must contain at least one element");

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/query/DeleteBatchQuery.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/query/DeleteBatchQuery.java b/cayenne-server/src/main/java/org/apache/cayenne/query/DeleteBatchQuery.java
index b58d11c..7c430eb 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/query/DeleteBatchQuery.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/query/DeleteBatchQuery.java
@@ -54,7 +54,7 @@ public class DeleteBatchQuery extends BatchQuery {
         super(dbEntity, qualifierAttributes, batchCapacity);
 
         if (nullQualifierNames == null) {
-            throw new NullPointerException("Null 'nullQualifierNames'");
+            throw new IllegalArgumentException("Null 'nullQualifierNames'");
         }
 
         this.nullQualifierNames = nullQualifierNames;

http://git-wip-us.apache.org/repos/asf/cayenne/blob/87c6ccc8/cayenne-server/src/main/java/org/apache/cayenne/query/ObjectIdQuery.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/query/ObjectIdQuery.java b/cayenne-server/src/main/java/org/apache/cayenne/query/ObjectIdQuery.java
index 96968c5..ddbe32f 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/query/ObjectIdQuery.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/query/ObjectIdQuery.java
@@ -69,7 +69,7 @@ public class ObjectIdQuery extends IndirectQuery {
      */
     public ObjectIdQuery(ObjectId objectId, boolean fetchingDataRows, int cachePolicy) {
         if (objectId == null) {
-            throw new NullPointerException("Null objectID");
+            throw new IllegalArgumentException("Null objectID");
         }
 
         this.objectId = objectId;


Mime
View raw message