Skip to content

Files

Latest commit

 

History

History
21 lines (13 loc) · 544 Bytes

UnnecessaryDotClass.md

File metadata and controls

21 lines (13 loc) · 544 Bytes

Pattern: Unnecessary .class

Issue: -

Description

To make a reference to a class, it is unnecessary to specify the .class identifier. For instance String.class can be shortened to String.

Example of violations:

// The '.class' identifier is unnecessary, violation occurs
def x = String.class

// Ok, unnecessary '.class' identifier has been excluded
def x = String

Further Reading