Bug 95862 NPE in CompletionProposalCollector
N20050517-0010 Found in .log, sorry no steps. Nothing strange seen in the UI !ENTRY org.eclipse.ui 4 4 2005-05-18 22:18:15.713 !MESSAGE Unhandled event loop exception !ENTRY org.eclipse.ui 4 0 2005-05-18 22:18:15.713 !MESSAGE Failed to execute runnable (java.lang.NullPointerException) !STACK 0 org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NullPointerException) at org.eclipse.swt.SWT.error(SWT.java:2940) at org.eclipse.swt.SWT.error(SWT.java:2863) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:121) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:2898) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2557) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1601) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1565) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:315) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:230) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:371) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:160) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:330) at org.eclipse.core.launcher.Main.basicRun(Main.java:274) at org.eclipse.core.launcher.Main.run(Main.java:977) at org.eclipse.core.launcher.Main.main(Main.java:952) Caused by: java.lang.NullPointerException at org.eclipse.jdt.ui.text.java.CompletionProposalCollector.<init>(CompletionProposalCollector.java:129) at org.eclipse.jdt.internal.ui.text.java.ExperimentalResultCollector.<init>(ExperimentalResultCollector.java:33) at org.eclipse.jdt.internal.ui.text.java.JavaCompletionProcessor.internalComputeCompletionProposals(JavaCompletionProcessor.java:323) at org.eclipse.jdt.internal.ui.text.java.JavaCompletionProcessor.computeCompletionProposals(JavaCompletionProcessor.java:313) at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1499) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:256) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$7(CompletionProposalPopup.java:253) at org.eclipse.jface.text.contentassist.CompletionProposalPopup$1.run(CompletionProposalPopup.java:216) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:211) at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:327) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:118) ... 18 more
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaCompletionProcessor.java
import org.eclipse.swt.widgets.Shell;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.ITextViewer;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.text.contentassist.IContextInformation;
import org.eclipse.jface.text.contentassist.IContextInformationExtension;
import org.eclipse.jface.text.contentassist.IContextInformationValidator;
import org.eclipse.jface.text.templates.TemplateContextType;
import org.eclipse.ui.IEditorPart;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.corext.template.java.JavaContextType;
import org.eclipse.jdt.ui.IWorkingCopyManager;
import org.eclipse.jdt.ui.PreferenceConstants;
import org.eclipse.jdt.ui.text.java.IJavaCompletionProposal;
import org.eclipse.jdt.ui.text.java.CompletionProposalCollector;
import org.eclipse.jdt.ui.text.java.CompletionProposalComparator;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.JavaUIMessages;
import org.eclipse.jdt.internal.ui.text.JavaCodeReader;
import org.eclipse.jdt.internal.ui.text.template.contentassist.TemplateEngine;
import org.eclipse.jdt.internal.ui.text.template.contentassist.TemplateProposal;
/**
 * Java completion processor.
 */
public class JavaCompletionProcessor implements IContentAssistProcessor {