You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Gary Gregory <ga...@gmail.com> on 2015/09/12 02:22:15 UTC

Checkstyle

Checkstyle complains about code like this:

private final int foo;
Ctor(int foo) {
  this.foo = foo;
}

Which is perfectly acceptable IMO.

I really do not see the point of renaming all param names in a ctor.

In a normal method, yes, you do not want to 'hide' an ivar with a pname.

Gary

-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: Checkstyle

Posted by Gary Gregory <ga...@gmail.com>.
Done in Git master.

Note that we had this already specified in javastyle.xml but we did not say
it checkstyle.xml!

Gary

On Mon, Sep 14, 2015 at 2:18 AM, Remko Popma <re...@gmail.com> wrote:

> No objections here either.
>
>
> On Monday, September 14, 2015, Ralph Goers <ra...@dslextreme.com>
> wrote:
>
>> Seems reasonable.
>>
>> Ralph
>>
>> On Sep 14, 2015, at 12:35 AM, Gary Gregory <ga...@gmail.com>
>> wrote:
>>
>> OK, I updated checkstyle with HidddenFields.
>>
>> Next, I'd like LineLength to be ignored for import statements.
>>
>> Thoughts?
>>
>> Gary
>>
>> On Fri, Sep 11, 2015 at 5:36 PM, Ralph Goers <ra...@dslextreme.com>
>> wrote:
>>
>>> Actually, I am fine with setters that do that as well. Both can be
>>> configured to be OK with the HiddenField element.
>>>
>>> Ralph
>>>
>>> On Sep 11, 2015, at 5:22 PM, Gary Gregory <ga...@gmail.com>
>>> wrote:
>>>
>>> Checkstyle complains about code like this:
>>>
>>> private final int foo;
>>> Ctor(int foo) {
>>>   this.foo = foo;
>>> }
>>>
>>> Which is perfectly acceptable IMO.
>>>
>>> I really do not see the point of renaming all param names in a ctor.
>>>
>>> In a normal method, yes, you do not want to 'hide' an ivar with a pname.
>>>
>>> Gary
>>>
>>> --
>>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
>>> Java Persistence with Hibernate, Second Edition
>>> <http://www.manning.com/bauer3/>
>>> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
>>> Spring Batch in Action <http://www.manning.com/templier/>
>>> Blog: http://garygregory.wordpress.com
>>> Home: http://garygregory.com/
>>> Tweet! http://twitter.com/GaryGregory
>>>
>>>
>>>
>>
>>
>> --
>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
>> Java Persistence with Hibernate, Second Edition
>> <http://www.manning.com/bauer3/>
>> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
>> Spring Batch in Action <http://www.manning.com/templier/>
>> Blog: http://garygregory.wordpress.com
>> Home: http://garygregory.com/
>> Tweet! http://twitter.com/GaryGregory
>>
>>


-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: Checkstyle

Posted by Remko Popma <re...@gmail.com>.
No objections here either.

On Monday, September 14, 2015, Ralph Goers <ra...@dslextreme.com>
wrote:

> Seems reasonable.
>
> Ralph
>
> On Sep 14, 2015, at 12:35 AM, Gary Gregory <garydgregory@gmail.com
> <javascript:_e(%7B%7D,'cvml','garydgregory@gmail.com');>> wrote:
>
> OK, I updated checkstyle with HidddenFields.
>
> Next, I'd like LineLength to be ignored for import statements.
>
> Thoughts?
>
> Gary
>
> On Fri, Sep 11, 2015 at 5:36 PM, Ralph Goers <ralph.goers@dslextreme.com
> <javascript:_e(%7B%7D,'cvml','ralph.goers@dslextreme.com');>> wrote:
>
>> Actually, I am fine with setters that do that as well. Both can be
>> configured to be OK with the HiddenField element.
>>
>> Ralph
>>
>> On Sep 11, 2015, at 5:22 PM, Gary Gregory <garydgregory@gmail.com
>> <javascript:_e(%7B%7D,'cvml','garydgregory@gmail.com');>> wrote:
>>
>> Checkstyle complains about code like this:
>>
>> private final int foo;
>> Ctor(int foo) {
>>   this.foo = foo;
>> }
>>
>> Which is perfectly acceptable IMO.
>>
>> I really do not see the point of renaming all param names in a ctor.
>>
>> In a normal method, yes, you do not want to 'hide' an ivar with a pname.
>>
>> Gary
>>
>> --
>> E-Mail: garydgregory@gmail.com
>> <javascript:_e(%7B%7D,'cvml','garydgregory@gmail.com');> | ggregory@apache.org
>> <javascript:_e(%7B%7D,'cvml','ggregory@apache.org');>
>> Java Persistence with Hibernate, Second Edition
>> <http://www.manning.com/bauer3/>
>> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
>> Spring Batch in Action <http://www.manning.com/templier/>
>> Blog: http://garygregory.wordpress.com
>> Home: http://garygregory.com/
>> Tweet! http://twitter.com/GaryGregory
>>
>>
>>
>
>
> --
> E-Mail: garydgregory@gmail.com
> <javascript:_e(%7B%7D,'cvml','garydgregory@gmail.com');> | ggregory@apache.org
> <javascript:_e(%7B%7D,'cvml','ggregory@apache.org');>
> Java Persistence with Hibernate, Second Edition
> <http://www.manning.com/bauer3/>
> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> Spring Batch in Action <http://www.manning.com/templier/>
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>
>

