New issue
Advanced search Search tips

Issue 812336 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2018
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

Build Output: Fix/suppress unchecked cast warning

Project Member Reported by wnwen@chromium.org, Feb 14 2018

Issue description

ninja: Entering directory `out/Debug'
[53431/61389] ACTION //content/public/android:content_junit_tests__compile_java(//build/toolchain/android:android_clang_arm)
../../content/public/android/junit/src/org/chromium/content/browser/remoteobjects/RemoteObjectImplTest.java:298: warning: [unchecked] unchecked cast
        final Consumer<Object> consumer = (Consumer<Object>) mock(Consumer.class);
                                                                 ^
  required: Consumer<Object>
  found:    Consumer
1 warning
[61388/61388] STAMP obj/gn_all.stamp
 

Comment 1 by wnwen@chromium.org, Feb 14 2018

Summary: Fix/suppress unchecked cast warning (was: Fix/suppress unchecked cast error)
Yeah, okay. There's not a good workaround here, so I'll just @SuppressWarnings it away as what's going on here isn't really interesting (just an awkward detail of the Mockito API).
Project Member

Comment 3 by bugdroid1@chromium.org, Feb 14 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/fa875869d3fa626e1d7554145ef59fb78878154e

commit fa875869d3fa626e1d7554145ef59fb78878154e
Author: Jeremy Roman <jbroman@chromium.org>
Date: Wed Feb 14 22:28:03 2018

[remoteobjects] Lift @SuppressWarnings("unchecked") to test class scope

This occurs when trying to mock an object of generic type (and not using
injected mocks). It's not a particularly interesting case, and this is
just a unit test, so just suppress this warning through the entire test case.

Bug:  812336 
Change-Id: I45322db55c65255551deaac50e51fce88cedd134
Reviewed-on: https://chromium-review.googlesource.com/919781
Reviewed-by: Bo <boliu@chromium.org>
Commit-Queue: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#536850}
[modify] https://crrev.com/fa875869d3fa626e1d7554145ef59fb78878154e/content/public/android/junit/src/org/chromium/content/browser/remoteobjects/RemoteObjectImplTest.java

Status: Fixed (was: Assigned)

Comment 5 by wnwen@chromium.org, Feb 14 2018

Thank you for suppressing the warning and keeping our build clean!

Comment 6 by wnwen@chromium.org, May 17 2018

Summary: Build Output: Fix/suppress unchecked cast warning (was: Fix/suppress unchecked cast warning)

Sign in to add a comment