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
private CodeGeneration() {
	}
	
	/**
	 * Returns the content for a new compilation unit using the 'new Java file' code template.
	 * @param cu The compilation to create the source for. The compilation unit does not need to exist.
	 * @param typeComment The comment for the type to created. Used when the code template contains a ${typecomment} variable. Can be <code>null</code> if
	 * no comment should be added.
	 * @param typeContent The code of the type, including type declaration and body.
	 * @param lineDelimiter The line delimiter to be used.
	 * @return Returns the new content or <code>null</code> if the template is undefined or empty.
	 * @throws CoreException
	 */
	public static String getCompilationUnitContent(ICompilationUnit cu, String typeComment, String typeContent, String lineDelimiter) throws CoreException {	
		return StubUtility.getCompilationUnitContent(cu, typeComment, typeContent, lineDelimiter);
	}
	
	/**
	 * Returns the content for a new type comment using the 'typecomment' code template. The returned content is unformatted and is not indented.
	 * @param cu The compilation where the type is contained. The compilation unit does not need to exist.
	 * @param typeQualifiedName The name of the type to which the comment is added. For inner types the name must be qualified and include the outer
	 * types names (dot separated). See {@link org.eclipse.jdt.core.IType#getTypeQualifiedName(char)}.
	 * @param lineDelimiter The line delimiter to be used.
	 * @return Returns the new content or <code>null</code> if the code template is undefined or empty. The returned content is unformatted and is not indented.
	 * @throws CoreException
	 */	
	public static String getTypeComment(ICompilationUnit cu, String typeQualifiedName, String lineDelimiter) throws CoreException {