Bug 50022 [DND] NPE in DelegatingDragAdapter
DelegatingDragAdapater defines a list "activeListeners" but initializes it only in DragStart. However, the list is referenced in removeDragSourceListener without a null check, thus causing a null pointer exception if no dragStart ever occured.
bundles/org.eclipse.jface/src/org/eclipse/jface/util/DelegatingDragAdapter.java
/*******************************************************************************
 * Copyright (c) 2000, 2003 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials 
 * are made available under the terms of the Common Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/cpl-v10.html
 * 
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.jface.util;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.eclipse.core.runtime.Platform;
import org.eclipse.swt.dnd.DragSource;
import org.eclipse.swt.dnd.DragSourceEvent;
import org.eclipse.swt.dnd.DragSourceListener;
import org.eclipse.swt.dnd.Transfer;
/**
 * A <code>DelegatingDragAdapter</code> is a <code>DragSourceListener</code> that  
 * maintains and delegates to a set of {@link TransferDragSourceListener}s. Each 
 * TransferDragSourceListener can then be implemented as if it were the 
 * <code>DragSource's</code> only DragSourceListener.
 * <p>
 * When a drag is started, a subset of all <code>TransferDragSourceListeners</code>
 * is generated and stored in a list of <i>active</i> listeners. This subset is
 * calculated by forwarding {@link DragSourceListener#dragStart(DragSourceEvent) to 
 * every listener, and checking if the {@link DragSourceEvent#doit doit} field is left 
 * set to <code>true</code>.