Bug 75551 - [javadoc][assist] javadoc completion for links to method with inner classes as argument is not correct
Summary: [javadoc][assist] javadoc completion for links to method with inner classes a...
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Linux-GTK
: P3 normal (vote)
Target Milestone: 3.2 RC1   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-03 19:59 EDT by Olaf Krische CLA
Modified: 2006-04-19 04:06 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Olaf Krische CLA 2004-10-03 19:59:56 EDT
Hello, 

i just had some warnings when creating javadoc and wondered about the
reasons. Then i saw, that eclipse gave me also wrong javadoc completions.

The JavaDoc-API says:

"Nested classes must be specified as outer.inner, not simply inner, for all forms."

( http://java.sun.com/j2se/1.4.2/docs/tooldocs/solaris/javadoc.html#@see )

Example:

public OtherClass extends OuterClass {

  /**
   * Wrong javadoc completion from Eclipse, that produces javadoc warnings:
   * 
   * {@link #kick(InnerClass)}
   *
   * Correct code would be: 
   *
   * {@link #kick(OuterClass.InnerClass)}
   *
   */
  public OtherClass() {
  }

  public kick(InnerClass innerClass) {
    return;
  }
}

public class OuterClass {

  public OuterClass() {
  }

  protected static class InnerClass {
     public InnerClass() {
     }
  }
}

Thanks!

Used version: Eclipse 3.0.1, Build id: 200409161125
Comment 1 Martin Aeschlimann CLA 2005-05-22 05:51:51 EDT
filed bug 96237 against jdt.core so that we also warn about the usage of simple
inner type names
Comment 2 Martin Aeschlimann CLA 2005-05-22 05:53:20 EDT
*** Bug 78796 has been marked as a duplicate of this bug. ***
Comment 3 Martin Aeschlimann CLA 2005-09-20 09:05:00 EDT
Moving all javadoc code assist bugs to jdt.core so they can be handled in the
new jdt.core implementation.
Comment 4 Frederic Fusier CLA 2006-04-19 04:06:13 EDT
Verified it works with 3.2 RC1.

Note that example is not correct and produce compiler error and warnings.
Error is due to missing class on OtherClass declaration.
Warnings in Javadoc are due to missing return type for method kick...

So, correct example is:
public class OtherClass extends OuterClass {

  /**
   * Wrong javadoc completion from Eclipse, that produces javadoc warnings:
   * {@link #k<complete here 1>
   *
   * #k<complete here 2>
   */
  public OtherClass() {
  }

  public void kick(InnerClass innerClass) {
    return;
  }
}

Completion correctly inserts:
1) kick(OuterClass.InnerClass)
2) {@link #kick(OuterClass.InnerClass)}