Skip to content

[java] LooseCoupling must ignore class literals: ArrayList.class #2464

@rxmicro

Description

@rxmicro

Affects PMD Version:

6.23.0.

Description:

LooseCoupling must ignore class literals. For Example ArrayList.class

Code Sample demonstrating the issue:

void someMethod(Object o){
       if ( o.getClass() == ArrayList.class ) { // This case must be ignored by rule!
             // do something
       }
}

Running PMD through: Maven

Metadata

Metadata

Assignees

No one assigned

    Labels

    a:false-positivePMD flags a piece of code that is not problematic

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions