Code violation: incorrect closing of inputstream.
**Description:**
  Incorrect closing of inputstream: 

 https://github.com/wso2/testgrid/blob/03d4ba54c56d2c06287a6f66f19951d1624a2f11/common/src/main/java/org/wso2/testgrid/common/util/FileUtil.java#L43                                                                                                                                              

**Affected Product Version:**
 0.9.0-m10                                                                                                                       

**OS, DB, other environment details and versions:**
  N/A                                                                                                      
**Steps to reproduce:**
  See above                                                                                                                                     
**Related Issues:**
 N/A                                                                                                      

diff --git a/automation/src/test/java/org/wso2/testgrid/automation/executor/JMeterExecutorTest.java b/automation/src/test/java/org/wso2/testgrid/automation/executor/JMeterExecutorTest.java
index 8722946b..280ad260 100644
--- a/automation/src/test/java/org/wso2/testgrid/automation/executor/JMeterExecutorTest.java
+++ b/automation/src/test/java/org/wso2/testgrid/automation/executor/JMeterExecutorTest.java
@@ -65,9 +65,6 @@ public class JMeterExecutorTest {
         URL resource = classLoader.getResource("test-grid-is-resources");
         Assert.assertNotNull(resource);
 
-        String testScript = Paths.get(resource.getPath(), "SolutionPattern22", "Tests", "jmeter", "mock.jmx")
-                .toAbsolutePath().toString();
-
         String testLocation = Paths.get(resource.getPath(), "SolutionPattern22", "Tests")
                 .toAbsolutePath().toString();
         TestExecutor testExecutor = new JMeterExecutor();
diff --git a/common/src/main/java/org/wso2/testgrid/common/util/FileUtil.java b/common/src/main/java/org/wso2/testgrid/common/util/FileUtil.java
index b9fc76fa..373b8c5d 100644
--- a/common/src/main/java/org/wso2/testgrid/common/util/FileUtil.java
+++ b/common/src/main/java/org/wso2/testgrid/common/util/FileUtil.java
@@ -38,9 +38,8 @@ public class FileUtil {
      * @throws IOException thrown when no file is found in the given location or when error on closing file input stream
      */
     public static <T> T readConfigurationFile(String location, Class<T> type) throws IOException {
-        FileInputStream fileInputStream = new FileInputStream(new File(location));
-        T configuration = new Yaml().loadAs(fileInputStream, type);
-        fileInputStream.close();
-        return configuration;
+        try (FileInputStream fileInputStream = new FileInputStream(new File(location))) {
+            return new Yaml().loadAs(fileInputStream, type);
+        }
     }
 }
['automation/src/test/java/org/wso2/testgrid/automation/executor/JMeterExecutorTest.java', 'common/src/main/java/org/wso2/testgrid/common/util/FileUtil.java']