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
borderStyle = SWT.BORDER;
	}
	/**
	 * Returns the orientation that all the widgets created by this toolkit will
	 * inherit, if set. Can be <code>SWT.NULL</code>,
	 * <code>SWT.LEFT_TO_RIGHT</code> and <code>SWT.RIGHT_TO_LEFT</code>.
	 * 
	 * @return orientation style for this toolkit, or <code>SWT.NULL</code> if
	 *         not set. The default orientation is inherited from the Window
	 *         default orientation.
	 * @see org.eclipse.jface.window.Window#getDefaultOrientation()
	 * @since 3.1
	 */
	public int getOrientation() {
		return orientation;
	}
	/**
	 * Sets the orientation that all the widgets created by this toolkit will
	 * inherit. Can be <code>SWT.NULL</code>, <code>SWT.LEFT_TO_RIGHT</code>
	 * and <code>SWT.RIGHT_TO_LEFT</code>.
	 * 
	 * @param orientation
	 *            style for this toolkit.
	 * @since 3.1
	 */
	public void setOrientation(int orientation) {
		this.orientation = orientation;
	}
}