cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntimof...@apache.org
Subject [09/11] cayenne git commit: Code-checkers
Date Fri, 02 Feb 2018 13:07:43 GMT
Code-checkers


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

Branch: refs/heads/master
Commit: 50bed162eb59bd78f6d9fd65a3d50a898b7842be
Parents: 97664e9
Author: Arseni Bulatski <ancarseni@gmail.com>
Authored: Fri Feb 2 11:34:46 2018 +0300
Committer: Arseni Bulatski <ancarseni@gmail.com>
Committed: Fri Feb 2 11:53:13 2018 +0300

----------------------------------------------------------------------
 .../CacheInvalidationModuleProvider.java        |  1 -
 .../java/org/apache/cayenne/rop/ROPUtil.java    |  9 +++------
 .../CommitLogServerModuleProvider.java          |  1 -
 .../reverse/dbimport/DefaultDbImportAction.java |  2 +-
 .../reverse/dbimport/FilterContainer.java       |  2 +-
 .../dbsync/reverse/dbimport/PatternParam.java   |  2 +-
 .../jcache/JCacheServerModuleProvider.java      |  1 -
 .../project/upgrade/DefaultUpgradeService.java  |  6 +++---
 .../upgrade/handlers/UpgradeHandler_V9.java     |  2 +-
 .../cayenne/CayenneContextMergeHandler.java     |  3 +--
 .../apache/cayenne/remote/RemoteSession.java    |  4 ++--
 .../apache/cayenne/ObjectContextStateLog.java   |  4 ++--
 .../translator/select/QualifierTranslator.java  |  6 ++----
 .../cayenne/access/types/CalendarType.java      |  9 +++------
 .../cayenne/ashwood/AshwoodEntitySorter.java    |  3 +--
 .../cayenne/ashwood/graph/MapDigraph.java       |  9 +++------
 .../cayenne/ashwood/graph/StrongConnection.java |  6 ++----
 .../configuration/Rot13PasswordEncoder.java     |  3 +--
 .../configuration/xml/DbEntityHandler.java      |  2 +-
 .../configuration/xml/ObjEntityHandler.java     |  2 +-
 .../xml/QueryDescriptorHandler.java             |  2 +-
 .../org/apache/cayenne/conn/DataSourceInfo.java | 21 +++++++-------------
 .../apache/cayenne/dba/mysql/MySQLAdapter.java  |  3 +--
 .../apache/cayenne/exp/ExpressionFactory.java   |  3 +--
 .../cayenne/map/QueryDescriptorLoader.java      |  9 ++++-----
 .../java/org/apache/cayenne/query/Ordering.java | 12 ++++-------
 .../cayenne/reflect/ConverterFactory.java       |  3 +--
 27 files changed, 48 insertions(+), 82 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/50bed162/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 3d3b34c..bcfd77e 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
@@ -41,7 +41,6 @@ public class CacheInvalidationModuleProvider implements CayenneServerModuleProvi
         return CacheInvalidationModule.class;
     }
 
