private void mergeResults(PermissionSolution solution) { for (Map.Entry<Integer, Boolean> entry : solution.getResult().entrySet()) { boolean shouldContainPermission = shouldContainPermission(entry); PFPermission permission = solution.getPermission(); Set<PFPermission> permissions = results.get(entry.getKey()); if (permissions == null) { permissions = new TreeSet<>(); results.put(entry.getKey(), permissions); } if (shouldContainPermission) { permissions.add(permission); } if (permissions.contains(PFPermission.ANY) && permissions.size() > 1) { permissions.clear(); permissions.add(PFPermission.ANY); } } }
private void mergeIdToExistance(PermissionSolution solution) { for (Map.Entry<Integer, Boolean> entry : solution.getResult().entrySet()) { int id = entry.getKey(); boolean existsPermission = entry.getValue(); if (idToExistance.containsKey(id)) { boolean alreadyExists = idToExistance.get(id); if (alreadyExists ^ existsPermission) { InferenceMain.getInstance() .logger .log(Level.INFO, "Mismatch between existance of annotation"); } } else { idToExistance.put(id, existsPermission); } } }