Changes between Version 4 and Version 5 of BadCodeExamples


Ignore:
Timestamp:
07/07/09 17:07:23 (16 years ago)
Author:
meddle
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • BadCodeExamples

    v4 v5  
    4848        } 
    4949}}} 
     50 
     51 * Don't swallow exceptions like that: 
     52{{{ 
     53                try { 
     54                    Reader r = new FileReader(txtFile); 
     55                    createText(r,text); 
     56                    r.close(); 
     57                    txtResource.text().set(text); 
     58                    txtResource.text().set(text); 
     59                    txtResource.origin().set(txtFile.getAbsolutePath()); 
     60                    return txtResource; 
     61                } catch (Exception e) { 
     62                    return null; 
     63                } 
     64}}}