db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1386508 - /db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/java/JavadocOutlet.java
Date Mon, 17 Sep 2012 08:33:19 GMT
Author: tfischer
Date: Mon Sep 17 08:33:18 2012
New Revision: 1386508

URL: http://svn.apache.org/viewvc?rev=1386508&view=rev
Log:
beautify code

Modified:
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/java/JavadocOutlet.java

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/java/JavadocOutlet.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/java/JavadocOutlet.java?rev=1386508&r1=1386507&r2=1386508&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/java/JavadocOutlet.java
(original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/java/JavadocOutlet.java
Mon Sep 17 08:33:18 2012
@@ -146,7 +146,7 @@ public class JavadocOutlet extends Outle
         // last char is space so it can be removed
         boolean lastCharRemovable = true;
         String token = null;
-        String currentIndent = indent + " * ";
+        String currentIndent = indent + MID_LINE_START;
         String lastJavadocAttribute = null;
         while (tokenizer.hasMoreTokens() || token != null)
         {
@@ -182,10 +182,11 @@ public class JavadocOutlet extends Outle
                 {
 
                     token = tokenizer.nextToken();
-                    // 5 because of " * @" + space after attribute
+                    // + 2 because of "@" + space after attribute
                     currentIndent = StringUtils.rightPad(
                             indent + MID_LINE_START,
-                            indent.length() + 5 + token.length());
+                            indent.length() + MID_LINE_START.length()
+                                + 2 + token.length());
                     if (result.length()
                             > indent.length() + MID_LINE_START.length())
                     {
@@ -202,13 +203,11 @@ public class JavadocOutlet extends Outle
                         {
                             doubleLineBreak = true;
                         }
-                        if (!alreadyIndented)
+                        if (!alreadyIndented || doubleLineBreak)
                         {
-                            result.append(lineBreak).append(indent).append(" *");
-                        }
-                        if (doubleLineBreak)
-                        {
-                            result.append(lineBreak).append(indent).append(" *");
+                            result.append(lineBreak)
+                                .append(indent)
+                                .append(" *");
                         }
                         result.append(" ");
                     }
@@ -368,6 +367,14 @@ public class JavadocOutlet extends Outle
         this.wrapAfterCharacters = wrapAfterCharacters;
     }
 
+    /**
+     * Removes the trailing characters from a string builder.
+     * The characters to be removed are passed in as parameter.
+     *
+     * @param stringBuilder the string builder to remove the end from, not null.
+     * @param removeChars The characters to remove if they appear at the end,
+     *        not null.
+     */
     static void removeEnd(StringBuilder stringBuilder, String removeChars)
     {
         Set<Character> removeCharSet = new HashSet<Character>();



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message