Project: aptanastudio
Issue APSTUD-7686: NullPointerException when trying to get a UserAgent for JS code assist
An exception occasionally happens when performing a code assist on a JS file: {code} Exception in thread "Aptana: ContentAssistant.assist_delay_timer_name" org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NullPointerException) org.eclipse.swt.SWT.error(SWT.java:4282) org.eclipse.swt.SWT.error(SWT.java:4197) org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:196) org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:150) org.eclipse.swt.widgets.Display.syncExec(Display.java:4613) com.aptana.editor.common.contentassist.ContentAssistant$AutoAssistListener.showAssist(ContentAssistant.java:456) com.aptana.editor.common.contentassist.ContentAssistant$AutoAssistListener.run(ContentAssistant.java:311) java.lang.Thread.run(Thread.java:680) Caused by: java.lang.NullPointerException com.aptana.core.internal.UserAgentManager.getUserAgentById(UserAgentManager.java:162) com.aptana.editor.common.contentassist.UserAgentManager.getUserAgentById(UserAgentManager.java:368) com.aptana.editor.common.contentassist.UserAgentManager.getUserAgentsByID(UserAgentManager.java:355) com.aptana.editor.common.contentassist.UserAgentManager.getActiveUserAgents(UserAgentManager.java:208) com.aptana.editor.common.contentassist.UserAgentManager.getUserAgentImages(UserAgentManager.java:309) com.aptana.editor.js.contentassist.JSContentAssistProcessor.addProposal(JSContentAssistProcessor.java:360) com.aptana.editor.js.contentassist.JSContentAssistProcessor.addKeywords(JSContentAssistProcessor.java:179) com.aptana.editor.js.contentassist.JSContentAssistProcessor.doComputeCompletionProposals(JSContentAssistProcessor.java:738) 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$AutoAssistListener$1.run(ContentAssistant.java:468) org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135) org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3938) org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3615) 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.appcelerator.titanium.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) org.eclipse.equinox.launcher.Main.main(Main.java:1386) {code}
Story points: 5