#fixed code
                             @Override
	public void process(ClusterEvent event) throws Exception
	{
		ClusterManager manager = event.getAttribute("clustermanager");
		if (manager == null)
		{
			throw new StageException("ClusterManager attribute value is null");
		}
		log.info("START ExternalViewComputeStage.process()");
		ClusterDataAccessor dataAccessor = manager.getDataAccessor();
		Map<String, ResourceGroup> resourceGroupMap = event
		    .getAttribute(AttributeName.RESOURCE_GROUPS.toString());
		if (resourceGroupMap == null)
		{
		  throw new StageException("ResourceGroupMap attribute value is null");
		}
		
		CurrentStateOutput currentStateOutput = event
		    .getAttribute(AttributeName.CURRENT_STATE.toString());
		for (String resourceGroupName : resourceGroupMap.keySet())
		{
			ZNRecord viewRecord = new ZNRecord();
			viewRecord.setId(resourceGroupName);
			ExternalView view = new ExternalView(viewRecord);
			ResourceGroup resourceGroup = resourceGroupMap.get(resourceGroupName);
			for (ResourceKey resource : resourceGroup.getResourceKeys())
			{
				Map<String, String> currentStateMap = currentStateOutput
				    .getCurrentStateMap(resourceGroupName, resource);
				if (currentStateMap != null && currentStateMap.size() > 0)
				{
					view.setStateMap(resource.getResourceKeyName(), currentStateMap);
				}
			}
			dataAccessor.setClusterProperty(ClusterPropertyType.EXTERNALVIEW,
			    resourceGroupName, view.getRecord());
		}
		log.info("START ExternalViewComputeStage.process()");
	}
#vulnerable code 
                             @Override
	public void process(ClusterEvent event) throws Exception
	{
		ClusterManager manager = event.getAttribute("clustermanager");
		if (manager == null)
		{
			throw new StageException("ClusterManager attribute value is null");
		}
		log.info("START ExternalViewComputeStage.process()");
		ClusterDataAccessor dataAccessor = manager.getDataAccessor();
		Map<String, ResourceGroup> resourceGroupMap = event
		    .getAttribute(AttributeName.RESOURCE_GROUPS.toString());
		CurrentStateOutput currentStateOutput = event
		    .getAttribute(AttributeName.CURRENT_STATE.toString());
		for (String resourceGroupName : resourceGroupMap.keySet())
		{
			ZNRecord viewRecord = new ZNRecord();
			viewRecord.setId(resourceGroupName);
			ExternalView view = new ExternalView(viewRecord);
			ResourceGroup resourceGroup = resourceGroupMap.get(resourceGroupName);
			for (ResourceKey resource : resourceGroup.getResourceKeys())
			{
				Map<String, String> currentStateMap = currentStateOutput
				    .getCurrentStateMap(resourceGroupName, resource);
				if (currentStateMap != null && currentStateMap.size() > 0)
				{
					view.setStateMap(resource.getResourceKeyName(), currentStateMap);
				}
			}
			dataAccessor.setClusterProperty(ClusterPropertyType.EXTERNALVIEW,
			    resourceGroupName, view.getRecord());
		}
		log.info("START ExternalViewComputeStage.process()");
	} 
                            #location 15 
                            #vulnerability type NULL_DEREFERENCE