package ca.earthgrazer.codereviewer.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import ca.earthgrazer.codereviewer.model.ReviewFile;
import ca.earthgrazer.codereviewer.repository.ReviewRepository;

@Service
public class ReviewManagementServiceImpl implements ReviewManagementService {

	@Autowired private ReviewRepository reviewRepo;
	
	Map<String, List<ReviewFile>> reviewMap = new HashMap<>();
	
	@Override
	public String createReviewUnit(List<ReviewFile> fileList) {
		return reviewRepo.createReviewUnit(fileList);
	}

	@Override
	public List<ReviewFile> getReviewUnit(String refId) {
		return reviewRepo.getReviewUnit(refId);
	}

}

@@ -109,16 +109,52 @@
 til.Map;
+%0Aimport java.util.stream.Collectors;
 %0A%0Aimport
@@ -645,24 +645,328 @@
 fileList) %7B%0A
+%09%09// filter out empty files%0A%09%09List%3CReviewFile%3E filteredList = fileList.stream()%0A%09%09%09%09%09%09%09%09%09%09%09%09.filter(f -%3E !f.fileName.isEmpty() %7C%7C %0A%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09 !f.fileContent.isEmpty() %7C%7C%0A%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09 !f.fileDiff.isEmpty() %7C%7C%0A%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09 !f.fileComment.isEmpty())%0A%09%09%09%09%09%09%09%09%09%09%09%09.collect(Collectors.toList());%0A%09%09%0A
 %09%09return rev
@@ -993,17 +993,21 @@
 Unit(fil
-e
+tered
 List);%0A%09

Add filtering for empty review files