This commit is contained in:
Alexey Kudravtsev
2011-12-07 20:12:03 +04:00
parent 8165b7f688
commit c25c9327c3
4 changed files with 10 additions and 82 deletions
@@ -17,6 +17,7 @@ package com.intellij.debugger.impl.descriptors.data;
import com.intellij.debugger.ui.impl.watch.MethodReturnValueDescriptorImpl;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Pair;
import com.sun.jdi.Method;
import com.sun.jdi.Value;
import org.jetbrains.annotations.NotNull;
@@ -68,32 +69,9 @@ public final class MethodReturnValueData extends DescriptorData<MethodReturnValu
return new MethodReturnValueDisplayKey(myMethod, myReturnValue);
}
private static final class MethodReturnValueDisplayKey implements DisplayKey<MethodReturnValueDescriptorImpl> {
private final @NotNull Method myMethod;
private final @Nullable Value myValue;
private static final class MethodReturnValueDisplayKey extends Pair<Method, Value> implements DisplayKey<MethodReturnValueDescriptorImpl> {
public MethodReturnValueDisplayKey(@NotNull Method method, @Nullable Value value) {
myMethod = method;
myValue = value;
}
public boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
final MethodReturnValueDisplayKey that = (MethodReturnValueDisplayKey)o;
if (!myMethod.equals(that.myMethod)) return false;
if (myValue != null ? !myValue.equals(that.myValue) : that.myValue != null) return false;
return true;
}
public int hashCode() {
int result;
result = myMethod.hashCode();
result = 31 * result + (myValue != null ? myValue.hashCode() : 0);
return result;
super(method, value);
}
}
}
@@ -79,7 +79,7 @@ public class DeclarationSearcher {
if (element instanceof PsiDeclarationStatement) {
final PsiElement[] declared = ((PsiDeclarationStatement) element).getDeclaredElements();
for (final PsiElement declaredElement : declared) {
if ((declaredElement instanceof PsiLocalVariable) && (myTargetType.equals(((PsiLocalVariable)declaredElement).getType()))) {
if (declaredElement instanceof PsiLocalVariable && myTargetType.equals(((PsiLocalVariable)declaredElement).getType())) {
return goThroughCache(parent, (PsiVariable) declaredElement);
}
}
@@ -34,6 +34,7 @@ import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.components.State;
import com.intellij.openapi.components.Storage;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.Alarm;
import org.jdom.Element;
@@ -55,37 +56,11 @@ public class IntentionManagerSettings implements PersistentStateComponent<Elemen
private static final Logger LOG = Logger.getInstance("#com.intellij.codeInsight.intention.impl.config.IntentionManagerSettings");
private static final Alarm ourRegisterMetaDataAlarm = new Alarm(Alarm.ThreadToUse.SHARED_THREAD);
private class MetaDataKey {
@NotNull private final String categoryNames;
@NotNull private final String familyName;
private static class MetaDataKey extends Pair<String, String> {
private MetaDataKey(@NotNull String[] categoryNames, @NotNull final String familyName) {
this.categoryNames = StringUtil.join(categoryNames, ":");
this.familyName = familyName;
}
@Override
public boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
final MetaDataKey that = (MetaDataKey)o;
if (!categoryNames.equals(that.categoryNames)) return false;
if (!familyName.equals(that.familyName)) return false;
return true;
}
@Override
public int hashCode() {
int result;
result = categoryNames.hashCode();
result = 31 * result + familyName.hashCode();
return result;
super(StringUtil.join(categoryNames, ":"), familyName);
}
}
private final Set<String> myIgnoredActions = new LinkedHashSet<String>();
@@ -18,6 +18,7 @@ package com.intellij.cvsSupport2.changeBrowser;
import com.intellij.cvsSupport2.connections.CvsEnvironment;
import com.intellij.cvsSupport2.history.CvsRevisionNumber;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Trinity;
import com.intellij.openapi.vfs.VirtualFile;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.Nullable;
@@ -29,35 +30,9 @@ import java.util.*;
public class CvsChangeListsBuilder {
@NonNls private static final String INITIALLY_ADDED_ON_BRANCH = "was initially added on branch";
private static class ChangeListKey {
public String branch;
public String author;
public String message;
private static class ChangeListKey extends Trinity<String, String, String> {
public ChangeListKey(final String branch, final String author, final String message) {
this.branch = branch;
this.author = author;
this.message = message;
}
public boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
final ChangeListKey that = (ChangeListKey)o;
if (!author.equals(that.author)) return false;
if (branch != null ? !branch.equals(that.branch) : that.branch != null) return false;
if (!message.equals(that.message)) return false;
return true;
}
public int hashCode() {
int result = (branch != null ? branch.hashCode() : 0);
result = 31 * result + author.hashCode();
result = 31 * result + message.hashCode();
return result;
super(branch, author, message);
}
}