diff --git a/platform/lang-impl/src/com/intellij/application/options/colors/ColorAndFontDescription.java b/platform/lang-impl/src/com/intellij/application/options/colors/ColorAndFontDescription.java index 71ba963db72f..d5ecdc4a1ef5 100644 --- a/platform/lang-impl/src/com/intellij/application/options/colors/ColorAndFontDescription.java +++ b/platform/lang-impl/src/com/intellij/application/options/colors/ColorAndFontDescription.java @@ -249,23 +249,11 @@ public abstract class ColorAndFontDescription extends TextAttributes implements @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; - - ColorAndFontDescription that = (ColorAndFontDescription)o; - - if (!myGroup.equals(that.myGroup)) return false; - if (!myType.equals(that.myType)) return false; - - return true; + return this == o; } @Override public int hashCode() { - int result = super.hashCode(); - result = 31 * result + myGroup.hashCode(); - result = 31 * result + myType.hashCode(); - return result; + return System.identityHashCode(this); } } \ No newline at end of file diff --git a/platform/lang-impl/src/com/intellij/application/options/colors/OptionsPanelImpl.java b/platform/lang-impl/src/com/intellij/application/options/colors/OptionsPanelImpl.java index e38dbad5e6c8..5e93ca6a9d82 100644 --- a/platform/lang-impl/src/com/intellij/application/options/colors/OptionsPanelImpl.java +++ b/platform/lang-impl/src/com/intellij/application/options/colors/OptionsPanelImpl.java @@ -183,8 +183,8 @@ public class OptionsPanelImpl extends JPanel implements OptionsPanel { } @Override - public Runnable showOption(String attribute) { - final int index = getAttributeIndex(attribute); + public Runnable showOption(String attributeDisplayName) { + final int index = getAttributeIndex(attributeDisplayName, true); return index < 0 ? null : new Runnable() { @Override public void run() { @@ -194,11 +194,11 @@ public class OptionsPanelImpl extends JPanel implements OptionsPanel { }; } - private int getAttributeIndex(final String option) { + private int getAttributeIndex(final String option, final boolean byDisplayNamePlease) { return ContainerUtil.indexOf(myListModel.getItems(), new Condition() { @Override public boolean value(EditorSchemeAttributeDescriptor o) { - return StringUtil.naturalCompare(o.toString(), option) == 0; + return StringUtil.naturalCompare(byDisplayNamePlease ? o.toString() : o.getType(), option) == 0; } }); } @@ -212,8 +212,8 @@ public class OptionsPanelImpl extends JPanel implements OptionsPanel { } @Override - public void selectOption(String attribute) { - int index = getAttributeIndex(attribute); + public void selectOption(String attributeType) { + int index = getAttributeIndex(attributeType, false); if (index < 0) return; ListScrollingUtil.selectItem(myOptionsList, index); }