New issue
Advanced search Search tips

Issue 615045 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: May 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

WrongConstant lint warning is produced using GN but not with gyp

Project Member Reported by xunji...@chromium.org, May 26 2016

Issue description

There are some lint errors generated. We need to investigate and fix them.


[2229/5747] ACTION //components/cronet/android:cronet_api__lint(//build/toolchain/android:arm)

../../../../../../tmp/tmpARzXkk/0/BidirectionalStream.java:186 Must be one of: Builder.STREAM_PRIORITY_IDLE, Builder.STREAM_PRIORITY_LOWEST, Builder.STREAM_PRIORITY_LOW, Builder.STREAM_PRIORITY_MEDIUM, Builder.STREAM_PRIORITY_HIGHEST: WrongConstant [warning]
                    mRequestHeaders, mPriority, mDisableAutoFlush);
                                     ~~~~~~~~~

../../../../../../tmp/tmpARzXkk/0/BidirectionalStream.java:186 Must be one of: Builder.STREAM_PRIORITY_IDLE, Builder.STREAM_PRIORITY_LOWEST, Builder.STREAM_PRIORITY_LOW, Builder.STREAM_PRIORITY_MEDIUM, Builder.STREAM_PRIORITY_HIGHEST: WrongConstant [warning]
                    mRequestHeaders, mPriority, mDisableAutoFlush);
                                     ~~~~~~~~~

Lint found 1 new issues.
 - For full explanation, please refer to out/Release/gen/components/cronet/android/cronet_api__lint/result.xml
 - For more information about lint and how to fix lint issues, please refer to https://chromium.googlesource.com/chromium/src/+/master/build/android/docs/lint.md

 
Owner: jbudorick@chromium.org
Summary: WrongConstant lint warning is produced using GN but not with gyp (was: Lint errors in BidirectionalStream.java)
jbudorick@: Could you help triage this issue? When compiling cronet_api using GN, this WrongConstant warning is produced, but when compiling with GYP, the warning is not produced. From talking with pauljensen@ in https://codereview.chromium.org/2010153002/, we think that this lint warning is produced incorrectly in GN's case. Could you take a look? Thanks!
Status: Started (was: Assigned)
Sure. We saw something similar in issue 605296.
I think this is basically https://code.google.com/p/android/issues/detail?id=182179. We can work around it for now by either:
 - suppressing the warning
 - bumping the RetentionPolicy on these two annotations up from SOURCE to CLASS.

I'll upload a CL that does the former.

Re the gyp/gn difference: the gyp invocation didn't have the android support annotation jar in its classpath, so AFAICT it didn't recognize or attempt to do anything with @IntDef. The gn invocation does.
Status: Fixed (was: Started)

Sign in to add a comment