Bug 209936 - [javadoc] Missing code implementation in the compiler on inner classes
Summary: [javadoc] Missing code implementation in the compiler on inner classes
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.4 M5   Edit
Assignee: Eric Jodet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-15 08:45 EST by Christophe Fondacci CLA
Modified: 2008-02-05 10:35 EST (History)
4 users (show)

See Also:


Attachments
Source code which generates the bug (25.66 KB, application/octet-stream)
2007-11-15 08:45 EST, Christophe Fondacci CLA
no flags Details
[proposed patch + test case] on top v826 - all jdt.core tests OK (3.82 KB, patch)
2007-11-30 11:58 EST, Eric Jodet CLA
no flags Details | Diff
[proposed patch + test cases] on top v827 - all jdt.core tests OK (18.53 KB, patch)
2007-12-07 02:36 EST, Eric Jodet CLA
no flags Details | Diff
[proposed patch + test case] on top v829 - all jdt.core tests OK (32.67 KB, patch)
2007-12-14 08:29 EST, Eric Jodet CLA
no flags Details | Diff
[proposed patch + test case] on top v829 - all jdt.core tests OK (34.56 KB, patch)
2007-12-17 00:56 EST, Eric Jodet CLA
no flags Details | Diff
[proposed patch + test case] on top v830 - all jdt.core tests OK (58.53 KB, patch)
2008-01-07 09:09 EST, Eric Jodet CLA
no flags Details | Diff
[ready to import project to test the bug] (3.83 KB, application/x-zip-compressed)
2008-02-05 09:30 EST, Eric Jodet CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christophe Fondacci CLA 2007-11-15 08:45:10 EST
Created attachment 82960 [details]
Source code which generates the bug

Build ID: M20071023-1652

Steps To Reproduce:
I am not able to reproduce it in a new test case. I have cleaned my source code to make it as short as possible and attached it to this bug. I have put only the source code, because with external libs it is quite huge. You will have many errors due to missing external librairies but the bug "Missing code implementation..." will still be in the error list.

So the steps are :
1- Create a new projet
2- Extract the attached source zipped code in the project folder
3- Compile with eclipse
4- Look for the 'Missing code implementation in the compiler' error

More information:
It seems to be caused by inner class extensions using generalized classes...
Don't hesitate to contact me to know more.
Comment 1 Philipe Mulet CLA 2007-11-15 09:26:04 EST
Suspecting some interference of ParameterizedTypeBinding with generic type layer (SourceTypeBinding/MemberTypeBinding) and a missing #erasure() call somewhere.

Olivier - if you could reproduce, this would be great (then reassign back to me)
Comment 2 Olivier Thomann CLA 2007-11-15 10:08:48 EST
The problem occurs because there is a wrong reference in javadoc.
The guilty javadoc is inside the member type ParentModelListener located in the top level type com.nextep.datadesigner.gui.model.TableDisplayConnector.

The method is #dispatchEvent(ChangeEvent event, IObservable source, Object data).

Are you using the batch compiler or you are compiling from within the IDE ?
Are you compiling in 1.5 or 1.6 mode ?

If you comment out this comment, your code should compile.
I will isolate a small test case.

Thanks for the test case.
Comment 3 Christophe Fondacci CLA 2007-11-15 10:33:06 EST
You are right!! When i comment the javadoc comments on dispatchEvent the compiler bug disapear. 

BUT, this seems to me weird that the javadoc comment on the setModel method doesn't throw the same compiler error since there is the exact same mistake in the javadoc reference on this method.

I am compiling directly from the eclipse IDE, nothing specific.
I am compiling with jdk 1.6.0_02-b06 with the compliance set to "6.0".


Thank you for your help and reactivity.


(In reply to comment #2)
> The problem occurs because there is a wrong reference in javadoc.
> The guilty javadoc is inside the member type ParentModelListener located in the
> top level type com.nextep.datadesigner.gui.model.TableDisplayConnector.
> The method is #dispatchEvent(ChangeEvent event, IObservable source, Object
> data).
> Are you using the batch compiler or you are compiling from within the IDE ?
> Are you compiling in 1.5 or 1.6 mode ?
> If you comment out this comment, your code should compile.
> I will isolate a small test case.
> Thanks for the test case.

Comment 4 Olivier Thomann CLA 2007-11-15 11:44:16 EST
Added regression test org.eclipse.jdt.core.tests.compiler.regression.JavadocTest_1_5#_testBug209936()

Eric, once fixed please reenable the test.
The problem is reproducable either in 1.6 mode (where -enableJavadoc is enabled by default) or in 1.5 mode with -enableJavadoc.

