Bug 168481 - Add Warning for bad uppercase/lowercase in variable names
Summary: Add Warning for bad uppercase/lowercase in variable names
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: All All
: P3 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-18 19:14 EST by Ron Romero CLA
Modified: 2006-12-18 19:14 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ron Romero CLA 2006-12-18 19:14:42 EST
Could we add a Java compiler warning for the incorrect case used for variable names.  E.g., a variable in all caps that is not a constant or a constant that is not in all caps.  I expect this would be settable in the Java --> Compiler --> Errors/Warnings preference panel.  

The rules would follow standard conventions.  Here (without looking it up) is what I think we'll have:

final fields -- must be all caps
non-final fields and local vars -- initial lowercase letter
class name -- Initial capital letter.

Perhaps additional checks like only constants can have an underscore, and class names should have a lowercase letter somewhere in the name.  Also an optional rule against more than one capital in a row in variable names and class names (some people have this as a convention).

The story is that I was debugging code that had a variable in all caps that I assumed it was a constant.  In fact, it was not, and if there were a warning available, I would have found that out sooner.