All code that is developed as part of the JNode project must conform to the style set out in Sun's "Java Style Guidelines" (JSG) with variations and exceptions listed below. Javadocs are also important, so please try to make an effort to make them accurate and comprehensive.
Note that we use CheckStyle 4.4 as our arbiter for Java style correctness. Run "./build.sh checkstyle" to check your code style before checking it in or submitting it as a patch. UPDATE: And also, please run "./build.sh javadoc" to make sure that you haven't introduced any new javadoc warnings.
try { if (condition) { something(); } else { somethingElse(); } } catch (Exception ex) { return 42; }
Note that the else is on the same line as the preceding }, as is the catch.
public void loopy() { int i; LOOP: for (i = 100; i < 1000000; i++) { if (isPrime(i) && isPrime(i + 3) && isPrime(i + 5) { break LOOP; } } }
try { myStream.close(); } catch (IOException ex) { // we can safely ignore this }
//******************************************************* // // Start of private methods // //*******************************************************
/** * {@inheritDoc} */ public void myMethod(String param1, int param2) { }