Bug 334652 - Javadoc content not found for non-static inner class constructors
Summary: Javadoc content not found for non-static inner class constructors
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.7 M5   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-18 09:58 EST by Eddie Galvez CLA
Modified: 2011-08-15 11:16 EDT (History)
4 users (show)

See Also:


Attachments
two projects as test case (67.79 KB, application/x-download)
2011-01-19 10:22 EST, Eddie Galvez CLA
no flags Details
Proposed fix + regression tests (12.14 KB, patch)
2011-01-19 15:08 EST, Olivier Thomann CLA
no flags Details | Diff
Test cases (126.05 KB, application/octet-stream)
2011-01-19 15:10 EST, Olivier Thomann CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eddie Galvez CLA 2011-01-18 09:58:52 EST
We have an eclipse product where we have projects that have java
build paths that include a Classpath Container that directs out to an external
jar. The classpath container code attaches javadoc to that jar, and we have a
class like this:


package some.package:

public class SomeException extends Exception

public abstract class SomeClass
 public final class InnerClass extends SomeException


when our end-users are typing

InnerClass ic = new InnerClass([CTRL-SPACE]

they just see arg0, arg1 and no javadoc.
Note that the CLASS javadoc for InnerClass appears as they hover over the type
string "InnerClass". If they hover over the "new InnerClass" portion, they will
see:

some.package.SomeClass.InnerClass.InnerClass(SomeClass arg0, String arg1,
String arg2)


which might be where the trouble stems from; technically, yes, the first
argument is the pointer to the containing class, but shouldn't the javadoc
layer know to unwind that? (I can look at the html file on disk that the
javadoc setting resolves to and I can see the constructor documentation in the
html)

I ventured an educated guess that this might be related to bug 151500 but was asked to file separately.
Comment 1 Dani Megert CLA 2011-01-18 11:13:39 EST
>I ventured an educated guess that this might be related to bug 151500 but was
>asked to file separately.
Sorry, it indeed looks likee a duplicate. Can you confirm that your problem is fixed when using 3.7 M1?
Comment 2 Eddie Galvez CLA 2011-01-19 10:22:36 EST
Created attachment 187115 [details]
two projects as test case
Comment 3 Eddie Galvez CLA 2011-01-19 10:23:22 EST
I just attached a test case: two java projects in the zip file.

Project "NoJavaDocForInnerClass":
  Look at PublicAbstractClass, then its inner class InnerFinalException

  I generated javadoc into its "doc" folder (left behind an ant file to re-gen it), then zipped it up as javadoc.zip. I exported that project as a jar and placed the jar right at the root, as NoJavaDocForInnerClass.jar.

Basically, any use of InnerFinalException /from an external archive/ will not show javadoc for its constructor call.

The "TestProject" demonstrates this. (its build path entry refers to the workspace, so you should have it good to go)
Comment 4 Dani Megert CLA 2011-01-19 10:25:20 EST
> Basically, any use of InnerFinalException /from an external archive/ will not
> show javadoc for its constructor call.
Is that also with 3.7 M1 or newer?
Comment 5 Eddie Galvez CLA 2011-01-19 10:37:20 EST
Sorry, I didn't say the most important thing: the test case was created in, and is exported from Eclipse 3.7 M4 (M FOUR)

Eclipse for RCP and RAP Developers

Version: Indigo Release
Build id: 20101216-1529
Comment 6 Dani Megert CLA 2011-01-19 10:39:46 EST
(In reply to comment #5)
> Sorry, I didn't say the most important thing: the test case was created in, and
> is exported from Eclipse 3.7 M4 (M FOUR)
> 
> Eclipse for RCP and RAP Developers
> 
> Version: Indigo Release
> Build id: 20101216-1529

OK thanks. So that means it's not a duplicate of bug 151500 (or its fix wasn't good enough).
Comment 7 Dani Megert CLA 2011-01-19 11:44:48 EST
Can reproduce using N20110117-2000.
Comment 8 Eddie Galvez CLA 2011-01-19 12:24:41 EST
Just a note re: the change of Version - we ship a commercial product, currently based on Eclipse 3.6.latest, and 3.7 doesn't line up with our next release either, so if feasible, I'd like to ask that this be considered for 3.6 SR2
Comment 9 Olivier Thomann CLA 2011-01-19 12:29:19 EST
I think I found the root cause of the problem. The anchor is not well computed
in this case.
The fix for bug 151500 was about getting the parameter names. In your case, you
do get the parameter names, but they are not retrieved from the javadoc (as
they should if javadoc would be available), but they are retrieved from the
debug info.
So the fix for 151500 was right I believe, it was simply not checking from what
source the parameter names were retrieved.

I am working on finalizing a fix for this. It is surprising that this was not
found before.

Sounds too late for me for 3.6.2 as this is not a regression over 3.5.2 or 3.4.2.
Daniel, you have the last word.
Comment 10 Olivier Thomann CLA 2011-01-19 15:08:47 EST
Created attachment 187145 [details]
Proposed fix + regression tests
Comment 11 Olivier Thomann CLA 2011-01-19 15:10:44 EST
Created attachment 187146 [details]
Test cases

Unzip these files inside /org.eclipse.jdt.core.tests.model/workspace/AttachedJavadocProject
Comment 12 Olivier Thomann CLA 2011-01-19 21:31:32 EST
Released for 3.7M5.
Comment 13 Dani Megert CLA 2011-01-21 02:08:27 EST
> Sounds too late for me for 3.6.2 as this is not a regression over 3.5.2 or
> 3.4.2.
> Daniel, you have the last word.
I agree.
Comment 14 Eddie Galvez CLA 2011-01-21 09:56:38 EST
pity (not allowing it for 3.6 SR2) -- we're working around this by beefing up the class javadoc (the one they get a chance to see, if they are lucky/smart enough to hover over it before the method itself) to tell them that in all constructors string argument 1 is xyz and string argument 2 is something else
Comment 15 Jay Arthanareeswaran CLA 2011-01-25 11:28:12 EST
Verified for 3.7M5 using build I20110124-1800.
Comment 16 Eddie Galvez CLA 2011-08-15 10:41:10 EDT
Note: I've taken steps to verify myself, and while the javadoc is fixed when hovering OVER an existing written-out invocation of the exception's constructor, when in content assist and choosing between more than one variant of the constructors, no javadoc informational panel shows!

To reproduce, simply add a new constructor, say:

/**
* javadoc for InnerFinalException(String property, Throwable cause)
* @param property the property argument
* @param cause the chained exception
*/
public InnerFinalException(String property, Throwable cause) {
}


then, you will notice that any call like

InnerFinalException e = new InnerFinalException([invoke-content-assist]

will display both constructors, but fail to display javadoc during the content assist chooser.

Would you prefer reopening this, or a new issue?
Comment 17 Dani Megert CLA 2011-08-15 11:16:03 EDT
> Would you prefer reopening this, or a new issue?
Please file a new bug.