Differences between revisions 12 and 13
Revision 12 as of 2014-08-25 16:42:29
Size: 1530
Editor: AndrewGaul
Comment:
Revision 13 as of 2014-11-04 03:36:01
Size: 1747
Editor: AdrianCole
Comment: Updated statement about java language level and guava
Deletions are marked like this. Additions are marked like this.
Line 10: Line 10:
 * Java dependency: jclouds 2.0 and onwards target Java 7 and thus cannot use newer language features or API additions in Java 8. jclouds 1.8 and earlier target Java 6. Note that jclouds Maven configuration prevents incorrect use of newer language features but not newer APIs.
 * Guava: jclouds extensively uses [[https://code.google.com/p/guava-libraries/|Guava]] to provide additional functionality and consistent abstractions. jclouds code should reuse Guava functionality instead of including equivalent libraries, e.g., Apache Commons.
 * Java language level: jclouds targets Java language level 6 and thus cannot use newer language features or API additions in Java 7. Note that jclouds Maven configuration prevents incorrect use of newer language features but not newer APIs (yet). The only exception to this rule is the filesystem api, which is configured by Maven to use Java language level 7.
 * Guava: jclouds extensively uses [[https://code.google.com/p/guava-libraries/|Guava]] to provide additional functionality and consistent abstractions as opposed to other libraries, e.g., Apache Commons. That said, Guava usage should be limited in public apis, and not used in domain/value classes. This is to avoid runtime incompatibilities and confusion between types defined in Guava and Java 8.

Coding Standards

  • Indentation: 3-spaces, no tabs
  • maximum 120-column line length
  • jclouds uses Checkstyle to enforce a consistent coding style. Configure your IDE or run mvn checkstyle:checkstyle --quiet -Dcheckstyle.output.file=/dev/stdout -Dcheckstyle.output.format=plain before submitting pull requests.

  • You can also see the Checkstyle results of your pull requests by clicking on the link to the DEV@cloud build in the comments (look for the cloudbees-pull-request-builder):
    • devatcloud-pr-builder-link.png

  • Both Eclipse and Idea support Checkstyle integration.
  • jclouds Checkstyle does not enforce all coding styles that should be followed in pull requests. However, developers can use this jclouds profile (compatible for import in both Eclipse and Idea): eclipse-code-formatter.xml; Also when using Idea ensure that .* imports are not used (under code style -> imports).

  • Java language level: jclouds targets Java language level 6 and thus cannot use newer language features or API additions in Java 7. Note that jclouds Maven configuration prevents incorrect use of newer language features but not newer APIs (yet). The only exception to this rule is the filesystem api, which is configured by Maven to use Java language level 7.
  • Guava: jclouds extensively uses Guava to provide additional functionality and consistent abstractions as opposed to other libraries, e.g., Apache Commons. That said, Guava usage should be limited in public apis, and not used in domain/value classes. This is to avoid runtime incompatibilities and confusion between types defined in Guava and Java 8.

Coding Standards (last edited 2014-11-04 03:36:01 by AdrianCole)