Bug 14390 npe on sorting in outline
20020418+ (20020418.2) java.lang.NullPointerException at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.initializeHighlightColor (LinkedPositionUI.java:109) at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.propertyChange (LinkedPositionUI.java:100) at org.eclipse.ui.plugin.AbstractUIPlugin$CompatibilityPreferenceStore.fireProperty ChangeEvent(AbstractUIPlugin.java:247) at org.eclipse.ui.plugin.AbstractUIPlugin$1.propertyChange (AbstractUIPlugin.java:188) at org.eclipse.core.runtime.Preferences.firePropertyChangeEvent (Preferences.java:505) at org.eclipse.core.runtime.Preferences.setValue(Preferences.java:563) at org.eclipse.ui.plugin.AbstractUIPlugin$CompatibilityPreferenceStore.setValue (AbstractUIPlugin.java:457) at org.eclipse.jdt.internal.ui.javaeditor.JavaOutlinePage$LexicalSortingAction.valu eChanged(JavaOutlinePage.java:569) at org.eclipse.jdt.internal.ui.javaeditor.JavaOutlinePage$LexicalSortingAction.run (JavaOutlinePage.java:558) at org.eclipse.jface.action.Action.runWithEvent(Action.java:590) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.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:816) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:643) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:349) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:195) at org.eclipse.core.launcher.Main.run(Main.java:541) at org.eclipse.core.launcher.Main.main(Main.java:396)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/link/LinkedPositionUI.java
if (!includes(region, fFramePosition)) {
		 	leave(UNINSTALL | COMMIT | DOCUMENT_CHANGED);
		 	return;		    
		}
		int offset= fFramePosition.getOffset() -  region.getOffset();
		int length= fFramePosition.getLength();
		fViewer.getTextWidget().redrawRange(offset, length, true);
	}
	private void selectRegion() {
		IRegion region= fViewer.getVisibleRegion();
		if (!includes(region, fFramePosition)) {
		 	leave(UNINSTALL | COMMIT | DOCUMENT_CHANGED);
		 	return;   
		}
		int start= fFramePosition.getOffset() - region.getOffset();
		int end= fFramePosition.getLength() + start;	
		fViewer.getTextWidget().setSelection(start, end);		
	}
	private void updateCaret() {
		IRegion region= fViewer.getVisibleRegion();		
		if (!includes(region, fFramePosition)) {
		 	leave(UNINSTALL | COMMIT | DOCUMENT_CHANGED);
		 	return;   
		}
		int offset= fFramePosition.getOffset() + fCaretOffset - region.getOffset();
		
		if ((offset >= 0) && (offset <= region.getLength()))	
			fViewer.getTextWidget().setCaretOffset(offset);
	}