Revert "Always run javadoc using the ToolProvider API"
This reverts commit f70aeb5e, except for some commented-out parts of
code and an unused method. I also simplified the code, e.g. with regard
to exception handling, and did some more cosmetic stuff, but basically
it is a revert.
In order to make it compile on more recent JDKs which doe not have class
com.sun.tools.javadoc.Main, I used Class.forName in the method being
called on JDK 8 only.
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
Add diagnostic output to HtmlDecorator if AJ-Doc generation fails
HtmlDecorator.decorateHTMLFile is where after Java version upgrades
(i.e. also new Javadoc generator version) usually tests fail for the
first time during builds because strings no longer match as expected.
There now is this log message on stdOut: "Something unexpected went
wrong in HtmlDecorator. Here is the full file causing the problem:"
After that, a full HTML page is logged. I hope this helps me identify
the new error on GitHub Linux Java 16, because the same test works on
Windows and I have no idea how to remote-debug a GitHub CI build.
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
Reports on declarations of Collection variables made by using the collection class as the type, rather than an appropriate interface.
Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
Reports the copying of array contents to a collection where each element is added individually using a for loop. Such constructs may be replaced by a call to Collection.addAll(Arrays.asList()) or Collections.addAll().
Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
Reports for loops which iterate over collections or arrays, and can be replaced with an enhanced for loop (i.e. the foreach iteration syntax).
Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
The version handling in LangUtil has been overhauled
to cope better with post 1.8 releases (JDK9 and JDK10 or 18.3
or whatever they call it). As part of this moved
to treating JDK9 as '9' rather than '1.9'. Also removed
duplicate version processing logic and had that defer to
the one place in LangUtil where we now deal with it.
Includes some generics tidyup in ajdoc. More ajdoc work
is necessary for Java10 because it removes the standard doclet
(old style). However trying to invoke the internal Javadoc
handler in Java10 is failing due to module visibility rules.
57780: ajdoc package summary should not show synthetic information;
57773: ajdoc crash;
Cleaned up link generation, added support for arbitrary levels of type nesting.
- Added support for 1.4 sources (use "-source 1.4" option)
- Made output class files go to documentation directory (-d) rather than source directory.
- Added "-XajdocDebug" option that will keep the source files generated from the ASM around in order to help people send better bug reports.
- Any declare forms that ajdoc doesn't know how to generate docs for get printed to the console and indicated as a limitation.
I also extended test coverage to declare forms and added proper clearing of state for multiple invocations from test cases.
I just committed the final round of updates to ajdoc needed for 1.2. In a nutshell it's moved forward a ways from the previous ajdoc:
- AJDT integration works
- generates documentation for all the AspectJ modules
- works on 1.3 and 1.4
- comments and Javadoc tags are properly preserved and resolved
Note that the hope is still for "declare" documentation to come in the form of a contribution.
Getting it to work for our tree involved a bunch of bug fixes to deal with things like anonymous types. To run from our tree in bootstrap mode use something like the attached batch script.
I had to roll back some of Andy's fix to broken links: getRelativeComponent didn't work properly for internal anchor links (..html#<mumble>). Andy, could you check this against the current thing against whatever was breaking for you, and ideally add that code patter to CoverageTestCase?
I added -XjavadocsInModel to make the addition of Javadoc strings to the ASM only happen when request it (prevent bloat of the model with strings. The running time of ajdoc is now dominated by the compilation time.