Bug 101261 [type hierarchy] overriding a method from context menu > Source is not 5.0 aware
N20050622-0010 There's a hidden feature in the type hierarchy, that allows you to select a type XY and an inherited method, open the context menu and select Source > Override in 'XY'. This action has not been updated for 5.0 and creates a wrong method stub when generics are involved, e.g. here: public class Top<E> { public void method(E e) { } } class XY<ELEMENT> extends Top<ELEMENT> { } It creates (wrong formatting, 'E' instead of 'ELEMENT'): public void method(E e) { // TODO Auto-generated method stub super.method(e); } I'd suggest to drop this action, since the Override/Implement Methods... dialog and content assist do better jobs.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddMethodStubAction.java
}	
	
	/**
	  * Tests if the action can run with given arguments
	 */
	public static boolean canActionBeAdded(IType parentType, ISelection selection) {
		if (parentType == null || parentType.getCompilationUnit() == null || !JavaModelUtil.isEditable(parentType.getCompilationUnit()) ||
				!(selection instanceof IStructuredSelection) || selection.isEmpty()) {
			return false;
		}
		Object[] elems= ((IStructuredSelection)selection).toArray();
		int nSelected= elems.length;
		if (nSelected > 0) {
			for (int i= 0; i < nSelected; i++) {
				Object elem= elems[i];
				if (!(elem instanceof IMethod)) {
					return false;
				}
				IMethod meth= (IMethod)elem;
				if (meth.getDeclaringType().equals(parentType)) {
					return false;
				}
			}
			return true;
		}
		return false;
	}
	
}