Query module BoxedVariable
- Boxed variable is never null
- Using a boxed type for a variable that is never assigned ‘null’ hinders readability because it implies that ‘null’ is a potential value.
- readability types
Provides all default Java QL imports.
Replacing the type of a boxed variable with the corresponding primitive type may affect overload resolution. If this is the case then the boxing is most likely intentional and it should not be reported as a violation.
If a primitive value always occurs in a boxed context (and maybe more than once for each assigned value), then declaring the type as a boxed type merely performs the boxing up front and is likely deliberate.