Pinned fields
Click on the next to a field label to start pinning.
Details
Assignee
UnassignedUnassignedReporter
Ann CampbellAnn CampbellLabels
Default Severity
MinorCovered Languages
C#JavaRemediation Function
Constant/IssueConstant Cost
2minAnalysis Scope
Main SourcesTest Sources
Details
Details
Assignee
Unassigned
UnassignedReporter
Ann Campbell
Ann CampbellLabels
Default Severity
Minor
Covered Languages
C#
Java
Remediation Function
Constant/Issue
Constant Cost
2min
Analysis Scope
Main Sources
Test Sources
Sentry
Sentry
Sentry
Created January 6, 2015 at 11:44 AM
Updated March 22, 2021 at 4:47 PM
The methods declared in an
interface
arepublic
andabstract
by default. Any variables are automaticallypublic static final
. Finally,class
andinterface
are automaticallypublic static
. There is no need to explicitly declare them so.Since annotations are implicitly interfaces, the same holds true for them as well.
Similarly, the
final
modifier is redundant on any method of afinal
class,private
is redundant on the constructor of anEnum
, andstatic
is redundant forinterface
nested into aclass
orenum
.Noncompliant Code Example
public interface Vehicle { public void go(int speed, Direction direction); // Noncompliant
Compliant Solution
public interface Vehicle { void go(int speed, Direction direction);