diff options
author | Xavier Ducrohet <xav@android.com> | 2011-06-14 17:30:49 -0700 |
---|---|---|
committer | Xavier Ducrohet <xav@android.com> | 2011-06-14 18:02:21 -0700 |
commit | d4ce6deaf19a6f07bbb2c9bd071a7b2d2758f67e (patch) | |
tree | b8f189015ccef4fa6a6425a2f71dc1eea5fc402b /ide_common | |
parent | 963066f59fead15ab71f9909615aef9299f1ee57 (diff) | |
download | sdk-d4ce6deaf19a6f07bbb2c9bd071a7b2d2758f67e.zip sdk-d4ce6deaf19a6f07bbb2c9bd071a7b2d2758f67e.tar.gz sdk-d4ce6deaf19a6f07bbb2c9bd071a7b2d2758f67e.tar.bz2 |
Merge 9d342967 from master to r12. do not merge.
Fix broken equals() in new qualifiers.
Change-Id: Id083d11a2941d120ca6fd9438a5a12ed7502ab92
Diffstat (limited to 'ide_common')
3 files changed, 28 insertions, 9 deletions
diff --git a/ide_common/src/com/android/ide/common/resources/configuration/ScreenHeightQualifier.java b/ide_common/src/com/android/ide/common/resources/configuration/ScreenHeightQualifier.java index 2899631..5437f71 100644 --- a/ide_common/src/com/android/ide/common/resources/configuration/ScreenHeightQualifier.java +++ b/ide_common/src/com/android/ide/common/resources/configuration/ScreenHeightQualifier.java @@ -150,6 +150,7 @@ public final class ScreenHeightQualifier extends ResourceQualifier { return ""; //$NON-NLS-1$ } + @Override public int hashCode() { return mValue; @@ -157,13 +158,19 @@ public final class ScreenHeightQualifier extends ResourceQualifier { @Override public boolean equals(Object obj) { - if (this == obj) + if (this == obj) { return true; - if (getClass() != obj.getClass()) + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { return false; + } ScreenHeightQualifier other = (ScreenHeightQualifier) obj; - if (mValue != other.mValue) + if (mValue != other.mValue) { return false; + } return true; } } diff --git a/ide_common/src/com/android/ide/common/resources/configuration/ScreenWidthQualifier.java b/ide_common/src/com/android/ide/common/resources/configuration/ScreenWidthQualifier.java index 8748864..cf1e71a 100644 --- a/ide_common/src/com/android/ide/common/resources/configuration/ScreenWidthQualifier.java +++ b/ide_common/src/com/android/ide/common/resources/configuration/ScreenWidthQualifier.java @@ -157,13 +157,19 @@ public final class ScreenWidthQualifier extends ResourceQualifier { @Override public boolean equals(Object obj) { - if (this == obj) + if (this == obj) { return true; - if (getClass() != obj.getClass()) + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { return false; + } ScreenWidthQualifier other = (ScreenWidthQualifier) obj; - if (mValue != other.mValue) + if (mValue != other.mValue) { return false; + } return true; } } diff --git a/ide_common/src/com/android/ide/common/resources/configuration/SmallestScreenWidthQualifier.java b/ide_common/src/com/android/ide/common/resources/configuration/SmallestScreenWidthQualifier.java index e151805..2f82e79 100644 --- a/ide_common/src/com/android/ide/common/resources/configuration/SmallestScreenWidthQualifier.java +++ b/ide_common/src/com/android/ide/common/resources/configuration/SmallestScreenWidthQualifier.java @@ -157,13 +157,19 @@ public final class SmallestScreenWidthQualifier extends ResourceQualifier { @Override public boolean equals(Object obj) { - if (this == obj) + if (this == obj) { return true; - if (getClass() != obj.getClass()) + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { return false; + } SmallestScreenWidthQualifier other = (SmallestScreenWidthQualifier) obj; - if (mValue != other.mValue) + if (mValue != other.mValue) { return false; + } return true; } } |