Bug 96237 - [javadoc] Inner types must be qualified
Summary: [javadoc] Inner types must be qualified
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3 M1   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 115487 (view as bug list)
Depends on:
Blocks: 119857
  Show dependency tree
 
Reported: 2005-05-22 05:51 EDT by Martin Aeschlimann CLA
Modified: 2006-08-04 08:12 EDT (History)
3 users (show)

See Also:


Attachments
Temporary patch which should be appliable on top of v_659 (8.71 KB, patch)
2006-04-25 10:27 EDT, Frederic Fusier CLA
no flags Details | Diff
Temporary patch which should be appliable on top of v_659 (48.45 KB, patch)
2006-04-26 12:59 EDT, Frederic Fusier CLA
no flags Details | Diff
Proposed patch (237.12 KB, patch)
2006-06-23 03:50 EDT, Frederic Fusier CLA
no flags Details | Diff
Fix improvement (57.42 KB, patch)
2006-06-27 05:52 EDT, Frederic Fusier CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Aeschlimann CLA 2005-05-22 05:51:01 EDT
M7

From bug 75551 I learned that the Javadoc tool gives out warnings when you
reference an inner type by its simple name 'InnerType'. It is required to at
least type qualify it ('OuterType.InnerType', or 'pack.OuterType.InnerType')

The Javadoc validator could also warn about this.

"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 )
Comment 1 Philipe Mulet CLA 2005-05-23 04:30:14 EDT
Warning could wait post 3.1.
Comment 2 Frederic Fusier CLA 2005-05-23 04:55:32 EDT
defer post 3.1
Comment 3 Frederic Fusier CLA 2005-08-05 04:46:49 EDT
Reopen for 3.2
Comment 4 Frederic Fusier CLA 2005-11-08 11:42:03 EST
*** Bug 115487 has been marked as a duplicate of this bug. ***
Comment 5 Frederic Fusier CLA 2005-11-29 04:49:29 EST
In fact, even if the spec says inner types has to be qualified, javadoc.exe accept unqualified references to member types...

Generate javadoc for this simple example:
/**
 * @see Inner
 */
public class Test {
  public class Inner {}
}
does not give any warning at all.

Note however that there's a warning if example becomes:
/**
 * @see Inner
 */
public class Test {
  class Inner {}
}
and that you generate javadoc only for members with 'public' visibility.

But this is only a problem a javadoc level of generation...
So, we will not modify compiler behavior on this point
Comment 6 Markus Keller CLA 2006-01-09 10:22:39 EST
Note that the example from comment 5 only seems to pass without a warning because the javadoc reference points from the enclosing type to its member type.

In other cases, javadoc.exe from a 1.4 JDK reports a warning "reference not found: Inner":

public class Test {
    /**
     * @see Inner
     */
    public class Inner { }
}
/**
 * See also {@link Inner}
 */
class X extends Test { }

According to the spec, javadoc.exe from a 1.5 SDK should report the same warnings. However, the 1.5 javadoc.exe only reports the second warning and accepts the first one.

IMO, the eclipse javadoc compiler should issue a warning whenever a comment would cause a javadoc.exe to issue an error or a warning. ImportRewrite 1.1 had such a problem which remained undetected until the javadoc.exe was executed.
Comment 7 Frederic Fusier CLA 2006-04-12 13:57:43 EDT
Reopen
Comment 8 Frederic Fusier CLA 2006-04-12 13:58:19 EDT
*** Bug 103304 has been marked as a duplicate of this bug. ***
Comment 9 Frederic Fusier CLA 2006-04-25 10:27:19 EDT
Created attachment 39409 [details]
Temporary patch which should be appliable on top of v_659

This patch fixes the problem but still have some impact (not all JDT/Core tests are green...).
Comment 10 Frederic Fusier CLA 2006-04-25 10:27:57 EDT
Defer patch finalization post 3.2
Comment 11 Frederic Fusier CLA 2006-04-26 12:59:28 EDT
Created attachment 39554 [details]
Temporary patch which should be appliable on top of v_659

Wrong patch...
Comment 12 Frederic Fusier CLA 2006-06-23 03:47:14 EDT
Reopen as final fix is now ready
Comment 13 Frederic Fusier CLA 2006-06-23 03:50:17 EDT
Created attachment 45150 [details]
Proposed patch
Comment 14 Frederic Fusier CLA 2006-06-23 03:55:19 EDT
Released for 3.3 M1 in HEAD
Comment 15 Frederic Fusier CLA 2006-06-27 05:52:29 EDT
Created attachment 45373 [details]
Fix improvement

Previous patch missed one case: fully qualified inner class not warned when visible.
Comment 16 Frederic Fusier CLA 2006-06-27 10:29:00 EDT
bug 103304 is not a duplicate of this bug!
Comment 17 Maxime Daniel CLA 2006-08-04 08:12:30 EDT
Verified for 3.3 M1 using build I20060804-0010.