RFR: 8285488: Improve DocFinder [v4]

Pavel Rappo prappo at openjdk.org
Tue Nov 1 14:28:09 UTC 2022


On Fri, 28 Oct 2022 18:22:14 GMT, Jonathan Gibbons <jjg at openjdk.org> wrote:

>> Pavel Rappo has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 49 commits:
>> 
>>  - refactor: improve error handling
>>  - refactor: clarify, reuse, simplify, clean up
>>  - refactor: pass Utils & BaseConfiguration to taglet
>>    
>>    This simplifies lots of methods. Later this could be done for other
>>    taglets too.
>>  - refactor: better code comments
>>  - refactor: add more relevant excerpts from JLS
>>  - fix: introduce more control to search
>>    
>>    This is done for the sake of `@throws`. Two convenience methods are
>>    added to assist migration from Optional with minimal change to
>>    DocFinder call sites.
>>    
>>    This solves 8295800: When searching documentation for an exception,
>>    don't jump over methods that don't mention that exception.
>>  - refactor: clean up ThrowsTaglet
>>  - Merge branch 'master' into HEAD
>>  - fix: test failed due to filesystem handling issues
>>    
>>    Filed 8295543 to track that filesystem issue and fixed the test to make
>>    sure the package cannot be confused with the type parameter, whose
>>    name is not pertinent to the test anyway.
>>  - Merge branch 'master' into 8285488
>>  - ... and 39 more: https://git.openjdk.org/jdk/compare/628820f4...c2db1ae6
>
> src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties line 122:
> 
>> 120: doclet.inheritDocWithinInappropriateTag=@inheritDoc cannot be used within this tag
>> 121: doclet.inheritDocNoDoc=overridden methods do not document exception type {0}
>> 122: doclet.throwsInheritDocUnsupported=@inheritDoc for exception-type type parameters not declared by a method is unsupported; \
> 
> Minor grammar quibble: _not supported_ reads better than _unsupported_.
> 
> Even better would be to reorder the message:
> 
> @inheritDoc is not supported for exception-type type parameters that are not declared by a method; document such exception types directly

Wouldn't it be harder to read though? _that are not declared ... are not supported_

> src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/ParamTaglet.java line 229:
> 
>> 227:         Utils utils = writer.configuration().utils;
>> 228:         Content result = writer.getOutputInstance();
>> 229:         var r = utils.docFinder().search((ExecutableElement) holder, m -> Result.fromOptional(extract(utils, m, position, kind == ParamKind.TYPE_PARAMETER)))
> 
> long line

What's an acceptable line width in langtools?

-------------

PR: https://git.openjdk.org/jdk/pull/10746


More information about the javadoc-dev mailing list