Generate android_icu4j with a fixed set of public APIs

By default, the feature isn't turned on since
the file whitelisted-public-api.txt should not exist
on "normal" release branches and master.

Usage:
1. Freeze the API surface temporarily when upgrading ICU to avoid
   changes in framework/base due to new API
2. Freeze the API surface in a downstream branch when pulling
   in upstream ICU sources.

Fixed a few bugs:
1. Include enum constant in public API report
2. Read method parameters with java generics
3. Don't walk the tree in RecordPublicApiRules.isExplicitlyHidden.
   Otherwise, while the caller is visiting a node in the tree,
   walking the tree will corrupt the bookkeeping and
   cause NullPointerException during ASTRewrite.

Refactored some code in RecordPublicApiRules into a
reusable static method isPublicApiEligible.

Test: ./generate_android_icu4j.sh generates no change in android_icu4j
Test: ./generate_android_icu4j.sh keeps the old behavior by default,
      and no @hide is added when icu4j has new @stable API
Test: ./generate_android_icu4j.sh adds @hide when new API is added
      in icu4j/ and whitelisted-public-api.txt is provided
Change-Id: I78bda12cea3976c857cf94d1a7389188d5651e28
8 files changed