Class names should not shadow interfaces or superclasses

Description

While it's perfectly legal to give a class the same simple name as a class in another package that it extends or interface it implements, it's confusing and could cause problems in the future.

Noncompliant Code Example

Compliant Solution

Message

Rename this class.

Highlighting

None

List of parameters

None

Activity

Nicolas PeruOctober 21, 2014 at 12:08 PM

LGTM

Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Labels

Default Severity

Critical

Default Quality Profiles

Sonar way

Covered Languages

Java

Remediation Function

Constant/Issue

Constant Cost

Analysis Scope

Main Sources
Test Sources

Sentry

Created October 20, 2014 at 5:30 PM
Updated March 22, 2021 at 4:47 PM