mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
@NotNull & simplify logic
This commit is contained in:
@@ -234,7 +234,7 @@ public class ChangeListWorker implements ChangeListsWriteOperations {
|
||||
return changeList != null;
|
||||
}
|
||||
|
||||
public void addChangeToCorrespondingList(final Change change, final VcsKey vcsKey) {
|
||||
public void addChangeToCorrespondingList(@NotNull Change change, final VcsKey vcsKey) {
|
||||
final String path = ChangesUtil.getFilePath(change).getPath();
|
||||
LOG.debug("[addChangeToCorrespondingList] for change " + path + " type: " + change.getType() + " have before revision: " + (change.getBeforeRevision() != null));
|
||||
assert myDefault != null;
|
||||
|
||||
@@ -5,11 +5,13 @@ import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.Computable;
|
||||
import com.intellij.openapi.util.Condition;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vcs.ProjectLevelVcsManager;
|
||||
import com.intellij.openapi.vcs.history.VcsRevisionNumber;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.containers.OpenTHashSet;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -179,7 +181,7 @@ public class LocalChangeListImpl extends LocalChangeList {
|
||||
});
|
||||
}
|
||||
|
||||
boolean processChange(Change change) {
|
||||
boolean processChange(@NotNull final Change change) {
|
||||
LOG.debug("[process change] for '" + myName + "' isDefault: " + myIsDefault + " change: " +
|
||||
ChangesUtil.getFilePath(change).getPath());
|
||||
if (myIsDefault) {
|
||||
@@ -188,12 +190,16 @@ public class LocalChangeListImpl extends LocalChangeList {
|
||||
return true;
|
||||
}
|
||||
|
||||
for (Change oldChange : myChangesBeforeUpdate) {
|
||||
if (Comparing.equal(oldChange, change)) {
|
||||
LOG.debug("[process change] adding bacuae equal to old: " + ChangesUtil.getFilePath(oldChange).getPath());
|
||||
addChange(change);
|
||||
return true;
|
||||
boolean foundSameChange = ContainerUtil.exists(myChangesBeforeUpdate, new Condition<Change>() {
|
||||
@Override
|
||||
public boolean value(Change oldChange) {
|
||||
return Comparing.equal(change, oldChange);
|
||||
}
|
||||
});
|
||||
if (foundSameChange) {
|
||||
LOG.debug("[process change] adding because equal to old: " + ChangesUtil.getFilePath(change).getPath());
|
||||
addChange(change);
|
||||
return true;
|
||||
}
|
||||
LOG.debug("[process change] not found");
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user