All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.l10n.java.rules.squid.S2786.html Maven / Gradle / Ivy

There is a newer version: 8.6.0.37351
Show newest version

According to the docs:

Nested enum types are implicitly static.

So there's no need to declare them static explicitly.

Noncompliant Code Example

public class Flower {
  static enum Color { // Noncompliant; static is redundant here
    RED, YELLOW, BLUE, ORANGE
  }

  // ...
}

Compliant Solution

public class Flower {
  enum Color { // Compliant
    RED, YELLOW, BLUE, ORANGE
  }

  // ...
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy