Bug 46042 [rulers] NPE in preference store, called from JavaAnnotationHover.getJavaAnnotationsForLine
build N20031031 Saw the following in the log. !ENTRY org.eclipse.ui 4 4 Nov 04, 2003 11:17:39.649 !MESSAGE Unhandled exception caught in event loop. !ENTRY org.eclipse.ui 4 0 Nov 04, 2003 11:17:39.649 !MESSAGE java.lang.NullPointerException !STACK 0 java.lang.NullPointerException at java.util.Hashtable.get(Hashtable.java:333) at java.util.Properties.getProperty(Properties.java:563) at org.eclipse.core.runtime.Preferences.getBoolean(Preferences.java:594) at org.eclipse.ui.plugin.AbstractUIPlugin$CompatibilityPreferenceStore.getBoolean (AbstractUIPlugin.java:268) at org.eclipse.jdt.internal.ui.text.JavaAnnotationHover.getJavaAnnotationsForLine (JavaAnnotationHover.java:123) at org.eclipse.jdt.internal.ui.text.JavaAnnotationHover.getHoverInfo (JavaAnnotationHover.java:214) at org.eclipse.jface.text.source.AnnotationBarHoverManager.computeInformation (AnnotationBarHoverManager.java:100) at org.eclipse.jface.text.AbstractInformationControlManager.doShowInformation (AbstractInformationControlManager.java:661) at org.eclipse.jface.text.AbstractHoverInformationControlManager$MouseTracker.mouse Hover(AbstractHoverInformationControlManager.java:298) at org.eclipse.swt.widgets.TypedListener.handleEvent (TypedListener.java:211) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:847) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2187) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1877) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1611) at org.eclipse.ui.internal.Workbench.run(Workbench.java:1594) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:858) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461) 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:299) at org.eclipse.core.launcher.Main.run(Main.java:767) at org.eclipse.core.launcher.Main.main(Main.java:601)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/JavaAnnotationHover.java
private static class JavaAnnotationHoverType {
	}
	
	public static final JavaAnnotationHoverType OVERVIEW_RULER_HOVER= new JavaAnnotationHoverType();
	public static final JavaAnnotationHoverType TEXT_RULER_HOVER= new JavaAnnotationHoverType();
	public static final JavaAnnotationHoverType VERTICAL_RULER_HOVER= new JavaAnnotationHoverType();
	
	private MarkerAnnotationPreferences fMarkerAnnotationPreferences= new MarkerAnnotationPreferences();
	private IPreferenceStore fStore= JavaPlugin.getDefault().getPreferenceStore();
	private IAnnotationAccess fAnnotationAccess= new DefaultMarkerAnnotationAccess(fMarkerAnnotationPreferences);
	
	private JavaAnnotationHoverType fType;
	
	public JavaAnnotationHover(JavaAnnotationHoverType type) {
		Assert.isTrue(OVERVIEW_RULER_HOVER.equals(type) || TEXT_RULER_HOVER.equals(type) || VERTICAL_RULER_HOVER.equals(type));
		fType= type;
	}
	
	/**
	 * Returns the distance to the ruler line. 
	 */
	protected int compareRulerLine(Position position, IDocument document, int line) {
		
		if (position.getOffset() > -1 && position.getLength() > -1) {
			try {
				int javaAnnotationLine= document.getLineOfOffset(position.getOffset());
				if (line == javaAnnotationLine)
					return 1;
				if (javaAnnotationLine <= line && line <= document.getLineOfOffset(position.getOffset() + position.getLength()))
					return 2;