#vulnerable code 
                             private void printLine(SearchResult result){
		StringBuilder builder = new StringBuilder();
		
		HashMap<String, Object> extraFields = result.getExtraData();
		
		for (String tag : tagsOrder) {
			Object temp1 = extraFields.get(tag);
			String temp1String = temp1.toString();
			
			if(NumberUtils.isNumber(temp1String)){
				temp1String = NumberUtils.createBigDecimal(temp1String).toPlainString();	
			}
			
			String s = (temp1 != null) ? StringUtils.trimToEmpty(temp1String) : "";
			
			if (s.length() > 0) {
				String temp = StringUtils.replaceEach(s, searchChars, replaceChars);
				builder.append('\"').append(temp).append("\";");
			} else {
				builder.append(";");
			}
		}
		
		log.debug("Printing Line: ", builder.toString());
		nLines++;
		this.writter.println(builder.toString());
	} 
                            #location 8 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                             private void printLine(SearchResult result){
		StringBuilder builder = new StringBuilder();
		
		HashMap<String, Object> extraFields = result.getExtraData();
		
		for (String tag : tagsOrder) {
			Object temp1 = extraFields.get(tag);

			final String s = (temp1 != null) ?
				temp1.toString().trim() : "";

			if (s.length() > 0) {
				String temp = StringUtils.replaceEach(s, searchChars, replaceChars);
				builder.append('\"').append(temp).append("\";");
			} else {
				builder.append(";");
			}
		}
		
		log.trace("Printing Line: ", builder.toString());
		nLines++;
		this.writter.println(builder.toString());
	}