summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-10-24 01:08:34 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-10-24 01:08:34 +0000
commitd11fcd7d9607faf33e1903fa7b4f62524bca2951 (patch)
tree9853764b8d2e96d74de9ad8742837e338ca4166e
parentd1fcf10075305486c374be0d5f226c2fd8bf8458 (diff)
parent512ec266ba3aa10dfd7e6c3e247d7c6a90257616 (diff)
downloaddoclava-android14-qpr2-s1-release.tar.gz
Change-Id: Ic9254a8bbf44c875855380dec7f084874d70b759
-rw-r--r--doclet_adapter/src/test/java/com/google/doclava/javadoc/DocImplTest.java2
-rw-r--r--src/com/google/doclava/ClearPage.java2
-rw-r--r--src/com/google/doclava/DocFile.java2
-rw-r--r--src/com/google/doclava/Doclava.java4
-rw-r--r--src/com/google/doclava/DoclavaDiff.java76
-rw-r--r--src/com/google/doclava/FederatedSite.java8
-rwxr-xr-xsrc/com/google/doclava/Hierarchy.java2
-rw-r--r--src/com/google/doclava/LinkReference.java2
-rw-r--r--src/com/google/doclava/SampleTagInfo.java8
-rw-r--r--src/com/google/doclava/SourcePositionInfo.java4
-rw-r--r--src/com/google/doclava/apicheck/AbstractMethodInfo.java2
-rw-r--r--src/com/google/doclava/apicheck/ApiCheck.java8
-rw-r--r--src/com/google/doclava/apicheck/ApiFile.java4
-rw-r--r--src/com/google/doclava/apicheck/ApiParseException.java4
-rw-r--r--src/com/google/doclava/apicheck/XmlApiFile.java32
15 files changed, 80 insertions, 80 deletions
diff --git a/doclet_adapter/src/test/java/com/google/doclava/javadoc/DocImplTest.java b/doclet_adapter/src/test/java/com/google/doclava/javadoc/DocImplTest.java
index 27c9309..6790173 100644
--- a/doclet_adapter/src/test/java/com/google/doclava/javadoc/DocImplTest.java
+++ b/doclet_adapter/src/test/java/com/google/doclava/javadoc/DocImplTest.java
@@ -117,7 +117,7 @@ public class DocImplTest extends BaseTest {
and text. Then goes the second sentence of class javadoc. It is followed by a third
sentence that has some inline tags, such as {@code some code},
{@link java.lang.Integer label} and {@linkplain java.lang.Byte label}.
-
+
@author someone with a very long name
@version version
@see Throws
diff --git a/src/com/google/doclava/ClearPage.java b/src/com/google/doclava/ClearPage.java
index 95392e0..3c5f240 100644
--- a/src/com/google/doclava/ClearPage.java
+++ b/src/com/google/doclava/ClearPage.java
@@ -33,7 +33,7 @@ import java.util.Arrays;
public class ClearPage {
/*
* public ClearPage() { String templ = "templates/index.cs"; String filename = "docs/index.html";
- *
+ *
* data.setValue("A.B.C", "1"); data.setValue("A.B.D", "2"); }
*/
diff --git a/src/com/google/doclava/DocFile.java b/src/com/google/doclava/DocFile.java
index 9fb25c1..599a433 100644
--- a/src/com/google/doclava/DocFile.java
+++ b/src/com/google/doclava/DocFile.java
@@ -334,7 +334,7 @@ public class DocFile {
hdf.setValue("page.type", "about");
hdf.setValue("page.category", "about");
}
-
+
//set metadata for this file in jd_lists_unified
PageMetadata.setPageMetadata(docfile, relative, outfile, hdf, Doclava.sTaglist);
diff --git a/src/com/google/doclava/Doclava.java b/src/com/google/doclava/Doclava.java
index 5a60cbb..dfa8287 100644
--- a/src/com/google/doclava/Doclava.java
+++ b/src/com/google/doclava/Doclava.java
@@ -339,7 +339,7 @@ public class Doclava implements Doclet {
return """
Javadoc output directory path relative to root, which is specified \
with '-d root'
-
+
Default value: 'reference/'""";
}
@Override public Option.Kind getKind() { return Option.Kind.STANDARD; }
@@ -361,7 +361,7 @@ public class Doclava implements Doclet {
Relative path to documentation root.
If set, use <path> as a (relative or absolute) link to \
documentation root in .html pages.
-
+
If not set, an auto-generated path traversal links will be used, \
e.g. “../../../”.
""";
diff --git a/src/com/google/doclava/DoclavaDiff.java b/src/com/google/doclava/DoclavaDiff.java
index 284f9a3..a9c2747 100644
--- a/src/com/google/doclava/DoclavaDiff.java
+++ b/src/com/google/doclava/DoclavaDiff.java
@@ -43,11 +43,11 @@ public final class DoclavaDiff {
private final String outputDir;
private final JSilver jSilver;
private final List<FederatedSite> sites = new ArrayList<FederatedSite>();
-
+
public static void main(String[] args) {
new DoclavaDiff(args).generateSite();
}
-
+
public DoclavaDiff(String[] args) {
// TODO: options parsing
try {
@@ -58,7 +58,7 @@ public final class DoclavaDiff {
} catch (Exception e) {
throw new AssertionError(e);
}
-
+
// TODO: accept external templates
List<ResourceLoader> resourceLoaders = new ArrayList<ResourceLoader>();
resourceLoaders.add(new FileSystemResourceLoader("assets/templates"));
@@ -66,12 +66,12 @@ public final class DoclavaDiff {
ResourceLoader compositeResourceLoader = new CompositeResourceLoader(resourceLoaders);
jSilver = new JSilver(compositeResourceLoader);
}
-
- public void generateSite() {
+
+ public void generateSite() {
Data data = generateHdf();
generateHtml("diff.cs", data, new File(outputDir + "/diff.html"));
}
-
+
/**
* Creates an HDF with this structure:
* <pre>
@@ -86,7 +86,7 @@ public final class DoclavaDiff {
* packages.0.classes.0.qualifiedName = java.lang.Object
* packages.0.classes.0.sites.0.hasClass = 1
* packages.0.classes.0.sites.0.link = http://proja.domain.com/reference/java/lang/Object
- * packages.0.classes.0.sites.1.hasClass = 0
+ * packages.0.classes.0.sites.1.hasClass = 0
* packages.0.classes.0.methods.0.signature = wait()
* packages.0.classes.0.methods.0.sites.0.hasMethod = 1
* packages.0.classes.0.methods.0.sites.0.link = http://proja.domain.com/reference/java/lang/Object#wait
@@ -95,25 +95,25 @@ public final class DoclavaDiff {
*/
private Data generateHdf() {
Data data = jSilver.createData();
-
+
data.setValue("triangle.opened", "../assets/templates/assets/images/triangle-opened.png");
data.setValue("triangle.closed", "../assets/templates/assets/images/triangle-closed.png");
-
+
int i = 0;
for (FederatedSite site : sites) {
String base = "sites." + (i++);
data.setValue(base + ".name", site.name());
data.setValue(base + ".url", site.baseUrl().toString());
}
-
+
List<String> allPackages = knownPackages(sites);
-
+
int p = 0;
for (String pkg : allPackages) {
PackageInfo packageInfo = new PackageInfo(pkg);
String packageBase = "packages." + (p++);
data.setValue(packageBase + ".name", pkg);
-
+
int s = 0;
for (FederatedSite site : sites) {
String siteBase = packageBase + ".sites." + (s++);
@@ -124,17 +124,17 @@ public final class DoclavaDiff {
data.setValue(siteBase + ".hasPackage", "0");
}
}
-
+
if (packageUniqueToSite(pkg, sites)) {
continue;
}
-
+
List<String> packageClasses = knownClassesForPackage(pkg, sites);
int c = 0;
for (String qualifiedClassName : packageClasses) {
String classBase = packageBase + ".classes." + (c++);
data.setValue(classBase + ".qualifiedName", qualifiedClassName);
-
+
s = 0;
for (FederatedSite site : sites) {
String siteBase = classBase + ".sites." + (s++);
@@ -146,22 +146,22 @@ public final class DoclavaDiff {
data.setValue(siteBase + ".hasClass", "0");
}
}
-
+
if (agreeOnClass(qualifiedClassName, sites)) {
continue;
}
-
+
if (classUniqueToSite(qualifiedClassName, sites)) {
continue;
}
-
+
int m = 0;
List<MethodInfo> methods = knownMethodsForClass(qualifiedClassName, sites);
for (MethodInfo method : methods) {
if (agreeOnMethod(qualifiedClassName, method, sites)) {
continue;
}
-
+
String methodBase = classBase + ".methods." + (m++);
data.setValue(methodBase + ".signature", method.prettySignature());
int k = 0;
@@ -183,10 +183,10 @@ public final class DoclavaDiff {
}
}
}
-
+
return data;
}
-
+
/**
* Returns a list of all known packages from all sites.
*/
@@ -198,12 +198,12 @@ public final class DoclavaDiff {
allPackages.add(pkg);
}
}
-
+
List<String> packages = new ArrayList<String>(allPackages);
Collections.sort(packages);
return packages;
}
-
+
/**
* Returns all known classes from all sites for a given package.
*/
@@ -219,35 +219,35 @@ public final class DoclavaDiff {
allClasses.add(entry.getValue().qualifiedName());
}
}
-
+
List<String> classes = new ArrayList<String>(allClasses);
Collections.sort(classes);
return classes;
}
-
+
/**
* Returns all known methods from all sites for a given class.
*/
private List<MethodInfo> knownMethodsForClass(String qualifiedClassName,
List<FederatedSite> sites) {
-
+
Map<String, MethodInfo> allMethods = new HashMap<String, MethodInfo>();
for (FederatedSite site : sites) {
ClassInfo classInfo = site.apiInfo().findClass(qualifiedClassName);
if (classInfo == null) {
continue;
}
-
+
for (Map.Entry<String, MethodInfo> entry: classInfo.allMethods().entrySet()) {
allMethods.put(entry.getKey(), entry.getValue());
}
}
-
+
List<MethodInfo> methods = new ArrayList<MethodInfo>();
methods.addAll(allMethods.values());
return methods;
}
-
+
/**
* Returns true if the list of sites all completely agree on the given
* package. All sites must possess the package, all classes it contains, and
@@ -259,7 +259,7 @@ public final class DoclavaDiff {
return false;
}
}
-
+
List<String> classes = knownClassesForPackage(pkg, sites);
for (String clazz : classes) {
if (!agreeOnClass(clazz, sites)) {
@@ -268,7 +268,7 @@ public final class DoclavaDiff {
}
return true;
}
-
+
/**
* Returns true if the list of sites all agree on the given class. Each site
* must have the class and agree on its methods.
@@ -282,26 +282,26 @@ public final class DoclavaDiff {
}
return true;
}
-
+
/**
* Returns true if the list of sites all contain the given method.
*/
private boolean agreeOnMethod(String qualifiedClassName, MethodInfo method,
List<FederatedSite> sites) {
-
+
for (FederatedSite site : sites) {
ClassInfo siteClass = site.apiInfo().findClass(qualifiedClassName);
if (siteClass == null) {
return false;
}
-
+
if (!siteClass.supportsMethod(method)) {
return false;
}
}
return true;
}
-
+
/**
* Returns true if the given package is known to exactly one of the given sites.
*/
@@ -314,7 +314,7 @@ public final class DoclavaDiff {
}
return numSites == 1;
}
-
+
/**
* Returns true if the given class is known to exactly one of the given sites.
*/
@@ -327,10 +327,10 @@ public final class DoclavaDiff {
}
return numSites == 1;
}
-
+
private void generateHtml(String template, Data data, File file) {
ClearPage.ensureDirectory(file);
-
+
OutputStreamWriter stream = null;
try {
stream = new OutputStreamWriter(new FileOutputStream(file), "UTF-8");
diff --git a/src/com/google/doclava/FederatedSite.java b/src/com/google/doclava/FederatedSite.java
index e904c53..063145c 100644
--- a/src/com/google/doclava/FederatedSite.java
+++ b/src/com/google/doclava/FederatedSite.java
@@ -32,11 +32,11 @@ public final class FederatedSite {
private final String name;
private final URL baseUrl;
private final ApiInfo apiInfo;
-
+
public FederatedSite(String name, URL baseUrl) throws ApiParseException {
this.name = name;
this.baseUrl = baseUrl;
-
+
try {
URL xmlUrl = new URL(baseUrl + "/xml/current.xml");
this.apiInfo = new ApiCheck().parseApi(xmlUrl);
@@ -44,7 +44,7 @@ public final class FederatedSite {
throw new AssertionError(e);
}
}
-
+
/**
* Constructs a federated site using an api file not contained on
* the site itself.
@@ -66,7 +66,7 @@ public final class FederatedSite {
public ApiInfo apiInfo() {
return apiInfo;
}
-
+
public URL baseUrl() {
return baseUrl;
}
diff --git a/src/com/google/doclava/Hierarchy.java b/src/com/google/doclava/Hierarchy.java
index 0fddf9a..6d8d82d 100755
--- a/src/com/google/doclava/Hierarchy.java
+++ b/src/com/google/doclava/Hierarchy.java
@@ -49,7 +49,7 @@ public class Hierarchy {
/*
* Set<String> keys = nodes.keySet(); for (String n: keys) { System.out.println("class: " + n);
- *
+ *
* TreeSet<String> values = nodes.get(n); for (String v: values) {
* System.out.println(" - " + v); } }
*/
diff --git a/src/com/google/doclava/LinkReference.java b/src/com/google/doclava/LinkReference.java
index 0bfa42f..0e6da98 100644
--- a/src/com/google/doclava/LinkReference.java
+++ b/src/com/google/doclava/LinkReference.java
@@ -71,7 +71,7 @@ public class LinkReference {
/**
* Parse and resolve a link string.
- *
+ *
* @param text the original text
* @param base the class or whatever that this link is on
* @param pos the original position in the source document
diff --git a/src/com/google/doclava/SampleTagInfo.java b/src/com/google/doclava/SampleTagInfo.java
index 66eb9ac..a7a3d9c 100644
--- a/src/com/google/doclava/SampleTagInfo.java
+++ b/src/com/google/doclava/SampleTagInfo.java
@@ -27,17 +27,17 @@ import java.util.regex.Matcher;
/*
* SampleTagInfo copies text from a given file into the javadoc comment.
- *
+ *
* The @include tag copies the text verbatim from the given file.
- *
+ *
* The @sample tag copies the text from the given file, stripping leading and trailing whitespace,
* and reducing the indent level of the text to the indent level of the first non-whitespace line.
- *
+ *
* Both tags accept either a filename and an id or just a filename. If no id is provided, the entire
* file is copied. If an id is provided, the lines in the given file between the first two lines
* containing BEGIN_INCLUDE(id) and END_INCLUDE(id), for the given id, are copied. The id may be
* only letters, numbers and underscore (_).
- *
+ *
* Four examples: {@include samples/ApiDemos/src/com/google/app/Notification1.java} {@sample
* samples/ApiDemos/src/com/google/app/Notification1.java} {@include
* samples/ApiDemos/src/com/google/app/Notification1.java Bleh} {@sample
diff --git a/src/com/google/doclava/SourcePositionInfo.java b/src/com/google/doclava/SourcePositionInfo.java
index cf516c8..a1a83a9 100644
--- a/src/com/google/doclava/SourcePositionInfo.java
+++ b/src/com/google/doclava/SourcePositionInfo.java
@@ -34,7 +34,7 @@ public class SourcePositionInfo implements Comparable {
/**
* Given this position and str which occurs at that position, as well as str an index into str,
* find the SourcePositionInfo.
- *
+ *
* @throw StringIndexOutOfBoundsException if index &gt; str.length()
*/
public static SourcePositionInfo add(SourcePositionInfo that, String str, int index) {
@@ -80,7 +80,7 @@ public class SourcePositionInfo implements Comparable {
if (r != 0) return r;
return this.line - that.line;
}
-
+
/**
* Build a SourcePositionInfo from the XML source= notation
*/
diff --git a/src/com/google/doclava/apicheck/AbstractMethodInfo.java b/src/com/google/doclava/apicheck/AbstractMethodInfo.java
index 306dba8..2bcf3cf 100644
--- a/src/com/google/doclava/apicheck/AbstractMethodInfo.java
+++ b/src/com/google/doclava/apicheck/AbstractMethodInfo.java
@@ -23,7 +23,7 @@ public interface AbstractMethodInfo {
public void addParameter(com.google.doclava.ParameterInfo p);
public void setDeprecated(boolean deprecated);
-
+
public void setVarargs(boolean varargs);
public boolean isVarArgs();
}
diff --git a/src/com/google/doclava/apicheck/ApiCheck.java b/src/com/google/doclava/apicheck/ApiCheck.java
index ab7ee84..3193b23 100644
--- a/src/com/google/doclava/apicheck/ApiCheck.java
+++ b/src/com/google/doclava/apicheck/ApiCheck.java
@@ -84,7 +84,7 @@ public class ApiCheck {
System.exit(report.code);
}
}
-
+
/**
* Compares two api xml files for consistency.
*/
@@ -238,16 +238,16 @@ public class ApiCheck {
public class Report {
private int code;
private Set<ErrorMessage> errors;
-
+
private Report(int code, Set<ErrorMessage> errors) {
this.code = code;
this.errors = errors;
}
-
+
public int code() {
return code;
}
-
+
public Set<ErrorMessage> errors() {
return errors;
}
diff --git a/src/com/google/doclava/apicheck/ApiFile.java b/src/com/google/doclava/apicheck/ApiFile.java
index 2f83da9..45f0ad0 100644
--- a/src/com/google/doclava/apicheck/ApiFile.java
+++ b/src/com/google/doclava/apicheck/ApiFile.java
@@ -228,7 +228,7 @@ public class ApiFile {
}
pkg.addClass(cl);
}
-
+
private static void parseConstructor(Tokenizer tokenizer, ClassInfo cl, String token)
throws ApiParseException {
boolean pub = false;
@@ -617,7 +617,7 @@ public class ApiFile {
throw new ApiParseException("Expected identifier: " + token, tokenizer.getLine());
}
}
-
+
static class Tokenizer {
char[] mBuf;
String mFilename;
diff --git a/src/com/google/doclava/apicheck/ApiParseException.java b/src/com/google/doclava/apicheck/ApiParseException.java
index e5fb89a..68d154e 100644
--- a/src/com/google/doclava/apicheck/ApiParseException.java
+++ b/src/com/google/doclava/apicheck/ApiParseException.java
@@ -22,7 +22,7 @@ public final class ApiParseException extends Exception {
public ApiParseException() {
}
-
+
public ApiParseException(String message) {
super(message);
}
@@ -38,7 +38,7 @@ public final class ApiParseException extends Exception {
super(message);
this.line = line;
}
-
+
public String getMessage() {
if (line > 0) {
return super.getMessage() + " line " + line;
diff --git a/src/com/google/doclava/apicheck/XmlApiFile.java b/src/com/google/doclava/apicheck/XmlApiFile.java
index d36766b..7f4b4fe 100644
--- a/src/com/google/doclava/apicheck/XmlApiFile.java
+++ b/src/com/google/doclava/apicheck/XmlApiFile.java
@@ -46,7 +46,7 @@ class XmlApiFile extends DefaultHandler {
private ClassInfo mCurrentClass;
private AbstractMethodInfo mCurrentMethod;
private Stack<ClassInfo> mClassScope = new Stack<ClassInfo>();
-
+
public static ApiInfo parseApi(InputStream xmlStream) throws ApiParseException {
try {
XMLReader xmlreader = XMLReaderFactory.createXMLReader();
@@ -78,14 +78,14 @@ class XmlApiFile extends DefaultHandler {
// push the old outer scope for later recovery, then set
// up the new current class object
mClassScope.push(mCurrentClass);
-
+
ClassDoc classDoc = null;
String rawCommentText = "";
SourcePositionInfo position = SourcePositionInfo.fromXml(attributes.getValue("source"));
String visibility = attributes.getValue("visibility");
boolean isPublic = "public".equals(visibility);
boolean isProtected = "protected".equals(visibility);
- boolean isPrivate = "private".equals(visibility);
+ boolean isPrivate = "private".equals(visibility);
boolean isPackagePrivate = !isPublic && !isPrivate && !isProtected;
boolean isStatic = Boolean.valueOf(attributes.getValue("static"));
boolean isInterface = qName.equals("interface");
@@ -101,23 +101,23 @@ class XmlApiFile extends DefaultHandler {
String qualifiedName = qualifiedName(mCurrentPackage.name(), name, mCurrentClass);
String qualifiedTypeName = null; // TODO: not sure
boolean isPrimitive = false;
-
+
mCurrentClass =
- new ClassInfo(classDoc, rawCommentText, position, isPublic, isProtected,
- isPackagePrivate, isPrivate, isStatic, isInterface, isAbstract, isOrdinaryClass,
+ new ClassInfo(classDoc, rawCommentText, position, isPublic, isProtected,
+ isPackagePrivate, isPrivate, isStatic, isInterface, isAbstract, isOrdinaryClass,
isException, isError, isEnum, isAnnotation, isFinal, isIncluded, name, qualifiedName,
qualifiedTypeName, isPrimitive);
-
+
mCurrentClass.setDeprecated("deprecated".equals(attributes.getValue("deprecated")));
mCurrentClass.setContainingPackage(mCurrentPackage);
String superclass = attributes.getValue("extends");
if (superclass == null && !isInterface && !"java.lang.Object".equals(qualifiedName)) {
throw new AssertionError("no superclass known for class " + name);
}
-
+
// Resolve superclass after .xml completely parsed.
mApi.mapClassToSuper(mCurrentClass, superclass);
-
+
TypeInfo typeInfo = Converter.obtainTypeFromString(qualifiedName) ;
mCurrentClass.setTypeInfo(typeInfo);
mCurrentClass.setAnnotations(new ArrayList<AnnotationInstanceInfo>());
@@ -131,7 +131,7 @@ class XmlApiFile extends DefaultHandler {
String visibility = attributes.getValue("visibility");
boolean isPublic = "public".equals(visibility);
boolean isProtected = "protected".equals(visibility);
- boolean isPrivate = "private".equals(visibility);
+ boolean isPrivate = "private".equals(visibility);
boolean isPackagePrivate = !isPublic && !isPrivate && !isProtected;
boolean isFinal = Boolean.valueOf(attributes.getValue("final"));
boolean isStatic = Boolean.valueOf(attributes.getValue("static"));
@@ -149,14 +149,14 @@ class XmlApiFile extends DefaultHandler {
ArrayList<ClassInfo> thrownExceptions = new ArrayList<ClassInfo>();
SourcePositionInfo position = SourcePositionInfo.fromXml(attributes.getValue("source"));
ArrayList<AnnotationInstanceInfo> annotations = new ArrayList<AnnotationInstanceInfo>(); // TODO
-
- mCurrentMethod =
+
+ mCurrentMethod =
new MethodInfo(rawCommentText, typeParameters, name, signature, containingClass,
realContainingClass, isPublic, isProtected, isPackagePrivate, isPrivate, isFinal,
isStatic, isSynthetic, isAbstract, isSynchronized, isNative, isDefault,
isAnnotationElement, kind, flatSignature, overriddenMethod, returnType, parameters,
thrownExceptions, position, annotations);
-
+
mCurrentMethod.setDeprecated("deprecated".equals(attributes.getValue("deprecated")));
} else if (qName.equals("constructor")) {
final boolean pub = "public".equals(attributes.getValue("visibility"));
@@ -181,7 +181,7 @@ class XmlApiFile extends DefaultHandler {
boolean isPackagePrivate = visibility.equals("");
String typeName = attributes.getValue("type");
TypeInfo type = Converter.obtainTypeFromString(typeName);
-
+
Object value;
try {
value = ApiFile.parseValue(typeName, attributes.getValue("value"));
@@ -196,7 +196,7 @@ class XmlApiFile extends DefaultHandler {
getValue("transient")), Boolean.valueOf(attributes.getValue("volatile")), false,
type, "", value, SourcePositionInfo.fromXml(attributes.getValue("source")),
new ArrayList<AnnotationInstanceInfo>());
-
+
fInfo.setDeprecated("deprecated".equals(attributes.getValue("deprecated")));
mCurrentClass.addField(fInfo);
} else if (qName.equals("parameter")) {
@@ -235,7 +235,7 @@ class XmlApiFile extends DefaultHandler {
public ApiInfo getApi() {
return mApi;
}
-
+
private String qualifiedName(String pkg, String className, ClassInfo parent) {
String parentQName = (parent != null) ? (parent.qualifiedName() + ".") : "";
return pkg + "." + parentQName + className;