#vulnerable code 
                              public void write(Object from, File target) throws IOException {
    FileWriter writer = new FileWriter(target);
    writer.write(write(from));
    writer.close();
  } 
                            #location 5 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                              public void write(Object from, File target) throws IOException {
    FileWriter writer = new FileWriter(target);
    write(from, writer);
    writer.close();
  }