#vulnerable code 
                              @Test
  public void testGetConfiguredTemplate() {
    String templateName = "";

    try {
      FileWriter fileWriter = new FileWriter(tempFile);
      fileWriter.append("new_command.template=templates/col_new_template_migration.sql");
      fileWriter.flush();
      templateName = ExternalResources.getConfiguredTemplate(tempFile.getAbsolutePath(), "new_command.template");
      assertEquals("templates/col_new_template_migration.sql", templateName);
    } catch (Exception e) {
      fail("Test failed with execption: " + e.getMessage());
    }
  } 
                            #location 11 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                              @Test
  public void testGetConfiguredTemplate() {
    String templateName = "";
    try {
      FileWriter fileWriter = new FileWriter(tempFile);
      try {
        fileWriter.append("new_command.template=templates/col_new_template_migration.sql");
        fileWriter.flush();
        templateName = ExternalResources.getConfiguredTemplate(tempFile.getAbsolutePath(),
            "new_command.template");
        assertEquals("templates/col_new_template_migration.sql", templateName);
      } finally {
        fileWriter.close();
      }
    } catch (Exception e) {
      fail("Test failed with execption: " + e.getMessage());
    }
  }