Include source position of broken docs.
Some source code included "{@link }" which broke the @SystemApi docs
build with a useless error message. This change adds logging to
identify the source position.
Test: make -j32 online-system-api-sdk-docs
Bug: 38164929
Change-Id: Idcf2ba68daa904584e2f2c3daf6228bc25e651d7
diff --git a/.gitignore b/.gitignore
index 378eac2..3770f89 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,4 @@
build
+.classpath
+.project
+.settings
diff --git a/src/com/google/doclava/LinkReference.java b/src/com/google/doclava/LinkReference.java
index 816bdb1..0fb7fcb 100644
--- a/src/com/google/doclava/LinkReference.java
+++ b/src/com/google/doclava/LinkReference.java
@@ -251,16 +251,20 @@
if (DBG) System.out.println("-- they provided ref = " + ref);
// they provided something, maybe it's a class or a package
if (cl != null) {
- if (DBG) System.out.println("-- cl non-null");
- result.classInfo = cl.extendedFindClass(ref);
- if (result.classInfo == null) {
- if (DBG) System.out.println("-- cl.extendedFindClass was null");
- result.classInfo = cl.findClass(ref);
- }
- if (result.classInfo == null) {
- if (DBG) System.out.println("-- cl.findClass was null");
- result.classInfo = cl.findInnerClass(ref);
- if (DBG) if (result.classInfo == null) System.out.println("-- cl.findInnerClass was null");
+ try {
+ if (DBG) System.out.println("-- cl non-null");
+ result.classInfo = cl.extendedFindClass(ref);
+ if (result.classInfo == null) {
+ if (DBG) System.out.println("-- cl.extendedFindClass was null");
+ result.classInfo = cl.findClass(ref);
+ }
+ if (result.classInfo == null) {
+ if (DBG) System.out.println("-- cl.findClass was null");
+ result.classInfo = cl.findInnerClass(ref);
+ if (DBG) if (result.classInfo == null) System.out.println("-- cl.findInnerClass was null");
+ }
+ } catch (RuntimeException e) {
+ throw new RuntimeException("Failed to resolve class at " + pos, e);
}
}
if (result.classInfo == null) {