Bug 36526 ErrorDialog leaks a clipboard
Build: 2.1 The JFace ErrorDialog leaks a clipboard instance in the copyToClipboard method: private void copyToClipboard(){ StringBuffer statusBuffer = new StringBuffer(); populateCopyBuffer(status,statusBuffer,0); Clipboard clipboard = new Clipboard(list.getDisplay()); clipboard.setContents( new Object[] {statusBuffer.toString()}, new Transfer[] {TextTransfer.getInstance()} ); } clipboard.dispose() should be called at the end of this method.
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/ErrorDialog.java
}
		StringBuffer sb = new StringBuffer();
		for (int i = 0; i < nesting; i++) {
			sb.append(NESTING_INDENT); 
		}
		sb.append(status.getMessage());
		list.add(sb.toString());
		IStatus[] children = status.getChildren();
		for (int i = 0; i < children.length; i++) {
			populateList(list, children[i], nesting + 1);
		}
	}
	/**
	 * Returns whether the given status object should be displayed.
	 *
	 * @param status a status object
	 * @param mask a mask as per <code>IStatus.matches</code>
	 * @return <code>true</code> if the given status should be displayed, 
	 *   and <code>false</code> otherwise
	 * @see org.eclipse.core.runtime.IStatus#matches(int)
	 */
	protected static boolean shouldDisplay(IStatus status, int mask) {
		IStatus[] children = status.getChildren();
		if (children == null || children.length == 0) {
			return status.matches(mask);
		}
		for (int i = 0; i < children.length; i++) {
			if (children[i].matches(mask))
				return true;
		}