1

Are there Java coding standards? If so, is there a tool that implements and checks for those standards? I'm not familiar but hoping that someone has used Sonar, Checkstyle, PMD, Findbugs, Clover, and/or Cobertura that could tell me if any of those tools or other tools can do that.

Albert T. Wong
  • 1,535
  • 1
  • 13
  • 21
  • http://stackoverflow.com/questions/3442167/existence-of-a-java-standard http://stackoverflow.com/questions/3615348/is-there-a-coding-standard-for-java – h3xStream Nov 16 '10 at 18:28

4 Answers4

2

Yes. All of those tools can enforce coding styles (and more).

Yuval Adam
  • 161,610
  • 92
  • 305
  • 395
1

Sun's (now Oracle's) coding conventions documentation is here:

http://www.oracle.com/technetwork/java/codeconv-138413.html

I've used Checkstyle to verify that my code follows these conventions as well as conventions adopted by organizations that I've worked for.

Greg
  • 33,450
  • 15
  • 93
  • 100
1

IntelliJ can enforce coding styles and standards as well. Its Inspector can also check for possible bugs as you write code.

duffymo
  • 305,152
  • 44
  • 369
  • 561
1

Yes all these tools will do what you want. You can also add custom rules if you need to. You can also get checkstyle and findbugs plugin for Eclipse.

CoolBeans
  • 20,654
  • 10
  • 86
  • 101