| Summary: | Auto-Activation works only once | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Jan <janwedding1> | ||||||||||||||
| Component: | Core | Assignee: | Ayushman Jain <amj87.iitr> | ||||||||||||||
| Status: | VERIFIED FIXED | QA Contact: | |||||||||||||||
| Severity: | blocker | ||||||||||||||||
| Priority: | P3 | CC: | amj87.iitr, daniel_megert, janwedding1, Olivier_Thomann, remy.suen, srikanth_sankaran, swheeler, will.horn | ||||||||||||||
| Version: | 3.6 | Flags: | srikanth_sankaran:
review+
|
||||||||||||||
| Target Milestone: | 3.6.1 | ||||||||||||||||
| Hardware: | PC | ||||||||||||||||
| OS: | Windows 7 | ||||||||||||||||
| Whiteboard: | |||||||||||||||||
| Attachments: |
|
||||||||||||||||
|
Description
Jan
What exactly do you mean with "Auto-Activation"? Which editor? Steps?Please Might be a duplicate of bug 317570 but hard to say without having the complete .log file. It is hard for me to reproduce, too, because this can be only reproduced with a special internet provider, which blocks some ports, so loading the Javadoc fails... (Vodafone Germany, UMTS) And I am there not until Friday, so I can reproduce this at Friday at the earliest. Auto-Activation is the thing which completes code... I'll follow up. Jan, please do let us know the steps to reproduce once you are able to do so to help us investigate further. Thanks! Created attachment 175092 [details] Complete Logfile Okay, here it is. In attachement the .log-file - besides I created a video to make clear, what I mean with the bug description from above. http://www.youtube.com/watch?v=l43ouo4OPUg The bug occurs only with the internet provider "Vodafone Germany" - UMTS (3G). I guess because they are blocking some of internet contents (e.g. I am also not able to be the hoster at some internet games - because Vodafone blocks incoming connections...) I get a similar error on Linux after doing an auto complete in a specific case (on a static assert method in a JUnit 3 TestCase test, e.g. "assertS" + Ctrl + Space ). However, for me, the entire UI fails. It is not a hang since the main thread is still live and the event loop is running. But no events are processed - keyboard and mouse input seem completely ignored (although mouse cursor does change on resize bars). I have to kill Eclipse and restart. This is reproducible, but I'm not sure If I can create a test case since I have a complex project structure.
!ENTRY org.eclipse.ui 4 0 2010-08-02 11:15:49.231
!MESSAGE "Content Assist" did not complete normally. Please see the log for more information.
!STACK 0
java.lang.ArrayIndexOutOfBoundsException: -1
at org.eclipse.jdt.core.compiler.CharOperation.indexOf(CharOperation.java:2126)
at org.eclipse.jdt.core.compiler.CharOperation.indexOf(CharOperation.java:2063)
at org.eclipse.jdt.internal.core.JavadocContents.computeChildrenSections(JavadocContents.java:213)
at org.eclipse.jdt.internal.core.JavadocContents.computeMethodRange(JavadocContents.java:300)
at org.eclipse.jdt.internal.core.JavadocContents.getMethodDoc(JavadocContents.java:126)
at org.eclipse.jdt.internal.core.BinaryMethod.getParameterNames(BinaryMethod.java:254)
at org.eclipse.jdt.internal.codeassist.InternalCompletionProposal.findMethodParameterNames(InternalCompletionProposal.java:317)
at org.eclipse.jdt.internal.codeassist.InternalCompletionProposal.findParameterNames(InternalCompletionProposal.java:1416)
at org.eclipse.jdt.ui.text.java.CompletionProposalLabelProvider.appendUnboundedParameterList(CompletionProposalLabelProvider.java:112)
at org.eclipse.jdt.ui.text.java.CompletionProposalLabelProvider.createMethodProposalLabel(CompletionProposalLabelProvider.java:271)
at org.eclipse.jdt.ui.text.java.CompletionProposalLabelProvider.createStyledLabel(CompletionProposalLabelProvider.java:561)
at org.eclipse.jdt.internal.ui.text.java.LazyJavaCompletionProposal.computeDisplayString(LazyJavaCompletionProposal.java:247)
at org.eclipse.jdt.internal.ui.text.java.LazyJavaCompletionProposal.getStyledDisplayString(LazyJavaCompletionProposal.java:226)
at org.eclipse.jface.text.contentassist.CompletionProposalPopup.handleSetData(CompletionProposalPopup.java:829)
at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$24(CompletionProposalPopup.java:819)
at org.eclipse.jface.text.contentassist.CompletionProposalPopup$3.handleEvent(CompletionProposalPopup.java:583)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1282)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1267)
at org.eclipse.swt.widgets.Table.checkData(Table.java:286)
at org.eclipse.swt.widgets.Table.cellDataProc(Table.java:223)
at org.eclipse.swt.widgets.Display.cellDataProc(Display.java:747)
at org.eclipse.swt.internal.gtk.OS._gtk_main_do_event(Native Method)
at org.eclipse.swt.internal.gtk.OS.gtk_main_do_event(OS.java:8163)
at org.eclipse.swt.widgets.Display.eventProc(Display.java:1239)
at org.eclipse.swt.internal.gtk.OS._gdk_window_process_updates(Native Method)
at org.eclipse.swt.internal.gtk.OS.gdk_window_process_updates(OS.java:5340)
at org.eclipse.swt.widgets.Control.update(Control.java:4753)
at org.eclipse.swt.widgets.Shell.setVisible(Shell.java:2002)
at org.eclipse.jface.text.contentassist.CompletionProposalPopup.displayProposals(CompletionProposalPopup.java:1194)
at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$23(CompletionProposalPopup.java:1159)
at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:500)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:482)
at org.eclipse.jface.text.contentassist.ContentAssistant.showPossibleCompletions(ContentAssistant.java:1660)
at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor$AdaptedSourceViewer.doOperation(CompilationUnitEditor.java:182)
at org.eclipse.ui.texteditor.ContentAssistAction$1.run(ContentAssistAction.java:82)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.ui.texteditor.ContentAssistAction.run(ContentAssistAction.java:80)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
at org.eclipse.ui.commands.ActionHandler.execute(ActionHandler.java:185)
at org.eclipse.ui.internal.handlers.LegacyHandlerWrapper.execute(LegacyHandlerWrapper.java:109)
at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:468)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:786)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:885)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:567)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:508)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:123)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1525)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1257)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1282)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1267)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1294)
at org.eclipse.swt.widgets.Widget.gtk_key_press_event(Widget.java:730)
at org.eclipse.swt.widgets.Control.gtk_key_press_event(Control.java:2839)
at org.eclipse.swt.widgets.Composite.gtk_key_press_event(Composite.java:734)
at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:1743)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:4794)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4372)
at org.eclipse.swt.internal.gtk.OS._gtk_main_do_event(Native Method)
at org.eclipse.swt.internal.gtk.OS.gtk_main_do_event(OS.java:8163)
at org.eclipse.swt.widgets.Display.eventProc(Display.java:1239)
at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method)
at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:2224)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3169)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670)
...
> This
>is reproducible, but I'm not sure If I can create a test case
A test case would be great!
In all these cases, it seems like we're trying to pull the javadoc contents off of the internet and are unable to do so because of some reason. Though I doubt that an AIOOB is responsible for hanging the workbench. It'll at best not show content assist. Will, a test will be great help in this one. Created attachment 175893 [details]
Proposed fix
I think the problem comes from the first lastIndex value being -1 and that there is no protection against a start index being lower than zero in the CharOperation.indexOf(..) call.
Ayushman, please try to get a regression test for this case.
Created attachment 175946 [details]
fix + test
I think the problem occurs when we dont get a properly formed javadoc from the internet, maybe because either the server modifies it, or because the connection breaks. The AIOOBE occurs while searching for the pattern "<!-- =" in the javadoc obtained. If this is not present, lastIndex will become -1 and the next call to CharOperation.indexOf(..) will cause AIOOBE.
In the added test, I've used a javadoc which doesnt have the <!-- = pattern. Hence without the patch an AIOOBE is thrown, and with the patch we dont find a valid javadoc format, so we throw a JavaModelException. The test captures this. Note that I have removed X.java and Y.java from the src folder in AttachedJavadocProject since we dont reference them anywhere, but we reference the binaries from the test6.jar in AttachedJavadocProject>lib.
Will / Jan, can you please test the patch and check if you still get the bug? Thanks.
(In reply to comment #10) > Will / Jan, can you please test the patch and check if you still get the bug? > Thanks. Where do I have to apply the patch to test it? Ayushman, please release for 3.7M2. I will attach a new regression test for CharOperationTest suite. Created attachment 175979 [details]
Regression test for the change in CharOperation
+1 for backporting to 3.6.1 as the consequences of this bug are pretty bad. I already reviewed the patch. Ayuhsman, just request a review and I'll set it to +1. Patch looks good. Ayush, please release for 3.6.1. Created attachment 176142 [details]
cumulative patch
(In reply to comment #16) > Created an attachment (id=176142) [details] > cumulative patch Released in HEAD for 3.7M2 Released in R3_6_maintenance for 3.6.1 Added tests AttachedJavadocTests#testBug320167(), CharOperationTest#test008()... 009() (In reply to comment #11) > (In reply to comment #10) > > Will / Jan, can you please test the patch and check if you still get the bug? > > Thanks. > > Where do I have to apply the patch to test it? You can use the next I-build and test the patch. Do let us know if you run into this issue again. Ok, I tested it once again with the nightly build "N20100809-2000" and the problem itself is fixed - content assist seems to work. Nevertheless, I get some error log entries though, when trying to view details of the Javadoc. I added the .log again, maybe, you are able to fix this problem, too. Created attachment 176229 [details]
Logfile
(In reply to comment #20) > Created an attachment (id=176229) [details] > Logfile Thanks a lot for testing the fix. The errors that you get in the log file are expected - JavaModelException being thrown because the javadoc is not in the format that we're expecting because of reasons such as those in comment 10. It maybe because of your ISP, which as you said - blocks some ports, or it may be because of an interrupted data transfer. These cases are out of our control, and the best we can do is throw a JavaModelException. Jan, where do you fetch your Javadoc from? Would you be able to provide us the link to it and also which JRE you are using? These exceptions are thrown when trying to access the Javadoc for the standard Java-functions, so it should be the default value there... oh, and I use the JRE version 6 Update 20 Yeah "should". It should also work and not throw exceptions ;-) Can you just go to the project, open the properties of the rt.jar and check what's the value of the Javadoc location path. (In reply to comment #26) > It is > http://java.sun.com/javase/6/docs/api/ > ;) Sounds good. And the attached source field is empty, right? Would you be able to attach a small test project that reproduces the problem? If we cannot reproduce it then, then I suspect that your firewall mangles the Javadoc. Btw. maybe this is a hint:
In my browser (Firefox), I need to have a plugin installed, which modifies the headers ("Modify Headers") to turn off image compression which is enabled by default by my ISP.
Therefore I have to add in this plugin "Cache-Control" = "no-cache" and "Pragma" = "no-cache"
Yes, the field is empty, And if I connect via VPN with my university the problem does not exist, either. So it must be a problem with my ISP... >So it must be a problem with my ISP...
You should report the bug there.
Verified by reporter using build N20100809-2000. using build N20100809-2000. *** Bug 350854 has been marked as a duplicate of this bug. *** |