cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntimof...@apache.org
Subject cayenne git commit: Cleanup
Date Thu, 06 Sep 2018 08:56:37 GMT
Repository: cayenne
Updated Branches:
  refs/heads/master 4fd50392e -> e89e99e6e


Cleanup


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

Branch: refs/heads/master
Commit: e89e99e6e6dd497e3eb5a0d41e7ac53814c6deb7
Parents: 4fd5039
Author: Nikita Timofeev <stariy95@gmail.com>
Authored: Thu Sep 6 11:56:31 2018 +0300
Committer: Nikita Timofeev <stariy95@gmail.com>
Committed: Thu Sep 6 11:56:31 2018 +0300

----------------------------------------------------------------------
 .../cayenne/project/upgrade/handlers/UpgradeHandler.java    | 6 ++----
 .../project/upgrade/handlers/UpgradeHandler_V10.java        | 6 ------
 .../cayenne/project/upgrade/handlers/UpgradeHandler_V8.java | 6 ------
 .../cayenne/project/upgrade/handlers/UpgradeHandler_V9.java | 9 +++------
 4 files changed, 5 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/e89e99e6/cayenne-project/src/main/java/org/apache/cayenne/project/upgrade/handlers/UpgradeHandler.java
----------------------------------------------------------------------
diff --git a/cayenne-project/src/main/java/org/apache/cayenne/project/upgrade/handlers/UpgradeHandler.java
b/cayenne-project/src/main/java/org/apache/cayenne/project/upgrade/handlers/UpgradeHandler.java
index 535ec8c..8ddd5de 100644
--- a/cayenne-project/src/main/java/org/apache/cayenne/project/upgrade/handlers/UpgradeHandler.java
+++ b/cayenne-project/src/main/java/org/apache/cayenne/project/upgrade/handlers/UpgradeHandler.java
@@ -50,9 +50,7 @@ public interface UpgradeHandler {
      * using this method will make upgrade process not future proof and
      * will require refactoring if model should change.
      */
-    void processModel(DataChannelDescriptor dataChannelDescriptor);
-    // should be this really, but no Java 8 yet:
-    //default void processModel(DataChannelDescriptor dataChannelDescriptor) {}
-
+    default void processModel(DataChannelDescriptor dataChannelDescriptor) {
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/e89e99e6/cayenne-project/src/main/java/org/apache/cayenne/project/upgrade/handlers/UpgradeHandler_V10.java
----------------------------------------------------------------------
diff --git a/cayenne-project/src/main/java/org/apache/cayenne/project/upgrade/handlers/UpgradeHandler_V10.java
b/cayenne-project/src/main/java/org/apache/cayenne/project/upgrade/handlers/UpgradeHandler_V10.java
index 01e0bd7..1103d35 100644
--- a/cayenne-project/src/main/java/org/apache/cayenne/project/upgrade/handlers/UpgradeHandler_V10.java
+++ b/cayenne-project/src/main/java/org/apache/cayenne/project/upgrade/handlers/UpgradeHandler_V10.java
@@ -19,7 +19,6 @@
 
 package org.apache.cayenne.project.upgrade.handlers;
 
-import org.apache.cayenne.configuration.DataChannelDescriptor;
 import org.apache.cayenne.project.upgrade.UpgradeUnit;
 import org.w3c.dom.Element;
 
@@ -60,9 +59,4 @@ public class UpgradeHandler_V10 implements UpgradeHandler {
         // update version
         dataMap.setAttribute("project-version", getVersion());
     }
-
-    @Override
-    public void processModel(DataChannelDescriptor dataChannelDescriptor) {
-        // noop
-    }
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/e89e99e6/cayenne-project/src/main/java/org/apache/cayenne/project/upgrade/handlers/UpgradeHandler_V8.java
----------------------------------------------------------------------
diff --git a/cayenne-project/src/main/java/org/apache/cayenne/project/upgrade/handlers/UpgradeHandler_V8.java
b/cayenne-project/src/main/java/org/apache/cayenne/project/upgrade/handlers/UpgradeHandler_V8.java
index 115969d..bdd5382 100644
--- a/cayenne-project/src/main/java/org/apache/cayenne/project/upgrade/handlers/UpgradeHandler_V8.java
+++ b/cayenne-project/src/main/java/org/apache/cayenne/project/upgrade/handlers/UpgradeHandler_V8.java
@@ -24,7 +24,6 @@ import javax.xml.xpath.XPathConstants;
 import javax.xml.xpath.XPathFactory;
 
 import org.apache.cayenne.ConfigurationException;
-import org.apache.cayenne.configuration.DataChannelDescriptor;
 import org.apache.cayenne.map.QueryDescriptor;
 import org.apache.cayenne.project.upgrade.UpgradeUnit;
 import org.w3c.dom.Element;
@@ -91,9 +90,4 @@ public class UpgradeHandler_V8 implements UpgradeHandler {
             queryElement.removeAttribute("factory");
         }
     }
-
-    @Override
-    public void processModel(DataChannelDescriptor dataChannelDescriptor) {
-
-    }
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/e89e99e6/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 7f9a53b..5c66f21 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
@@ -24,7 +24,6 @@ import javax.xml.xpath.XPath;
 import javax.xml.xpath.XPathConstants;
 import javax.xml.xpath.XPathFactory;
 
-import org.apache.cayenne.configuration.DataChannelDescriptor;
 import org.apache.cayenne.project.upgrade.UpgradeUnit;
 import org.apache.cayenne.util.Util;
 import org.slf4j.Logger;
@@ -70,7 +69,9 @@ public class UpgradeHandler_V9 implements UpgradeHandler {
 
                 File file = new File(directoryPath + "/" + reFileName);
                 if (file.exists()) {
-                    file.delete();
+                    if(!file.delete()) {
+                        logger.warn("Can't delete file " + file);
+                    }
                 }
                 dataMap.removeChild(reNode);
             }
@@ -78,8 +79,4 @@ public class UpgradeHandler_V9 implements UpgradeHandler {
             logger.warn("Can't process dataMap DOM: ", ex);
         }
     }
-
-    @Override
-    public void processModel(DataChannelDescriptor dataChannelDescriptor) {
-    }
 }


Mime
View raw message