I just found this peace of code in a big java project i’m working on: public void testSomething() throws IOException { … catch (Exception e) { StringWriter sw = new StringWriter(); e.printStackTrace(new PrintWriter(sw)); fail(sw.toString()); } } Wtf? I changed it to: public void testSomething() throws IOException { … catch (Exception e) { fail(e.getMessage()); } }
May 9, 2011