UpperEll

Since Checkstyle 3.0

Description

Checks that long constants are defined with an upper ell. That is 'L' and not 'l'. This is in accordance with the Java Language Specification, Section 3.10.1.

Rationale: The lower-case ell 'l' looks a lot like 1.

Examples

To configure the check:

<module name="Checker">
  <module name="TreeWalker">
    <module name="UpperEll"/>
  </module>
</module>
        

Example:

class Example1 {
  long var1 = 508987; // OK
  long var2 = 508987l; // violation
  long var3 = 508987L; // OK
}
        

Example of Usage

Violation Messages

All messages can be customized if the default message doesn't suit you. Please see the documentation to learn how to.

Package

com.puppycrawl.tools.checkstyle.checks

Parent Module

TreeWalker