#fixed code
                             private void writeToFile(String message, String path) throws IOException {
		if(StringUtils.isEmpty(message) || StringUtils.isEmpty(path)){
			return ;
		}
		
		PrintWriter out = null;
		try {
			out = new PrintWriter(new BufferedWriter(new FileWriter(path, true)));
			out.println(message);
			out.flush();
		} finally {
			if( null != out ) {
				out.close();
			}
		}
	}
#vulnerable code 
                             private void writeToFile(String message, String path) throws IOException{
		if(StringUtils.isEmpty(message) || StringUtils.isEmpty(path)){
			return ;
		}
		
		RandomAccessFile rf = new RandomAccessFile(path, "rw");
		rf.seek(rf.length());
		rf.write(message.getBytes());
		rf.close();
	} 
                            #location 4 
                            #vulnerability type RESOURCE_LEAK