Bug 6009 New class wizard doesn't get context right for nested classes
Build 20011106. - with a .java file open in the editor, - click the new class button - check "Enclosing Type" - the field is blank - it should default to the current type in the editor
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/util/JavaModelUtil.java
return result;
				}
			}
		}
		return null;
	}
	
	/**
	 * Returns the element contained in the given set with the same name
	 * as the given key.
	 * 
	 * @param set the set to choose from
	 * @param key the key to look for
	 * @return the member of the given set with the same name as the given key
	 */
	private static IJavaElement find(IJavaElement[] set, IJavaElement key) {
		if (set == null)
			return null;
			
		String name= key.getElementName();
		if (name == null)
			return null;
			
		for (int i= 0; i < set.length; i++) {
			if (name.equals(set[i].getElementName()))
				return set[i];
		}
		
		return null;
	}