aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraclement <aclement>2008-07-18 21:56:28 +0000
committeraclement <aclement>2008-07-18 21:56:28 +0000
commitd2ffd516f8c75144ab877e72b285de6197642341 (patch)
tree3ea9294c8022674a72859e93f0a43c2cb1ed3f52
parent41f9314f6b9b29cf5a47ce32b37257834549b112 (diff)
downloadaspectj-d2ffd516f8c75144ab877e72b285de6197642341.tar.gz
aspectj-d2ffd516f8c75144ab877e72b285de6197642341.zip
230234 comment 10 - ajdoc modifications and tests
-rw-r--r--ajdoc/src/org/aspectj/tools/ajdoc/StubFileGenerator.java13
-rw-r--r--ajdoc/testdata/pr164356/C.java7
-rw-r--r--ajdoc/testsrc/org/aspectj/tools/ajdoc/BugTests.java4
3 files changed, 18 insertions, 6 deletions
diff --git a/ajdoc/src/org/aspectj/tools/ajdoc/StubFileGenerator.java b/ajdoc/src/org/aspectj/tools/ajdoc/StubFileGenerator.java
index a0b073a67..c0f154f1b 100644
--- a/ajdoc/src/org/aspectj/tools/ajdoc/StubFileGenerator.java
+++ b/ajdoc/src/org/aspectj/tools/ajdoc/StubFileGenerator.java
@@ -76,9 +76,7 @@ class StubFileGenerator{
List imports = node.getChildren();
for (Iterator i = imports.iterator(); i.hasNext();) {
IProgramElement importNode = (IProgramElement) i.next();
- writer.print("import ");
- writer.print(importNode.getName());
- writer.println(';');
+ writer.println(importNode.getSourceSignature());
}
}
@@ -94,7 +92,7 @@ class StubFileGenerator{
// System.err.println("######" + signature + ", " + classNode.getName());
if (!StructureUtil.isAnonymous(classNode) && !classNode.getName().equals("<undefined>")) {
- writer.println(signature + " {" );
+ writer.println(signature + " { " );
processMembers(classNode.getChildren(), writer, classNode.getKind().equals(IProgramElement.Kind.INTERFACE));
writer.println();
writer.println("}");
@@ -192,6 +190,9 @@ class StubFileGenerator{
* replaced.
*/
static String addToFormal(String formalComment, String string) {
+ if(string == null || string.equals("")) {
+ return formalComment;
+ }
//boolean appendPeriod = true;
if ( (formalComment == null) || formalComment.equals("")) {
//formalComment = "/**\n * . \n */\n";
@@ -202,11 +203,11 @@ class StubFileGenerator{
int atsignPos = formalComment.indexOf('@');
int endPos = formalComment.indexOf("*/");
- int periodPos = formalComment.indexOf("/**")+2;
+ int periodPos = formalComment.indexOf("/**");
int position = 0;
String periodPlaceHolder = "";
if ( periodPos != -1 ) {
- position = periodPos+1;
+ position = periodPos + 3;// length of "/**"
}
else if ( atsignPos != -1 ) {
string = string + "\n * ";
diff --git a/ajdoc/testdata/pr164356/C.java b/ajdoc/testdata/pr164356/C.java
index cb3891efb..f4925ec11 100644
--- a/ajdoc/testdata/pr164356/C.java
+++ b/ajdoc/testdata/pr164356/C.java
@@ -17,5 +17,12 @@ public class C {
//******* description of goo
public void goo() {
}
+
+ /*---------------------------*/
+ /**
+ * description of bas
+ */
+ public void bas() {
+ }
}
diff --git a/ajdoc/testsrc/org/aspectj/tools/ajdoc/BugTests.java b/ajdoc/testsrc/org/aspectj/tools/ajdoc/BugTests.java
index c1749875f..c36852c6d 100644
--- a/ajdoc/testsrc/org/aspectj/tools/ajdoc/BugTests.java
+++ b/ajdoc/testsrc/org/aspectj/tools/ajdoc/BugTests.java
@@ -146,6 +146,7 @@ public class BugTests extends AjdocTestCase {
String foo = "description of foo";
String bar = "description of bar";
String goo = "description of goo";
+ String bas = "description of bas";
assertTrue("expected method description 'description of foo' to appear" +
" in ajdoc output but it did not",
AjdocOutputChecker.containsString(htmlFile, foo));
@@ -155,6 +156,9 @@ public class BugTests extends AjdocTestCase {
assertFalse("didn't expect method description 'description of goo' to " +
"appear in ajdoc output but it did not",
AjdocOutputChecker.containsString(htmlFile, goo));
+ assertTrue("expected method description 'description of bas' to appear" +
+ " in ajdoc output but it did not",
+ AjdocOutputChecker.containsString(htmlFile, bas));
}
/**