On Thu, 22 Feb 2024 04:53:20 GMT, Chen Liang <li...@openjdk.org> wrote:

>> Currently in the javadoc tool, the generated class use page does not track 
>> the occurrences of a class in the type arguments of the extends or 
>> implements list, where they can appear. (See more details on the JBS issue) 
>> For example:
>> 
>> public class One {}
>> 
>> 
>> import java.util.*;
>> public class Two extends ArrayList<One> implements Comparator<One> {
>> }
>> 
>> 
>> This patch proposes to add new 2 usage categories, "Classes that extend 
>> types with arguments of type" and "Classes that implement types with 
>> arguments of type" to describe the missing usage scenarios.
>> 
>> A preview of the new use page with the 2 new categories, generated based on 
>> the example above, can be found here: 
>> https://cr.openjdk.org/~liach/8323698-javadocuse/doc/class-use/One.html
>
> Chen Liang has updated the pull request with a new target base due to a merge 
> or a rebase. The incremental webrev excludes the unrelated changes brought in 
> by the merge/rebase. The pull request contains eight additional commits since 
> the last revision:
> 
>  - Distinguish subinterfaces, use clearer terms
>  - Merge branch 'master' of https://github.com/openjdk/jdk into 
> feature/jd-use-super-typearg
>  - Review changes
>  - Merge branch 'master' of https://github.com/openjdk/jdk into 
> feature/jd-use-super-typearg
>  - Fix tests
>  - Improve localization
>  - Merge branch 'master' of https://github.com/openjdk/jdk into 
> feature/jd-use-super-typearg
>  - Use page to check extends/implements type arguments

Thanks for your review, Pavel! I've addressed your changes and updated the 
preview on CR.

1. `interface MyList<T extends One & Two<Three>> extends java.util.List<T>`
This case is already perfectly handled by existing 
`doclet.ClassUse_TypeParameter`, since `One` `Two` `Three` here exists in a 
type parameter's bounds, which will be scanned by a visitor and recorded 
correctly.
2. For generic interfaces, I have reworded the usage categories; closer to the 
simple subclass version.
3. Have split out the subinterfaces in a separate category and added it to 
tests.
4. These being used as a type argument and as a bound are unfortunately not 
distinguished by our existing type parameter handling, in both type parameter 
declarations in classes/methods and parameterized type usages in field/method 
types. I don't think it's in this patch's scope to change this behavior, and if 
this should be changed, all those sites should be updated as well.

Feel free to suggest improvments to the wordings!

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

PR Comment: https://git.openjdk.org/jdk/pull/17414#issuecomment-1958706531

Reply via email to