Community
Participate
Working Groups
Below super in construtor type swi'ctr+space' and choose switch from the templates. Select the whole statment to ident it to left. Shift+space. An NPE occurs. Seems that the insertion of a template is different from normal typing or pasting code. public class IndentTest { public IndentTest() { super(); } public void test() { return; } } java.lang.NullPointerException at org.eclipse.jdt.internal.ui.text.link.LinkedPositionManager.documentAboutToBeCha nged(LinkedPositionManager.java:317) at org.eclipse.jface.text.AbstractDocument.fireDocumentAboutToBeChanged (AbstractDocument.java:444) at org.eclipse.jface.text.AbstractDocument.replace (AbstractDocument.java:772) at org.eclipse.jface.text.TextViewer.shiftLeft(TextViewer.java:2230) at org.eclipse.jface.text.TextViewer.shift(TextViewer.java:2128) at org.eclipse.jface.text.TextViewer.doOperation(TextViewer.java:1939) at org.eclipse.jface.text.source.SourceViewer.doOperation (SourceViewer.java:398) at org.eclipse.ui.texteditor.TextOperationAction.run (TextOperationAction.java:61) at org.eclipse.ui.texteditor.AbstractTextEditor$ActivationCodeTrigger.verifyKey (AbstractTextEditor.java:299) at org.eclipse.swt.custom.StyledTextListener.handleEvent (StyledTextListener.java:49) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:74) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:637) at org.eclipse.swt.custom.StyledText.handleKeyDown(StyledText.java:5050) at org.eclipse.swt.custom.StyledText$8.handleEvent(StyledText.java:4812) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:74) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:637) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1413) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1205) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:788) at org.eclipse.ui.internal.Workbench.run(Workbench.java:771) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:777) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:319) 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:151) at org.eclipse.core.launcher.Main.run(Main.java:502) at org.eclipse.core.launcher.Main.main(Main.java:362)
Martin, What build did this occur on? I don't see anything which could produce an NPE on line 317 of that file. I couldn't reproduce the bug either.
Ah, forgot the version again, build 20021402. As i can reproduce it without any problems here may steps again. package test; public class IndentTest { public IndentTest() { swi* } } * ctrl+space, choose switch, now don't do anything else, just select the whole switch statement. Now shift+tab(space was wrong) or in the context menu Shift left. The npe occurs. Perhaps a screenshot helps, attaching later.
Created attachment 446 [details] ____
ok, I managed to reproduce it.
fixed. will be likely in I-20020312