FYI: java.io.Writer fixlet from GNU Classpath

Mark Wielaard mark@klomp.org
Tue May 18 08:37:00 GMT 2004


Hi,

On Mon, 2004-05-17 at 11:37, Andrew Haley wrote:
> Mark Wielaard writes:
> 
>  > The following fixlet from GNU Classpath fixes two Mauve tests.
>  > 
>  >        * java/io/Writer.java (Writer(Object)): Check for null lock object.
> 
> I'm wondering what the justification for the Mauve test is.

See GNU Classpath [bugs #8860] new java.io.FilterWriter(null) should
throw NullPointerException
https://savannah.gnu.org/bugs/index.php?func=detailitem&item_id=8860

> The old Java spec (2nd ed, paper copy) says that "lock" must be
> non-null, but the current online spec says just "lock - Object to
> synchronize on."

I am working from the book. And when it says that lock must be non-null
then I interpret that as pre-condition that must be checked. I also got
bitten by this a while ago and had to search why some write operation
was suddenly failing before realizing that I had given a null lock
object.

Cheers,

Mark
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://gcc.gnu.org/pipermail/java-patches/attachments/20040518/27a321b9/attachment.sig>


More information about the Java-patches mailing list