Community
Participate
Working Groups
Good day. Here's the line of code: new int[0].getClass(). when i press Ctrl+Space after that dot, i get a dialog message java.lang. IllegalArgumentException. This also takes place for some other primitive values, like byte[] or char[](i didn't check all of them). All's fine for Objects and Object arrays. I'm using Eclipse 3.2m2. I checked this line of code in Eclipse 3.1m7, it worked fine. Here's the stack trace: ======================================================================== !ENTRY org.eclipse.ui 4 4 2005-10-08 16:41:56.765 !MESSAGE "Content Assist" did not complete normally. Please see the log for more information. !ENTRY org.eclipse.ui 4 0 2005-10-08 16:41:56.765 !MESSAGE java.lang.IllegalArgumentException !STACK 0 java.lang.IllegalArgumentException at org.eclipse.jdt.internal.core.util.Util.scanTypeBoundSignature(Util. java:2606) at org.eclipse.jdt.internal.core.util.Util.scanTypeSignature(Util.java: 2375) at org.eclipse.jdt.core.Signature.getReturnType(Signature.java:1635) at org.eclipse.jdt.ui.text.java.CompletionProposalLabelProvider. createMethodProposalLabel(CompletionProposalLabelProvider.java:182) at org.eclipse.jdt.ui.text.java.CompletionProposalLabelProvider. createLabel(CompletionProposalLabelProvider.java:351) at org.eclipse.jdt.internal.ui.text.java.LazyJavaCompletionProposal. computeDisplayString(LazyJavaCompletionProposal.java:442) at org.eclipse.jdt.internal.ui.text.java.LazyJavaCompletionProposal. getDisplayString(LazyJavaCompletionProposal.java:436) at org.eclipse.jdt.internal.ui.text.java.LazyJavaCompletionProposal. computeSortString(LazyJavaCompletionProposal.java:803) at org.eclipse.jdt.internal.ui.text.java.LazyJavaCompletionProposal. getSortString(LazyJavaCompletionProposal.java:793) at org.eclipse.jdt.ui.text.java.CompletionProposalComparator. getSortKey(CompletionProposalComparator.java:73) at org.eclipse.jdt.ui.text.java.CompletionProposalComparator. compare(CompletionProposalComparator.java:68) at java.util.Arrays.mergeSort(Unknown Source) at java.util.Arrays.mergeSort(Unknown Source) at java.util.Arrays.mergeSort(Unknown Source) at java.util.Arrays.mergeSort(Unknown Source) at java.util.Arrays.mergeSort(Unknown Source) at java.util.Arrays.sort(Unknown Source) at java.util.Collections.sort(Unknown Source) at org.eclipse.jdt.internal.ui.text.java.JavaCompletionProcessor. filter(JavaCompletionProcessor.java:147) at org.eclipse.jdt.internal.ui.text.java.JavaCompletionProcessor. filterAndSortProposals(JavaCompletionProcessor.java:125) at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor. computeCompletionProposals(ContentAssistProcessor.java:91) at org.eclipse.jface.text.contentassist.ContentAssistant. computeCompletionProposals(ContentAssistant.java:1558) at org.eclipse.jface.text.contentassist.CompletionProposalPopup. computeProposals(CompletionProposalPopup.java:350) at org.eclipse.jface.text.contentassist.CompletionProposalPopup. access$15(CompletionProposalPopup.java:347) at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2. run(CompletionProposalPopup.java:293) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69) at org.eclipse.jface.text.contentassist.CompletionProposalPopup. showProposals(CompletionProposalPopup.java:287) at org.eclipse.jface.text.contentassist.ContentAssistant. showPossibleCompletions(ContentAssistant.java:1405) at org.eclipse.jdt.internal.ui.javaeditor. CompilationUnitEditor$AdaptedSourceViewer.doOperation(CompilationUnitEditor. java:201) at org.eclipse.ui.texteditor.ContentAssistAction$1. run(ContentAssistAction.java:82) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69) at org.eclipse.ui.texteditor.ContentAssistAction.run(ContentAssistAction. java:80) at org.eclipse.jface.action.Action.runWithEvent(Action.java:996) at org.eclipse.ui.commands.ActionHandler.execute(ActionHandler.java:182) at org.eclipse.ui.internal.handlers.LegacyHandlerWrapper. execute(LegacyHandlerWrapper.java:108) at org.eclipse.core.commands.Command.execute(Command.java:311) at org.eclipse.core.commands.ParameterizedCommand. execute(ParameterizedCommand.java:397) at org.eclipse.ui.internal.keys.WorkbenchKeyboard. executeCommand(WorkbenchKeyboard.java:459) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard. java:781) at org.eclipse.ui.internal.keys.WorkbenchKeyboard. processKeyEvent(WorkbenchKeyboard.java:828) at org.eclipse.ui.internal.keys.WorkbenchKeyboard. filterKeySequenceBindings(WorkbenchKeyboard.java:550) at org.eclipse.ui.internal.keys.WorkbenchKeyboard. access$3(WorkbenchKeyboard.java:493) at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter. handleEvent(WorkbenchKeyboard.java:117) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Display.filterEvent(Display.java:971) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:883) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:908) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:893) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:921) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:917) at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1231) at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:3157) at org.eclipse.swt.widgets.Control.windowProc(Control.java:3058) at org.eclipse.swt.widgets.Display.windowProc(Display.java:3830) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1679) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2821) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1755) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1719) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java: 368) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:106) at org.eclipse.core.internal.runtime.PlatformActivator$1. run(PlatformActivator.java:226) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter. java:377) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter. java:164) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:338) at org.eclipse.core.launcher.Main.basicRun(Main.java:282) at org.eclipse.core.launcher.Main.run(Main.java:977) at org.eclipse.core.launcher.Main.main(Main.java:952) ======================================================================== Hope that helps. Goodbye, Evgeny.
Created attachment 38936 [details] Proposed fix
Philippe - Do you want this fix for 3.2RC2 ? Util.scanTypeBoundSignature() check if the signature length is at least 4 but the length can be 3 with an array of base type (eg. '+[I').
+1 for 3.2RC2
Fix released and test added SignatureTests#testGetReturnType2()
Verified with I20060427-1600 for 3.2RC2