Skip to content

Latest commit

 

History

History
22 lines (15 loc) · 592 Bytes

UnnecessaryCast.md

File metadata and controls

22 lines (15 loc) · 592 Bytes

Pattern: Unnecessary cast

Issue: -

Description

Checks for unnecessary cast operations.

Example of violations:

int count = (int)123                    // violation
def longValue = (long)123456L           // violation
def bigDecimal = (BigDecimal)1234.56    // violation
String name = (String) "Joe"            // violation
def list = (List)[1, 2, 3]              // violation
def map = (Map)[a:1]                    // violation

Further Reading