[abc] nice tracematch...

From: Eric Bodden <eric.bodden@mail.mcgill.ca>
Date: Mon Oct 09 2006 - 23:00:30 BST

Hehe, I found quite a nice tracematch spec IMHO.

Try the following code:

                File f = new File("temp");
                f.deleteOnExit();
                FileOutputStream fos = new FileOutputStream(f);
                PrintWriter writer = new PrintWriter(fos);
                
                fos.close();
                writer.write("bla");

Since we close the stream before we write to the writer one would expect that Java throws an exception or something when attempting this write operation. But - it does not! It does nothing in fact. No file is created, nothing is written. The failure just occurs completely silently. And we can easily capture it with a tracematch!

Eric

--
Eric Bodden
Sable Research Group, McGill University
Montréal, Québec, Canada
Received on Mon Oct 09 23:00:55 2006

This archive was generated by hypermail 2.1.8 : Tue Mar 06 2007 - 16:13:30 GMT