Bug 49802 comparing with local history leaks an Image
M6 - open a java file - make a change to it and save it - in the open editor right-click -> Local History > Compare With... - Close the subsequent dialog This leaks the image from the "Java Source Compare" title bar each time it's invoked. Here's the creation trace: at org.eclipse.swt.graphics.Device.new_Object(Device.java:648) at org.eclipse.swt.graphics.Image.<init>(Image.java:629) at org.eclipse.jface.resource.ImageDescriptor.createImage (ImageDescriptor.java:135) at org.eclipse.jface.resource.ImageDescriptor.createImage (ImageDescriptor.java:94) at org.eclipse.jface.resource.ImageDescriptor.createImage (ImageDescriptor.java:83) at org.eclipse.jdt.internal.ui.compare.JavaCompareUtilities.getImage (JavaCompareUtilities.java:230) at org.eclipse.jdt.internal.ui.compare.JavaCompareWithEditionAction.run (JavaCompareWithEditionAction.java:76) at org.eclipse.jdt.internal.ui.compare.JavaHistoryAction.run (JavaHistoryAction.java:341) at org.eclipse.jface.action.Action.runWithEvent(Action.java:842) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:509) at org.eclipse.jface.action.ActionContributionItem.access$2 (ActionContributionItem.java:461) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent (ActionContributionItem.java:408) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:833) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2318) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1999) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1506) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1482) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:246) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:139) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:47) at org.eclipse.core.internal.runtime.PlatformActivator$1.run (PlatformActivator.java:226) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:85) 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:279) at org.eclipse.core.launcher.Main.run(Main.java:742) at org.eclipse.core.launcher.Main.main(Main.java:581)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaCompareWithEditionAction.java
private static final String BUNDLE_NAME= "org.eclipse.jdt.internal.ui.compare.CompareWithEditionAction"; 
	
	
	public JavaCompareWithEditionAction() {
		super(false);
	}	
	
	public void run(ISelection selection) {
		
		String errorTitle= CompareMessages.getString("CompareWithHistory.title"); 
		String errorMessage= CompareMessages.getString("CompareWithHistory.internalErrorMessage"); 
				
		IMember input= getEditionElement(selection);
		if (input == null) {
			String invalidSelectionMessage= CompareMessages.getString("CompareWithHistory.invalidSelectionMessage"); 
			MessageDialog.openInformation(getShell(), errorTitle, invalidSelectionMessage);
			return;
		}
		
		IFile file= getFile(input);