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
/**
	 * Checks whether the given type has a valid main method or not.
	 */
	public static boolean hasMainMethod(IType type) throws JavaModelException {
		String[] paramSignature=  { Signature.createArraySignature(Signature.createTypeSignature("String", false), 1) };
		IMethod method= findMethod("main", paramSignature, false, type);
		if (method != null) {
			int flags= method.getFlags();
			return Flags.isStatic(flags) && Flags.isPublic(flags) && Signature.SIG_VOID.equals(method.getReturnType());
		}
		return false;		
	}
	
	/**
	 * Tests if a method is a main method. Does not resolve the parameter types.
	 * Method must exist.
	 */
	public static boolean isMainMethod(IMethod method) throws JavaModelException {
		if ("main".equals(method.getElementName()) && Signature.SIG_VOID.equals(method.getReturnType())) { 
			int flags= method.getFlags();
			if (Flags.isStatic(flags) && Flags.isPublic(flags)) {
				String[] paramTypes= method.getParameterTypes();
				if (paramTypes.length == 1) {
					String name=  Signature.toString(paramTypes[0]);
					return "String[]".equals(Signature.getSimpleName(name)); 
				}
			}
		}
		return false;
	}