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: I7f401949381aa3e27a12825127d1a613be6d97eb
1 file changed
tree: 34084012ad1ceeb55d3b01c48e693271f4768b5c
  1. cpp/
  2. cpu_ref/
  3. driver/
  4. perf-test-scripts/
  5. script_api/
  6. support/
  7. tests/
  8. toolkit/
  9. Android.bp
  10. Android.mk
  11. build_rs.py
  12. CleanSpec.mk
  13. libRS.map
  14. OWNERS
  15. rs.h
  16. rs.spec
  17. rs_compat.spec
  18. rs_hal.h
  19. RS_OWNERS
  20. rsAllocation.cpp
  21. rsAllocation.h
  22. rsAnimation.cpp
  23. rsAnimation.h
  24. rsApiAllocation.cpp
  25. rsApiContext.cpp
  26. rsApiDevice.cpp
  27. rsApiElement.cpp
  28. rsApiFileA3D.cpp
  29. rsApiMesh.cpp
  30. rsApiStubs.cpp
  31. rsApiStubs.h
  32. rsApiType.cpp
  33. rsCacheDir.cpp
  34. rsClosure.cpp
  35. rsClosure.h
  36. rsCompatibilityLib.h
  37. rsComponent.cpp
  38. rsComponent.h
  39. rsContext.cpp
  40. rsContext.h
  41. rsCppUtils.cpp
  42. rsCppUtils.h
  43. rsDebugHelper.h
  44. rsDefines.h
  45. rsDevice.cpp
  46. rsDevice.h
  47. rsDriverLoader.cpp
  48. rsElement.cpp
  49. rsElement.h
  50. rsEnv.h
  51. rsFallbackAdaptation.cpp
  52. rsFallbackAdaptation.h
  53. rsFBOCache.cpp
  54. rsFBOCache.h
  55. rsFifo.h
  56. rsFifoSocket.cpp
  57. rsFifoSocket.h
  58. rsFileA3D.cpp
  59. rsFileA3D.h
  60. rsFont.cpp
  61. rsFont.h
  62. rsg.spec
  63. rsg_generator.c
  64. rsgApi.cpp_rsg
  65. rsgApiFuncDecl.h_rsg
  66. rsgApiReplay.cpp_rsg
  67. rsgApiStructs.h_rsg
  68. rsGrallocConsumer.cpp
  69. rsGrallocConsumer.h
  70. rsHidlAdaptation.cpp
  71. rsHidlAdaptation.h
  72. rsInternalDefines.h
  73. rsList.h
  74. rsMap.h
  75. rsMatrix2x2.cpp
  76. rsMatrix2x2.h
  77. rsMatrix3x3.cpp
  78. rsMatrix3x3.h
  79. rsMatrix4x4.cpp
  80. rsMatrix4x4.h
  81. rsMesh.cpp
  82. rsMesh.h
  83. rsMutex.cpp
  84. rsMutex.h
  85. rsObjectBase.cpp
  86. rsObjectBase.h
  87. rsProgram.cpp
  88. rsProgram.h
  89. rsProgramBase.h
  90. rsProgramFragment.cpp
  91. rsProgramFragment.h
  92. rsProgramRaster.cpp
  93. rsProgramRaster.h
  94. rsProgramStore.cpp
  95. rsProgramStore.h
  96. rsProgramVertex.cpp
  97. rsProgramVertex.h
  98. rsRuntime.h
  99. rsSampler.cpp
  100. rsSampler.h
  101. rsScript.cpp
  102. rsScript.h
  103. rsScriptC.cpp
  104. rsScriptC.h
  105. rsScriptC_Lib.cpp
  106. rsScriptC_LibGL.cpp
  107. rsScriptGroup.cpp
  108. rsScriptGroup.h
  109. rsScriptGroup2.cpp
  110. rsScriptGroup2.h
  111. rsScriptGroupBase.h
  112. rsScriptIntrinsic.cpp
  113. rsScriptIntrinsic.h
  114. rsSignal.cpp
  115. rsSignal.h
  116. rsStream.cpp
  117. rsStream.h
  118. rsThreadIO.cpp
  119. rsThreadIO.h
  120. rsType.cpp
  121. rsType.h
  122. rsUtils.h
  123. run_rs_cts.sh
  124. spec.h
  125. spec.l
  126. support.bp
  127. update-prebuilts.py
  128. update_rs_prebuilts.sh