Thread: [Codenarc-user] FieldNameRule: definition of what's a constant
Brought to you by:
chrismair
From: R. S. <ren...@go...> - 2011-05-30 20:35:18
|
I was wondering why the "finalRegex" contains the DEFAULT_CONST_NAME pattern. I think only the "staticFinalRegex" should contain the DEFAULT_CONST_NAME pattern, as only "static final" declares class constants. Have a look at Sun's code conventions: http://www.oracle.com/technetwork/java/codeconventions-135099.html#367 http://download.oracle.com/javase/tutorial/java/nutsandbolts/variables.html I was confused when violations popped up for things I am doing since years. :-) Regards, René Scheibe |
From: Hamlet D. <ham...@ca...> - 2011-05-31 05:25:36
|
IMO, I would also have a different "finalRegex" default property. I think we won't change the default because of backwards compatibility. ----- Original Message ----- > I was wondering why the "finalRegex" contains the DEFAULT_CONST_NAME > pattern. I think only the "staticFinalRegex" should contain the > DEFAULT_CONST_NAME pattern, as only "static final" declares class > constants. > > Have a look at Sun's code conventions: > http://www.oracle.com/technetwork/java/codeconventions-135099.html#367 > http://download.oracle.com/javase/tutorial/java/nutsandbolts/variables.html > > I was confused when violations popped up for things I am doing since > years. :-) > > Regards, > René Scheibe > > ------------------------------------------------------------------------------ > vRanger cuts backup time in half-while increasing security. > With the market-leading solution for virtual backup and recovery, > you get blazing-fast, flexible, and affordable data protection. > Download your free trial now. > http://p.sf.net/sfu/quest-d2dcopy1 > _______________________________________________ > Codenarc-user mailing list > Cod...@li... > https://lists.sourceforge.net/lists/listinfo/codenarc-user > |
From: R. S. <ren...@go...> - 2011-05-31 07:18:23
|
For me it's a bug, not only changed expectations. This results in people having incorrectly named variables. So I vote to change the finalRegex to the staticFinalRegex. Regards, René Scheibe On 05/31/2011 07:25 AM, Hamlet DArcy wrote: > IMO, I would also have a different "finalRegex" default property. I think we won't change the default because of backwards compatibility. > > > ----- Original Message ----- >> I was wondering why the "finalRegex" contains the DEFAULT_CONST_NAME >> pattern. I think only the "staticFinalRegex" should contain the >> DEFAULT_CONST_NAME pattern, as only "static final" declares class >> constants. >> >> Have a look at Sun's code conventions: >> http://www.oracle.com/technetwork/java/codeconventions-135099.html#367 >> http://download.oracle.com/javase/tutorial/java/nutsandbolts/variables.html >> >> I was confused when violations popped up for things I am doing since >> years. :-) >> >> Regards, >> René Scheibe >> >> ------------------------------------------------------------------------------ >> vRanger cuts backup time in half-while increasing security. >> With the market-leading solution for virtual backup and recovery, >> you get blazing-fast, flexible, and affordable data protection. >> Download your free trial now. >> http://p.sf.net/sfu/quest-d2dcopy1 >> _______________________________________________ >> Codenarc-user mailing list >> Cod...@li... >> https://lists.sourceforge.net/lists/listinfo/codenarc-user >> |
From: Hamlet D. <ham...@ca...> - 2011-05-31 07:23:53
|
> So I vote to change the finalRegex to the staticFinalRegex. You want it like this, right? String regex = DEFAULT_FIELD_NAME String staticRegex String finalRegex String staticFinalRegex = DEFAULT_CONST_NAME I agree. It's up to Chris if he thinks it is a backwards incompatible change or a bug to be fixed. ----- Original Message ----- > For me it's a bug, not only changed expectations. This results in > people > having incorrectly named variables. > > So I vote to change the finalRegex to the staticFinalRegex. > > Regards, > René Scheibe > > On 05/31/2011 07:25 AM, Hamlet DArcy wrote: > > IMO, I would also have a different "finalRegex" default property. I > > think we won't change the default because of backwards > > compatibility. > > > > > > ----- Original Message ----- > >> I was wondering why the "finalRegex" contains the > >> DEFAULT_CONST_NAME > >> pattern. I think only the "staticFinalRegex" should contain the > >> DEFAULT_CONST_NAME pattern, as only "static final" declares class > >> constants. > >> > >> Have a look at Sun's code conventions: > >> http://www.oracle.com/technetwork/java/codeconventions-135099.html#367 > >> http://download.oracle.com/javase/tutorial/java/nutsandbolts/variables.html > >> > >> I was confused when violations popped up for things I am doing > >> since > >> years. :-) > >> > >> Regards, > >> René Scheibe > >> > >> ------------------------------------------------------------------------------ > >> vRanger cuts backup time in half-while increasing security. > >> With the market-leading solution for virtual backup and recovery, > >> you get blazing-fast, flexible, and affordable data protection. > >> Download your free trial now. > >> http://p.sf.net/sfu/quest-d2dcopy1 > >> _______________________________________________ > >> Codenarc-user mailing list > >> Cod...@li... > >> https://lists.sourceforge.net/lists/listinfo/codenarc-user > >> > > |
From: R. S. <ren...@go...> - 2011-05-31 07:30:13
|
On 05/31/2011 09:23 AM, Hamlet DArcy wrote: >> So I vote to change the finalRegex to the staticFinalRegex. > > You want it like this, right? > > String regex = DEFAULT_FIELD_NAME > String staticRegex > String finalRegex > String staticFinalRegex = DEFAULT_CONST_NAME Yes. Exactly. :-) > I agree. It's up to Chris if he thinks it is a backwards incompatible change or a bug to be fixed. > > > > > ----- Original Message ----- >> For me it's a bug, not only changed expectations. This results in >> people >> having incorrectly named variables. >> >> So I vote to change the finalRegex to the staticFinalRegex. >> >> Regards, >> René Scheibe >> >> On 05/31/2011 07:25 AM, Hamlet DArcy wrote: >>> IMO, I would also have a different "finalRegex" default property. I >>> think we won't change the default because of backwards >>> compatibility. >>> >>> >>> ----- Original Message ----- >>>> I was wondering why the "finalRegex" contains the >>>> DEFAULT_CONST_NAME >>>> pattern. I think only the "staticFinalRegex" should contain the >>>> DEFAULT_CONST_NAME pattern, as only "static final" declares class >>>> constants. >>>> >>>> Have a look at Sun's code conventions: >>>> http://www.oracle.com/technetwork/java/codeconventions-135099.html#367 >>>> http://download.oracle.com/javase/tutorial/java/nutsandbolts/variables.html >>>> >>>> I was confused when violations popped up for things I am doing >>>> since >>>> years. :-) >>>> >>>> Regards, >>>> René Scheibe >>>> >>>> ------------------------------------------------------------------------------ >>>> vRanger cuts backup time in half-while increasing security. >>>> With the market-leading solution for virtual backup and recovery, >>>> you get blazing-fast, flexible, and affordable data protection. >>>> Download your free trial now. >>>> http://p.sf.net/sfu/quest-d2dcopy1 >>>> _______________________________________________ >>>> Codenarc-user mailing list >>>> Cod...@li... >>>> https://lists.sourceforge.net/lists/listinfo/codenarc-user >>>> >> >> |
From: <chr...@we...> - 2011-05-31 14:46:47
|
I agree. And though this has the potential to "break" some existing users (including me, by the way), I agree it is a "bug" and should be fixed. I have opened an issue for that: https://sourceforge.net/tracker/?func=detail&aid=3309748&group_id=250145&atid=1126573 Chris -----Original Message----- From: René Scheibe [mailto:ren...@go...] Sent: Tuesday, May 31, 2011 3:30 AM To: Hamlet DArcy Cc: codenarc-user Subject: Re: [Codenarc-user] FieldNameRule: definition of what's a constant On 05/31/2011 09:23 AM, Hamlet DArcy wrote: >> So I vote to change the finalRegex to the staticFinalRegex. > > You want it like this, right? > > String regex = DEFAULT_FIELD_NAME > String staticRegex > String finalRegex > String staticFinalRegex = DEFAULT_CONST_NAME Yes. Exactly. :-) > I agree. It's up to Chris if he thinks it is a backwards incompatible change or a bug to be fixed. > > > > > ----- Original Message ----- >> For me it's a bug, not only changed expectations. This results in >> people >> having incorrectly named variables. >> >> So I vote to change the finalRegex to the staticFinalRegex. >> >> Regards, >> René Scheibe >> >> On 05/31/2011 07:25 AM, Hamlet DArcy wrote: >>> IMO, I would also have a different "finalRegex" default property. I >>> think we won't change the default because of backwards >>> compatibility. >>> >>> >>> ----- Original Message ----- >>>> I was wondering why the "finalRegex" contains the >>>> DEFAULT_CONST_NAME >>>> pattern. I think only the "staticFinalRegex" should contain the >>>> DEFAULT_CONST_NAME pattern, as only "static final" declares class >>>> constants. >>>> >>>> Have a look at Sun's code conventions: >>>> http://www.oracle.com/technetwork/java/codeconventions-135099.html#367 >>>> http://download.oracle.com/javase/tutorial/java/nutsandbolts/variables.html >>>> >>>> I was confused when violations popped up for things I am doing >>>> since >>>> years. :-) >>>> >>>> Regards, >>>> René Scheibe >>>> >>>> ------------------------------------------------------------------------------ >>>> vRanger cuts backup time in half-while increasing security. >>>> With the market-leading solution for virtual backup and recovery, >>>> you get blazing-fast, flexible, and affordable data protection. >>>> Download your free trial now. >>>> http://p.sf.net/sfu/quest-d2dcopy1 >>>> _______________________________________________ >>>> Codenarc-user mailing list >>>> Cod...@li... >>>> https://lists.sourceforge.net/lists/listinfo/codenarc-user >>>> >> >> ------------------------------------------------------------------------------ Simplify data backup and recovery for your virtual environment with vRanger. Installation's a snap, and flexible recovery options mean your data is safe, secure and there when you need it. Data protection magic? Nope - It's vRanger. Get your free trial download today. http://p.sf.net/sfu/quest-sfdev2dev _______________________________________________ Codenarc-user mailing list Cod...@li... https://lists.sourceforge.net/lists/listinfo/codenarc-user |