cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r662254 - in /cayenne/main/trunk: docs/doc/src/main/resources/RELEASE-NOTES.txt framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/gen/ImportUtils.java
Date Sun, 01 Jun 2008 17:41:32 GMT
Author: aadamchik
Date: Sun Jun  1 10:41:32 2008
New Revision: 662254

URL: http://svn.apache.org/viewvc?rev=662254&view=rev
Log:
CAY-1062 Code Generation line ending consistency: ImportUtils

Modified:
    cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/gen/ImportUtils.java

Modified: cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt?rev=662254&r1=662253&r2=662254&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt Sun Jun  1 10:41:32 2008
@@ -21,6 +21,10 @@
 CAY-1058 Add a maven plugin for starting up the modeler.
 CAY-1061 ResourceFinder: abstract API for looking up resources, including multiple resources
for a given name
 
+Bug fixes since M4:
+
+CAY-1062 Code Generation line ending consistency: ImportUtils
+
 ----------------------------------
 Release: 3.0M4
 Date: 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/gen/ImportUtils.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/gen/ImportUtils.java?rev=662254&r1=662253&r2=662254&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/gen/ImportUtils.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/gen/ImportUtils.java
Sun Jun  1 10:41:32 2008
@@ -58,10 +58,10 @@
 
     protected Map<String, String> importTypesMap = new HashMap<String, String>();
     protected Map<String, String> reservedImportTypesMap = new HashMap<String, String>();
// Types
-                                                                                        
   // forced
-                                                                                        
   // to
-                                                                                        
   // be
-                                                                                        
   // FQN
+    // forced
+    // to
+    // be
+    // FQN
 
     protected String packageName;
 
@@ -214,9 +214,11 @@
         if (null != packageName) {
             outputBuffer.append("package ");
             outputBuffer.append(packageName);
-            outputBuffer.append(';');
-            outputBuffer.append(System.getProperty("line.separator"));
-            outputBuffer.append(System.getProperty("line.separator"));
+
+            // Using UNIX line endings intentionally - generated Java files should look
+            // the same regardless of platform to prevent developer teams working on
+            // multiple OS's to override each other's work
+            outputBuffer.append(";\n\n");
         }
 
         List<String> typesList = new ArrayList<String>(importTypesMap.values());
@@ -245,7 +247,7 @@
                 firstIteration = false;
             }
             else {
-                outputBuffer.append(System.getProperty("line.separator"));
+                outputBuffer.append('\n');
             }
             // Output another newline if we're in a different root package.
             // Find root package
@@ -258,8 +260,8 @@
             if (null != lastStringPrefix) {
                 // and it's different from the last import
                 if (false == thisStringPrefix.equals(lastStringPrefix)) {
-                    // output a newline
-                    outputBuffer.append(System.getProperty("line.separator"));
+                    // output a newline; force UNIX style per comment above
+                    outputBuffer.append("\n");
                 }
             }
             lastStringPrefix = thisStringPrefix;



Mime
View raw message