Back to Intellij Community

IntLiteralMayBeLongLiteral

java/java-impl/resources/inspectionDescriptions/IntLiteralMayBeLongLiteral.html

2025.3-rc-2243 B
Original Source

Reports int literal expressions that are immediately cast to long.

Such literal expressions can be replaced with equivalent long literals.

Example:

Long l = (long)42;

After the quick-fix is applied:

Long l = 42L;