Merge branch 'master' of git.labs.intellij.net:idea/community

This commit is contained in:
Dmitry Trofimov
2010-12-15 00:55:54 +03:00
3 changed files with 30 additions and 7 deletions
@@ -378,6 +378,9 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec
myUpdateException = null;
composite.cleanAll();
}
if (LOG.isDebugEnabled()) {
LOG.debug("refresh procedure started, everything = " + wasEverythingDirty);
}
}
if (wasEverythingDirty) {
changeListWorker.notifyStartProcessingChanges(null);
@@ -450,6 +453,9 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec
}
if (takeChanges) {
if (LOG.isDebugEnabled()) {
LOG.debug("refresh procedure finished, size: " + composite.getVFHolder(FileHolder.HolderType.UNVERSIONED).getSize());
}
final boolean statusChanged = ! myComposite.equals(composite);
myComposite = composite;
if (statusChanged) {
@@ -31,6 +31,7 @@ import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.application.ModalityState;
import com.intellij.openapi.components.ProjectComponent;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.SimpleToolWindowPanel;
@@ -81,6 +82,7 @@ public class ChangesViewManager implements ChangesViewI, JDOMExternalizable, Pro
@NonNls private static final String ATT_FLATTENED_VIEW = "flattened_view";
@NonNls private static final String ATT_SHOW_IGNORED = "show_ignored";
private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.vcs.changes.ChangesViewManager");
public static ChangesViewI getInstance(Project project) {
return PeriodicalTasksCloser.getInstance().safeGetComponent(project, ChangesViewI.class);
@@ -208,7 +210,10 @@ public class ChangesViewManager implements ChangesViewI, JDOMExternalizable, Pro
@Override
public void scheduleRefresh() {
if (ApplicationManager.getApplication().isHeadlessEnvironment()) return;
myRepaintAlarm.cancelAllRequests();
int was = myRepaintAlarm.cancelAllRequests();
if (LOG.isDebugEnabled()) {
LOG.debug("schedule refresh, was " + was);
}
myRepaintAlarm.addRequest(new Runnable() {
public void run() {
refreshView();
@@ -228,6 +233,10 @@ public class ChangesViewManager implements ChangesViewI, JDOMExternalizable, Pro
new Trinity<List<VirtualFile>, Integer, Integer>(manyUnversioned ? Collections.<VirtualFile>emptyList() : changeListManager.getUnversionedFiles(), unv.getFirst(),
unv.getSecond());
if (LOG.isDebugEnabled()) {
LOG.debug("refresh view, unversioned collections size: " + unversionedPair.getFirst().size() + " unv size passed: " +
unversionedPair.getSecond() + " dirs: " + unversionedPair.getThird());
}
myView.updateModel(changeListManager.getChangeListsCopy(), unversionedPair,
changeListManager.getDeletedFiles(),
changeListManager.getModifiedWithoutEditing(),
@@ -101,17 +101,17 @@ public class SimplifiableAnnotationInspection extends BaseInspection {
return;
}
final PsiNameValuePair[] attributes = parameterList.getAttributes();
final PsiElement[] annotationChildren = annotation.getChildren();
if (annotationChildren.length >= 2) {
final PsiElement child = annotationChildren[1];
if (child instanceof PsiWhiteSpace) {
final String annotationName = nameReferenceElement.getText();
final String replacementText;
if (attributes.length > 0) {
replacementText = '@' + nameReferenceElement.getText() +
replacementText = '@' + annotationName +
parameterList.getText();
} else {
replacementText = '@' + nameReferenceElement.getText();
replacementText = '@' + annotationName;
}
registerError(annotation, replacementText);
return;
@@ -122,15 +122,23 @@ public class SimplifiableAnnotationInspection extends BaseInspection {
if (children.length <= 0) {
return;
}
registerError(annotation, '@' + nameReferenceElement.getText());
final String annotationName = nameReferenceElement.getText();
registerError(annotation, '@' + annotationName);
} else if (attributes.length == 1) {
final PsiNameValuePair attribute = attributes[0];
@NonNls final String name = attribute.getName();
if (!"value".equals(name)) {
return;
}
registerError(annotation, '@' + nameReferenceElement.getText() +
'(' + attribute.getValue().getText() + ')');
final PsiAnnotationMemberValue attributeValue =
attribute.getValue();
if (attributeValue == null) {
return;
}
final String annotationName = nameReferenceElement.getText();
final String replacementText = '@' + annotationName +
'(' + attributeValue.getText() + ')';
registerError(annotation, replacementText);
}
}
}