-    @SuppressWarnings("unchecked")
     @Override
     public Collection<Class<? extends Module>> overrides() {
         return Collections.singletonList(ServerModule.class);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/50bed162/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 44aa7b1..c95f46d 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
@@ -137,14 +137,11 @@ public class ROPUtil {
         d &= 0x3f;
         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 {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/50bed162/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 4294c3e..6693e5a 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
@@ -41,7 +41,6 @@ public class CommitLogServerModuleProvider implements CayenneServerModuleProvide
         return CommitLogModule.class;
     }
 
-    @SuppressWarnings("unchecked")
     @Override
     public Collection<Class<? extends Module>> overrides() {
         return Collections.singletonList(ServerModule.class);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/50bed162/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 7446c5f..17c26ce 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
@@ -196,7 +196,7 @@ public class DefaultDbImportAction implements DbImportAction {
 
     private boolean syncDataMapProperties(DataMap targetDataMap, DbImportConfiguration config)
{
         String defaultPackage = config.getDefaultPackage();
-        if (defaultPackage == null || isBlank(defaultPackage.trim())) {
+        if (defaultPackage == null || isBlank(defaultPackage)) {
             return false;
         }
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/50bed162/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 a05f8dd..7090522 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
@@ -156,7 +156,7 @@ public abstract class FilterContainer {
     }
 
     public void addText(String name) {
-        if (Util.isBlank(name.trim())) {
+        if (Util.isBlank(name)) {
             return;
         }
         setName(name);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/50bed162/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 f0ec3ed..bef2d5e 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
@@ -59,7 +59,7 @@ public class PatternParam {
      * Used by Ant task
      */
     public void addText(String pattern) {
-        if (isBlank(pattern.trim())) {
+        if (isBlank(pattern)) {
             return;
         }
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/50bed162/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 6dcd227..0d1643a 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
@@ -41,7 +41,6 @@ public class JCacheServerModuleProvider implements CayenneServerModuleProvider
{
         return JCacheModule.class;
     }
 
-    @SuppressWarnings("unchecked")
     @Override
     public Collection<Class<? extends Module>> overrides() {
         return Collections.singletonList(ServerModule.class);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/50bed162/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 c4044a6..d00b7b5 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
@@ -227,7 +227,7 @@ public class DefaultUpgradeService implements UpgradeService {
                 resources.add(mapResource);
             }
         } catch (Exception ex) {
-            logger.warn("Message: ", ex);
+            logger.warn("Can't get additional dataMap resources: ", ex);
         }
         return resources;
     }
@@ -240,7 +240,7 @@ public class DefaultUpgradeService implements UpgradeService {
             Transformer transformer = TransformerFactory.newInstance().newTransformer();
             transformer.transform(input, output);
         } catch (Exception ex) {
-            logger.warn("Message: ", ex);
+            logger.warn("Can't save the document: ", ex);
         }
     }
 
@@ -267,7 +267,7 @@ public class DefaultUpgradeService implements UpgradeService {
     }
 
     protected static double decodeVersion(String version) {
-        if (version == null || isBlank(version.trim())) {
+        if (version == null || isBlank(version)) {
             return 0;
         }
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/50bed162/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 ac796ec..91850ea 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
@@ -75,7 +75,7 @@ public class UpgradeHandler_V9 implements UpgradeHandler {
                 dataMap.removeChild(reNode);
             }
         } catch (Exception ex) {
-            logger.warn("Message: ", ex);
+            logger.warn("Can't process dataMap DOM: ", ex);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/50bed162/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 1f03bb7..e3217a8 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
@@ -189,8 +189,7 @@ class CayenneContextMergeHandler implements GraphChangeHandler, DataChannelListe
 
         if (p instanceof ToManyProperty) {
             ((ToManyProperty) p).addTargetDirectly(source, target);
-        }
-        else {
+        } else {
             p.writePropertyDirectly(source, null, target);
         }
     }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/50bed162/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 7eae9d4..d86e1ec 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
@@ -90,8 +90,8 @@ public class RemoteSession implements Serializable {
 
     @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; }
         RemoteSession that = (RemoteSession) o;
         return Objects.equals(sessionId, that.sessionId);
     }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/50bed162/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 69920d3..25a970b 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/ObjectContextStateLog.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/ObjectContextStateLog.java
@@ -41,12 +41,12 @@ class ObjectContextStateLog implements GraphChangeHandler {
     GraphManager graphManager;
 
     ObjectContextStateLog(GraphManager graphManager) {
-        this.dirtyIds = new HashSet<Object>();
+        this.dirtyIds = new HashSet<>();
         this.graphManager = graphManager;
     }
 
     void clear() {
-        dirtyIds = new HashSet<Object>();
+        dirtyIds = new HashSet<>();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/cayenne/blob/50bed162/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 774d0bf..3795976 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
@@ -316,16 +316,14 @@ public class QualifierTranslator extends QueryAssemblerHelper implements
Travers
 			case Expression.BETWEEN:
 				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) {
 					out.append(" NOT BETWEEN ");
-				}
-				else if (childIndex == 1) {
+				} else if (childIndex == 1) {
 					out.append(" AND ");
 				}
 				break;

http://git-wip-us.apache.org/repos/asf/cayenne/blob/50bed162/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 d5d2c42..77447ca 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
@@ -151,14 +151,11 @@ public class CalendarType<T extends Calendar> implements ExtendedType<Calendar>
     protected Object convertToJdbcObject(Calendar value, int type) throws Exception {
         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()

http://git-wip-us.apache.org/repos/asf/cayenne/blob/50bed162/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 c7775a5..4c1a947 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
@@ -360,8 +360,7 @@ public class AshwoodEntitySorter implements EntitySorter {
 			}
 			if (t1 == null) {
 				return -1;
-			}
-			else if (t2 == null) {
+			} else if (t2 == null) {
 				return 1;
 			}
 			else {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/50bed162/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 31cac7b..949681c 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
@@ -132,8 +132,7 @@ public class MapDigraph<E, V> implements Digraph<E, V> {
 		Map<E, V> destination = graph.remove(vertex);
 		if (destination != null) {
 			size -= destination.size();
-		}
-		else {
+		} else {
 			return false;
 		}
 
@@ -188,8 +187,7 @@ public class MapDigraph<E, V> implements Digraph<E, V> {
 		Map<E, V> destinations = graph.remove(vertex);
 		if (destinations != null) {
 			size -= destinations.size();
-		}
-		else {
+		} else {
 			return false;
 		}
 		boolean modified = !destinations.isEmpty();
@@ -240,8 +238,7 @@ public class MapDigraph<E, V> implements Digraph<E, V> {
 		Map<E, V> destinations = graph.get(vertex);
 		if (destinations == null) {
 			return 0;
-		}
-		else {
+		} else {
 			return destinations.size();
 		}
 	}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/50bed162/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 3c9cf20..b96fb86 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
@@ -178,8 +178,7 @@ public class StrongConnection<E, V> implements Iterator<Collection<E>>
{
 		}
 		if (directDfs == null) {
 			directDfs = new DepthFirstStampSearch<>(filteredDigraph, root);
-		}
-		else {
+		} else {
 			directDfs.reset(root);
 		}
 		int stamp;
@@ -204,8 +203,7 @@ public class StrongConnection<E, V> implements Iterator<Collection<E>>
{
 		boolean singleton = true;
 		if (reverseDfs == null) {
 			reverseDfs = new DepthFirstSearch<>(reverseDigraph, root);
-		}
-		else {
+		} else {
 			reverseDfs.reset(root);
 		}
 		while (reverseDfs.hasNext()) {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/50bed162/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 d8cd163..c2bb9ca 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
@@ -68,8 +68,7 @@ public class Rot13PasswordEncoder implements PasswordEncoding {
             // If c is a letter, rotate it by 13. Numbers/symbols are untouched.
             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
             }
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/50bed162/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 ce766f8..b248f6a 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
@@ -128,7 +128,7 @@ public class DbEntityHandler extends NamespaceAwareNestedTagHandler {
     }
 
     private void createQualifier(String qualifier) {
-        if (isBlank(qualifier.trim())) {
+        if (isBlank(qualifier)) {
             return;
         }
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/50bed162/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 ab4a655..3da4cbc 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
@@ -193,7 +193,7 @@ public class ObjEntityHandler extends NamespaceAwareNestedTagHandler {
     }
 
     private void createQualifier(String qualifier) {
-        if (isBlank(qualifier.trim())) {
+        if (isBlank(qualifier)) {
             return;
         }
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/50bed162/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 da18429..1cff9eb 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
@@ -162,7 +162,7 @@ public class QueryDescriptorHandler extends NamespaceAwareNestedTagHandler
{
     }
 
     private void createQualifier(String qualifier) {
-        if (isBlank(qualifier.trim())) {
+        if (isBlank(qualifier)) {
             return;
         }
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/50bed162/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 967054c..165f37b 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
@@ -280,8 +280,7 @@ public class DataSourceInfo implements Cloneable, Serializable, XMLSerializable
 	public void setPasswordEncoderClass(String passwordEncoderClass) {
 		if (passwordEncoderClass == null) {
 			this.passwordEncoderClass = PasswordEncoding.standardEncoders[0];
-		}
-		else {
+		} else {
 			this.passwordEncoderClass = passwordEncoderClass;
 		}
 	}
@@ -356,14 +355,11 @@ public class DataSourceInfo implements Cloneable, Serializable, XMLSerializable
 	public String getPasswordSource() {
 		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();
 		}
 
@@ -374,11 +370,9 @@ public class DataSourceInfo implements Cloneable, Serializable, XMLSerializable
 		// The location for the model is omitted since it cannot change
 		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);
 		}
 	}
@@ -397,8 +391,7 @@ public class DataSourceInfo implements Cloneable, Serializable, XMLSerializable
 	public void setPasswordLocation(String passwordLocation) {
 		if (passwordLocation == null) {
 			this.passwordLocation = DataSourceInfo.PASSWORD_LOCATION_MODEL;
-		}
-		else {
+		} else {
 			this.passwordLocation = passwordLocation;
 		}
 	}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/50bed162/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 4c53225..b50fbc0 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
@@ -290,8 +290,7 @@ public class MySQLAdapter extends JdbcAdapter {
             while (pkit.hasNext()) {
                 if (firstPk) {
 					firstPk = false;
-				}
-                else {
+				} else {
 					sqlBuffer.append(", ");
 				}
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/50bed162/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 ec0b2ce..ab525af 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
@@ -109,8 +109,7 @@ public class ExpressionFactory {
 		for (int i = 0; i < allLen; i++) {
 			if (allTypes[i] > max) {
 				max = allTypes[i];
-			}
-			else if (allTypes[i] < min) {
+			} else if (allTypes[i] < min) {
 				min = allTypes[i];
 			}
 		}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/50bed162/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 fe4382b..d8370de 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
@@ -191,10 +191,9 @@ public class QueryDescriptorLoader {
     }
 
     public void setQualifier(String qualifier) {
-        if (qualifier == null || isBlank(qualifier.trim())) {
+        if (qualifier == null || isBlank(qualifier)) {
             this.qualifier = null;
-        }
-        else {
+        } else {
             this.qualifier = ExpressionFactory.exp(qualifier.trim());
         }
     }
@@ -212,7 +211,7 @@ public class QueryDescriptorLoader {
             orderings = new ArrayList<>();
         }
 
-        if (path != null && isBlank(path.trim())) {
+        if (path != null && isBlank(path)) {
             path = null;
         }
         boolean isDescending = "true".equalsIgnoreCase(descending);
@@ -235,7 +234,7 @@ public class QueryDescriptorLoader {
     }
 
     public void addPrefetch(String path) {
-        if (path == null || (path != null && isBlank(path.trim()))) {
+        if (path == null || (path != null && isBlank(path))) {
             // throw??
             return;
         }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/50bed162/cayenne-server/src/main/java/org/apache/cayenne/query/Ordering.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/query/Ordering.java b/cayenne-server/src/main/java/org/apache/cayenne/query/Ordering.java
index 1de21fa..85ad2cc 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/query/Ordering.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/query/Ordering.java
@@ -270,8 +270,7 @@ public class Ordering implements Comparator<Object>, Serializable,
XMLSerializab
 	public void setAscending() {
 		if (sortOrder == null || sortOrder == SortOrder.DESCENDING) {
 			setSortOrder(SortOrder.ASCENDING);
-		}
-		else if (sortOrder == SortOrder.DESCENDING_INSENSITIVE) {
+		} else if (sortOrder == SortOrder.DESCENDING_INSENSITIVE) {
 			setSortOrder(SortOrder.ASCENDING_INSENSITIVE);
 		}
 	}
@@ -285,8 +284,7 @@ public class Ordering implements Comparator<Object>, Serializable,
XMLSerializab
 	public void setDescending() {
 		if (sortOrder == null || sortOrder == SortOrder.ASCENDING) {
 			setSortOrder(SortOrder.DESCENDING);
-		}
-		else if (sortOrder == SortOrder.ASCENDING_INSENSITIVE) {
+		} else if (sortOrder == SortOrder.ASCENDING_INSENSITIVE) {
 			setSortOrder(SortOrder.DESCENDING_INSENSITIVE);
 		}
 	}
@@ -314,8 +312,7 @@ public class Ordering implements Comparator<Object>, Serializable,
XMLSerializab
 	public void setCaseInsensitive() {
 		if (sortOrder == null || sortOrder == SortOrder.ASCENDING) {
 			setSortOrder(SortOrder.ASCENDING_INSENSITIVE);
-		}
-		else if (sortOrder == SortOrder.DESCENDING) {
+		} else if (sortOrder == SortOrder.DESCENDING) {
 			setSortOrder(SortOrder.DESCENDING_INSENSITIVE);
 		}
 	}
@@ -329,8 +326,7 @@ public class Ordering implements Comparator<Object>, Serializable,
XMLSerializab
 	public void setCaseSensitive() {
 		if (sortOrder == null || sortOrder == SortOrder.ASCENDING_INSENSITIVE) {
 			setSortOrder(SortOrder.ASCENDING);
-		}
-		else if (sortOrder == SortOrder.DESCENDING_INSENSITIVE) {
+		} else if (sortOrder == SortOrder.DESCENDING_INSENSITIVE) {
 			setSortOrder(SortOrder.DESCENDING);
 		}
 	}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/50bed162/cayenne-server/src/main/java/org/apache/cayenne/reflect/ConverterFactory.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/reflect/ConverterFactory.java
b/cayenne-server/src/main/java/org/apache/cayenne/reflect/ConverterFactory.java
index 8fad950..1567e0b 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/reflect/ConverterFactory.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/reflect/ConverterFactory.java
@@ -63,8 +63,7 @@ public class ConverterFactory {
                 } else if (object instanceof Integer || object instanceof Long || object
instanceof Short || object instanceof Byte) {
                 	if (((Number)object).longValue() == 0) {
                         return Boolean.FALSE;
-                    }
-                	else if (((Number)object).longValue() == 1) {
+                    } else if (((Number)object).longValue() == 1) {
                         return Boolean.TRUE;
                     }
                 }


Mime
View raw message