Community
Participate
Working Groups
Build ID: I20050627-1435 Steps To Reproduce: Hi, In order you could reproduce this problem iseally. It would be best if I could send you my project. In my project there is a class GUIClass. In this class it has different attributes and methods. It has also : ActionListener actionListener = new ActionListener() { public void actionPerformed(ActionEvent buttonPressed) { . . . } }; actionPerformed(...) method is very long and complicated and when I press in other class methods ctrl+space I get for some reason "No completions available". If I write simple actionPerformed(...) method than everything is working fine. It is important to mention that the project is compiling and running without any problem.
Created attachment 56452 [details] project to use in order to reproduce the problem Hi, This is the project on which you can reproduce the problem. If you open in IDE(Eclipse) GUIClass.java file and tru in constructor to write, "this." and press "ctrl+shift" you'll see the problem. If you swap: ActionListener actionListener = new ActionListener() { public void actionPerformed(ActionEvent buttonPressed) {...} }; with other one, which has a small or empty actionPerformed(...) method you will see that this problem does not occure.
Can reproduce using I20070418-1012. >GUIClass.java file and tru in constructor to write, "this." and >press "ctrl+shift" you'll see the problem. Simply open the constructor and try "this.<code assist>" ==> no results.
Hello, I have the same problem, i try extending a class to ActionListener and when i do ctrl + space it gives me the same error. The interesting thing is, it only happens in one project of my workspace. I tried to remove the project and add it without any project's configuration files and still it gives the same error. I tried to remove the entire workspace and remove the .metadata folder and import it back again.. same problem occurs. I even formatted by computer and same problem occurs. I tried both Eclipse 3.3.2 and Eclipse Ganymede 3.4M7 and same problem occurs. I remember installing Java EE and tried to program with eclipse with it.. i think the problems started happening ever since. But if that was the problem.. i think formatting or even removing the Java EE from my computer would fix the problem. I think some configuration file was changed and keeps giveing the same error over and over again. There was another time that this error occured, i dont remember much details but it was solved when i changed to an empty workspace.
Did you eventually have Mylyin/Mylar installed? If so, go and reset the advanced content assist prefs to its defaults.
(In reply to comment #2) > Can reproduce using I20070418-1012. > > >GUIClass.java file and tru in constructor to write, "this." and > >press "ctrl+shift" you'll see the problem. > Simply open the constructor and try "this.<code assist>" > ==> no results. > Hi, Although for me this problem is not relevant as I am not working on mentioned project (please see attached file) anymore. It will be great if this issue could be solved so other eclipse users won't have such problem. This message was opened about 1.5 years ago. It would be great if you could at least add some resolution plan when this problem will be solved. Best regards, Yevgeny
The original problem is caused by a bug in the CompletionParser. The test case to reproduce it must contain an anonymous class in a field initializer. The anonymous class must contain a lot of 'if/else' statements with a variable in the last 'else' body. eg: package p; public class X { public X() { this.// do ctrl+space here } Object field = new Object() { public void foo() { if(true) {} else if(true) {} else if(true) {} ... else if(true) {} else if(true) {} else if(true) { if(true) { if(true) { boolean result[][]; } } } } }; } This test case cause an exception. This exception is caught and the completion operation fail silently and display "No completions available". java.lang.ArrayIndexOutOfBoundsException: 50 at org.eclipse.jdt.internal.codeassist.complete.CompletionParser.consumeEnterVariable(CompletionParser.java:2224) at org.eclipse.jdt.internal.compiler.parser.Parser.consumeRule(Parser.java:5346) at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:9270) at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:9498) at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:9455) at org.eclipse.jdt.internal.compiler.parser.Parser.dietParse(Parser.java:8102) at org.eclipse.jdt.internal.codeassist.complete.CompletionParser.dietParse(CompletionParser.java:4120) In the Yevgeny's test case there is 36 'else if(...)' statements and the problem do not appear with 35 or 37 of these statements. This bug is not a regression and exists since 2002. As we are late in 3.4 release cycle then a fix for this bug is too dangerous for 3.4. We should fix it in 3.5. The problem described in comment 3 seems to be different. Phil - Could you enter a separate bug report for you problem ?
Created attachment 100882 [details] Potential fix
Another symptom of this bug: 1) create X.java public class X { # int[] i; Obj| x; // do ctrl+space at | } 2) do ctrl+space at | location There is no proposal.
The comment i posted is wrong, i was using extends instead of implements (thats what happens when we program at night) after i used implements it showed the ActionListener interface. I do agree that the "No completions available" should give more details about what exactly the problem is. Sorry for any incovenience.
Created attachment 107713 [details] Proposed fix
Released for 3.5M1 Tests added CompletionTests#testBug169682a() -> testBug169682b()
Verified for 3.5M1 using I20080805-1307