Build Output: Fix/suppress unchecked cast warning |
|||
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
,
Feb 14 2018
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).
,
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
,
Feb 14 2018
,
Feb 14 2018
Thank you for suppressing the warning and keeping our build clean!
,
May 17 2018
|
|||
►
Sign in to add a comment |
|||
Comment 1 by wnwen@chromium.org
, Feb 14 2018