#vulnerable code 
                             public static String readFileAsString(String filePath) throws IOException {
		byte[] buffer = new byte[(int) getFile(filePath).length()];
		BufferedInputStream inputStream = null;
		try {
			inputStream = new BufferedInputStream(new FileInputStream(getFile(filePath)));
			inputStream.read(buffer);
		} finally {
			inputStream.close();
		}
		return new String(buffer);
	} 
                            #location 8 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                             public static String readFileAsString(String filePath) throws IOException {
		byte[] buffer = new byte[(int) getFile(filePath).length()];
		BufferedInputStream bis = null;
		try {
			bis = new BufferedInputStream(new FileInputStream(getFile(filePath)));
			bis.read(buffer);
		} finally {
			if (bis != null) {
				bis.close();
			}
		}
		return new String(buffer);
	}