Merge "Non-functional simplification of ComponentName.equals" am: 00c792bba0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2268166 Change-Id: Ieafb7c7bfdc5daa5c0d10afb87a2a6303619d8be Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -314,17 +314,14 @@ public final class ComponentName implements Parcelable, Cloneable, Comparable<Co
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(@Nullable Object obj) {
|
public boolean equals(@Nullable Object obj) {
|
||||||
try {
|
if (obj instanceof ComponentName) {
|
||||||
if (obj != null) {
|
ComponentName other = (ComponentName) obj;
|
||||||
ComponentName other = (ComponentName)obj;
|
// mPackage and mClass can never be null.
|
||||||
// Note: no null checks, because mPackage and mClass can
|
return mPackage.equals(other.mPackage)
|
||||||
// never be null.
|
&& mClass.equals(other.mClass);
|
||||||
return mPackage.equals(other.mPackage)
|
} else {
|
||||||
&& mClass.equals(other.mClass);
|
return false;
|
||||||
}
|
|
||||||
} catch (ClassCastException e) {
|
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user