Community
Participate
Working Groups
I find that auto-completion with JDT is doing weird stuff with nested classes (both Functional implementations and solid implementations). I am not sure how many are connected, but I'll report them one by one. This bug is hard for me to pinpoint, but I'll try to sum up as much as I can. I noticed this only happening with the JavaFX's TableCell/ListCell/TreeCell/TreeTableCell classes (or any subClass of it). I usually use them as follow: public void init() { TableColumn<String, Object> c = new TableColumn<>(); c.setCellFactory(C -> { return new TableCell<String, Object>() { // all the content }; }); } Again I only noticed this with the above mentioned classes, I tried reproducing it with other classes, but I didn't got any of the following results. - When completely empty (or sometime just at random), no autocomplete results are displayed. - When initiating an method-override it will sometimes result in the following: return new TableCell<String, Object>() { protected void updateItem(Object item, boolean empty) {}; {}; }; instead of the expected: return new TableCell<String, Object>() { @Override public void updateIndex(int i) { // TODO Auto-generated method stub super.updateIndex(i); } }; - At some point autocomplete will start to fail with a RuntimeException (posted at the bottom for readability) at which point eclipse is just unusable within the scope of the nested class. For all the other issues things are not always the same, sometimes it will work, sometimes not. But when it comes to this point, I am unable to find a quick-fix or a workaround. I usually end up typing everything commented out, and afterward uncommenting everything in order to make it workable (as every '.' character will also trigger the autocomplete...). Stacktrace/Error produced by the autocomplete within the nested Class declaration. org.eclipse.recommenders.completion.rcp Error Mon May 06 22:42:40 CEST 2019 Exception during code completion. java.lang.NullPointerException at org.eclipse.jdt.internal.compiler.ast.QualifiedAllocationExpression.getAnonymousConstructorBinding(QualifiedAllocationExpression.java:659) at org.eclipse.jdt.internal.compiler.ast.QualifiedAllocationExpression.resolveTypeForQualifiedAllocationExpression(QualifiedAllocationExpression.java:553) at org.eclipse.jdt.internal.compiler.ast.QualifiedAllocationExpression.resolveType(QualifiedAllocationExpression.java:303) at org.eclipse.jdt.internal.compiler.ast.Assignment.resolveType(Assignment.java:214) at org.eclipse.jdt.internal.compiler.ast.Expression.resolve(Expression.java:1034) at org.eclipse.jdt.internal.compiler.ast.Block.resolve(Block.java:125) at org.eclipse.jdt.internal.compiler.ast.Initializer.resolve(Initializer.java:135) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1165) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1328) at org.eclipse.jdt.internal.compiler.ast.QualifiedAllocationExpression.getAnonymousConstructorBinding(QualifiedAllocationExpression.java:662) at org.eclipse.jdt.internal.compiler.ast.QualifiedAllocationExpression.resolveTypeForQualifiedAllocationExpression(QualifiedAllocationExpression.java:553) at org.eclipse.jdt.internal.compiler.ast.QualifiedAllocationExpression.resolveType(QualifiedAllocationExpression.java:303) at org.eclipse.jdt.internal.compiler.ast.LocalDeclaration.resolve(LocalDeclaration.java:379) at org.eclipse.jdt.internal.compiler.ast.Block.resolve(Block.java:125) at org.eclipse.jdt.internal.compiler.ast.LambdaExpression.resolveType(LambdaExpression.java:449) at org.eclipse.jdt.internal.compiler.ast.ASTNode.resolvePolyExpressionArguments(ASTNode.java:705) at org.eclipse.jdt.internal.compiler.ast.MessageSend.findMethodBinding(MessageSend.java:959) at org.eclipse.jdt.internal.compiler.ast.MessageSend.resolveType(MessageSend.java:773) at org.eclipse.jdt.internal.compiler.ast.Expression.resolve(Expression.java:1034) at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements(AbstractMethodDeclaration.java:641) at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:316) at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:551) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1229) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1353) at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:656) at org.eclipse.jdt.internal.codeassist.CompletionEngine.complete(CompletionEngine.java:2250) at org.eclipse.jdt.internal.core.Openable.codeComplete(Openable.java:136) at org.eclipse.jdt.internal.core.CompilationUnit.codeComplete(CompilationUnit.java:368) at org.eclipse.jdt.internal.core.CompilationUnit.codeComplete(CompilationUnit.java:358) at org.eclipse.recommenders.completion.rcp.CompletionContextFunctions$InternalCompletionContextFunction.compute(CompletionContextFunctions.java:407) at org.eclipse.recommenders.completion.rcp.RecommendersCompletionContext.get(RecommendersCompletionContext.java:325) at org.eclipse.recommenders.completion.rcp.RecommendersCompletionContext.get(RecommendersCompletionContext.java:333) at org.eclipse.recommenders.completion.rcp.RecommendersCompletionContext.getProposals(RecommendersCompletionContext.java:241) at org.eclipse.recommenders.internal.statics.rcp.StaticsCompletionSessionProcessor.startSession(StaticsCompletionSessionProcessor.java:87) at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:305) at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:171) at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:336) at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:340) at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:334) at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:291) at org.eclipse.jface.text.contentassist.ContentAssistant$2.lambda$0(ContentAssistant.java:2012) at java.util.Collections$SingletonSet.forEach(Unknown Source) at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:2011) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:2008) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:561) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.lambda$0(CompletionProposalPopup.java:491) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:72) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:486) at org.eclipse.jface.text.contentassist.ContentAssistant.showPossibleCompletions(ContentAssistant.java:1822) at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor$AdaptedSourceViewer.doOperation(CompilationUnitEditor.java:189) at org.eclipse.ui.texteditor.ContentAssistAction.lambda$0(ContentAssistAction.java:85) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:72) at org.eclipse.ui.texteditor.ContentAssistAction.run(ContentAssistAction.java:84) at org.eclipse.jface.action.Action.runWithEvent(Action.java:476) at org.eclipse.jface.commands.ActionHandler.execute(ActionHandler.java:121) at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:96) at sun.reflect.GeneratedMethodAccessor44.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58) at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:320) at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:254) at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:164) at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:156) at org.eclipse.core.commands.Command.executeWithChecks(Command.java:497) at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:490) at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:207) at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.executeCommand(KeyBindingDispatcher.java:308) at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.press(KeyBindingDispatcher.java:582) at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.processKeyEvent(KeyBindingDispatcher.java:651) at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.filterKeySequenceBindings(KeyBindingDispatcher.java:441) at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.access$2(KeyBindingDispatcher.java:384) at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher$KeyDownFilter.handleEvent(KeyBindingDispatcher.java:96) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89) at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1193) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1054) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1064) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1106) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1102) at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1489) at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4888) at org.eclipse.swt.widgets.Canvas.WM_CHAR(Canvas.java:353) at org.eclipse.swt.widgets.Control.windowProc(Control.java:4768) at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:348) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4784) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2309) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3559) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1173) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1062) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156) at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:628) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:563) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:151) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:155) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:199) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:391) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:246) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:595) at org.eclipse.equinox.launcher.Main.run(Main.java:1501)
I see you are using 4.9. Please try with https://download.eclipse.org/eclipse/downloads/drops4/S-4.12M1-201904110625/
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. If you have further information on the current state of the bug, please add it. 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.