am 0ee89a72: DO NOT MERGE - Back port change from master that enforces correctness in the javadoc comments.

Merge commit '0ee89a72d50ff4bc5c7d2a285cd799d3a8b48efb' into gingerbread-plus-aosp

* commit '0ee89a72d50ff4bc5c7d2a285cd799d3a8b48efb':
  DO NOT MERGE - Back port change from master that enforces correctness in the javadoc comments.
This commit is contained in:
Joe Onorato
2010-08-31 12:12:17 -07:00
committed by Android Git Automerger
2 changed files with 27 additions and 5 deletions

View File

@@ -334,8 +334,17 @@ public class Comment
{ {
isHidden(); isHidden();
isDocOnly(); isDocOnly();
parseRegex(mText);
parseBriefTags(); // Don't bother parsing text if we aren't generating documentation.
if (DroidDoc.parseComments()) {
parseRegex(mText);
parseBriefTags();
} else {
// Forces methods to be recognized by findOverriddenMethods in MethodInfo.
mInlineTagsList.add(new TextTagInfo("Text", "Text", mText,
SourcePositionInfo.add(mPosition, mText, 0)));
}
mText = null; mText = null;
mInitialized = true; mInitialized = true;

View File

@@ -59,6 +59,17 @@ public class DroidDoc
public static String title = ""; public static String title = "";
public static SinceTagger sinceTagger = new SinceTagger(); public static SinceTagger sinceTagger = new SinceTagger();
private static boolean parseComments = false;
private static boolean generateDocs = true;
/**
* Returns true if we should parse javadoc comments,
* reporting errors in the process.
*/
public static boolean parseComments() {
return generateDocs || parseComments;
}
public static boolean checkLevel(int level) public static boolean checkLevel(int level)
{ {
return (showLevel & level) == level; return (showLevel & level) == level;
@@ -96,7 +107,6 @@ public class DroidDoc
String stubsDir = null; String stubsDir = null;
//Create the dependency graph for the stubs directory //Create the dependency graph for the stubs directory
boolean apiXML = false; boolean apiXML = false;
boolean noDocs = false;
boolean offlineMode = false; boolean offlineMode = false;
String apiFile = null; String apiFile = null;
String debugStubsFile = ""; String debugStubsFile = "";
@@ -191,7 +201,10 @@ public class DroidDoc
apiFile = a[1]; apiFile = a[1];
} }
else if (a[0].equals("-nodocs")) { else if (a[0].equals("-nodocs")) {
noDocs = true; generateDocs = false;
}
else if (a[0].equals("-parsecomments")) {
parseComments = true;
} }
else if (a[0].equals("-since")) { else if (a[0].equals("-since")) {
sinceTagger.addVersion(a[1], a[2]); sinceTagger.addVersion(a[1], a[2]);
@@ -209,7 +222,7 @@ public class DroidDoc
// Set up the data structures // Set up the data structures
Converter.makeInfo(r); Converter.makeInfo(r);
if (!noDocs) { if (generateDocs) {
long startTime = System.nanoTime(); long startTime = System.nanoTime();
// Apply @since tags from the XML file // Apply @since tags from the XML file