Bug 23425 - Code-Templates with linked positions fail [regression] [build I0911]
Summary: Code-Templates with linked positions fail [regression] [build I0911]
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: Other other
: P2 major (vote)
Target Milestone: ---   Edit
Assignee: Claude Knaus CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-09-11 12:00 EDT by Scott Rutledge CLA
Modified: 2002-09-20 20:29 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Scott Rutledge CLA 2002-09-11 12:00:25 EDT
Trying to invoke the following template (my method stub):

/**
 *
 */
${public} ${void} 
${name}(${arguments})
{
} // ${name}

Results in the following error message to be 
displayed:
 Overlapping text edits.

The template is expanded without the linked 
positions. Templates also no longer show up in the completion list for that editor (must be closed 
and reopened).

The following exeception is logged:
!ENTRY org.eclipse.ui 4 4 Sep 11, 2002 
10:11:26.57
!MESSAGE Unhandled exception caught in event loop.
!ENTRY org.eclipse.ui 4 0 
Sep 11, 2002 10:11:26.107
!MESSAGE java.lang.NullPointerException
!STACK 
0
java.lang.NullPointerException
	at 
org.eclipse.jdt.internal.ui.text.template.TemplateProposal.getSelection(TemplateProposal.java:157)
	at 
org.eclipse.jface.text.contentassist.CompletionProposalPopup.insertProposal(CompletionProposalPopup.java:257)
	at 
org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$7(CompletionProposalPopup.java:243)
	at 
org.eclipse.jface.text.contentassist.CompletionProposalPopup$1.run(CompletionProposalPopup.java:110)
	at 
org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:66)
	at 
org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:92)
	at 
org.eclipse.jface.text.contentassist.ContentAssistant.showPossibleCompletions(ContentAssistant.java:1200)
	at 
org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor$AdaptedSourceViewer.doOperation(CompilationUnitEditor.java:218)
	at 
org.eclipse.ui.texteditor.ContentAssistAction$1.run(ContentAssistAction.java:84)
	at 
org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:66)
	at 
org.eclipse.ui.texteditor.ContentAssistAction.run(ContentAssistAction.java:82)
	at 
org.eclipse.jface.action.Action.runWithEvent(Action.java:749)
	at 
org.eclipse.ui.internal.registry.AcceleratorScope$AcceleratorAction.run(AcceleratorScope.java:289)
	at 
org.eclipse.ui.internal.registry.AcceleratorScope.processKey(AcceleratorScope.java:249)
	at 
org.eclipse.ui.internal.KeyBindingMenu$3.handleEvent(KeyBindingMenu.java:90)
	at 
org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:77)
	at 
org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:833)
	at 
org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1622)
	at 
org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1368)
	at 
org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1256)
	at 
org.eclipse.ui.internal.Workbench.run(Workbench.java:1239)
	at 
org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:775)
	at 
org.eclipse.core.boot.BootLoader.run(BootLoader.java:462)
	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:247)
	at 
org.eclipse.core.launcher.Main.run(Main.java:703)
	at 
org.eclipse.core.launcher.Main.main(Main.java:539)
Comment 1 Claude Knaus CLA 2002-09-12 10:00:45 EDT
fixed by Dirk >= 20020912
fixed by me: potential NPE
Comment 2 Scott Rutledge CLA 2002-09-18 21:31:40 EDT
This same template fails if the code formatter is disabled ('Use Code Formattter' unchecked in 
the Java->Templates preferences). Same error message. Using build 0917.
Comment 3 Claude Knaus CLA 2002-09-19 06:32:26 EDT
fixed >= 20020919 (will be in M1 build)