#vulnerable code 
                             public void write(String filename) throws IOException {
		FileSink output = FileSinkFactory.sinkFor(filename);
		write(output, filename);
	} 
                            #location 3 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                             public void write(String filename) throws IOException {
		FileSink output = FileSinkFactory.sinkFor(filename);
		if(output != null) {
			write(output, filename);
		} else {
			throw new IOException("No sink writer for "+filename);
		}
	}