summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPete Gillin <peteg@google.com>2018-06-14 15:33:21 +0100
committerPete Gillin <peteg@google.com>2018-06-18 15:37:37 +0100
commitc43ff0c05403677073ccac3355ca2447f0d17f6b (patch)
tree7d9081cbca8b7f3447d57f2a5f2ab97ea0f4ea22 /src
parentfe1601d9fc7ee4e38868701710307263738b630f (diff)
downloaddoclava-c43ff0c05403677073ccac3355ca2447f0d17f6b.tar.gz
Make broken @see tags errors in doclava outside frameworks.
Prior to this change, doclava reported errors for @link tags that cross-referenced to something that didn't exist or wasn't visible, but had an exemption for @see tags. Recent changes[1] have removed all such broken @see tags outside of frameworks. This change removes the exemption, and so detects regressions. (Broken @see tags in frameworks are fixed downstream, and there is a change downstream to remove the exemption globally. The latter change is used as the merged-in for this change. That will mean we catch regressions downstream, but that's less convenient than catching them directly in AOSP for libcore, external/icu, etc.) This is the second attempt at this change. The first attempt[2] caused issues downstream, with violations that don't show up in AOSP. This attempt has been tested in an appropriate downstream branch. [1] See: https://android-review.googlesource.com/c/platform/libcore/+/704719 https://android-review.googlesource.com/c/platform/external/icu/+/704721 https://android-review.googlesource.com/c/platform/libcore/+/705144 [2] See: https://android-review.googlesource.com/c/platform/external/doclava/+/705225 Bug: 80570421 Test: make docs Test: make docs, cherry-picked into pi-dev Change-Id: I92852fab0a8d22b115fa89ce4302abe1ca082bd6 Merged-In: I5ad574025d5e2709a853a82d2d52124526520c69
Diffstat (limited to 'src')
-rw-r--r--src/com/google/doclava/SeeTagInfo.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/com/google/doclava/SeeTagInfo.java b/src/com/google/doclava/SeeTagInfo.java
index 9f38655..040cbf0 100644
--- a/src/com/google/doclava/SeeTagInfo.java
+++ b/src/com/google/doclava/SeeTagInfo.java
@@ -35,8 +35,16 @@ public class SeeTagInfo extends TagInfo {
protected LinkReference linkReference() {
if (mLink == null) {
+ // If this is a @see reference in frameworks/base, suppress errors about broken references.
+ // Outside of frameworks/base, frameworks/support, and the generated android/R file, all such
+ // errors have been fixed, see b/80570421.
+ boolean suppressableSeeReference =
+ "@see".equals(name()) &&
+ (position().file.contains("frameworks/base/")
+ || position().file.contains("frameworks/support/")
+ || position().file.endsWith("android/R.java"));
mLink =
- LinkReference.parse(text(), mBase, position(), (!"@see".equals(name()))
+ LinkReference.parse(text(), mBase, position(), !suppressableSeeReference
&& (mBase != null ? mBase.checkLevel() : true));
}
return mLink;