Community
Participate
Working Groups
I20070502-0010 Given: package test; public class E01 { public E01(int number) {} } 1. Select constructor E01 2. Introduce parameter object 3. Check 'generate setters', accept other defaults Is: public void setNumber(int number) { number = number; } Should: public void setNumber(int number) { this.number = number; } Major since with the default settings this only leads to a compiler warning and not an error.
if the field access is qualified by a this depends on the global setting in code style to qualify field accesses with this. But should check for name collision and force this.qualifier in case of a collision.
Maybe of interest to you: org.eclipse.jdt.internal.corext.codemanipulation.GetterSetterUtil
Created attachment 65765 [details] Qualify this if names collide
I do use the getterSetterUtil for the method body. But the creation of getter setter stubs is not AST based and considered obsolete therewith.
patch looks good, will release when M7 is done
patch reviewed and released > 20070507
verified in I20070516-0010