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
if (message != null && message.trim().length() > 0)
						messages.add(message.trim());
				}
				
				if (messages.size() == 1)
					return formatSingleMessage((String) messages.get(0));
					
				if (messages.size() > 1)
					return formatMultipleMessages(messages);
			}
		}
		
		return null;
	}
	
	/*
	 * Formats a message as HTML text.
	 */
	private String formatSingleMessage(String message) {
		StringBuffer buffer= new StringBuffer();
		HTMLPrinter.addPageProlog(buffer);
		HTMLPrinter.addParagraph(buffer, HTMLPrinter.convertToHTMLContent(message));
		HTMLPrinter.addPageEpilog(buffer);
		return buffer.toString();
	}
	
	/*
	 * Formats several message as HTML text.
	 */
	private String formatMultipleMessages(List messages) {