Community
Participate
Working Groups
Created attachment 255209 [details] Template to reprocude the problem Observed on Kubuntu 14.04.2 LTS with GTK 3.10.8 and Eclipse Java EE IDE for Web Developers. Version: Mars Release (4.5.0) Build id: 20150621-1200 Steps to reproduce: 1. Go to Window->Preferences->Java->Editor->Templates 2. Create a template (like the one attached) with an import declaration using the "${:import (package1, package2)}" notation. 3. Create a new class and delete _everything_ from it. 4. Type the template name, use autocompletion and select your template Observed behaviour: Eclipse shows a empty error window (see screenshot) and the error log show the follwing stack trace: org.eclipse.jface.text.BadLocationException at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1179) at org.eclipse.core.internal.filebuffers.SynchronizableDocument.replace(SynchronizableDocument.java:194) at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1210) at org.eclipse.core.internal.filebuffers.SynchronizableDocument.replace(SynchronizableDocument.java:180) at org.eclipse.jdt.internal.ui.text.template.contentassist.TemplateProposal.apply(TemplateProposal.java:215) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.insertProposal(CompletionProposalPopup.java:963) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.insertSelectedProposalWithMask(CompletionProposalPopup.java:914) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.verifyKey(CompletionProposalPopup.java:1358) at org.eclipse.jface.text.contentassist.ContentAssistant$InternalListener.verifyKey(ContentAssistant.java:814) at org.eclipse.jface.text.TextViewer$VerifyKeyListenersManager.verifyKey(TextViewer.java:493) at org.eclipse.swt.custom.StyledTextListener.handleEvent(StyledTextListener.java:66) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4481) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1327) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1351) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1336) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1117) at org.eclipse.swt.custom.StyledText.handleKeyDown(StyledText.java:5990) at org.eclipse.swt.custom.StyledText$7.handleEvent(StyledText.java:5682) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4481) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1327) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1351) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1336) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1363) at org.eclipse.swt.widgets.Widget.gtk_key_press_event(Widget.java:763) at org.eclipse.swt.widgets.Control.gtk_key_press_event(Control.java:3317) at org.eclipse.swt.widgets.Composite.gtk_key_press_event(Composite.java:785) at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:1965) at org.eclipse.swt.widgets.Control.windowProc(Control.java:5590) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4717) 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:9272) at org.eclipse.swt.widgets.Display.eventProc(Display.java:1225) 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:2422) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3428) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1127) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1018) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:654) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:598) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:139) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:669) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608) at org.eclipse.equinox.launcher.Main.run(Main.java:1515) at org.eclipse.equinox.launcher.Main.main(Main.java:1488) Expected behaviour: As far as I can see I'm using the syntax described in the help: http://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Fconcepts%2Fconcept-template-variables.htm But even if I would be using wrong syntax the error message should display some useful text for the user.
Created attachment 255210 [details] Screenshots which displays the emtpy error message.
(In reply to Tobias Hirning from comment #0) > org.eclipse.jface.text.BadLocationException > at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1179) > at org.eclipse.core.internal.filebuffers.SynchronizableDocument.replace(SynchronizableDocument.java:194) > at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1210) > at org.eclipse.core.internal.filebuffers.SynchronizableDocument.replace(SynchronizableDocument.java:180) > at org.eclipse.jdt.internal.ui.text.template.contentassist.TemplateProposal.apply(TemplateProposal.java:215) Seems to be pointing towards JDT/Text ...
*** This bug has been marked as a duplicate of bug 494691 ***