Bug 432274 - [compile][generics] Bad method resolution in Javadoc when using @link tags
Summary: [compile][generics] Bad method resolution in Javadoc when using @link tags
Status: REOPENED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.3.1   Edit
Hardware: PC Windows 8
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-08 08:07 EDT by Lukas Eder CLA
Modified: 2024-04-22 10:06 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lukas Eder CLA 2014-04-08 08:07:17 EDT
I've noticed a bogus deprecation warning in my Javadocs that only appears in Eclipse and which isn't correct when looking at the code. Consider the following example to reproduce the issue:

========================================
import java.util.List;

public interface Other {

    @Deprecated
    <T> T getValue(List<T> field, T defaultValue);
    <T> T getValue(List<?> field, Class<?> type);

    /**
     * This doesn't get any deprecation 
     * warning {@link Other#getValue(List, Class)}
     */
    void x();

}

import java.util.List;

public interface Test {

    /**
     * Let's reference the non-deprecated
     * class through a {@link Other#getValue(List, Class)}.
     * We get a deprecation warning in the Javadocs
     */
    void x();
}
========================================

In the above example, I get a warning in Test.x()'s Javadoc (but not in Other.x()'s Javadoc), because the link is resolved to Other.getValue(List, Object), not to Other.getValue(List, Class).

It has something to do with the wildcards in Other.getValue(List<?>, Class<?>). The following method signature will help work around the issue:

========================================
import java.util.List;

public interface Other {

    @Deprecated
    <T> T getValue(List<T> field, T defaultValue);
    <T> T getValue(List<T> field, Class<?> type);

}
========================================
Comment 1 Eclipse Genie CLA 2020-05-10 16:05:19 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 2 Lukas Eder CLA 2020-05-11 02:56:50 EDT
Still wrong
Comment 3 Eclipse Genie CLA 2022-05-02 17:33:53 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 4 Eclipse Genie CLA 2024-04-22 10:06:00 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.