ANDROID: Port fix for JDK-8166379 to legacy javadoc code path.
Due to a bug  javadoc -source 1.9 --patch-module ... crashed 100% of the
time; this bug was fixed  in upstream OpenJDK 9 for the logic in
jdk.javadoc.internal. However, there is near-duplicate legacy logic in
com.sun.tools.javadoc for which the bug has not yet been fixed upstream;
this legacy logic is invoked when processing legacy doclets
implementations (such as Droiddoc) that do not extend the Doclet class.
This CL ports the upstream fix to the legacy code path; note that in the
legacy code, alias options (example: --class-path vs. -classpath vs. -cp)
are treated as logically separate options with their own names whereas
in the non-legacy codepath these have been refactored to be represented
as a single Option where one of those names (the first) is the "primaryName".
Test: In a local client with other patches applied to droiddoc.mk and
droiddoc.go, "make docs" doesn't exhibit the early crash indicated
in http://b/74381003#comment2 . There are currently still other
blockers for droiddoc support for language level 9 sources, so a
complete "make docs" run has not yet been completed.
2 files changed