cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntimof...@apache.org
Subject cayenne git commit: CAY-2273 Modeler: default suggested cgen location is rooted in subpackage
Date Thu, 23 Mar 2017 09:13:35 GMT
Repository: cayenne
Updated Branches:
  refs/heads/master a0ef5ad24 -> e0ed68170


CAY-2273 Modeler: default suggested cgen location is rooted in subpackage


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

Branch: refs/heads/master
Commit: e0ed681703654a4675261d60c80ea820d73e5c20
Parents: a0ef5ad
Author: Nikita Timofeev <stariy95@gmail.com>
Authored: Thu Mar 23 12:13:28 2017 +0300
Committer: Nikita Timofeev <stariy95@gmail.com>
Committed: Thu Mar 23 12:13:28 2017 +0300

----------------------------------------------------------------------
 .../org/apache/cayenne/gen/ClassGenerationAction.java     |  6 +++---
 docs/doc/src/main/resources/RELEASE-NOTES.txt             |  1 +
 .../modeler/dialog/codegen/GeneratorController.java       | 10 ++++------
 3 files changed, 8 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/e0ed6817/cayenne-cgen/src/main/java/org/apache/cayenne/gen/ClassGenerationAction.java
----------------------------------------------------------------------
diff --git a/cayenne-cgen/src/main/java/org/apache/cayenne/gen/ClassGenerationAction.java
b/cayenne-cgen/src/main/java/org/apache/cayenne/gen/ClassGenerationAction.java
index 6c46977..2c3fbda 100644
--- a/cayenne-cgen/src/main/java/org/apache/cayenne/gen/ClassGenerationAction.java
+++ b/cayenne-cgen/src/main/java/org/apache/cayenne/gen/ClassGenerationAction.java
@@ -29,7 +29,7 @@ import org.apache.velocity.Template;
 import org.apache.velocity.VelocityContext;
 import org.apache.velocity.app.VelocityEngine;
 import org.apache.velocity.runtime.RuntimeConstants;
-import org.apache.velocity.runtime.log.NullLogSystem;
+import org.apache.velocity.runtime.log.NullLogChute;
 
 import java.io.File;
 import java.io.FileOutputStream;
@@ -231,7 +231,7 @@ public class ClassGenerationAction {
 		TemplateType[] templateTypes = artifact.getTemplateTypes(artifactMode);
 		for (TemplateType type : templateTypes) {
 
-			try (Writer out = openWriter(type);) {
+			try (Writer out = openWriter(type)) {
 				if (out != null) {
 
 					resetContextForArtifactTemplate(artifact, type);
@@ -261,7 +261,7 @@ public class ClassGenerationAction {
 			Properties props = new Properties();
 
 			// null logger that will prevent velocity.log from being generated
-			props.put(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS, NullLogSystem.class.getName());
+			props.put(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS, NullLogChute.class.getName());
 			props.put("resource.loader", "cayenne");
 			props.put("cayenne.resource.loader.class", ClassGeneratorResourceLoader.class.getName());
 			props.put("cayenne.resource.loader.cache", "false");

http://git-wip-us.apache.org/repos/asf/cayenne/blob/e0ed6817/docs/doc/src/main/resources/RELEASE-NOTES.txt
----------------------------------------------------------------------
diff --git a/docs/doc/src/main/resources/RELEASE-NOTES.txt b/docs/doc/src/main/resources/RELEASE-NOTES.txt
index 2d04acb..48618a8 100644
--- a/docs/doc/src/main/resources/RELEASE-NOTES.txt
+++ b/docs/doc/src/main/resources/RELEASE-NOTES.txt
@@ -32,6 +32,7 @@ CAY-2240 Modeler: issue with cursor rendering for EJBQL query
 CAY-2243 ObjectContext.getGraphManager().unregisterObject() inconsistencies
 CAY-2256 Cannot Save/Insert an Object With null Flattened (complex) toOne Relationship (see
also CAY-2146)
 CAY-2265 ServerRuntime.builder() fails to set default runtime name when a the project file
doesn't follow recognized pattern
+CAY-2273 Modeler: default suggested cgen location is rooted in subpackage
 
 ----------------------------------
 Release: 4.0.M5

http://git-wip-us.apache.org/repos/asf/cayenne/blob/e0ed6817/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/GeneratorController.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/GeneratorController.java
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/GeneratorController.java
index 6cf1b31..92a75ec 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/GeneratorController.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/GeneratorController.java
@@ -436,7 +436,7 @@ public abstract class GeneratorController extends CayenneController {
 
         if (!relationship.isToMany()) {
 
-            ObjEntity targetEntity = (ObjEntity) relationship.getTargetEntity();
+            ObjEntity targetEntity = relationship.getTargetEntity();
 
             if (clientValidation && targetEntity != null) {
                 targetEntity = targetEntity.getClientEntity();
@@ -554,8 +554,7 @@ public abstract class GeneratorController extends CayenneController {
     }
 
     private void initOutputFolder() {
-
-        String path = null;
+        String path;
         if (getOutputPath() == null) {
             if (System.getProperty("cayenne.cgen.destdir") != null) {
                 setOutputPath(System.getProperty("cayenne.cgen.destdir"));
@@ -582,11 +581,10 @@ public abstract class GeneratorController extends CayenneController
{
         if (idx < 0) {
             return null;
         }
-        return path.substring(0, idx) + buildFilePath("src", dirType, "java")
-                + path.substring(idx + resourcePath.length());
+        return path.substring(0, idx) + buildFilePath("src", dirType, "java");
     }
 
-    private static final String buildFilePath(String... pathElements) {
+    private static String buildFilePath(String... pathElements) {
         if (pathElements.length == 0) {
             return "";
         }


Mime
View raw message