#vulnerable code 
                             private void printVersionTable(OutputStream out) {
		try {
			StringBuffer buffer = new StringBuffer();
			List<String> col = modelService.getAllModelVersions();

			buffer.append("<table>");
			buffer.append("<tr><th>Version</th><th>Workflow Group</th><th>Updated</th></tr>");
			for (String aversion : col) {

				// now check groups...
				List<String> groupList = modelService.getAllWorkflowGroups(aversion);
				for (String group : groupList) {
					buffer.append("<tr>");
					buffer.append("<td>" + aversion + "</td>");

					buffer.append("<td><a href=\"./model/" + aversion
							+ "/groups/" + group + "\">" + group + "</a></td>");
					// get update date...
					List<ItemCollection> processList = null;
					logger.severe("NOT IMPLEMENTED");
					//modelService.getAllModelVersions()
					//		.getAllProcessEntitiesByGroup(group,
					//				aversion);

					if (processList.size() > 0) {
						ItemCollection process = processList.get(0);
						Date dat = process.getItemValueDate("$Modified");

						SimpleDateFormat formater = new SimpleDateFormat(
								"yyyy-MM-dd HH:mm:ss");
						buffer.append("<td>" + formater.format(dat) + "</td>");
					}
					buffer.append("</tr>");
				}

			}

			buffer.append("</table>");
			out.write(buffer.toString().getBytes());
		} catch (Exception e) {
			// no opp!
			try {
				out.write("No model definition found.".getBytes());
			} catch (IOException e1) {

				e1.printStackTrace();
			}
		}
	} 
                            #location 25 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                             private void printVersionTable(OutputStream out) {
		try {
			StringBuffer buffer = new StringBuffer();
			List<String> modelVersionList = modelService.getAllModelVersions();

			buffer.append("<table>");
			buffer.append("<tr><th>Version</th><th>Workflow Group</th><th>Uploaded</th></tr>");
			for (String modelVersion : modelVersionList) {
				
				Model model=modelService.getModel(modelVersion);
				ItemCollection modelEntity=modelService.loadModelEntity(modelVersion);

				// now check groups...
				List<String> groupList = model.getGroups();
				for (String group : groupList) {
					buffer.append("<tr>");
					buffer.append("<td>" + modelVersion + "</td>");
					buffer.append("<td><a href=\"./model/" + modelVersion
							+ "/groups/" + group + "\">" + group + "</a></td>");
					// print upload date...
					if (modelEntity!=null) {
						Date dat = modelEntity.getItemValueDate("$Modified");
						SimpleDateFormat formater = new SimpleDateFormat(
								"yyyy-MM-dd HH:mm:ss");
						buffer.append("<td>" + formater.format(dat) + "</td>");
					} else {
						buffer.append("<td> - </td>");
					}
					buffer.append("</tr>");
				}

			}

			buffer.append("</table>");
			out.write(buffer.toString().getBytes());
		} catch (Exception e) {
			// no opp!
			try {
				out.write("No model definition found.".getBytes());
			} catch (IOException e1) {

				e1.printStackTrace();
			}
		}
	}