Bug 205070 [JFace] ImageDataImageDescriptor's hashCode doesn't correspond to its equals method
3.3 ImageDataImageDescriptor.hashCode() and equals don't correspond when it's created from an original image. Note that a new ImageData object is created each time, so comparing hashCode/equals on the resulting ImageData does not allow supposedly-equivalent image descriptors to compare (or hash) properly. This can result in leaks when the image descriptor is used in a resource manager. Suggested change: public int hashCode() { if (originalImage != null) { return System.identityHashCode(originalImage); } return data.hashCode(); }
bundles/org.eclipse.jface/src/org/eclipse/jface/resource/ImageDataImageDescriptor.java
private ImageData data;
    
    /**
     * Original image being described, or null if this image is described
     * completely using its ImageData
     */
    private Image originalImage = null;
    
    /**
     * Creates an image descriptor, given an image and the device it was created on.
     * 
     * @param originalImage
     */
    ImageDataImageDescriptor(Image originalImage) {
        this(originalImage.getImageData());
        this.originalImage = originalImage;
    }
    
    /**
     * Creates an image descriptor, given some image data.
     * 
     * @param data describing the image
     */
    ImageDataImageDescriptor(ImageData data) {
        this.data = data;
    }