Suppress / fix error prone warnings

Deal with the new set of warnings introduced by new error prone
version.

Test: `make` doesn't spit out warning messages anymore
Change-Id: I1eee8e5f89f3726e9b66f0bd3fe86154ebb4b79a
This commit is contained in:
Maurice Lam 2018-02-16 16:24:07 -08:00
parent 53c263400c
commit 647b83757b
4 changed files with 8 additions and 1 deletions

View file

@ -103,6 +103,8 @@ public class TemplateLayout extends FrameLayout {
* by this view but not currently added to the view hierarchy. e.g. recycler view or list view * by this view but not currently added to the view hierarchy. e.g. recycler view or list view
* headers that are not currently shown. * headers that are not currently shown.
*/ */
// Returning generic type is the common pattern used for findViewBy* methods
@SuppressWarnings("TypeParameterUnusedInFormals")
public <T extends View> T findManagedViewById(int id) { public <T extends View> T findManagedViewById(int id) {
return findViewById(id); return findViewById(id);
} }

View file

@ -137,7 +137,8 @@ public class Illustration extends FrameLayout {
if (mAspectRatio != 0.0f) { if (mAspectRatio != 0.0f) {
int parentWidth = MeasureSpec.getSize(widthMeasureSpec); int parentWidth = MeasureSpec.getSize(widthMeasureSpec);
int illustrationHeight = (int) (parentWidth / mAspectRatio); int illustrationHeight = (int) (parentWidth / mAspectRatio);
illustrationHeight -= illustrationHeight % mBaselineGridSize; illustrationHeight =
(int) (illustrationHeight - (illustrationHeight % mBaselineGridSize));
setPadding(0, illustrationHeight, 0, 0); setPadding(0, illustrationHeight, 0, 0);
} }
if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) { if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) {

View file

@ -107,6 +107,8 @@ public class GlifRecyclerLayout extends GlifLayout {
} }
@Override @Override
// Returning generic type is the common pattern used for findViewBy* methods
@SuppressWarnings("TypeParameterUnusedInFormals")
public <T extends View> T findManagedViewById(int id) { public <T extends View> T findManagedViewById(int id) {
final View header = mRecyclerMixin.getHeader(); final View header = mRecyclerMixin.getHeader();
if (header != null) { if (header != null) {

View file

@ -127,6 +127,8 @@ public class SetupWizardRecyclerLayout extends SetupWizardLayout {
} }
@Override @Override
// Returning generic type is the common pattern used for findViewBy* methods
@SuppressWarnings("TypeParameterUnusedInFormals")
public <T extends View> T findManagedViewById(int id) { public <T extends View> T findManagedViewById(int id) {
final View header = mRecyclerMixin.getHeader(); final View header = mRecyclerMixin.getHeader();
if (header != null) { if (header != null) {