private static NCube checkForConflicts( ApplicationID appId, Map<String, Map> errors, String message, NCubeInfoDto info, NCubeInfoDto head, boolean reverse) { Map<String, Object> map = new LinkedHashMap<>(); map.put("message", message); map.put("sha1", info.sha1); map.put("headSha1", head != null ? head.sha1 : null); try { if (head != null) { long branchCubeId = (long) Converter.convert(info.id, long.class); long headCubeId = (long) Converter.convert(head.id, long.class); NCube branchCube = getPersister().loadCubeById(branchCubeId); NCube headCube = getPersister().loadCubeById(headCubeId); if (info.headSha1 != null) { NCube baseCube = getPersister().loadCubeBySha1(appId, info.name, info.headSha1); Map delta1 = baseCube.getDelta(branchCube); Map delta2 = baseCube.getDelta(headCube); if (NCube.areDeltaSetsCompatible(delta1, delta2)) { if (reverse) { headCube.mergeCellChangeSet(delta1); return headCube; } else { branchCube.mergeCellChangeSet(delta2); return branchCube; } } } List<Delta> diff = branchCube.getDeltaDescription(headCube); if (diff.size() > 0) { map.put("diff", diff); } else { return branchCube; } } else { map.put("diff", null); } } catch (Exception e) { map.put("diff", e.getMessage()); } errors.put(info.name, map); return null; }