cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntimof...@apache.org
Subject [2/2] cayenne git commit: Minor code cleanup
Date Wed, 05 Sep 2018 09:06:25 GMT
Minor code cleanup


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

Branch: refs/heads/master
Commit: b8b4e00abab2f177a76978d5d4ac779bb44bd892
Parents: 9c39fa7
Author: Nikita Timofeev <stariy95@gmail.com>
Authored: Wed Sep 5 12:02:23 2018 +0300
Committer: Nikita Timofeev <stariy95@gmail.com>
Committed: Wed Sep 5 12:02:23 2018 +0300

----------------------------------------------------------------------
 .../xml/DataSourceChildrenHandler.java              | 16 +++++++---------
 .../configuration/xml/DbKeyGeneratorHandler.java    |  2 +-
 .../configuration/xml/SAXNestedTagHandler.java      |  2 +-
 3 files changed, 9 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/b8b4e00a/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 c4c0304..8f40650 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
@@ -102,7 +102,7 @@ class DataSourceChildrenHandler extends NamespaceAwareNestedTagHandler
{
 
         // Replace {} in passwordSource with encoderSalt -- useful for EXECUTABLE & URL
options
         if (encoderKey != null) {
-            passwordSource = passwordSource.replaceAll("\\{\\}", encoderKey);
+            passwordSource = passwordSource.replaceAll("\\{}", encoderKey);
         }
 
         String encoderType = dataSourceDescriptor.getPasswordEncoderClass();
@@ -131,14 +131,12 @@ class DataSourceChildrenHandler extends NamespaceAwareNestedTagHandler
{
                     }
                     break;
                 case DataSourceInfo.PASSWORD_LOCATION_EXECUTABLE:
-                    if (passwordSource != null) {
-                        try {
-                            Process process = Runtime.getRuntime().exec(passwordSource);
-                            password = XMLDataChannelDescriptorLoader.passwordFromInputStream(process.getInputStream());
-                            process.waitFor();
-                        } catch (IOException | InterruptedException exception) {
-                            logger.warn(exception.getMessage(), exception);
-                        }
+                    try {
+                        Process process = Runtime.getRuntime().exec(passwordSource);
+                        password = XMLDataChannelDescriptorLoader.passwordFromInputStream(process.getInputStream());
+                        process.waitFor();
+                    } catch (IOException | InterruptedException exception) {
+                        logger.warn(exception.getMessage(), exception);
                     }
                     break;
             }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/b8b4e00a/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/DbKeyGeneratorHandler.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/DbKeyGeneratorHandler.java
b/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/DbKeyGeneratorHandler.java
index e76c4c3..54018f3 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/DbKeyGeneratorHandler.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/DbKeyGeneratorHandler.java
@@ -109,7 +109,7 @@ public class DbKeyGeneratorHandler extends NamespaceAwareNestedTagHandler
{
             return;
         }
         try {
-            pkGenerator.setKeyCacheSize(new Integer(size.trim()));
+            pkGenerator.setKeyCacheSize(Integer.valueOf(size.trim()));
         } catch (Exception ex) {
             pkGenerator.setKeyCacheSize(null);
         }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/b8b4e00a/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/SAXNestedTagHandler.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/SAXNestedTagHandler.java
b/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/SAXNestedTagHandler.java
index d2d4e04..7d2aa5c 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/SAXNestedTagHandler.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/SAXNestedTagHandler.java
@@ -83,7 +83,7 @@ public class SAXNestedTagHandler extends DefaultHandler {
 
         List<String> expected = tagsExpected != null
                 ? Arrays.asList(tagsExpected)
-                : Collections.<String> emptyList();
+                : Collections.emptyList();
 
         return String.format("tag <%s> is unexpected at [%d,%d]. The following tags
are allowed here: %s",
                 tagFound,


Mime
View raw message