Skip to content

Latest commit

 

History

History
26 lines (18 loc) · 562 Bytes

PatternVariableName.md

File metadata and controls

26 lines (18 loc) · 562 Bytes

Pattern: Malformed pattern variable name

Issue: -

Description

Checks that pattern variable names conform to a specified pattern.

Examples

class MyClass {
    MyClass(Object o1){
        if (o1 instanceof String STRING) { // violation, name 'STRING' must
        // match pattern '^[a-z][a-zA-Z0-9]*$'
        }
        if (o1 instanceof Integer num) { // OK
        }
    }
}
     

Further Reading