Bug 276202 [Forms] NPE if dispose() called on FormToolkit more than once
Build id: I20090512-2000 java.lang.NullPointerException at org.eclipse.ui.forms.widgets.FormToolkit.dispose(FormToolkit.java:711) At the moment, if you invoke dispose() twice on a FormToolkit instance, an NPE will be thrown. public void dispose() { if (colors.isShared() == false) { colors.dispose(); colors = null; } boldFontHolder.dispose(); } As can be seen, the 'colors' field is set to 'null' which is the cause of the NPE. It's okay to repeatedly invoke dispose() on an SWT widget so I feel this pattern should be extended for a FormToolkit also.
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/FormToolkit.java
*            the text style
	 * @return the text widget
	 */
	public Text createText(Composite parent, String value, int style) {
		Text text = new Text(parent, borderStyle | style | orientation);
		if (value != null)
			text.setText(value);
		text.setForeground(colors.getForeground());
		text.setBackground(colors.getBackground());
		text.addFocusListener(visibilityHandler);
		return text;
	}
	/**
	 * Creates a tree widget as a part of the form.
	 * 
	 * @param parent
	 *            the tree parent
	 * @param style
	 *            the tree style
	 * @return the tree widget
	 */
	public Tree createTree(Composite parent, int style) {
		Tree tree = new Tree(parent, borderStyle | style | orientation);
		adapt(tree, false, false);
		
		return tree;
	}
	/**
	 * Creates a scrolled form widget in the provided parent. If you do not
	 * require scrolling because there is already a scrolled composite up the