Handling type arguments from outer classes for inner class in javadoc

classic Classic list List threaded Threaded
4 messages Options
-
Reply | Threaded
Open this post in threaded view
|

Handling type arguments from outer classes for inner class in javadoc

-
Hello,
When I was creating tests for JDK-8259216 (namely this example), I encountered another problem, where instance inner class parameterized types (generics) in javadoc omit outer classes' generic information.

An example:
Tree.java
public class Tree<T> {
    public class Node {
        T data;
        Node left;
        Node right;
        // etc..
    }
    Node root;
    // etc..
}

User.java
public class User {
    public void take(Tree<Integer>.Node now, Tree<String>.Node other) {}
    public void take(Tree<Integer> now, Tree<String> other) {}
}

Observe the javadoc method summaries (same for details) are
void take(Tree.Node now, Tree.Node other)  
void take(Tree<java.lang.Integer> now, Tree<java.lang.String> other)
while it's the most reasonable from the test code above that both should include the generic information.

Is anyone interested in filing an issue on the bugtracker? I didn't find any relevant results there.

Best,
liangchenblue at gmail.com
Reply | Threaded
Open this post in threaded view
|

Re: Handling type arguments from outer classes for inner class in javadoc

Jonathan Gibbons

Filed as

https://bugs.openjdk.java.net/browse/JDK-8259499

-- Jon

On 1/8/21 9:59 AM, - wrote:
Hello,
When I was creating tests for JDK-8259216 (namely this example), I encountered another problem, where instance inner class parameterized types (generics) in javadoc omit outer classes' generic information.

An example:
Tree.java
public class Tree<T> {
    public class Node {
        T data;
        Node left;
        Node right;
        // etc..
    }
    Node root;
    // etc..
}

User.java
public class User {
    public void take(Tree<Integer>.Node now, Tree<String>.Node other) {}
    public void take(Tree<Integer> now, Tree<String> other) {}
}

Observe the javadoc method summaries (same for details) are
void take(Tree.Node now, Tree.Node other)  
void take(Tree<java.lang.Integer> now, Tree<java.lang.String> other)
while it's the most reasonable from the test code above that both should include the generic information.
-
Reply | Threaded
Open this post in threaded view
|

Re: Handling type arguments from outer classes for inner class in javadoc

-
Hi Jon,
I made a quick patch (attached) that renders the whole inner/nested class chains. However, I am not sure if the behavior of the rendered text is desired (i.e. clicking before . actually goes to parent class) and the patch's side effects; it passes make test-only TEST="jtreg:test/langtools/jdk/javadoc/*" though.

liangchenblue at gmail.com

On Fri, Jan 8, 2021 at 12:28 PM Jonathan Gibbons <[hidden email]> wrote:

Filed as

https://bugs.openjdk.java.net/browse/JDK-8259499

-- Jon

On 1/8/21 9:59 AM, - wrote:
Hello,
When I was creating tests for JDK-8259216 (namely this example), I encountered another problem, where instance inner class parameterized types (generics) in javadoc omit outer classes' generic information.

An example:
Tree.java
public class Tree<T> {
    public class Node {
        T data;
        Node left;
        Node right;
        // etc..
    }
    Node root;
    // etc..
}

User.java
public class User {
    public void take(Tree<Integer>.Node now, Tree<String>.Node other) {}
    public void take(Tree<Integer> now, Tree<String> other) {}
}

Observe the javadoc method summaries (same for details) are
void take(Tree.Node now, Tree.Node other)  
void take(Tree<java.lang.Integer> now, Tree<java.lang.String> other)
while it's the most reasonable from the test code above that both should include the generic information.

8259499.patch (9K) Download Attachment
-
Reply | Threaded
Open this post in threaded view
|

Fwd: Handling type arguments from outer classes for inner class in javadoc

-


---------- Forwarded message ---------
From: - <[hidden email]>
Date: Tue, Jan 12, 2021 at 10:22 AM
Subject: Re: Handling type arguments from outer classes for inner class in javadoc
To: Jonathan Gibbons <[hidden email]>


Hmm, so a question arises:
For example, if we are getting a link for O<T>.I<S>, what should the first O link to? Should it link to O or should it link to I? and what should the dot link to, or should it be plain?

When we have static nested classes like Map.Entry, the whole "Map.Entry" links to the Entry class. We need a designated linking behavior before we can properly fix this.


liangchenblue at gmail.com

On Fri, Jan 8, 2021 at 10:56 PM - <[hidden email]> wrote:
Hi Jon,
I made a quick patch (attached) that renders the whole inner/nested class chains. However, I am not sure if the behavior of the rendered text is desired (i.e. clicking before . actually goes to parent class) and the patch's side effects; it passes make test-only TEST="jtreg:test/langtools/jdk/javadoc/*" though.

liangchenblue at gmail.com

On Fri, Jan 8, 2021 at 12:28 PM Jonathan Gibbons <[hidden email]> wrote:

Filed as

https://bugs.openjdk.java.net/browse/JDK-8259499

-- Jon

On 1/8/21 9:59 AM, - wrote:
Hello,
When I was creating tests for JDK-8259216 (namely this example), I encountered another problem, where instance inner class parameterized types (generics) in javadoc omit outer classes' generic information.

An example:
Tree.java
public class Tree<T> {
    public class Node {
        T data;
        Node left;
        Node right;
        // etc..
    }
    Node root;
    // etc..
}

User.java
public class User {
    public void take(Tree<Integer>.Node now, Tree<String>.Node other) {}
    public void take(Tree<Integer> now, Tree<String> other) {}
}

Observe the javadoc method summaries (same for details) are
void take(Tree.Node now, Tree.Node other)  
void take(Tree<java.lang.Integer> now, Tree<java.lang.String> other)
while it's the most reasonable from the test code above that both should include the generic information.