#vulnerable code 
                             public static void main(String[] args) throws IOException {
		Client client = new TransportClient().addTransportAddress(new InetSocketTransportAddress("localhost", 9300));
		BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(new File("/home/ansj/temp/20140421.txt"))));
		String temp = null;

		while ((temp = br.readLine()) != null) {
			
System.out.println("in");
			try {
				JSONObject job = JSON.parseObject(br.readLine());
				client.prepareIndex().setIndex("testdoc").setType("testdoc").setSource(job).execute().actionGet();
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	} 
                            #location 14 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                             public static void main(String[] args) throws IOException {
		Client client = new TransportClient().addTransportAddress(new InetSocketTransportAddress("localhost", 9300));
		BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(new File("/home/ansj/temp/20140421.txt"))));
		String temp = null;
		
		int a = 0  ;

		while ((temp = br.readLine()) != null) {
if(a++%100==0)			
System.out.println(a);
			try {
				JSONObject job = JSON.parseObject(br.readLine());
				client.prepareIndex().setIndex("testdoc").setType("testdoc").setSource(job).setTimeout("10s").execute().actionGet();
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	}