News for hackers. Stuff that matters.
Re:Google open sources "Contracts for Java" by jgershen on Friday February 04, 2011 @09:33PM (#2182258)
Very cool stuff. I wonder if there is any way to integrate something like KeYmeara (http://symbolaris.com/info/KeYmaera.html) for a way to prove correctness of Java systems (or components of Java systems).
Re:Google open sources "Contracts for Java" by eneveu on Friday February 04, 2011 @09:53PM (#2182291)
I did not know about KeYmeara. Looks great!

While I'm not sure if we may count those as "programmation by contract", some Java tools provide (some) static analysis:

- Findbugs

- IntelliJ IDEA does some nullness analysis : http://www.jetbrains.com/idea/documentation/howto.html

- JSR 305 (Annotations for Software Defect Detection in Java) attempted to standardize on a set of annotations. We use it in our project, mainly the @Nonnull at the moment... I believe Findbugs considers these annotations.

- CodePro Analytix, also recently open sourced by Google, might also do some static analysis: http://code.google.com/javadevtools/codepro/doc/index.html

- Eclipse might too (any expert Eclipse user knows?)

I think there is still a lot to do in this space. "Contracts for Java" is a step in the right direction :)

Re:Google open sources "Contracts for Java" by ShabbyDoo on Saturday February 05, 2011 @01:48PM (#2183680)
For completeness, PMD should be added to the list although I haven't found it as useful as FindBugs:

http://pmd.sourceforge.net/

Re:Google open sources "Contracts for Java" by tikkes on Saturday February 05, 2011 @07:17AM (#2182949)
Eclipse does not do static analysis by default I believe. There are some patches however...
Re:Google open sources "Contracts for Java" by ShabbyDoo on Saturday February 05, 2011 @01:46PM (#2183669)
The out-of-the-box Eclipse distro does include some static analysis stuff, but it's turned off by default. Preferences->Java->Compiler->Errors/Warnings. Under "Potential Programming Problems", you can alert on such things as guaranteed NPEs, etc.