@NotNull @Override public FileStatus getElementStatus(final RefEntity element) { final GlobalInspectionContextImpl context = getContext(); if (!isDisposed() && context.getUIOptions().SHOW_DIFF_WITH_PREVIOUS_RUN) { if (myOldProblemElements != null) { final boolean old = RefUtil.contains(element, myOldProblemElements.keySet()); final boolean current = RefUtil.contains(element, getProblemElements().keySet()); return calcStatus(old, current); } } return FileStatus.NOT_CHANGED; }
@Override public Map<String, Set<RefEntity>> getOldContent() { if (myOldProblemElements == null) return null; final Map<String, Set<RefEntity>> oldContents = new com.intellij.util.containers.HashMap<String, Set<RefEntity>>(); final Set<RefEntity> elements = myOldProblemElements.keySet(); for (RefEntity element : elements) { String groupName = element instanceof RefElement ? element.getRefManager().getGroupName((RefElement) element) : element.getName(); final Set<RefEntity> collection = myContents.get(groupName); if (collection != null) { final Set<RefEntity> currentElements = new HashSet<RefEntity>(collection); if (RefUtil.contains(element, currentElements)) continue; } Set<RefEntity> oldContent = oldContents.get(groupName); if (oldContent == null) { oldContent = new HashSet<RefEntity>(); oldContents.put(groupName, oldContent); } oldContent.add(element); } return oldContents; }