The build environment of tom now integrates the use of findbugs, to help spotting errors.
Yet, we are starting to fix the issues it shows.
The first ones were about an incorrect use of the Cloneable interface.
To me, this issue is weird: you should use "super.clone()" when defining the clone() method, instead of using "new", so that the class can be later extended. The problem is that I want the "clone()" method to be public, and not to throw "CloneNotSupportedException". Then, y have to "try{ } catch" this exception in the clone method, and send a RuntimeException in the catch part. But it will never happen, as I implement Cloneable.
Is Java's Cloneable interface simply poorly designed, or am I simply misusing it? Seems like Joshua Blosh favor the first solution.
Yet, we are starting to fix the issues it shows.
The first ones were about an incorrect use of the Cloneable interface.
To me, this issue is weird: you should use "super.clone()" when defining the clone() method, instead of using "new", so that the class can be later extended. The problem is that I want the "clone()" method to be public, and not to throw "CloneNotSupportedException". Then, y have to "try{ } catch" this exception in the clone method, and send a RuntimeException in the catch part. But it will never happen, as I implement Cloneable.
Is Java's Cloneable interface simply poorly designed, or am I simply misusing it? Seems like Joshua Blosh favor the first solution.
1 Comments:
The news about findbugs in Tom, on Tom's gforge page
By tonio, at 10:54 AM
Post a Comment
<< Home