Bug 10387 Code Assist crashes on constructor parameters
Using Nightly 0227 (but it's been present for since before the previous stable build) I get an exception thrown whenever I do code-assist on constructor parameters. example: throw new FlowHandlerException(<code-assist> "fillin argument names on completion" doesn't appear to change this. FlowHandlerException is a standard 1.1-type exception ( ie/ 2 constructors, () and (String) ) Eclipse nightly 20020227, PIII-800, 512 Megs ram, Win2k Stack trace: org.eclipse.jface.util.Assert$AssertionFailedException: null argument; at org.eclipse.jface.util.Assert.isNotNull(Assert.java:133) at org.eclipse.jface.util.Assert.isNotNull(Assert.java:110) at org.eclipse.jdt.internal.ui.text.java.AnonymousTypeCompletionProposal.<init>(AnonymousTypeCompletionProposal.java:39) at org.eclipse.jdt.internal.ui.text.java.ResultCollector.createAnonymousTypeCompletion(ResultCollector.java:346) at org.eclipse.jdt.internal.ui.text.java.ResultCollector.acceptAnonymousType(ResultCollector.java:142) at org.eclipse.jdt.internal.core.CompletionRequestorWrapper.acceptAnonymousType(CompletionRequestorWrapper.java:42) at org.eclipse.jdt.internal.codeassist.CompletionEngine.findConstructors(CompletionEngine.java:810) at org.eclipse.jdt.internal.codeassist.CompletionEngine.findAnonymousType(CompletionEngine.java:736) at org.eclipse.jdt.internal.codeassist.CompletionEngine.complete(CompletionEngine.java:521) at org.eclipse.jdt.internal.codeassist.CompletionEngine.complete(CompletionEngine.java:673) at org.eclipse.jdt.internal.core.Openable.codeComplete(Openable.java:113) at org.eclipse.jdt.internal.core.CompilationUnit.codeComplete(CompilationUnit.java:64) at org.eclipse.jdt.internal.ui.text.java.JavaCompletionProcessor.computeCompletionProposals(JavaCompletionProcessor.java:312) at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1197) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:103) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$3(CompletionProposalPopup.java:102) at org.eclipse.jface.text.contentassist.CompletionProposalPopup$1.run(CompletionProposalPopup.java:71) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:56) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:66) at org.eclipse.jface.text.contentassist.ContentAssistant.showPossibleCompletions(ContentAssistant.java:1132) at org.eclipse.jface.text.source.SourceViewer.doOperation(SourceViewer.java:368) at org.eclipse.ui.texteditor.TextOperationAction.run(TextOperationAction.java:61) at org.eclipse.ui.texteditor.RetargetTextEditorAction.run(RetargetTextEditorAction.java:103) at org.eclipse.jface.action.Action.runWithEvent(Action.java:452) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent(ActionContributionItem.java:361) at org.eclipse.jface.action.ActionContributionItem.access$0(ActionContributionItem.java:352) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent(ActionContributionItem.java:47) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:74) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:637) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1420) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1208) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:788) at org.eclipse.ui.internal.Workbench.run(Workbench.java:771) at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:777) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:319) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:151) at org.eclipse.core.launcher.Main.run(Main.java:502) at org.eclipse.core.launcher.Main.main(Main.java:362)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/ResultCollector.java
package org.eclipse.jdt.internal.ui.text.java;
/*
 * (c) Copyright IBM Corp. 2000, 2001.
 * All Rights Reserved.
 */
  
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.core.resources.IMarker;
import org.eclipse.jdt.core.Flags;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.ICompletionRequestor;
import org.eclipse.jdt.core.IImportDeclaration;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.internal.corext.util.JavaModelUtil;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.JavaPluginImages;
import org.eclipse.jdt.internal.ui.viewsupport.ImageDescriptorRegistry;
import org.eclipse.jdt.ui.JavaElementImageDescriptor;
/**
 * Bin to collect the proposal of the infrastructure on code assist in a java text.
 */
public class ResultCollector implements ICompletionRequestor {