Skip to content
Snippets Groups Projects
Commit 97dc5448 authored by Tor Norbye's avatar Tor Norbye
Browse files

Fix misc metalava issues: wildcard imports, type use, etc

This CL fixes a cluster of issues that have come up recently:

(1) Preserve wildcard imports from the original source files for
    packages that are members of the API. This normally isn't an issue
    since most framework code doesn't use wildcard imports, but some
    ojluni source files do, and without these wildcard imports in the
    documentation stubs any unqualified class references in the
    javadoc could not be resolved. (However, we have to take care to
    only include wildcard imports where at least one member is part of
    the API; otherwise we get a compilation error in the stubs.)

(2) Including annotations was on by default. That was not supposed to
    be the case. Also, stop emitting annotations into the doc stubs.

(3) Fix a couple of crashes related to comment lookup observed when
    running metalava on the support library.

(4) Warn if anyone tries to mark findViewById or getSystemService as
    nullable. We should leave these as platform types, since otherwise
    a lot of valid code lights up as warnings even though developers
    can correctly conclude that the methods won't return null if they
    pass in correct arguments.

(5) Fix handling of type-use annotations; this addresses
    111054266: Don't repeat annotations
    and possibly 111116803.

(6) Don't warn about mismatches between @Deprecated and @deprecated in
    documentation for Kotlin. Instead, inline the text from
    kotlin.Deprecated into the documentation stubs.

(7) Fix the javadoc invocation such that we emit its output
    synchronously instead of accumulating everything until the tool is
    done.

(8) Don't mark *newly* added APIs with nullness annotations as
    recently null/non-null, only existing APIs newly annotated.

(9) When inserting documentation (such as API levels, deprecation
    levels etc) for methods overriding other methods, add
    {@inheritDoc} at the beginning to ensure we don't wipe out
    inherited documentation from the base method. Also make sure
    appended segments are separated from the earlier documentation
    with a <br>. Also fixes other javadoc formatting issues.

(11) Don't add @link references to constants in auto-generated
     comments if the referenced constant or permission isn't part of
     the API.

(11) Misc other tweaks; flag using "JetPack" instead of "Jetpack",
     bump to latest Ktlint version, delete some unused code, allow the
     -keepstubcomments flag from doclava, remove redundant error
     constant MISSING_TYPEDEF_CONSTANT, ...

Fixes: 111054266
Test: Tests updated
Change-Id: I22008b009a633e216d365b4b15a4995e6fcdec7c
parent 84f81f21
No related branches found
No related tags found
No related merge requests found
Showing
with 502 additions and 328 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment