Community
Participate
Working Groups
Build 20020411 I can't reproduce this anymore, but I got into a state where every attempt to use incremental find, in any java editor, would cause an internal error. Shutting down and restarting Eclipse made the problem go away. Here is the stack trace: java.lang.NullPointerException at org.eclipse.ui.texteditor.IncrementalFindTarget.install(IncrementalFindTarget.ja va:163) at org.eclipse.ui.texteditor.IncrementalFindTarget.beginSession(IncrementalFindTarg et.java:120) at org.eclipse.ui.texteditor.IncrementalFindAction.run(IncrementalFindAction.java:7 5) at org.eclipse.ui.texteditor.RetargetTextEditorAction.run(RetargetTextEditorAction. java:103) at org.eclipse.jface.action.Action.runWithEvent(Action.java:590) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionCont ributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent(ActionContribu tionItem.java(Compiled Code)) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent(Actio nContributionItem.java(Compiled Code)) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent(Actio nContributionItem.java(Compiled Code)) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java(Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java(Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java(Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java(Compiled Code)) at org.eclipse.ui.internal.Workbench.run(Workbench.java:819) at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:77 7) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:319) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:190) at org.eclipse.core.launcher.Main.run(Main.java:549) at org.eclipse.core.launcher.Main.main(Main.java:390)
This can only happen when the StyledText widget of the viewer is disposed. I'm not sure how it could get into that state. John, do you remember which editor you were using when this occured?
The error was definitely occuring in java editors. I may have also had a text editor open in another perspective, but 99% of the time I'm just using java editors. I haven't yet reproduced this, although I'm using incremental find quite often (excellent feature by the way!).
I added a guard against the NPE. It's still not clear why I get an editor which was disposed. I am suspecting that I'm not getting an IUpdate.update() for the incremental find action just before run() is called. A workaround could be to call update() again inside run(). It would be really good to have a reproducible case... The same problem could occure in other actions like find/replace action, etc. as well. Decreasing priority, since it no longer throws an exception.
*** Bug 15689 has been marked as a duplicate of this bug. ***
closing, since I haven't seen any problems with incremental find since 2.0. Please reopen, if necessary.