Bug 40952 Generate getter and setter: set field name as default return value
Unfortunately, the new Eclipse version does not create a get/set method in the form of /** * Description. * * @return string */ public String getName() { return name; } anymore but it leaves out the value of the @return param: /** * Description. * * @return */ public String getName() { return name; } But this has the bad side effect that generating javadoc generates warnings for each method that was automatically generated via "Generate getter and setter" function of eclipse. To get a clean javadoc creation back again, you have to fill in the @return value by hand which makes all the nice automatic stuff rather useless. i suggest to set the field name as the default return value: /** * Description. * * @return name */ public String getName() { return name; } which should be quite easy to implement as each get/set method is created based on this field name!
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/CodeGeneration.java
* types names (dot separated).
	 * @param methodName Name of the method.
	 * @param paramNames Names of the parameters for the method.
	 * @param excTypeSig Throwns exceptions (Signature notation)
	 * @param retTypeSig Return type (Signature notation) or <code>null</code>
	 * for constructors.
	 * @param overridden The method that will be overridden by the created method or
	 * <code>null</code> for non-overriding methods. If not <code>null</code>, the method must exist.
	 * @param lineDelimiter The line delimiter to be used
	 * @return Returns the constructed comment or <code>null</code> if
	 * the comment code template is empty. The returned content is unformatted and not indented (formatting required).
	 * @throws CoreException
	 */
	public static String getMethodComment(ICompilationUnit cu, String declaringTypeName, String methodName, String[] paramNames, String[] excTypeSig, String retTypeSig, IMethod overridden, String lineDelimiter) throws CoreException {
		return StubUtility.getMethodComment(cu, declaringTypeName, methodName, paramNames, excTypeSig, retTypeSig, overridden, lineDelimiter);
	}
	
	/**
	 * Returns the comment for a method or constructor using the comment code templates (constructor / method / overriding method).
	 * <code>null</code> is returned if the template is empty.
	 * <p>The returned string is unformatted and not indented.
	 * 
	 * @param method The method to be documented. The method must exist.
	 * @param overridden The method that will be overridden by the created method or
	 * <code>null</code> for non-overriding methods. If not <code>null</code>, the method must exist.
	 * @param lineDelimiter The line delimiter to be used
	 * @return String Returns the constructed comment or <code>null</code> if
	 * the comment code template is empty. The returned string is unformatted and and has no indent (formatting required).
	 * @throws CoreException 
	 */