Fwd: Sonar analysis of OpenJDK 7 available

David Holmes david.holmes at oracle.com
Tue Nov 22 02:03:47 PST 2011


Certainly some interesting statistics being gathered, but I think a few 
rule refinements are in order:

- Illegal throws: don't throw Throwable

Probably generally good advice for end-user code and most libs, but less 
so for java.lang.invoke :)

- Avoid throwing NullPointerException

While I've argued in the past that IllegalArgumentException may well be 
semantically more appropriate that ship sailed long ago and it is a 
firmly established convention in the core libraries that unexpected null 
arguments cause NullPointerException to be thrown - it is in fact 
mandated by the specs for the methods. (Of course it is better if you 
get them for free by dereferencing the arg but that isn't always 
applicable.)

Anyway just a brief observation.

Cheers,
David Holmes

On 22/11/2011 7:49 PM, Dalibor Topic wrote:
> Since Evgeny's analysis is running on jdk7u/jdk7u, I think this will be
> in particularly interesting for those of us working on JDK 7 Updates.
>
> cheers,
> dalibor topic
>
> -------- Original Message --------
> Subject: Sonar analysis of OpenJDK 7 available
> Date: Tue, 22 Nov 2011 13:24:40 +0400
> From: Evgeny Mandrikov<mandrikov at gmail.com>
> To: discuss at openjdk.java.net
>
> Hi,
>
> As per request of Dalibor Topic [1] I'm announcing that static analysis of
> OpenJDK 7 [2] by Sonar [3] available at our public instance called Nemo [4].
> Analysis is scheduled on a periodic basis once in a week.
> Dedicated quality profile was not used, so there might be some
> false-positive violations (like rule "Dont Import Sun"). However we are
> open for collaborations and ready to create a dedicated quality profile and
> I suppose that "Code Conventions" [5] might be used as a starting point.
>
> [1] https://twitter.com/#!/robilad/status/138707382363635712
> [2] http://hg.openjdk.java.net/jdk7u/jdk7u/jdk/
> [3] http://www.sonarsource.org/
> [4] http://nemo.sonarsource.org/dashboard/index/net.java.openjdk:jdk7
> [5] http://openjdk.java.net/guide/codeConventions.html
>



More information about the jdk7u-dev mailing list