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());
}
}
// 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("}");
* 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";
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 * ";
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));
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));
}
/**