Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 367612 - Content assist doesn't work on some anonymous inner classes when there are a lot of them.
Summary: Content assist doesn't work on some anonymous inner classes when there are a ...
Status: CLOSED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.8   Edit
Hardware: PC Linux
: P3 normal with 5 votes (vote)
Target Milestone: ---   Edit
Assignee: Ayushman Jain CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-29 02:31 EST by Missing name CLA
Modified: 2020-03-16 10:33 EDT (History)
10 users (show)

See Also:


Attachments
code assist broken with array of AIC (105.36 KB, image/png)
2012-01-18 17:10 EST, Missing name CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Missing name CLA 2011-12-29 02:31:42 EST
Build Identifier: 20110916-0149

I have a class with 54 inner classes and content assist doesn't work on some of them, but works on others.

Reproducible: Always

Steps to Reproduce:
1.Get class with many inner classes
2.Do ctrl+space on some inner classes
3.See that on some of them it doesn't work
Comment 1 Missing name CLA 2011-12-29 02:33:04 EST
Anonymous inner classes.
Comment 2 Stephan Herrmann CLA 2011-12-29 04:21:47 EST
Gasan, it would greatly help if you can give some more information
about those anonymous classes where content assist doesn't work.
(It is certainly not a matter of the number of inner classes :) )

Some questions: 
Do you have compile errors in your code when you hit Ctrl-space?
Can you see a correlation between the super type of your anonymous
classes and on which of them content assist is broken?
Does the bug occur in specific control structures, e.g., if the
anonymous class is created inside a loop or a try-catch etc.?
Where exactly do you invoke content assist? Inside a method of
the anonymous class or in the body of the class (as to create
a new method override)?

Ideally, you might strip down your example to a test case that
you can attach to this bug.
Comment 3 Missing name CLA 2011-12-29 07:46:17 EST
Stephan,

1. Do you have compile errors in your code when you hit Ctrl-space? 
-No, I don't
2. Can you see a correlation between the super type of your anonymous
classes and on which of them content assist is broken? 
-There are 3 types of supertypes of anonymous classes and for 1 specified superclass some anonymous classes are working and some don't.
3. Does the bug occur in specific control structures, e.g., if the
anonymous class is created inside a loop or a try-catch etc.? 
-All classes are constructed inside method call: foo(new Parent("param"){}); foo(new 
AnotherParent("param"){}); etc.
4. Where exactly do you invoke content assist? Inside a method of
the anonymous class or in the body of the class (as to create
a new method override)? 
-Content assist doesn't work both inside methods of anonymous class and it's body, e.g. if I try to add a field to that anonymous class and write: public String foo = "asdf" then dot (.) then press ctrl+space(content assist), it doesn't show anything.

As for sample, I'll try to do that lately.
Comment 4 Stephan Herrmann CLA 2011-12-29 13:21:20 EST
Thanks, Gasan, for your replies. Unfortunately this doesn't yet give
a clue why in some locations content assist does not work.
If you find anything that distinguishes the broken locations please 
let us know.

(In reply to comment #3)
> As for sample, I'll try to do that lately.

Yes, please. At this point this may be the only way how we can reproduce 
(and fix) the problem.
Comment 5 Srikanth Sankaran CLA 2012-01-03 01:08:10 EST
See also bug 306908, bug 311356, bug 318192, bug 336620.
Comment 6 Missing name CLA 2012-01-18 17:09:12 EST
I not sure if it's related to this but I can always reproduce the following:
If one has an array of anonymous inner classes with more that one item then CC breaks. If the array has only one item, the CC works fine. 
See the attached print screen where CTRL+SPACE at line 12 yields only templates.
Comment 7 Missing name CLA 2012-01-18 17:10:35 EST
Created attachment 209710 [details]
code assist broken with array of AIC
Comment 8 Missing name CLA 2012-01-18 17:12:27 EST
Forgot to mention context:

Version: Indigo Service Release 1
Build id: 20110916-0149
Win7 64-bit

Maybe I should open a new issue?
Comment 9 Tom Eugelink CLA 2012-05-10 07:09:08 EDT
I've got a simple case where this code completion is not working; a AIC provided as a argument to a constructor of another AIC.

http://www.eclipse.org/forums/index.php?t=rview&goto=870951#msg_870951
Comment 10 Ayushman Jain CLA 2012-05-10 08:18:25 EDT
(In reply to comment #9)
> I've got a simple case where this code completion is not working; a AIC
> provided as a argument to a constructor of another AIC.
> 
> http://www.eclipse.org/forums/index.php?t=rview&goto=870951#msg_870951

Thanks for the test case.
Comment 11 Eclipse Genie CLA 2020-03-16 10:33:57 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.