We might want to backport to 3.3.2.
Comment 5 Olivier Thomann CLA 2007-11-15 11:46:23 EST
The test doesn't contain the right error. This will need to be fixed once we don't throw the missing implementation error anymore.
Comment 6 Philipe Mulet CLA 2007-11-16 08:59:05 EST
Released some changes to at least locate the error on the offending AST node.
Comment 7 Eric Jodet CLA 2007-11-30 11:58:39 EST
Created attachment 84203 [details]
[proposed patch + test case] on top v826 - all jdt.core tests OK

Now handle the ProblemReasons.ReceiverTypeNotVisible pb id

warning/error message is now displayed correctly:
sample: Javadoc: The method foo(Object, Object) from the type Z<T>.Member is not visible
Comment 8 Eric Jodet CLA 2007-11-30 12:02:49 EST
Patch released for 3.4M4 in HEAD.
Comment 9 Eric Jodet CLA 2007-12-07 00:53:57 EST
New proposed behavior will consist in converting all generic types to raw types, when referenced from within a Javadoc.

As a consequence, and contrary to comment#7, correct behavior should not raise a warning against the method not being visible, but rather against the type not being visible.
Member#foo(Object, Object)
^^^^^^
Javadoc: Invalid member type qualification

Comment 10 Eric Jodet CLA 2007-12-07 02:34:31 EST
see also bug 80257, bug 87868, bug 83127 for related issues
Comment 11 Eric Jodet CLA 2007-12-07 02:36:26 EST
Created attachment 84710 [details]
[proposed patch + test cases] on top v827 - all jdt.core tests OK

Frederic - may you please review proposed patch - thanks
Comment 12 Frederic Fusier CLA 2007-12-08 12:06:29 EST
(In reply to comment #11)
> Created an attachment (id=84710) [details]
> [proposed patch + test cases] on top v827 - all jdt.core tests OK
> 
> Frederic - may you please review proposed patch - thanks
> 
It seems that something is wrong as while testing your patch I saw that the tests you added to JavadocTest_1_5 didn't go into the loop when enclosing level is greater than 1.

Investigating further, it looks like that the solution should be more simple than the proposed patch.
Comment 13 Eric Jodet CLA 2007-12-14 08:29:04 EST
Created attachment 85267 [details]
[proposed patch + test case] on top v829 - all jdt.core tests OK

improved fix: new method added  to LookupEnvironment - Philippe may you please review - thanks
Comment 14 Philipe Mulet CLA 2007-12-14 09:47:53 EST
I am not a big fan of adding #deepConvertToRawType(...).
Feels like we should try to retrofit it in existing conversion method.

Wondering why conversion doesn't occur already when resolving a type name, could be that the javadoc node is not doing the right thing.
Comment 15 Eric Jodet CLA 2007-12-17 00:56:26 EST
Created attachment 85366 [details]
[proposed patch + test case] on top v829 - all jdt.core tests OK

(In reply to comment #14)
Improved patch.
Confirmed with Philippe that Javadoc had the specific need to (deep) raw convert references.
#deepConvertToRawType(...) moved from LookupEnvironment to Util for possible reuse.
Comment 16 Philipe Mulet CLA 2007-12-17 03:50:22 EST
I could imagine having a force flag on #convertToRawType(...) to force conversion of enclosing type.

#convertToRawType(boolean forceRawEnclosingType)

All existing senders (26) would call it with 'false', only javadoc would call it with 'true'.
Comment 17 Eric Jodet CLA 2008-01-07 09:09:59 EST
Created attachment 86312 [details]
[proposed patch + test case] on top v830 - all jdt.core tests OK

better patch
Comment 18 Eric Jodet CLA 2008-01-07 09:17:43 EST
Patch released for 3.4M5 in HEAD.
Comment 19 Eric Jodet CLA 2008-01-07 09:18:05 EST
fixed
Comment 20 Eric Jodet CLA 2008-02-05 09:30:48 EST
Created attachment 88878 [details]
[ready to import project to test the bug]

It might be not obvious in the bug history, but a partial fix for this bug went into M4, so that, at this level, the "missing compiler implementation" message is not displayed anymore.

To test this bug, use a 3.4 M3, import the above project and observe the error message: "Missing code implementation in the compiler"

After M4, this message won't show up anymore:
- in M4: a single line was added to the ProblemReporter to prevent the above message
- in M5, the bug was "really" fixed, and partial fix that went into M4 was removed.

Sorry for the confusion.
Comment 21 Eric Jodet CLA 2008-02-05 09:42:13 EST
(In reply to comment #20) - to sum-up (with the above attached project)
- before M4: missing compiler message
- at M4 level: warning Javadoc: The method foo(Object, Object) from the type Z<T>.Member is not visible
- at M5 level: no warning

Explanation: with the latest "real" fix (that went into M5),
all type generic type references in Javadoc comments are converted to raw type, the reason why the warning message displayed at M4 level is not displayed anymore.
Comment 22 Jerome Lanneluc CLA 2008-02-05 10:35:17 EST
Thanks for the explanation.

Verified for 3.4M5 using I20080205-0010