Project: SWT
Bug 49942 NPE in StyledText.getSelectionRange (line 4275)
Reported: 2004-01-13 15:19:19 | Status: resolved fixed

I200401130800 Found many of these in the log file. General stability seems to be affected while in use. !ENTRY org.eclipse.ui 4 0 Jan 13, 2004 15:11:53.105 !MESSAGE java.lang.NullPointerException !STACK 0 java.lang.NullPointerException at org.eclipse.swt.custom.StyledText.getSelectionRange (StyledText.java:4275) at org.eclipse.jface.text.TextViewer.getSelectedRange (TextViewer.java:1875) at org.eclipse.jface.text.TextViewer.getSelection(TextViewer.java:2009) at org.eclipse.ui.texteditor.AbstractTextEditor.doGetSelection (AbstractTextEditor.java:1770) at org.eclipse.ui.texteditor.AbstractTextEditor$SelectionProvider.getSelection (AbstractTextEditor.java:1154) at org.eclipse.ui.internal.AbstractSelectionService.getSelection (AbstractSelectionService.java:221) at org.eclipse.search.internal.ui.OpenSearchDialogAction.getSelection (OpenSearchDialogAction.java:68) at org.eclipse.search.internal.ui.OpenSearchDialogAction.run (OpenSearchDialogAction.java:57) at org.eclipse.search.ui.SearchUI.openSearchDialog(SearchUI.java:110) at org.eclipse.search.internal.ui.OpenFileSearchPageAction.run (OpenFileSearchPageAction.java:46) at org.eclipse.ui.internal.PluginAction.runWithEvent (PluginAction.java:273) at org.eclipse.ui.internal.WWinPluginAction.runWithEvent (WWinPluginAction.java:207) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:509) at org.eclipse.jface.action.ActionContributionItem.access$2 (ActionContributionItem.java:461) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent (ActionContributionItem.java:408) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:953) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1845) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1625) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1518) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1494) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench (Workbench.java:258) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:139) at org.eclipse.ui.internal.ide.IDEApplication.run (IDEApplication.java:47) at org.eclipse.core.internal.runtime.PlatformActivator$1.run (PlatformActivator.java:226) at org.eclipse.core.runtime.adaptor.EclipseStarter.run (EclipseStarter.java:85) 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:279) at org.eclipse.core.launcher.Main.run(Main.java:742) at org.eclipse.core.launcher.Main.main(Main.java:581)

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java