#vulnerable code 
                             private void denormalizeSdata(Sdata theSdata) {
		Map<String,Room> roomMap = new HashMap<String,Room>();
		for (Room i : theSdata.getRooms()) roomMap.put(i.getId(),i);
		Map<String,Categorie> categoryMap = new HashMap<String,Categorie>();
		for (Categorie i : theSdata.getCategoriess()) categoryMap.put(i.getId(),i);
		Categorie controllerCat = new Categorie();
		controllerCat.setName("Controller");
		controllerCat.setId("0");
		categoryMap.put(controllerCat.getId(),controllerCat);
		ListIterator<Device> theIterator = theSdata.getDevices().listIterator();
		Device theDevice = null;
		while (theIterator.hasNext()) {
			theDevice = theIterator.next();
			if(theDevice.getRoom() != null)
				theDevice.setRoom(roomMap.get(theDevice.getRoom()).getName());
			else
				theDevice.setRoom("<unknown>");
			if(theDevice.getCategory() != null)
				theDevice.setCategory(categoryMap.get(theDevice.getCategory()).getName());
			else
				theDevice.setCategory("<unknown>");
		}

		ListIterator<Scene> theSecneIter = theSdata.getScenes().listIterator();
		Scene theScene = null;
		while (theSecneIter.hasNext()) {
			theScene = theSecneIter.next();
			theScene.setRoom(roomMap.get(theScene.getRoom()).getName());
		}
	} 
                            #location 19 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                             private void denormalizeSdata(Sdata theSdata) {
		Map<String,Room> roomMap = new HashMap<String,Room>();
		for (Room i : theSdata.getRooms()) roomMap.put(i.getId(),i);
		Map<String,Categorie> categoryMap = new HashMap<String,Categorie>();
		for (Categorie i : theSdata.getCategoriess()) categoryMap.put(i.getId(),i);
		Categorie controllerCat = new Categorie();
		controllerCat.setName("Controller");
		controllerCat.setId("0");
		categoryMap.put(controllerCat.getId(),controllerCat);
		ListIterator<Device> theIterator = theSdata.getDevices().listIterator();
		Device theDevice = null;
		while (theIterator.hasNext()) {
			theDevice = theIterator.next();
			if(theDevice.getRoom() != null && roomMap.get(theDevice.getRoom()) != null)
				theDevice.setRoom(roomMap.get(theDevice.getRoom()).getName());
			else
				theDevice.setRoom("no room");
			if(theDevice.getCategory() != null && categoryMap.get(theDevice.getCategory()) != null)
				theDevice.setCategory(categoryMap.get(theDevice.getCategory()).getName());
			else
				theDevice.setCategory("<unknown>");
		}

		ListIterator<Scene> theSecneIter = theSdata.getScenes().listIterator();
		Scene theScene = null;
		while (theSecneIter.hasNext()) {
			theScene = theSecneIter.next();
			theScene.setRoom(roomMap.get(theScene.getRoom()).getName());
		}
	}