This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
[ BUILD # : 200509251800 ] [ JDK VERSION : 1.5.0_04 ] The naming convention assumed by the Encapsulate Field refactoring doesn't suit everybody. We use the following rules: A property has a capitalized name (PN), e g "Date". The instance variable is called "its<PN>", , e g "itsDate". Statics use "their<PN>". The getters and setters are called "get<PN>" and "set<PN>". The parameter to the setter is called "p<PN>", e g "pDate". This way, the property name has the same capitalization wherever it is used. With this naming convention, using Encapsulate Field requires quite a lot of editing of the result. A template for the field name and templates for getters and setters would solve the problem. I'd set the field name template to e g "its__NAME__". NetBeans could easily deduce that a variable called "itsDate" would have the property name "Date" and could then make this available when expanding the getters and setters template. It could also set and match against e g __LNAME__ and __UNAME__ so that the current behavior could be handled by templates also.
+1 I'm working with major PHP frameworks like Zend and Symfony2. With both the convention is to break the method braces to a new line: public function foo() { return $this->bar; } Netbeans generates them with the starting brace in the same line: public function foo() { return $this->bar; }
This should now be supported by the prefix/suffix naming support. I do not think templates are necessary as well, but please reopen if this is not sufficient. Fixed in jet-main 80f139ccdada
Integrated into 'main-golden', will be available in build *201305021042* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/80f139ccdada User: Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org> Log: #228870 - New API to support CodeStyle's prefix/suffix #65315 #81243 #224242 - Use CodeStyle's prefix and suffix configuration