Bug 83685 - [assist] Content assist fails when there's a dot ('.') after type name
Summary: [assist] Content assist fails when there's a dot ('.') after type name
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.2 RC2   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-25 23:44 EST by Brock Janiczak CLA
Modified: 2006-04-27 22:36 EDT (History)
1 user (show)

See Also:


Attachments
Proposed patch (1.18 KB, text/plain)
2005-06-15 13:11 EDT, David Audel CLA
no flags Details
Regression test (1.53 KB, text/plain)
2005-06-15 13:17 EDT, David Audel CLA
no flags Details
Proposed fix (2.80 KB, patch)
2006-04-20 04:38 EDT, David Audel CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brock Janiczak CLA 2005-01-25 23:44:54 EST
Version: 3.1.0
Build id: I20050125-0800

When you invoke content assist at the location marked as | no matches are found.
 After a little poke around i found that an IndexOutOfBoundsException is caught
and ignored (may be related).

/**
 * {@link Stri|.
 */
public void foo() {
}

exception:

java.lang.ArrayIndexOutOfBoundsException: -1
	at
org.eclipse.jdt.internal.codeassist.complete.CompletionParser.checkRecoveredType(CompletionParser.java:1129)
	at
org.eclipse.jdt.internal.codeassist.complete.CompletionParser.completionIdentifierCheck(CompletionParser.java:1162)
	at
org.eclipse.jdt.internal.codeassist.complete.CompletionParser.updateRecoveryState(CompletionParser.java:3100)
	at
org.eclipse.jdt.internal.compiler.parser.Parser.resumeOnSyntaxError(Parser.java:9239)
	at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:8421)
	at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:8634)
	at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:8599)
	at org.eclipse.jdt.internal.compiler.parser.Parser.dietParse(Parser.java:7347)
	at
org.eclipse.jdt.internal.codeassist.complete.CompletionParser.dietParse(CompletionParser.java:2725)
	at
org.eclipse.jdt.internal.codeassist.CompletionEngine.complete(CompletionEngine.java:1112)
	at org.eclipse.jdt.internal.core.Openable.codeComplete(Openable.java:119)
	at
org.eclipse.jdt.internal.core.CompilationUnit.codeComplete(CompilationUnit.java:287)
	at
org.eclipse.jdt.internal.core.CompilationUnit.codeComplete(CompilationUnit.java:202)
	at
org.eclipse.jdt.internal.core.CompilationUnit.codeComplete(CompilationUnit.java:192)
	at
org.eclipse.jdt.internal.ui.text.javadoc.JavaDocCompletionEvaluator.evalTypeNameCompletions(JavaDocCompletionEvaluator.java:391)
	at
org.eclipse.jdt.internal.ui.text.javadoc.JavaDocCompletionEvaluator.evalSeeTag(JavaDocCompletionEvaluator.java:341)
	at
org.eclipse.jdt.internal.ui.text.javadoc.JavaDocCompletionEvaluator.addArgumentProposals(JavaDocCompletionEvaluator.java:306)
	at
org.eclipse.jdt.internal.ui.text.javadoc.JavaDocCompletionEvaluator.evalProposals(JavaDocCompletionEvaluator.java:219)
	at
org.eclipse.jdt.internal.ui.text.javadoc.JavaDocCompletionEvaluator.computeCompletionProposals(JavaDocCompletionEvaluator.java:176)
	at
org.eclipse.jdt.internal.ui.text.javadoc.JavaDocCompletionProcessor.computeCompletionProposals(JavaDocCompletionProcessor.java:199)
	at
org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1470)
	at
org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:250)
	at
org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$7(CompletionProposalPopup.java:247)
	at
org.eclipse.jface.text.contentassist.CompletionProposalPopup$1.run(CompletionProposalPopup.java:206)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
	at
org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:201)
	at
org.eclipse.jface.text.contentassist.ContentAssistant.showPossibleCompletions(ContentAssistant.java:1319)
	at
org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor$AdaptedSourceViewer.doOperation(CompilationUnitEditor.java:180)
	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:989)
	at org.eclipse.ui.commands.ActionHandler.execute(ActionHandler.java:188)
	at org.eclipse.ui.internal.commands.Command.execute(Command.java:130)
	at
org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:445)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:724)
	at
org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:767)
	at
org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:536)
	at
org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$2(WorkbenchKeyboard.java:479)
	at
org.eclipse.ui.internal.keys.WorkbenchKeyboard$1.handleEvent(WorkbenchKeyboard.java:221)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
	at org.eclipse.swt.widgets.Display.filterEvent(Display.java:781)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:836)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:861)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:846)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:874)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:870)
	at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1176)
	at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:3116)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:3019)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:3449)
	at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1578)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2513)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1584)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1550)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:288)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:144)
	at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:102)
	at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:225)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:274)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:129)
	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:324)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:255)
	at org.eclipse.core.launcher.Main.run(Main.java:811)
	at org.eclipse.core.launcher.Main.main(Main.java:795)
Comment 1 Dani Megert CLA 2005-01-26 03:41:22 EST
Can reproduce.
Comment 2 Frederic Fusier CLA 2005-02-15 11:02:46 EST
Code assist is currently not fully implemented in Javadoc.
Comment 3 Frederic Fusier CLA 2005-03-11 10:46:04 EST
In fact:
1) Javadoc does not implement code assist at all. It's done by jdt-text using a
specific JavaDocCompletionEvaluator(as one can seen in stack trace...)
2) This AIOOBE is not specific to javadoc context, it also happens using
following (minimal) test case:
class Test {
    Str|.
}

Note that the final point in line is really important to reproduce the bug.
i.e. code assist works properly on following test case:
class Test {
    Str|
}
Comment 4 David Audel CLA 2005-06-15 13:11:48 EDT
Created attachment 23224 [details]
Proposed patch
Comment 5 David Audel CLA 2005-06-15 13:17:21 EDT
Created attachment 23227 [details]
Regression test
Comment 6 David Audel CLA 2006-04-20 04:38:10 EDT
Created attachment 39016 [details]
Proposed fix
Comment 7 David Audel CLA 2006-04-20 04:40:16 EDT
Philippe - Do you want this fix for 3.2RC2 ?
Comment 8 Philipe Mulet CLA 2006-04-20 07:31:24 EDT
+1 for 3.2RC2
Comment 9 David Audel CLA 2006-04-20 08:04:53 EDT
Fix released and test added
  GenericsCompletionParserTest#test0211()
Comment 10 Olivier Thomann CLA 2006-04-27 22:36:05 EDT
Verified with I20060427-1600 for RC2.