String adviceDoc
= "<TABLE WIDTH=\"100%\" BGCOLOR=#FFFFFF><TR>" +
- "<TD width=\"15%\" bgcolor=\"#FFD8B0\"><B><FONT COLOR=000000> Advised by:</font></b></td><td>";
+ "<TD width=\"15%\" bgcolor=\"#FFD8B0\"><B><FONT COLOR=000000> Advised by:</font></b></td><td>";
+ List addedNames = new ArrayList();
for (Iterator it = targets.iterator(); it.hasNext(); ) {
String currHandle = (String)it.next();
IProgramElement currDecl = AsmManager.getDefault().getHierarchy().findElementForHandle(currHandle);
hrefLink += currDecl.getParent().toLinkLabelString() + ".html"
+ "#" + currDecl.toLabelString();
- adviceDoc = adviceDoc +
- "<A HREF=\"" + hrefLink + "\"><tt>"
- + hrefName.replace('/', '.') + "</tt></A>";
-
- if (it.hasNext()) adviceDoc += ", ";
+ if (!addedNames.contains(hrefName)) {
+ adviceDoc = adviceDoc +
+ "<A HREF=\"" + hrefLink + "\"><tt>"
+ + hrefName.replace('/', '.') + "</tt></A>";
+
+ if (it.hasNext()) adviceDoc += ", ";
+ addedNames.add(hrefName);
+ }
}
adviceDoc += "</TR></TD></TABLE>\n";
fileContentsBuffer.insert( index, adviceDoc );
= "<TABLE WIDTH=\"100%\" BGCOLOR=#FFFFFF><TR>" +
"<TD width=\"10%\" bgcolor=\"#FFD8B0\"><B><FONT COLOR=000000> Advises:</b></font></td><td>";
+ List addedNames = new ArrayList(); // for ensuring that we don't add duplciates
for (Iterator it = targets.iterator(); it.hasNext(); ) {
String currHandle = (String)it.next();
IProgramElement currDecl = AsmManager.getDefault().getHierarchy().findElementForHandle(currHandle);
linkRef = currDecl.getParent().getParent().getName() + "." + linkRef;
}
}
- entry += "<A HREF=\"" + linkRef +
- "\"><tt>" + linkName.replace('/', '.') + "</tt></A>"; // !!! don't replace
- if (it.hasNext()) entry += ", ";
-// if ( isIntroduction ) {
-// if ( !addedDecls.contains(currDecl.getSourceSignature() ) ) {
-// //addedDecls.add(currDecl.getPackageName() + "." + currDecl.getSignature());
-// addedDecls.add(packageName + currDecl.getSourceSignature());
-// }
-// }
- }
+ if (!addedNames.contains(linkName)) {
+ entry += "<A HREF=\"" + linkRef +
+ "\"><tt>" + linkName.replace('/', '.') + "</tt></A>"; // !!! don't replace
+ if (it.hasNext()) entry += ", ";
+ addedNames.add(linkName);
+ }
+ }
}
entry += "</B></FONT></TD></TR></TABLE>\n</TR></TD>\n";
return entry;
public static void main(String[] args) {
aborted = false;
-
+
+// System.err.println("> command invoked: " + Arrays.asList(args).toString());
+
// STEP 1: parse the command line and do other global setup
sourcepath.addElement("."); // add the current directory to the classapth
- parseCommandLine(args);
+ parseCommandLine(args);
rootDir = getRootDir();
symbolManager = SymbolManager.getDefault();
File[] inputFiles = new File[filenames.size()];
static void parseCommandLine(String[] args) {
if (args.length == 0) {
displayHelpAndExit( null );
+ } else if (args.length == 1 && args[0].startsWith("@")) {
+ System.err.println("!!!!!!!!");
}
List vargs = new LinkedList(Arrays.asList(args));
else {
// didn't find it on that element of the classpath but that's ok
}
- }
+ }
}
}
}