<html>
<head>
<style><!--
body {background-color:#ffffff;}
.file {border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;}
.pathname {font-family:monospace; float:right;}
.fileheader {margin-bottom:.5em;}
.diff {margin:0;}
.tasklist {padding:4px;border:1px dashed #000000;margin-top:1em;}
.tasklist ul {margin-top:0;margin-bottom:0;}
tr.alt {background-color:#eeeeee}
#added {background-color:#ddffdd;}
#addedchars {background-color:#99ff99;font-weight:bolder;}
tr.alt #added {background-color:#ccf7cc;}
#removed {background-color:#ffdddd;}
#removedchars {background-color:#ff9999;font-weight:bolder;}
tr.alt #removed {background-color:#f7cccc;}
#copied {background-color:#ccccff;}
tr.alt #copied {background-color:#bbbbf7;}
#info {color:#888888;}
#context {background-color:#eeeeee;}
td {padding-left:.3em;padding-right:.3em;}
tr.head {border-bottom-width:1px;border-bottom-style:solid;}
tr.head td {padding:0;padding-top:.2em;}
.task {background-color:#ffff00;}
.comment {white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;white-space:pre-wrap;word-wrap:break-word;padding:4px;border:1px dashed #000000;background-color:#ffffdd}
.error {color:red;}
hr {border-width:0px;height:2px;background:black;}
--></style>
</head>
<body>
<table cellspacing="0" cellpadding="0" border="0" rules="cols">
<tr class="head"><td colspan="5">Commit in <b><tt>metaas/trunk/src</tt></b></td></tr>
<tr><td><tt>main/java/uk/co/badgersinfoil/metaas/impl/<a href="#file1">ASTDocTag.java</a></tt> </td><td></td><td align="right" id="added">+13</td><td></td><td nowrap="nowrap" align="center">440 -> 441</td></tr>
<tr class="alt"><td><tt> /<a href="#file2">DocCommentUtils.java</a></tt> </td><td></td><td align="right" id="added">+1</td><td align="right" id="removed">-1</td><td nowrap="nowrap" align="center">440 -> 441</td></tr>
<tr><td><tt>test/java/uk/co/badgersinfoil/metaas/<a href="#file3">DocCommentTests.java</a></tt> </td><td></td><td align="right" id="added">+26</td><td></td><td nowrap="nowrap" align="center">440 -> 441</td></tr>
<tr><td></td><td></td><td align="right" id="added">+40</td><td align="right" id="removed">-1</td><td></td></tr>
</table>
<small id="info">3 modified files</small><br />
<pre class="comment">
neaten-up formatting of content added to javadoc tagged paragraphs
</pre>
<hr /><a name="file1" /><div class="file">
<span class="pathname">metaas/trunk/src/main/java/uk/co/badgersinfoil/metaas/impl</span><br />
<div class="fileheader"><big><b>ASTDocTag.java</b></big> <small id="info">440 -> 441</small></div>
<pre class="diff"><small id="info">--- trunk/src/main/java/uk/co/badgersinfoil/metaas/impl/ASTDocTag.java        2007-02-26 00:02:24 UTC (rev 440)
+++ trunk/src/main/java/uk/co/badgersinfoil/metaas/impl/ASTDocTag.java        2007-02-26 00:29:56 UTC (rev 441)
@@ -45,11 +45,13 @@
</small></pre><pre class="diff" id="context">
        public void setBody(String text) {
                int lastIndex = ast.getChildCount()-1;
</pre><pre class="diff" id="added">+                String indentNL = DocCommentUtils.findNewline(ast);
</pre><pre class="diff" id="context">                 LinkedListTree trailingNL = null;
                if (lastIndex>=0 && ast.getChild(lastIndex).getType() == JavadocParser.NL) {
                        trailingNL = (LinkedListTree)ast.getChild(lastIndex);
                }
                LinkedListTree tag = DocCommentUtils.parseParaTag(ast.getFirstChild().getText()+" "+text);
</pre><pre class="diff" id="added">+                replaceNLs(tag, indentNL);
</pre><pre class="diff" id="context">                 if (trailingNL != null) {
                        tag.addChildWithTokens(trailingNL);
                }
</pre><pre class="diff"><small id="info">@@ -59,4 +61,15 @@
</small></pre><pre class="diff" id="context">
                comment.commitModifiedAST();
        }
</pre><pre class="diff" id="added">+
+        private void replaceNLs(LinkedListTree tree, String indentNL) {
+                for (LinkedListToken tok=tree.getStartToken().getNext(); tok!=null&&tok.getType()!=-1; tok=tok.getNext()) {
+                        if (tok.getType() == JavadocParser.NL) {
+                                tok.setText(indentNL);
+                        }
+                        if (tok == tree.getStopToken()) {
+                                break;
+                        }
+                }
+        }
</pre><pre class="diff" id="context"> }
</pre><pre class="diff"><small id="info">\ No newline at end of file
</small></pre></div>
<hr /><a name="file2" /><div class="file">
<span class="pathname">metaas/trunk/src/main/java/uk/co/badgersinfoil/metaas/impl</span><br />
<div class="fileheader"><big><b>DocCommentUtils.java</b></big> <small id="info">440 -> 441</small></div>
<pre class="diff"><small id="info">--- trunk/src/main/java/uk/co/badgersinfoil/metaas/impl/DocCommentUtils.java        2007-02-26 00:02:24 UTC (rev 440)
+++ trunk/src/main/java/uk/co/badgersinfoil/metaas/impl/DocCommentUtils.java        2007-02-26 00:29:56 UTC (rev 441)
@@ -220,7 +220,7 @@
</small></pre><pre class="diff" id="context">                 return newline;
        }
</pre><pre class="diff" id="removed">-        p<span id="removedchars">rivate</span> static String findNewline(LinkedListTree javadoc) {
</pre><pre class="diff" id="added">+        p<span id="addedchars">ublic</span> static String findNewline(LinkedListTree javadoc) {
</pre><pre class="diff" id="context">                 LinkedListToken tok=javadoc.getStopToken();
                if (tok.getType() == JavadocParser.NL) {
                        // Skip the very-last NL, since this will preceed the
</pre></div>
<hr /><a name="file3" /><div class="file">
<span class="pathname">metaas/trunk/src/test/java/uk/co/badgersinfoil/metaas</span><br />
<div class="fileheader"><big><b>DocCommentTests.java</b></big> <small id="info">440 -> 441</small></div>
<pre class="diff"><small id="info">--- trunk/src/test/java/uk/co/badgersinfoil/metaas/DocCommentTests.java        2007-02-26 00:02:24 UTC (rev 440)
+++ trunk/src/test/java/uk/co/badgersinfoil/metaas/DocCommentTests.java        2007-02-26 00:29:56 UTC (rev 441)
@@ -1,12 +1,16 @@
</small></pre><pre class="diff" id="context"> package uk.co.badgersinfoil.metaas;
import java.io.IOException;
</pre><pre class="diff" id="added">+import java.io.StringWriter;
+
</pre><pre class="diff" id="context"> import uk.co.badgersinfoil.metaas.dom.ASArg;
import uk.co.badgersinfoil.metaas.dom.ASClassType;
import uk.co.badgersinfoil.metaas.dom.ASCompilationUnit;
import uk.co.badgersinfoil.metaas.dom.DocComment;
import uk.co.badgersinfoil.metaas.dom.ASMethod;
</pre><pre class="diff" id="added">+import uk.co.badgersinfoil.metaas.dom.DocTag;
</pre><pre class="diff" id="context"> import uk.co.badgersinfoil.metaas.dom.Visibility;
</pre><pre class="diff" id="added">+import uk.co.badgersinfoil.metaas.impl.ASTASClassType;
</pre><pre class="diff" id="context"> import junit.framework.TestCase;
</pre><pre class="diff"><small id="info">@@ -97,7 +101,29 @@
</small></pre><pre class="diff" id="context">                 assertEquals("replacement text", test.getDescriptionString().trim());
        }
</pre><pre class="diff" id="added">+        public void testParaTagUpdateNewline() throws IOException {
+                DocComment doc = clazz.getDocumentation();
+                doc.addParaTag("test", "initial text");
+                DocTag tag = doc.findFirstTag("test");
+                tag.setBody("replacement\ncontent");
+                ActionScriptWriter writer = fact.newWriter();
+                StringWriter buff = new StringWriter();
+                writer.write(buff, unit);
+                String[] lines = buff.toString().split("\n");
+                // check indentation, skipping first and last lines,
+                for (int i=1; i<lines.length-1; i++) {
+                        assertIndent("\t", lines[i]);
+                }
+        }
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="added">+        private static void assertIndent(String indent, String line) {
+                if (line.length() == 0) {
+                        // blank lines allowed
+                        return;
+                }
+                assertTrue("expected indentation "+ActionScriptFactory.str(indent)+" but line started with "+ActionScriptFactory.str(line.substring(0, indent.length())), line.startsWith(indent));
+        }
+
</pre><pre class="diff" id="context">         public void testReturnDocs() {
                ASMethod meth = clazz.newMethod("test", Visibility.PUBLIC, "void");
                assertNull(meth.getReturnDescriptionString());
</pre></div>
<center><small><a href="http://www.badgers-in-foil.co.uk/projects/cvsspam/" title="commit -> email">CVSspam</a> 0.2.12</small></center>
</body></html>