• Post Reply Bookmark Topic Watch Topic
  • New Topic

Variable name not allowed  RSS feed

 
paul a carron
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm developing in Eclipse and have a code format file which contains the following:



This prevents me from using the following static variable:



I believe it's forcing me to name the variable in a cretain way vut don't know what structure it should take. Initially I thought it should beginwith an upper case letter followed by any combination of letters and numbers but this didn't work. I'n not sure what ^s means.

Can anybody please advise?
 
paul a carron
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually I think I have it. The first letter should be s followed by an upper case letter followed by any combination of numbers and letters.

 
Carey Brown
Saloon Keeper
Posts: 3329
46
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
paul a carron wrote:Actually I think I have it. The first letter should be s followed by an upper case letter followed by any combination of numbers and letters.


You shouldn't requre an "s" in front of the name of a static variable.
Where did this "s" come from?
 
Carey Brown
Saloon Keeper
Posts: 3329
46
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, it looks like your pattern requires the name to begin with an uppercase letter. This should not be required. And your pattern doesn't take into account that an underscore (_) is acceptable as well.
 
Campbell Ritchie
Marshal
Posts: 56595
172
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The s looks like some sort of bad “Hungarian notation” where the first letter denotes the type or scope of the variable. Whatever, it looks bad style to me; I think that template ought to be changed.
 
paul a carron
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks guys.

Richie, I agree. It seems somewhat dated or restrictive. Unfortunately that's only one aspect of the template. There's quite a few things in it that I'm not so keen on.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!