Project: aptanastudio
Issue APSTUD-4797: PHP Autocomplete throws an NPE and shows error dialog
Trying to resolve APSTUD-190, I copied the original (incorrect) block from the description into a php file and tried to invoke content assist after "parent::". I get an error dialog complaining of an NPE. Here's the stack trace from the log: {code} !ENTRY org.eclipse.ui 4 4 2012-05-08 15:33:42.293 !MESSAGE "Content Assist" did not complete normally. Please see the log for more information. !ENTRY org.eclipse.ui 4 0 2012-05-08 15:33:42.294 !MESSAGE java.lang.NullPointerException !STACK 0 java.lang.NullPointerException com.aptana.editor.php.internal.indexer.UnpackedElementIndex.getEntries(UnpackedElementIndex.java:390) com.aptana.editor.php.internal.indexer.ModuleSubstitutionIndex.getEntries(ModuleSubstitutionIndex.java:64) com.aptana.editor.php.internal.contentAssist.PHPContentAssistProcessor.getClassEntries(PHPContentAssistProcessor.java:1209) com.aptana.editor.php.internal.contentAssist.PHPContentAssistProcessor.computeStaticDereferenceLeftEntries(PHPContentAssistProcessor.java:1121) com.aptana.editor.php.internal.contentAssist.PHPContentAssistProcessor.computeStaticDereferenceEntries(PHPContentAssistProcessor.java:822) com.aptana.editor.php.internal.contentAssist.PHPContentAssistProcessor.dereferencingStaticCompletion(PHPContentAssistProcessor.java:772) com.aptana.editor.php.internal.contentAssist.PHPContentAssistProcessor.computeCompletionProposalInternal(PHPContentAssistProcessor.java:555) com.aptana.editor.php.internal.contentAssist.PHPContentAssistProcessor.computeCompletionProposals(PHPContentAssistProcessor.java:485) com.aptana.editor.php.internal.contentAssist.PHPContentAssistProcessor.computeCompletionProposals(PHPContentAssistProcessor.java:306) com.aptana.editor.common.CommonContentAssistProcessor.doComputeCompletionProposals(CommonContentAssistProcessor.java:500) com.aptana.editor.common.CommonContentAssistProcessor.computeCompletionProposals(CommonContentAssistProcessor.java:417) com.aptana.editor.common.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:2221) com.aptana.editor.common.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:394) com.aptana.editor.common.contentassist.CompletionProposalPopup.access$7(CompletionProposalPopup.java:388) com.aptana.editor.common.contentassist.CompletionProposalPopup$1.run(CompletionProposalPopup.java:331) org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) com.aptana.editor.common.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:325) com.aptana.editor.common.contentassist.ContentAssistant.showPossibleCompletions(ContentAssistant.java:2008) org.eclipse.jface.text.source.SourceViewer.doOperation(SourceViewer.java:930) org.eclipse.jface.text.source.projection.ProjectionViewer.doOperation(ProjectionViewer.java:1535) org.eclipse.ui.texteditor.ContentAssistAction$1.run(ContentAssistAction.java:82) org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) org.eclipse.ui.texteditor.ContentAssistAction.run(ContentAssistAction.java:80) org.eclipse.jface.action.Action.runWithEvent(Action.java:498) org.eclipse.ui.commands.ActionHandler.execute(ActionHandler.java:185) org.eclipse.ui.internal.handlers.LegacyHandlerWrapper.execute(LegacyHandlerWrapper.java:109) org.eclipse.core.commands.Command.executeWithChecks(Command.java:476) org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508) org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169) org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:468) org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:786) org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:885) org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:567) org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:508) org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:123) org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) org.eclipse.swt.widgets.Display.filterEvent(Display.java:1069) org.eclipse.swt.widgets.Display.sendEvent(Display.java:4127) org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1457) org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1480) org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1465) org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1494) org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1490) org.eclipse.swt.widgets.Canvas.sendKeyEvent(Canvas.java:493) org.eclipse.swt.widgets.Control.doCommandBySelector(Control.java:1060) org.eclipse.swt.widgets.Display.windowProc(Display.java:5563) org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method) org.eclipse.swt.internal.cocoa.NSResponder.interpretKeyEvents(NSResponder.java:68) org.eclipse.swt.widgets.Composite.keyDown(Composite.java:587) org.eclipse.swt.widgets.Display.windowProc(Display.java:5473) org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method) org.eclipse.swt.widgets.Widget.callSuper(Widget.java:220) org.eclipse.swt.widgets.Widget.windowSendEvent(Widget.java:2095) org.eclipse.swt.widgets.Shell.windowSendEvent(Shell.java:2253) org.eclipse.swt.widgets.Display.windowProc(Display.java:5535) org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method) org.eclipse.swt.widgets.Display.applicationSendEvent(Display.java:4989) org.eclipse.swt.widgets.Display.applicationProc(Display.java:5138) org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method) org.eclipse.swt.internal.cocoa.NSApplication.sendEvent(NSApplication.java:128) org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3610) org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701) org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665) org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499) org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679) org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668) org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) com.aptana.rcp.IDEApplication.start(IDEApplication.java:125) org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344) org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:597) org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622) org.eclipse.equinox.launcher.Main.basicRun(Main.java:577) org.eclipse.equinox.launcher.Main.run(Main.java:1410) {code}
Story points: 3