This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 59524 - Javadoc @inheritDoc fails for Generics classes
Summary: Javadoc @inheritDoc fails for Generics classes
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 5.x
Hardware: All Windows XP
: P3 blocker (vote)
Assignee: Tomas Hurka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-01 23:54 UTC by _ gtzabari
Modified: 2007-09-26 09:14 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description _ gtzabari 2005-06-01 23:54:17 UTC
dev build 200505311800

1) Given class MyClass which implements Comparable<MyClass>
2) Create method "public int compareTo(MyClass other)" with javadoc comment
"{@inheritDoc}"
3) What you will notice is if you bring up code-complete on this method (which
shows the Javadoc) it'll show the raw text "{@inheritDoc}" but if you redefine
the method as "public int compareTo(Object other)" instead it'll actually
substitute the correct Javadoc (inherited) from Comparable.

This is obviously some sort of bug in our Generics + Javadoc support. The
Javadoc engine should be smart enough to know that if I implement
Comparable<MyClass> then the correct method signature takes MyClass as an
argument, not Object.
Comment 1 Jan Pokorsky 2005-06-02 12:24:15 UTC
This support is provided by the editor module.
Comment 2 Dusan Balek 2005-11-03 14:42:39 UTC
The problem is that ParameterizedType.getMethod(...) does not work well with
generics. The same bug can be seen if "Goto Super Implementation" (Ctrl-B) is
invoked at compareTo(...) method in MyClass. Reassigning to javacore.

Tome, look at NbJMICompletionJavaDoc.JMIParsingThread.findOverridenMethod(...),
JavaKit.JavaGotoSuperImplementation.findOverridenMethod(...), and
MethodImpl.getOverridenMethods(). The code is almost the same. After fixing
getMethod()'s behavior, could you please add a new utility method
getOverridenMethods to JavaModelUtils and modify the above mentioned sources to
use it?
Comment 3 Tomas Hurka 2005-11-21 14:55:45 UTC
Fixed in trunk together with issue #66228.

Checking in javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/ClassDefinitionImpl.java;
/cvs/java/javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/ClassDefinitionImpl.java,v  
<--  ClassDefinitionImpl.java
new revision: 1.23; previous revision: 1.22
done
Checking in javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/MethodImpl.java;
/cvs/java/javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/MethodImpl.java,v  <--  
MethodImpl.java
new revision: 1.42; previous revision: 1.41
done
Checking in javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/
ParameterizedTypeImpl.java;
/cvs/java/javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/
ParameterizedTypeImpl.java,v  <--  ParameterizedTypeImpl.java
new revision: 1.29; previous revision: 1.28
done
Checking in javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/TypeClassImpl.java;
/cvs/java/javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/TypeClassImpl.java,v  <--  
TypeClassImpl.java
new revision: 1.7; previous revision: 1.6
done
Checking in javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/TypeParameterImpl.java;
/cvs/java/javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/TypeParameterImpl.java,v  
<--  TypeParameterImpl.java
new revision: 1.28; previous revision: 1.27
done
Checking in javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/UsageFinder.java;
/cvs/java/javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/UsageFinder.java,v  <--  
UsageFinder.java
new revision: 1.29; previous revision: 1.28
done
Checking in javacore/src/org/netbeans/modules/javacore/parser/MDRParser.java;
/cvs/java/javacore/src/org/netbeans/modules/javacore/parser/MDRParser.java,v  <--  MDRParser.java
new revision: 1.93; previous revision: 1.92
done
Checking in src/org/netbeans/modules/java/OverrideAnnotationSupport.java;
/cvs/java/src/org/netbeans/modules/java/OverrideAnnotationSupport.java,v  <--  
OverrideAnnotationSupport.java
new revision: 1.24; previous revision: 1.23
done
Checking in src/org/netbeans/modules/java/bridge/ElementImpl.java;
/cvs/java/src/org/netbeans/modules/java/bridge/ElementImpl.java,v  <--  ElementImpl.java
new revision: 1.35; previous revision: 1.34
done
Checking in src/org/netbeans/modules/java/ui/nodes/elements/MethodCustomizer.java;
/cvs/java/src/org/netbeans/modules/java/ui/nodes/elements/MethodCustomizer.java,v  <--  
MethodCustomizer.java
new revision: 1.16; previous revision: 1.15
done
Comment 4 Quality Engineering 2007-09-20 12:11:25 UTC
Reorganization of java component