Bug 112440 Generate Delegate Methods does not work in anonymous types
Build ID: I20051011-1655 When selecting "Generate Delegate Methods" for an anonymous type, the refactoring does not use the fields of the anonymous type, but of the enclosing type as a reference (1). When inserting methods (from fields of the enclosing type) at the current position, it fails without an error message (2). 1) Select "Foo()", invoke the Refactoring => No generation possible 2) Add a field to top-level class Foo, select "Foo()" invoke the Refactoring, select some method and "insert at current position" => Generation possible, but methods do not get inserted. ---- public class Foo { public void foo() { Foo d= new Foo() { Foo d; }; } } ----
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddDelegateMethodsAction.java
/*******************************************************************************
 * Copyright (c) 2000, 2005 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *   Martin Moebius (m.moebius@gmx.de) - initial API and implementation
 *             (report 28793)
 *   IBM Corporation - updates
 *******************************************************************************/
package org.eclipse.jdt.ui.actions;
import java.lang.reflect.InvocationTargetException;
import java.text.Collator;
import java.util.ArrayList;
import java.util.HashSet;