Re: Checkstyle

Posted by Ralph Goers <ra...@dslextreme.com>.
Seems reasonable.

Ralph

> On Sep 14, 2015, at 12:35 AM, Gary Gregory <ga...@gmail.com> wrote:
> 
> OK, I updated checkstyle with HidddenFields.
> 
> Next, I'd like LineLength to be ignored for import statements.
> 
> Thoughts?
> 
> Gary
> 
>> On Fri, Sep 11, 2015 at 5:36 PM, Ralph Goers <ra...@dslextreme.com> wrote:
>> Actually, I am fine with setters that do that as well. Both can be configured to be OK with the HiddenField element.
>> 
>> Ralph
>> 
>>> On Sep 11, 2015, at 5:22 PM, Gary Gregory <ga...@gmail.com> wrote:
>>> 
>>> Checkstyle complains about code like this:
>>> 
>>> private final int foo;
>>> Ctor(int foo) {
>>>   this.foo = foo;
>>> }
>>> 
>>> Which is perfectly acceptable IMO. 
>>> 
>>> I really do not see the point of renaming all param names in a ctor.
>>> 
>>> In a normal method, yes, you do not want to 'hide' an ivar with a pname.
>>> 
>>> Gary
>>> 
>>> -- 
>>> E-Mail: garydgregory@gmail.com | ggregory@apache.org 
>>> Java Persistence with Hibernate, Second Edition
>>> JUnit in Action, Second Edition
>>> Spring Batch in Action
>>> Blog: http://garygregory.wordpress.com 
>>> Home: http://garygregory.com/
>>> Tweet! http://twitter.com/GaryGregory
>> 
> 
> 
> 
> -- 
> E-Mail: garydgregory@gmail.com | ggregory@apache.org 
> Java Persistence with Hibernate, Second Edition
> JUnit in Action, Second Edition
> Spring Batch in Action
> Blog: http://garygregory.wordpress.com 
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory

Re: Checkstyle

Posted by Gary Gregory <ga...@gmail.com>.
OK, I updated checkstyle with HidddenFields.

Next, I'd like LineLength to be ignored for import statements.

Thoughts?

Gary

On Fri, Sep 11, 2015 at 5:36 PM, Ralph Goers <ra...@dslextreme.com>
wrote:

> Actually, I am fine with setters that do that as well. Both can be
> configured to be OK with the HiddenField element.
>
> Ralph
>
> On Sep 11, 2015, at 5:22 PM, Gary Gregory <ga...@gmail.com> wrote:
>
> Checkstyle complains about code like this:
>
> private final int foo;
> Ctor(int foo) {
>   this.foo = foo;
> }
>
> Which is perfectly acceptable IMO.
>
> I really do not see the point of renaming all param names in a ctor.
>
> In a normal method, yes, you do not want to 'hide' an ivar with a pname.
>
> Gary
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> Java Persistence with Hibernate, Second Edition
> <http://www.manning.com/bauer3/>
> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> Spring Batch in Action <http://www.manning.com/templier/>
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>
>
>


-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: Checkstyle

Posted by Ralph Goers <ra...@dslextreme.com>.
Actually, I am fine with setters that do that as well. Both can be configured to be OK with the HiddenField element.

Ralph

> On Sep 11, 2015, at 5:22 PM, Gary Gregory <ga...@gmail.com> wrote:
> 
> Checkstyle complains about code like this:
> 
> private final int foo;
> Ctor(int foo) {
>   this.foo = foo;
> }
> 
> Which is perfectly acceptable IMO. 
> 
> I really do not see the point of renaming all param names in a ctor.
> 
> In a normal method, yes, you do not want to 'hide' an ivar with a pname.
> 
> Gary
> 
> -- 
> E-Mail: garydgregory@gmail.com <ma...@gmail.com> | ggregory@apache.org  <ma...@apache.org>
> Java Persistence with Hibernate, Second Edition <http://www.manning.com/bauer3/>
> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> Spring Batch in Action <http://www.manning.com/templier/>
> Blog: http://garygregory.wordpress.com <http://garygregory.wordpress.com/> 
> Home: http://garygregory.com/ <http://garygregory.com/>
> Tweet! http://twitter.com/GaryGregory <http://twitter.com/GaryGregory>