Community
Participate
Working Groups
Dear JDT team. this came in via the automated error reporting. I don't think this problem is unique to or caused by Code Recommender's subwords completion, as all it does is call CompilationUnit.codeComplete (with a valid offset, of course). I hope the stack trace is enough to construct a scenario to reproduce this error (at least, it mentions a couple of AST nodes :-). The following incident was reported via the automated error reporting: code: 1 plugin: org.eclipse.recommenders.subwords.rcp_2.2.0.v20150603-1713 message: Exception during code completion fingerprint: 52f77094 exception class: java.lang.NullPointerException exception message: - number of children: 0 java.lang.NullPointerException: null at org.eclipse.jdt.internal.compiler.problem.ProblemReporter.typesAsString(ProblemReporter.java:7973) at org.eclipse.jdt.internal.compiler.problem.ProblemReporter.typesAsString(ProblemReporter.java:7931) at org.eclipse.jdt.internal.compiler.problem.ProblemReporter.typesAsString(ProblemReporter.java:7928) at org.eclipse.jdt.internal.compiler.problem.ProblemReporter.invalidConstructor(ProblemReporter.java:3738) at org.eclipse.jdt.internal.compiler.ast.AllocationExpression.resolveType(AllocationExpression.java:474) at org.eclipse.jdt.internal.codeassist.complete.CompletionOnMemberAccess.resolveType(CompletionOnMemberAccess.java:56) at org.eclipse.jdt.internal.compiler.ast.Expression.resolve(Expression.java:1020) at org.eclipse.jdt.internal.compiler.ast.Block.resolve(Block.java:117) at org.eclipse.jdt.internal.compiler.ast.LambdaExpression.resolveType(LambdaExpression.java:428) at org.eclipse.jdt.internal.compiler.ast.ArrayInitializer.resolveTypeExpecting(ArrayInitializer.java:186) at org.eclipse.jdt.internal.compiler.ast.ArrayAllocationExpression.resolveType(ArrayAllocationExpression.java:195) at org.eclipse.jdt.internal.compiler.ast.AllocationExpression.resolveType(AllocationExpression.java:404) at org.eclipse.jdt.internal.codeassist.complete.CompletionOnMemberAccess.resolveType(CompletionOnMemberAccess.java:56) at org.eclipse.jdt.internal.compiler.ast.Expression.resolve(Expression.java:1020) at org.eclipse.jdt.internal.compiler.ast.Block.resolve(Block.java:117) at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements(AbstractMethodDeclaration.java:641) at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:309) at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:551) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1188) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1301) at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:590) at org.eclipse.jdt.internal.codeassist.CompletionEngine.complete(CompletionEngine.java:1923) at org.eclipse.jdt.internal.core.Openable.codeComplete(Openable.java:131) at org.eclipse.jdt.internal.core.CompilationUnit.codeComplete(CompilationUnit.java:357) at org.eclipse.jdt.internal.core.CompilationUnit.codeComplete(CompilationUnit.java:345) at org.eclipse.recommenders.internal.subwords.rcp.SubwordsSessionProcessor.initializeContext(SubwordsSessionProcessor.java:115) at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireInitializeContext(IntelligentCompletionProposalComputer.java:243) at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:135) at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:322) at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:279) at org.eclipse.jface.text.contentassist.ContentAssistant$5.run(ContentAssistant.java:1904) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1902) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:384) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4024) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3700) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1127) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1018) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:654) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:598) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:139) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) at sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:-2) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:669) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608) at org.eclipse.equinox.launcher.Main.run(Main.java:1515) General Information: reported-by: Doug Schaefer anonymous-id: 89f3853b-8ec3-4e7d-b4b1-8d6ba0a6d791 eclipse-build-id: 4.5.0.I20150603-2000 eclipse-product: org.eclipse.epp.package.java.product operating system: MacOSX 10.9.5 (x86_64) - cocoa jre-version: 1.8.0_40-b25 The following plug-ins were present on the execution stack (*): 1. org.eclipse.core.databinding.observable_1.5.0.v20150422-0725 2. org.eclipse.core.databinding_1.5.0.v20150422-0725 3. org.eclipse.core.runtime_3.11.0.v20150405-1723 4. org.eclipse.e4.ui.workbench_1.3.0.v20150531-1948 5. org.eclipse.e4.ui.workbench.swt_0.13.0.v20150504-0621 6. org.eclipse.equinox.app_1.3.300.v20150423-1356 7. org.eclipse.equinox.launcher_1.3.100.v20150511-1540 8. org.eclipse.jdt_3.11.0.v20150603-2000 9. org.eclipse.jdt.core_3.11.0.v20150602-1242 10. org.eclipse.jdt.ui_3.11.0.v20150527-0925 11. org.eclipse.jface.text_3.10.0.v20150603-1752 12. org.eclipse.jface_3.11.0.v20150602-1400 13. org.eclipse.recommenders.completion.rcp_2.2.0.v20150603-1715 14. org.eclipse.recommenders.subwords.rcp_2.2.0.v20150603-1713 15. org.eclipse.swt_3.104.0.v20150528-0211 16. org.eclipse.ui_3.107.0.v20150507-1945 17. org.eclipse.ui.ide.application_1.1.0.v20150422-0725 18. org.eclipse.ui.ide_3.11.0.v20150510-1749 Please note that: * Messages, stacktraces, and nested status objects may be shortened. * Bug fields like status, resolution, and whiteboard are sent back to reporters. * The list of present bundles and their respective versions was calculated by package naming heuristics. This may or may not reflect reality. Other Resources: * Report: https://dev.eclipse.org/recommenders/committers/confess/#/problems/5586f327e4b08735226aa5b4 * Manual: https://dev.eclipse.org/recommenders/community/confess/#/guide Thank you for your assistance. Your friendly error-reports-inbox. This bug was created on behalf of andreas.sewe@codetrails.com.
(In reply to EPP Error Reports from comment #0) > Dear JDT team. > > this came in via the automated error reporting. I don't think this problem > is unique to or caused by Code Recommender's subwords completion, as all it > does is call CompilationUnit.codeComplete (with a valid offset, of course). > I hope the stack trace is enough to construct a scenario to reproduce this > error (at least, it mentions a couple of AST nodes :-). Thanks, but I'm afraid we need more than the list of enclosing AST nodes, we need the binding of the constructor being referenced. One of its parameters seems to be null.
Does it make sense to add a few lines to add this information to the logged output? Maybe for M1?
*** Bug 514775 has been marked as a duplicate of this bug. ***
Bug 514775 has an example.
*** Bug 515760 has been marked as a duplicate of this bug. ***
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.
(In reply to Dani Megert from comment #4) > Bug 514775 has an example. I tried completing that example in various ways but even that example doesn't suffice to reproduce.