aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCole Faust <colefaust@google.com>2022-10-15 21:33:27 -0700
committerCole Faust <colefaust@google.com>2022-10-15 21:33:27 -0700
commit6b98e5087a3873440e8e040c0ab42df88f1caad9 (patch)
tree47fde9300bbbb46e244758f4bf5508c4c34683d7
parentdbdc67e0150cedaa3c34e732b007137a276d4b6b (diff)
downloadDialer-6b98e5087a3873440e8e040c0ab42df88f1caad9.tar.gz
Fix errorprone warnings that should be errors
This commit is part of a large scale change to fix errorprone errors that have been downgraded to warnings in the android source tree, so that they can be promoted to errors again. The full list of changes include the following, but not all will be present in any one individual commit: BadAnnotationImplementation BadShiftAmount BanJNDI BoxedPrimitiveEquality ComparableType ComplexBooleanConstant CollectionToArraySafeParameter ConditionalExpressionNumericPromotion DangerousLiteralNull DoubleBraceInitialization DurationFrom DurationTemporalUnit EmptyTopLevelDeclaration EqualsNull EqualsReference FormatString FromTemporalAccessor GetClassOnAnnotation GetClassOnClass HashtableContains IdentityBinaryExpression IdentityHashMapBoxing InstantTemporalUnit InvalidTimeZoneID InvalidZoneId IsInstanceIncompatibleType JUnitParameterMethodNotFound LockOnBoxedPrimitive MathRoundIntLong MislabeledAndroidString MisusedDayOfYear MissingSuperCall MisusedWeekYear ModifyingCollectionWithItself NoCanIgnoreReturnValueOnClasses NonRuntimeAnnotation NullableOnContainingClass NullTernary OverridesJavaxInjectableMethod ParcelableCreator PeriodFrom PreconditionsInvalidPlaceholder ProtoBuilderReturnValueIgnored ProtoFieldNullComparison RandomModInteger RectIntersectReturnValueIgnored ReturnValueIgnored SelfAssignment SelfComparison SelfEquals SizeGreaterThanOrEqualsZero StringBuilderInitWithChar TreeToString TryFailThrowable UnnecessaryCheckNotNull UnusedCollectionModifiedInPlace XorPower See https://errorprone.info/bugpatterns for more information on the checks. Bug: 253827323 Test: m RUN_ERROR_PRONE=true javac-check Change-Id: I10d139f492db5f63e0a0fc82f7321d105277f656
-rw-r--r--java/com/android/contacts/common/model/dataitem/ImDataItem.java4
-rw-r--r--java/com/android/dialer/callintent/CallIntent.java3
-rw-r--r--java/com/android/dialer/callintent/CallIntentBuilder.java3
3 files changed, 5 insertions, 5 deletions
diff --git a/java/com/android/contacts/common/model/dataitem/ImDataItem.java b/java/com/android/contacts/common/model/dataitem/ImDataItem.java
index 16b9fd094..b9902551b 100644
--- a/java/com/android/contacts/common/model/dataitem/ImDataItem.java
+++ b/java/com/android/contacts/common/model/dataitem/ImDataItem.java
@@ -22,6 +22,8 @@ import android.provider.ContactsContract.CommonDataKinds.Email;
import android.provider.ContactsContract.CommonDataKinds.Im;
import android.text.TextUtils;
+import java.util.Objects;
+
/**
* Represents an IM data item, wrapping the columns in {@link ContactsContract.CommonDataKinds.Im}.
*/
@@ -97,7 +99,7 @@ public class ImDataItem extends DataItem {
return that.getProtocol() == Im.PROTOCOL_CUSTOM;
}
return true;
- } else if (getProtocol() != that.getProtocol()) {
+ } else if (!Objects.equals(getProtocol(), that.getProtocol())) {
return false;
} else if (getProtocol() == Im.PROTOCOL_CUSTOM
&& !TextUtils.equals(getCustomProtocol(), that.getCustomProtocol())) {
diff --git a/java/com/android/dialer/callintent/CallIntent.java b/java/com/android/dialer/callintent/CallIntent.java
index ef7aff672..183eb16e7 100644
--- a/java/com/android/dialer/callintent/CallIntent.java
+++ b/java/com/android/dialer/callintent/CallIntent.java
@@ -152,8 +152,7 @@ public abstract class CallIntent implements Parcelable {
.setTimeSinceFirstClick(PerformanceReport.getTimeSinceFirstClick())
.addAllUiActionsSinceAppLaunch(PerformanceReport.getActions())
.addAllUiActionTimestampsSinceAppLaunch(PerformanceReport.getActionTimestamps())
- .setStartingTabIndex(PerformanceReport.getStartingTabIndex())
- .build();
+ .setStartingTabIndex(PerformanceReport.getStartingTabIndex());
PerformanceReport.stopRecording();
}
diff --git a/java/com/android/dialer/callintent/CallIntentBuilder.java b/java/com/android/dialer/callintent/CallIntentBuilder.java
index 7cc589123..b7f7d76a9 100644
--- a/java/com/android/dialer/callintent/CallIntentBuilder.java
+++ b/java/com/android/dialer/callintent/CallIntentBuilder.java
@@ -77,8 +77,7 @@ public class CallIntentBuilder implements Parcelable {
.setTimeSinceFirstClick(PerformanceReport.getTimeSinceFirstClick())
.addAllUiActionsSinceAppLaunch(PerformanceReport.getActions())
.addAllUiActionTimestampsSinceAppLaunch(PerformanceReport.getActionTimestamps())
- .setStartingTabIndex(PerformanceReport.getStartingTabIndex())
- .build();
+ .setStartingTabIndex(PerformanceReport.getStartingTabIndex());
PerformanceReport.stopRecording();
}