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/internal/ui/preferences/CodeTemplateBlock.java
fCodeTemplateTree.addElement(COMMENT_NODE);
		fCodeTemplateTree.addElement(CODE_NODE);
		
		fCreateJavaDocComments= new SelectionButtonDialogField(SWT.CHECK | SWT.WRAP);
		fCreateJavaDocComments.setLabelText(PreferencesMessages.getString("CodeTemplateBlock.createcomment.label")); 
		fCreateJavaDocComments.setSelection(PreferenceConstants.getPreferenceStore().getBoolean(PREF_JAVADOC_STUBS));
		
		fCodeTemplateTree.selectFirstElement();	
	}
	
	protected Control createContents(Composite parent) {
		fPixelConverter=  new PixelConverter(parent);
		fSWTWidget= parent;
		
		Composite composite=  new Composite(parent, SWT.NONE);
		GridLayout layout= new GridLayout();
		
		
		layout.numColumns= 2;
		composite.setLayout(layout);
		
		fCodeTemplateTree.doFillIntoGrid(composite, 3);
		LayoutUtil.setHorizontalSpan(fCodeTemplateTree.getLabelControl(null), 2);
		LayoutUtil.setHorizontalGrabbing(fCodeTemplateTree.getTreeControl(null));
		
		fPatternViewer= createViewer(composite, 2);
		
		fCreateJavaDocComments.doFillIntoGrid(composite, 2);
		
		DialogField label= new DialogField();