laito / cleartk

Automatically exported from code.google.com/p/cleartk
0 stars 0 forks source link

InstanceDataWriter has bad error handling #332

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This is really bad code:

    try {
      this.objout = new ObjectOutputStream(new BufferedOutputStream(
          new FileOutputStream(outputFile)));
    } catch (FileNotFoundException e) {
      e.printStackTrace();
    } catch (IOException e) {
      e.printStackTrace();
    }

99.9% of the time, if you see yourself writing e.printStackTrace(), you're 
doing it wrong.

The InstanceDataWriter constructor should instead be declared to throw 
IOException.

Original issue reported on code.google.com by steven.b...@gmail.com on 9 Sep 2012 at 9:39

GoogleCodeExporter commented 9 years ago
Lee fixed this in f38c0f2ef374f1bfafe06ec94c261cfb5d001743.

Original comment by steven.b...@gmail.com on 15 Feb 2013 at 12:36